+2
-1
cmd/server/main.go
···-communityEventConsumer := jetstream.NewCommunityEventConsumer(communityRepo, instanceDID, skipDIDWebVerification)+communityEventConsumer := jetstream.NewCommunityEventConsumer(communityRepo, instanceDID, skipDIDWebVerification, identityResolver)communityJetstreamConnector := jetstream.NewCommunityJetstreamConnector(communityEventConsumer, communityJetstreamURL)
+65
-1
internal/atproto/jetstream/community_consumer.go
······+identityResolver interface{ Resolve(context.Context, string) (*identity.Identity, error) } // For resolving handles from DIDsdidCache *lru.Cache[string, cachedDIDDoc] // Bounded LRU cache for .well-known verification results···-func NewCommunityEventConsumer(repo communities.Repository, instanceDID string, skipVerification bool) *CommunityEventConsumer {+func NewCommunityEventConsumer(repo communities.Repository, instanceDID string, skipVerification bool, identityResolver interface{ Resolve(context.Context, string) (*identity.Identity, error) }) *CommunityEventConsumer {······+// atProto Best Practice: Handles are NOT stored in records (they're mutable, resolved from DIDs)+return fmt.Errorf("failed to resolve handle from PLC for %s: %w (no fallback - will retry during backfill)", did, err)// This prevents malicious instances from claiming to host communities for domains they don't own···+// atProto Best Practice: Handles are NOT stored in records (they're mutable, resolved from DIDs)+return fmt.Errorf("failed to resolve handle from PLC for %s: %w (no fallback - will retry during backfill)", did, err)···
+6
-1
internal/db/postgres/community_repo.go
···func (r *postgresCommunityRepo) Create(ctx context.Context, community *communities.Community) (*communities.Community, error) {···
+2
-1
tests/integration/community_blocking_test.go
···
+265
-14
tests/integration/community_consumer_test.go
······+consumer := jetstream.NewCommunityEventConsumer(repo, "did:web:coves.local", true, mockResolver)······+consumer := jetstream.NewCommunityEventConsumer(repo, "did:web:coves.local", true, mockResolver)···+consumer := jetstream.NewCommunityEventConsumer(repo, "did:web:coves.local", true, mockResolver)···+consumer := jetstream.NewCommunityEventConsumer(repo, "did:web:coves.local", true, mockResolver)···+consumer := jetstream.NewCommunityEventConsumer(repo, "did:web:coves.local", true, mockResolver)···+func (m *mockIdentityResolver) Resolve(ctx context.Context, did string) (*identity.Identity, error) {+consumer := jetstream.NewCommunityEventConsumer(repo, "did:web:coves.local", true, mockResolver)+consumer := jetstream.NewCommunityEventConsumer(repo, "did:web:coves.local", true, mockResolver)
+5
-4
tests/integration/community_e2e_test.go
···+consumer := jetstream.NewCommunityEventConsumer(communityRepo, "did:web:coves.local", true, identityResolver)···
+10
-5
tests/integration/community_hostedby_security_test.go
···············
+4
-2
tests/integration/community_v2_validation_test.go
······
+6
-3
tests/integration/subscription_indexing_test.go
·········
+12
tests/integration/user_test.go
···+func setupIdentityResolver(db *sql.DB) interface{ Resolve(context.Context, string) (*identity.Identity, error) } {