A community based topic aggregation platform built on atproto

style: apply gofumpt formatting across codebase

Standardize import ordering and formatting using gofumpt.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Changed files
+304 -211
internal
tests
+2 -1
internal/api/handlers/aggregator/errors.go
···
package aggregator
import (
-
"Coves/internal/core/aggregators"
"encoding/json"
"log"
"net/http"
+
+
"Coves/internal/core/aggregators"
)
// ErrorResponse represents an XRPC error response
+2 -1
internal/api/handlers/aggregator/get_authorizations.go
···
package aggregator
import (
-
"Coves/internal/core/aggregators"
"encoding/json"
"log"
"net/http"
"strconv"
+
+
"Coves/internal/core/aggregators"
)
// GetAuthorizationsHandler handles listing authorizations for an aggregator
+2 -1
internal/api/handlers/aggregator/get_services.go
···
package aggregator
import (
-
"Coves/internal/core/aggregators"
"encoding/json"
"log"
"net/http"
"strings"
+
+
"Coves/internal/core/aggregators"
)
// GetServicesHandler handles aggregator service details retrieval
+2 -1
internal/api/handlers/aggregator/list_for_community.go
···
package aggregator
import (
-
"Coves/internal/core/aggregators"
"encoding/json"
"log"
"net/http"
"strconv"
+
+
"Coves/internal/core/aggregators"
)
// ListForCommunityHandler handles listing aggregators for a community
+2 -1
internal/api/handlers/comments/errors.go
···
package comments
import (
-
"Coves/internal/core/comments"
"encoding/json"
"log"
"net/http"
+
+
"Coves/internal/core/comments"
)
// errorResponse represents a standardized JSON error response
+3 -2
internal/api/handlers/comments/get_comments.go
···
package comments
import (
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/comments"
"encoding/json"
"log"
"net/http"
"strconv"
+
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/comments"
)
// GetCommentsHandler handles comment retrieval for posts
+2 -1
internal/api/handlers/comments/middleware.go
···
package comments
import (
+
"net/http"
+
"Coves/internal/api/middleware"
-
"net/http"
)
// OptionalAuthMiddleware wraps the existing OptionalAuth middleware from the middleware package.
+2 -1
internal/api/handlers/comments/service_adapter.go
···
package comments
import (
+
"net/http"
+
"Coves/internal/core/comments"
-
"net/http"
)
// ServiceAdapter adapts the core comments.Service to the handler's Service interface
+3 -2
internal/api/handlers/community/block.go
···
package community
import (
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/communities"
"encoding/json"
"log"
"net/http"
+
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/communities"
)
// BlockHandler handles community blocking operations
+2 -1
internal/api/handlers/community/errors.go
···
package community
import (
-
"Coves/internal/core/communities"
"encoding/json"
"log"
"net/http"
+
+
"Coves/internal/core/communities"
)
// XRPCError represents an XRPC error response
+2 -1
internal/api/handlers/community/get.go
···
package community
import (
-
"Coves/internal/core/communities"
"encoding/json"
"net/http"
+
+
"Coves/internal/core/communities"
)
// GetHandler handles community retrieval
+2 -1
internal/api/handlers/community/list.go
···
package community
import (
-
"Coves/internal/core/communities"
"encoding/json"
"net/http"
"strconv"
+
+
"Coves/internal/core/communities"
)
// ListHandler handles listing communities
+2 -1
internal/api/handlers/community/search.go
···
package community
import (
-
"Coves/internal/core/communities"
"encoding/json"
"net/http"
"strconv"
+
+
"Coves/internal/core/communities"
)
// SearchHandler handles community search
+3 -2
internal/api/handlers/community/subscribe.go
···
package community
import (
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/communities"
"encoding/json"
"log"
"net/http"
"strings"
+
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/communities"
)
// SubscribeHandler handles community subscriptions
+3 -2
internal/api/handlers/community/update.go
···
package community
import (
+
"encoding/json"
+
"net/http"
+
"Coves/internal/api/middleware"
"Coves/internal/core/communities"
-
"encoding/json"
-
"net/http"
)
// UpdateHandler handles community updates
+2 -1
internal/api/handlers/communityFeed/errors.go
···
package communityFeed
import (
-
"Coves/internal/core/communityFeeds"
"encoding/json"
"errors"
"log"
"net/http"
+
+
"Coves/internal/core/communityFeeds"
)
// ErrorResponse represents an XRPC error response
+3 -2
internal/api/handlers/communityFeed/get_community.go
···
package communityFeed
import (
-
"Coves/internal/core/communityFeeds"
-
"Coves/internal/core/posts"
"encoding/json"
"log"
"net/http"
"strconv"
+
+
"Coves/internal/core/communityFeeds"
+
"Coves/internal/core/posts"
)
// GetCommunityHandler handles community feed retrieval
+2 -1
internal/api/handlers/discover/errors.go
···
package discover
import (
-
"Coves/internal/core/discover"
"encoding/json"
"errors"
"log"
"net/http"
+
+
"Coves/internal/core/discover"
)
// XRPCError represents an XRPC error response
+3 -2
internal/api/handlers/discover/get_discover.go
···
package discover
import (
-
"Coves/internal/core/discover"
-
"Coves/internal/core/posts"
"encoding/json"
"log"
"net/http"
"strconv"
+
+
"Coves/internal/core/discover"
+
"Coves/internal/core/posts"
)
// GetDiscoverHandler handles discover feed retrieval
+3 -2
internal/api/handlers/post/create.go
···
package post
import (
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/posts"
"encoding/json"
"log"
"net/http"
"strings"
+
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/posts"
)
// CreateHandler handles post creation requests
+3 -2
internal/api/handlers/post/errors.go
···
package post
import (
-
"Coves/internal/core/aggregators"
-
"Coves/internal/core/posts"
"encoding/json"
"log"
"net/http"
+
+
"Coves/internal/core/aggregators"
+
"Coves/internal/core/posts"
)
type errorResponse struct {
+2 -1
internal/api/handlers/timeline/errors.go
···
package timeline
import (
-
"Coves/internal/core/timeline"
"encoding/json"
"errors"
"log"
"net/http"
+
+
"Coves/internal/core/timeline"
)
// XRPCError represents an XRPC error response
+4 -3
internal/api/handlers/timeline/get_timeline.go
···
package timeline
import (
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/posts"
-
"Coves/internal/core/timeline"
"encoding/json"
"log"
"net/http"
"strconv"
"strings"
+
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/posts"
+
"Coves/internal/core/timeline"
)
// GetTimelineHandler handles timeline feed retrieval
+2 -1
internal/api/middleware/auth.go
···
package middleware
import (
-
"Coves/internal/atproto/auth"
"context"
"log"
"net/http"
"strings"
+
+
"Coves/internal/atproto/auth"
)
// Context keys for storing user information
+2 -1
internal/api/routes/user.go
···
package routes
import (
-
"Coves/internal/core/users"
"encoding/json"
"errors"
"log"
"net/http"
"time"
+
+
"Coves/internal/core/users"
"github.com/go-chi/chi/v5"
)
+2 -1
internal/atproto/jetstream/aggregator_consumer.go
···
package jetstream
import (
-
"Coves/internal/core/aggregators"
"context"
"encoding/json"
"fmt"
"log"
"time"
+
+
"Coves/internal/core/aggregators"
)
// AggregatorEventConsumer consumes aggregator-related events from Jetstream
+3 -2
internal/atproto/jetstream/comment_consumer.go
···
package jetstream
import (
-
"Coves/internal/atproto/utils"
-
"Coves/internal/core/comments"
"context"
"database/sql"
"encoding/json"
···
"log"
"strings"
"time"
+
+
"Coves/internal/atproto/utils"
+
"Coves/internal/core/comments"
"github.com/lib/pq"
)
+10 -8
internal/atproto/jetstream/community_consumer.go
···
package jetstream
import (
-
"Coves/internal/atproto/identity"
-
"Coves/internal/atproto/utils"
-
"Coves/internal/core/communities"
"context"
"encoding/json"
"fmt"
···
"net/http"
"strings"
"time"
+
+
"Coves/internal/atproto/identity"
+
"Coves/internal/atproto/utils"
+
"Coves/internal/core/communities"
lru "github.com/hashicorp/golang-lru/v2"
"golang.org/x/net/publicsuffix"
···
// verifyDIDDocument fetches and validates the DID document from .well-known/did.json
// Implements Bluesky's bidirectional verification model:
-
// 1. Verify DID document exists at https://domain/.well-known/did.json
-
// 2. Verify DID document ID matches claimed DID
-
// 3. Verify DID document claims the handle in alsoKnownAs field
+
// 1. Verify DID document exists at https://domain/.well-known/did.json
+
// 2. Verify DID document ID matches claimed DID
+
// 3. Verify DID document claims the handle in alsoKnownAs field
+
//
// Results are cached with TTL and rate-limited to prevent DoS attacks
func (c *CommunityEventConsumer) verifyDIDDocument(ctx context.Context, did, domain, handle string) error {
// Skip verification in dev mode
···
// Parse DID document
var didDoc struct {
-
ID string `json:"id"`
-
AlsoKnownAs []string `json:"alsoKnownAs"`
+
ID string `json:"id"`
+
AlsoKnownAs []string `json:"alsoKnownAs"`
}
if err := json.NewDecoder(resp.Body).Decode(&didDoc); err != nil {
// Cache the failure
+4 -3
internal/atproto/jetstream/post_consumer.go
···
package jetstream
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/core/users"
"context"
"database/sql"
"encoding/json"
···
"log"
"strings"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/core/users"
)
// PostEventConsumer consumes post-related events from Jetstream
+3 -2
internal/atproto/jetstream/user_consumer.go
···
package jetstream
import (
-
"Coves/internal/atproto/identity"
-
"Coves/internal/core/users"
"context"
"encoding/json"
"fmt"
"log"
"sync"
"time"
+
+
"Coves/internal/atproto/identity"
+
"Coves/internal/core/users"
"github.com/gorilla/websocket"
)
+4 -3
internal/atproto/jetstream/vote_consumer.go
···
package jetstream
import (
-
"Coves/internal/atproto/utils"
-
"Coves/internal/core/users"
-
"Coves/internal/core/votes"
"context"
"database/sql"
"fmt"
"log"
"strings"
"time"
+
+
"Coves/internal/atproto/utils"
+
"Coves/internal/core/users"
+
"Coves/internal/core/votes"
)
// VoteEventConsumer consumes vote-related events from Jetstream
+2 -1
internal/core/aggregators/service.go
···
package aggregators
import (
-
"Coves/internal/core/communities"
"context"
"encoding/json"
"fmt"
"time"
+
+
"Coves/internal/core/communities"
"github.com/xeipuuv/gojsonschema"
)
+2 -1
internal/core/blobs/service.go
···
package blobs
import (
-
"Coves/internal/core/communities"
"bytes"
"context"
"encoding/json"
···
"log"
"net/http"
"time"
+
+
"Coves/internal/core/communities"
)
// Service defines the interface for blob operations
+4 -3
internal/core/comments/comment_service.go
···
package comments
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/core/users"
"context"
"encoding/json"
"errors"
···
"net/url"
"strings"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/core/users"
)
const (
+4 -3
internal/core/comments/comment_service_test.go
···
package comments
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/core/users"
"context"
"errors"
"testing"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/core/users"
"github.com/stretchr/testify/assert"
)
+2 -1
internal/core/communities/service.go
···
package communities
import (
-
"Coves/internal/atproto/utils"
"bytes"
"context"
"encoding/json"
···
"strings"
"sync"
"time"
+
+
"Coves/internal/atproto/utils"
)
// Community handle validation regex (DNS-valid handle: name.community.instance.com)
+2 -1
internal/core/communityFeeds/service.go
···
package communityFeeds
import (
-
"Coves/internal/core/communities"
"context"
"fmt"
+
+
"Coves/internal/core/communities"
)
type feedService struct {
+2 -1
internal/core/communityFeeds/types.go
···
package communityFeeds
import (
+
"time"
+
"Coves/internal/core/posts"
-
"time"
)
// GetCommunityFeedRequest represents input for fetching a community feed
+2 -1
internal/core/discover/types.go
···
package discover
import (
-
"Coves/internal/core/posts"
"context"
"errors"
+
+
"Coves/internal/core/posts"
)
// Repository defines discover data access interface
+6 -5
internal/core/posts/service.go
···
package posts
import (
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/aggregators"
-
"Coves/internal/core/blobs"
-
"Coves/internal/core/communities"
-
"Coves/internal/core/unfurl"
"bytes"
"context"
"encoding/json"
···
"net/http"
"os"
"time"
+
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/aggregators"
+
"Coves/internal/core/blobs"
+
"Coves/internal/core/communities"
+
"Coves/internal/core/unfurl"
)
type postService struct {
+2 -1
internal/core/timeline/types.go
···
package timeline
import (
-
"Coves/internal/core/posts"
"context"
"errors"
"time"
+
+
"Coves/internal/core/posts"
)
// Repository defines timeline data access interface
+2 -1
internal/core/users/service.go
···
package users
import (
-
"Coves/internal/atproto/identity"
"bytes"
"context"
"encoding/json"
···
"regexp"
"strings"
"time"
+
+
"Coves/internal/atproto/identity"
)
// atProto handle validation regex (per official atProto spec: https://atproto.com/specs/handle)
+2 -1
internal/db/postgres/aggregator_repo.go
···
package postgres
import (
-
"Coves/internal/core/aggregators"
"context"
"database/sql"
"fmt"
"strings"
"time"
+
+
"Coves/internal/core/aggregators"
)
type postgresAggregatorRepo struct {
+2 -1
internal/db/postgres/comment_repo.go
···
package postgres
import (
-
"Coves/internal/core/comments"
"context"
"database/sql"
"encoding/base64"
"fmt"
"log"
"strings"
+
+
"Coves/internal/core/comments"
"github.com/lib/pq"
)
+2 -1
internal/db/postgres/community_repo.go
···
package postgres
import (
-
"Coves/internal/core/communities"
"context"
"database/sql"
"fmt"
"log"
"strings"
+
+
"Coves/internal/core/communities"
"github.com/lib/pq"
)
+2 -1
internal/db/postgres/community_repo_blocks.go
···
package postgres
import (
-
"Coves/internal/core/communities"
"context"
"database/sql"
"fmt"
"log"
+
+
"Coves/internal/core/communities"
)
// BlockCommunity creates a new block record (idempotent)
+2 -1
internal/db/postgres/community_repo_memberships.go
···
package postgres
import (
-
"Coves/internal/core/communities"
"context"
"database/sql"
"fmt"
"log"
"strings"
+
+
"Coves/internal/core/communities"
)
// CreateMembership creates a new membership record
+2 -1
internal/db/postgres/community_repo_subscriptions.go
···
package postgres
import (
-
"Coves/internal/core/communities"
"context"
"database/sql"
"fmt"
"log"
"strings"
+
+
"Coves/internal/core/communities"
)
// Subscribe creates a new subscription record
+2 -1
internal/db/postgres/discover_repo.go
···
package postgres
import (
-
"Coves/internal/core/discover"
"context"
"database/sql"
"fmt"
+
+
"Coves/internal/core/discover"
)
type postgresDiscoverRepo struct {
+2 -1
internal/db/postgres/feed_repo.go
···
package postgres
import (
-
"Coves/internal/core/communityFeeds"
"context"
"database/sql"
"fmt"
+
+
"Coves/internal/core/communityFeeds"
)
type postgresFeedRepo struct {
+2 -1
internal/db/postgres/feed_repo_base.go
···
package postgres
import (
-
"Coves/internal/core/posts"
"crypto/hmac"
"crypto/sha256"
"database/sql"
···
"strconv"
"strings"
"time"
+
+
"Coves/internal/core/posts"
)
// feedRepoBase contains shared logic for timeline and discover feed repositories
+2 -1
internal/db/postgres/post_repo.go
···
package postgres
import (
-
"Coves/internal/core/posts"
"context"
"database/sql"
"fmt"
"strings"
+
+
"Coves/internal/core/posts"
)
type postgresPostRepo struct {
+2 -1
internal/db/postgres/timeline_repo.go
···
package postgres
import (
-
"Coves/internal/core/timeline"
"context"
"database/sql"
"fmt"
+
+
"Coves/internal/core/timeline"
)
type postgresTimelineRepo struct {
+2 -1
internal/db/postgres/user_repo.go
···
package postgres
import (
-
"Coves/internal/core/users"
"context"
"database/sql"
"fmt"
"log"
"strings"
+
+
"Coves/internal/core/users"
"github.com/lib/pq"
)
+2 -1
internal/db/postgres/vote_repo.go
···
package postgres
import (
-
"Coves/internal/core/votes"
"context"
"database/sql"
"fmt"
"strings"
+
+
"Coves/internal/core/votes"
)
type postgresVoteRepo struct {
+2 -1
internal/db/postgres/vote_repo_test.go
···
package postgres
import (
-
"Coves/internal/core/votes"
"context"
"database/sql"
"os"
"testing"
"time"
+
+
"Coves/internal/core/votes"
_ "github.com/lib/pq"
"github.com/pressly/goose/v3"
+5 -4
tests/e2e/error_recovery_test.go
···
package e2e
import (
-
"Coves/internal/atproto/identity"
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/users"
-
"Coves/internal/db/postgres"
"context"
"database/sql"
"fmt"
···
"sync/atomic"
"testing"
"time"
+
+
"Coves/internal/atproto/identity"
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/users"
+
"Coves/internal/db/postgres"
_ "github.com/lib/pq"
"github.com/pressly/goose/v3"
+5 -4
tests/e2e/user_signup_test.go
···
package e2e
import (
-
"Coves/internal/atproto/identity"
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/users"
-
"Coves/internal/db/postgres"
"bytes"
"context"
"database/sql"
···
"os"
"testing"
"time"
+
+
"Coves/internal/atproto/identity"
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/users"
+
"Coves/internal/db/postgres"
_ "github.com/lib/pq"
"github.com/pressly/goose/v3"
+11 -10
tests/integration/aggregator_e2e_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/aggregator"
-
"Coves/internal/api/handlers/post"
-
"Coves/internal/api/middleware"
-
"Coves/internal/atproto/identity"
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/aggregators"
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/core/users"
-
"Coves/internal/db/postgres"
"bytes"
"context"
"database/sql"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/api/handlers/aggregator"
+
"Coves/internal/api/handlers/post"
+
"Coves/internal/api/middleware"
+
"Coves/internal/atproto/identity"
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/aggregators"
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/core/users"
+
"Coves/internal/db/postgres"
_ "github.com/lib/pq"
"github.com/pressly/goose/v3"
+4 -3
tests/integration/aggregator_test.go
···
package integration
import (
-
"Coves/internal/core/aggregators"
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"encoding/json"
"fmt"
"testing"
"time"
+
+
"Coves/internal/core/aggregators"
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
// TestAggregatorRepository_Create tests basic aggregator creation
+8 -7
tests/integration/blob_upload_e2e_test.go
···
package integration
import (
-
"Coves/internal/atproto/identity"
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/blobs"
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/core/users"
-
"Coves/internal/db/postgres"
"bytes"
"context"
"encoding/json"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/atproto/identity"
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/blobs"
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/core/users"
+
"Coves/internal/db/postgres"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+5 -4
tests/integration/block_handle_resolution_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/community"
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/communities"
-
postgresRepo "Coves/internal/db/postgres"
"bytes"
"context"
"encoding/json"
···
"net/http"
"net/http/httptest"
"testing"
+
+
"Coves/internal/api/handlers/community"
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/communities"
+
postgresRepo "Coves/internal/db/postgres"
)
// TestBlockHandler_HandleResolution tests that the block handler accepts handles
+4 -3
tests/integration/comment_consumer_test.go
···
package integration
import (
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/comments"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"testing"
"time"
+
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/comments"
+
"Coves/internal/db/postgres"
)
func TestCommentConsumer_CreateComment(t *testing.T) {
+4 -3
tests/integration/comment_query_test.go
···
package integration
import (
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/comments"
-
"Coves/internal/db/postgres"
"context"
"database/sql"
"encoding/json"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/comments"
+
"Coves/internal/db/postgres"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+5 -4
tests/integration/comment_vote_test.go
···
package integration
import (
+
"context"
+
"fmt"
+
"testing"
+
"time"
+
"Coves/internal/atproto/jetstream"
"Coves/internal/core/comments"
"Coves/internal/core/users"
"Coves/internal/db/postgres"
-
"context"
-
"fmt"
-
"testing"
-
"time"
)
// TestCommentVote_CreateAndUpdate tests voting on comments and vote count updates
+3 -2
tests/integration/community_blocking_test.go
···
package integration
import (
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/communities"
"context"
"database/sql"
"fmt"
"testing"
"time"
+
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/communities"
postgresRepo "Coves/internal/db/postgres"
)
+5 -4
tests/integration/community_consumer_test.go
···
package integration
import (
-
"Coves/internal/atproto/identity"
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"errors"
"fmt"
"testing"
"time"
+
+
"Coves/internal/atproto/identity"
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
func TestCommunityConsumer_HandleCommunityProfile(t *testing.T) {
+3 -2
tests/integration/community_credentials_test.go
···
package integration
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"testing"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
// TestCommunityRepository_CredentialPersistence tests that PDS credentials are properly persisted
+3 -2
tests/integration/community_hostedby_security_test.go
···
package integration
import (
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"net/http"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/db/postgres"
)
// TestHostedByVerification_DomainMatching tests that hostedBy domain must match handle domain
+3 -2
tests/integration/community_identifier_resolution_test.go
···
package integration
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"os"
"strings"
"testing"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+3 -2
tests/integration/community_provisioning_test.go
···
package integration
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"strings"
"testing"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
// TestCommunityRepository_PasswordEncryption verifies P0 fix:
+3 -2
tests/integration/community_repo_test.go
···
package integration
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"testing"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
func TestCommunityRepository_Create(t *testing.T) {
+3 -2
tests/integration/community_service_integration_test.go
···
package integration
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"bytes"
"context"
"encoding/json"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
// TestCommunityService_CreateWithRealPDS tests the complete service layer flow
+4 -3
tests/integration/community_v2_validation_test.go
···
package integration
import (
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"testing"
"time"
+
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
// TestCommunityConsumer_V2RKeyValidation tests that only V2 communities (rkey="self") are accepted
+6 -5
tests/integration/concurrent_scenarios_test.go
···
package integration
import (
+
"context"
+
"fmt"
+
"sync"
+
"testing"
+
"time"
+
"Coves/internal/atproto/jetstream"
"Coves/internal/core/comments"
"Coves/internal/core/communities"
"Coves/internal/core/users"
"Coves/internal/db/postgres"
-
"context"
-
"fmt"
-
"sync"
-
"testing"
-
"time"
)
// TestConcurrentVoting_MultipleUsersOnSamePost tests race conditions when multiple users
+3 -2
tests/integration/discover_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/discover"
-
"Coves/internal/db/postgres"
"context"
"encoding/json"
"fmt"
···
"net/http/httptest"
"testing"
"time"
+
+
"Coves/internal/api/handlers/discover"
+
"Coves/internal/db/postgres"
discoverCore "Coves/internal/core/discover"
+5 -4
tests/integration/feed_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/communityFeed"
-
"Coves/internal/core/communities"
-
"Coves/internal/core/communityFeeds"
-
"Coves/internal/db/postgres"
"context"
"encoding/json"
"fmt"
···
"net/http/httptest"
"testing"
"time"
+
+
"Coves/internal/api/handlers/communityFeed"
+
"Coves/internal/core/communities"
+
"Coves/internal/core/communityFeeds"
+
"Coves/internal/db/postgres"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+3 -2
tests/integration/helpers.go
···
package integration
import (
-
"Coves/internal/atproto/auth"
-
"Coves/internal/core/users"
"bytes"
"context"
"database/sql"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/atproto/auth"
+
"Coves/internal/core/users"
"github.com/golang-jwt/jwt/v5"
)
+2 -1
tests/integration/identity_resolution_test.go
···
package integration
import (
-
"Coves/internal/atproto/identity"
"context"
"fmt"
"os"
"testing"
"time"
+
+
"Coves/internal/atproto/identity"
)
// uniqueID generates a unique identifier for test isolation
+4 -3
tests/integration/jetstream_consumer_test.go
···
package integration
import (
+
"context"
+
"testing"
+
"time"
+
"Coves/internal/atproto/identity"
"Coves/internal/atproto/jetstream"
"Coves/internal/core/users"
"Coves/internal/db/postgres"
-
"context"
-
"testing"
-
"time"
)
func TestUserIndexingFromJetstream(t *testing.T) {
+3 -2
tests/integration/jwt_verification_test.go
···
package integration
import (
-
"Coves/internal/atproto/auth"
-
"Coves/internal/api/middleware"
"fmt"
"net/http"
"net/http/httptest"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/api/middleware"
+
"Coves/internal/atproto/auth"
)
// TestJWTSignatureVerification tests end-to-end JWT signature verification
+4 -3
tests/integration/post_consumer_test.go
···
package integration
import (
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/users"
-
"Coves/internal/db/postgres"
"context"
"fmt"
"testing"
"time"
+
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/users"
+
"Coves/internal/db/postgres"
)
// TestPostConsumer_CommentCountReconciliation tests that post comment_count
+5 -4
tests/integration/post_creation_test.go
···
package integration
import (
+
"context"
+
"fmt"
+
"strings"
+
"testing"
+
"Coves/internal/api/middleware"
"Coves/internal/atproto/identity"
"Coves/internal/core/communities"
"Coves/internal/core/posts"
"Coves/internal/core/users"
"Coves/internal/db/postgres"
-
"context"
-
"fmt"
-
"strings"
-
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+9 -8
tests/integration/post_e2e_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/post"
-
"Coves/internal/api/middleware"
-
"Coves/internal/atproto/identity"
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/core/users"
-
"Coves/internal/db/postgres"
"bytes"
"context"
"database/sql"
···
"strings"
"testing"
"time"
+
+
"Coves/internal/api/handlers/post"
+
"Coves/internal/api/middleware"
+
"Coves/internal/atproto/identity"
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/core/users"
+
"Coves/internal/db/postgres"
"github.com/gorilla/websocket"
_ "github.com/lib/pq"
+6 -5
tests/integration/post_handler_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/post"
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/db/postgres"
"bytes"
"encoding/json"
"net/http"
"net/http/httptest"
"strings"
"testing"
+
+
"Coves/internal/api/handlers/post"
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/db/postgres"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+6 -5
tests/integration/post_thumb_validation_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/post"
-
"Coves/internal/api/middleware"
-
"Coves/internal/core/communities"
-
"Coves/internal/core/posts"
-
"Coves/internal/db/postgres"
"bytes"
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
+
+
"Coves/internal/api/handlers/post"
+
"Coves/internal/api/middleware"
+
"Coves/internal/core/communities"
+
"Coves/internal/core/posts"
+
"Coves/internal/db/postgres"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+6 -5
tests/integration/post_unfurl_test.go
···
package integration
import (
+
"context"
+
"encoding/json"
+
"fmt"
+
"testing"
+
"time"
+
"Coves/internal/api/middleware"
"Coves/internal/atproto/identity"
"Coves/internal/atproto/jetstream"
···
"Coves/internal/core/unfurl"
"Coves/internal/core/users"
"Coves/internal/db/postgres"
-
"context"
-
"encoding/json"
-
"fmt"
-
"testing"
-
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+3 -2
tests/integration/subscription_indexing_test.go
···
package integration
import (
-
"Coves/internal/atproto/jetstream"
-
"Coves/internal/core/communities"
"context"
"database/sql"
"fmt"
"testing"
"time"
+
+
"Coves/internal/atproto/jetstream"
+
"Coves/internal/core/communities"
postgresRepo "Coves/internal/db/postgres"
)
+4 -3
tests/integration/timeline_test.go
···
package integration
import (
-
"Coves/internal/api/handlers/timeline"
-
"Coves/internal/api/middleware"
-
"Coves/internal/db/postgres"
"context"
"encoding/json"
"fmt"
···
"net/http/httptest"
"testing"
"time"
+
+
"Coves/internal/api/handlers/timeline"
+
"Coves/internal/api/middleware"
+
"Coves/internal/db/postgres"
timelineCore "Coves/internal/core/timeline"
+3 -2
tests/integration/token_refresh_test.go
···
package integration
import (
-
"Coves/internal/core/communities"
-
"Coves/internal/db/postgres"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"testing"
"time"
+
+
"Coves/internal/core/communities"
+
"Coves/internal/db/postgres"
)
// TestTokenRefresh_ExpirationDetection tests the NeedsRefresh function with various token states
+5 -4
tests/integration/user_test.go
···
package integration
import (
-
"Coves/internal/api/routes"
-
"Coves/internal/atproto/identity"
-
"Coves/internal/core/users"
-
"Coves/internal/db/postgres"
"context"
"database/sql"
"encoding/json"
···
"os"
"strings"
"testing"
+
+
"Coves/internal/api/routes"
+
"Coves/internal/atproto/identity"
+
"Coves/internal/core/users"
+
"Coves/internal/db/postgres"
"github.com/go-chi/chi/v5"
_ "github.com/lib/pq"
+2 -1
tests/unit/community_service_test.go
···
package unit
import (
-
"Coves/internal/core/communities"
"context"
"fmt"
"net/http"
···
"sync/atomic"
"testing"
"time"
+
+
"Coves/internal/core/communities"
)
// mockCommunityRepo is a minimal mock for testing service layer