A container registry that uses the AT Protocol for manifest storage and S3 for blob storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix go formatting

+45 -46
+3 -3
pkg/appview/db/hold_store_test.go
··· 275 275 updatedRecord := &HoldCaptainRecord{ 276 276 HoldDID: "did:web:hold04.atcr.io", // Same DID 277 277 OwnerDID: "did:plc:eve222", // Changed owner 278 - Public: true, // Changed to public 279 - AllowAllCrew: true, // Changed allow all crew 278 + Public: true, // Changed to public 279 + AllowAllCrew: true, // Changed allow all crew 280 280 DeployedAt: "2025-03-01", // Changed date 281 281 Region: "ap-south-1", // Changed region 282 - Provider: "azure", // Changed provider 282 + Provider: "azure", // Changed provider 283 283 UpdatedAt: time.Now(), 284 284 } 285 285
+6 -6
pkg/appview/storage/context_test.go
··· 37 37 func TestRegistryContext_Fields(t *testing.T) { 38 38 // Create a sample RegistryContext 39 39 ctx := &RegistryContext{ 40 - DID: "did:plc:test123", 41 - Handle: "alice.bsky.social", 42 - HoldDID: "did:web:hold01.atcr.io", 43 - PDSEndpoint: "https://bsky.social", 44 - Repository: "debian", 45 - ServiceToken: "test-token", 40 + DID: "did:plc:test123", 41 + Handle: "alice.bsky.social", 42 + HoldDID: "did:web:hold01.atcr.io", 43 + PDSEndpoint: "https://bsky.social", 44 + Repository: "debian", 45 + ServiceToken: "test-token", 46 46 ATProtoClient: &atproto.Client{ 47 47 // Mock client - would need proper initialization in real tests 48 48 },
+3 -3
pkg/appview/storage/manifest_store_test.go
··· 544 544 ociManifest := []byte(`{"schemaVersion":2}`) 545 545 546 546 tests := []struct { 547 - name string 548 - manifestResp string 549 - expectedHoldDID string 547 + name string 548 + manifestResp string 549 + expectedHoldDID string 550 550 }{ 551 551 { 552 552 name: "tracks HoldDID from new format",
+5 -5
pkg/auth/hold_local_test.go
··· 11 11 12 12 // Shared PDS instances for read-only tests 13 13 var ( 14 - sharedEmptyPDS *pds.HoldPDS 15 - sharedPublicPDS *pds.HoldPDS 16 - sharedPrivatePDS *pds.HoldPDS 17 - sharedAllowCrewPDS *pds.HoldPDS 18 - sharedTempDir string 14 + sharedEmptyPDS *pds.HoldPDS 15 + sharedPublicPDS *pds.HoldPDS 16 + sharedPrivatePDS *pds.HoldPDS 17 + sharedAllowCrewPDS *pds.HoldPDS 18 + sharedTempDir string 19 19 ) 20 20 21 21 // TestMain sets up shared test fixtures
+20 -20
pkg/auth/hold_remote.go
··· 20 20 // Used by AppView to authorize access to remote holds 21 21 // Implements caching for captain records to reduce XRPC calls 22 22 type RemoteHoldAuthorizer struct { 23 - db *sql.DB 24 - httpClient *http.Client 25 - cacheTTL time.Duration // TTL for captain record cache 26 - recentDenials sync.Map // In-memory cache for first denials 27 - stopCleanup chan struct{} // Signal to stop cleanup goroutine 28 - testMode bool // If true, use HTTP for local DIDs 29 - firstDenialBackoff time.Duration // Backoff duration for first denial (default: 10s) 30 - cleanupInterval time.Duration // Cleanup goroutine interval (default: 10s) 31 - cleanupGracePeriod time.Duration // Grace period before cleanup (default: 5s) 32 - dbBackoffDurations []time.Duration // Backoff durations for DB denials (default: [1m, 5m, 15m, 1h]) 23 + db *sql.DB 24 + httpClient *http.Client 25 + cacheTTL time.Duration // TTL for captain record cache 26 + recentDenials sync.Map // In-memory cache for first denials 27 + stopCleanup chan struct{} // Signal to stop cleanup goroutine 28 + testMode bool // If true, use HTTP for local DIDs 29 + firstDenialBackoff time.Duration // Backoff duration for first denial (default: 10s) 30 + cleanupInterval time.Duration // Cleanup goroutine interval (default: 10s) 31 + cleanupGracePeriod time.Duration // Grace period before cleanup (default: 5s) 32 + dbBackoffDurations []time.Duration // Backoff durations for DB denials (default: [1m, 5m, 15m, 1h]) 33 33 } 34 34 35 35 // denialEntry stores timestamp for in-memory first denials ··· 40 40 // NewRemoteHoldAuthorizer creates a new remote authorizer for AppView with production defaults 41 41 func NewRemoteHoldAuthorizer(db *sql.DB, testMode bool) HoldAuthorizer { 42 42 return NewRemoteHoldAuthorizerWithBackoffs(db, testMode, 43 - 10*time.Second, // firstDenialBackoff 44 - 10*time.Second, // cleanupInterval 45 - 5*time.Second, // cleanupGracePeriod 43 + 10*time.Second, // firstDenialBackoff 44 + 10*time.Second, // cleanupInterval 45 + 5*time.Second, // cleanupGracePeriod 46 46 []time.Duration{ // dbBackoffDurations 47 47 1 * time.Minute, 48 48 5 * time.Minute, ··· 60 60 httpClient: &http.Client{ 61 61 Timeout: 10 * time.Second, 62 62 }, 63 - cacheTTL: 1 * time.Hour, // 1 hour cache TTL 64 - stopCleanup: make(chan struct{}), 65 - testMode: testMode, 66 - firstDenialBackoff: firstDenialBackoff, 67 - cleanupInterval: cleanupInterval, 68 - cleanupGracePeriod: cleanupGracePeriod, 69 - dbBackoffDurations: dbBackoffDurations, 63 + cacheTTL: 1 * time.Hour, // 1 hour cache TTL 64 + stopCleanup: make(chan struct{}), 65 + testMode: testMode, 66 + firstDenialBackoff: firstDenialBackoff, 67 + cleanupInterval: cleanupInterval, 68 + cleanupGracePeriod: cleanupGracePeriod, 69 + dbBackoffDurations: dbBackoffDurations, 70 70 } 71 71 72 72 // Start cleanup goroutine for in-memory denials
+2 -3
pkg/auth/hold_remote_test.go
··· 288 288 // Create authorizer with fast backoffs for testing (10ms instead of 10s) 289 289 remote := NewRemoteHoldAuthorizerWithBackoffs( 290 290 testDB, 291 - false, // testMode 291 + false, // testMode 292 292 10*time.Millisecond, // firstDenialBackoff (10ms instead of 10s) 293 293 50*time.Millisecond, // cleanupInterval (50ms instead of 10s) 294 294 50*time.Millisecond, // cleanupGracePeriod (50ms instead of 5s) 295 - []time.Duration{ // dbBackoffDurations (fast test values) 295 + []time.Duration{ // dbBackoffDurations (fast test values) 296 296 10 * time.Millisecond, 297 297 20 * time.Millisecond, 298 298 30 * time.Millisecond, ··· 389 389 390 390 _ = server 391 391 } 392 -
+6 -6
pkg/logging/logger_test.go
··· 49 49 defer slog.SetDefault(originalLogger) 50 50 51 51 tests := []struct { 52 - name string 53 - level string 54 - shouldLogDebug bool 55 - shouldLogInfo bool 56 - shouldLogWarn bool 57 - shouldLogError bool 52 + name string 53 + level string 54 + shouldLogDebug bool 55 + shouldLogInfo bool 56 + shouldLogWarn bool 57 + shouldLogError bool 58 58 }{ 59 59 { 60 60 name: "debug level logs all",