// We cannot allow arbitrary domains to prevent impersonation attacks
// Example attack: !leagueoflegends@riotgames.com on a non-Riot instance
+
// SECURITY: did:web domain verification is implemented in the Jetstream consumer
+
// See: internal/atproto/jetstream/community_consumer.go - verifyHostedByClaim()
+
// Communities with mismatched hostedBy domains are rejected during indexing
var instanceDomain string
if strings.HasPrefix(instanceDID, "did:web:") {
// Extract domain from did:web (this is the authoritative source)
communityJetstreamURL = "ws://localhost:6008/subscribe?wantedCollections=social.coves.community.profile&wantedCollections=social.coves.community.subscription"
+
// Initialize community event consumer with did:web verification
+
skipDIDWebVerification := os.Getenv("SKIP_DID_WEB_VERIFICATION") == "true"
+
if skipDIDWebVerification {
+
log.Println("⚠️ WARNING: did:web domain verification is DISABLED (dev mode)")
+
log.Println(" Set SKIP_DID_WEB_VERIFICATION=false for production")
+
communityEventConsumer := jetstream.NewCommunityEventConsumer(communityRepo, instanceDID, skipDIDWebVerification)
communityJetstreamConnector := jetstream.NewCommunityJetstreamConnector(communityEventConsumer, communityJetstreamURL)