Config for separate primary domain Nostr pubkey
Allow to configure a separate key for the NIP-05 address of the primary domain vs the accounts domain.
This commit is contained in:
@@ -79,10 +79,36 @@ RSpec.describe "Well-known URLs", type: :request do
|
||||
end
|
||||
|
||||
describe "placeholder username for domain's own pubkey" do
|
||||
it "returns the configured nostr pubkey" do
|
||||
get "/.well-known/nostr.json?name=_"
|
||||
res = JSON.parse(response.body)
|
||||
expect(res["names"]["_"]).to eq(Setting.nostr_public_key)
|
||||
describe "for primary domain" do
|
||||
context "no different pubkey configured for primary domain" do
|
||||
it "returns the akkounts nostr pubkey" do
|
||||
get "/.well-known/nostr.json?name=_"
|
||||
res = JSON.parse(response.body)
|
||||
expect(res["names"]["_"]).to eq("bdd76ce2934b2f591f9fad2ebe9da18f20d2921de527494ba00eeaa0a0efadcf")
|
||||
end
|
||||
end
|
||||
|
||||
context "different pubkey configured for primary domain" do
|
||||
before do
|
||||
Setting.nostr_public_key_primary_domain = "b3e8f62fbe41217ffc0aa1e178d297339932d8ba4f46d9c7df3b61575e78fecc"
|
||||
end
|
||||
|
||||
it "returns the primary domain's nostr pubkey" do
|
||||
get "/.well-known/nostr.json?name=_"
|
||||
res = JSON.parse(response.body)
|
||||
expect(res["names"]["_"]).to eq("b3e8f62fbe41217ffc0aa1e178d297339932d8ba4f46d9c7df3b61575e78fecc")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "for akkounts domain" do
|
||||
it "returns the configured nostr pubkey" do
|
||||
headers = { "X-Forwarded-Host" => "accounts.kosmos.org" }
|
||||
get "/.well-known/nostr.json?name=_"
|
||||
|
||||
res = JSON.parse(response.body)
|
||||
expect(res["names"]["_"]).to eq("bdd76ce2934b2f591f9fad2ebe9da18f20d2921de527494ba00eeaa0a0efadcf")
|
||||
end
|
||||
end
|
||||
|
||||
context "with relay configured" do
|
||||
|
||||
Reference in New Issue
Block a user