A container registry that uses the AT Protocol for manifest storage and S3 for blob storage.
atcr.io
docker
container
atproto
go
1package storage
2
3import (
4 "atcr.io/pkg/atproto"
5 "atcr.io/pkg/auth"
6 "atcr.io/pkg/auth/oauth"
7)
8
9// DatabaseMetrics interface for tracking pull/push counts
10type DatabaseMetrics interface {
11 IncrementPullCount(did, repository string) error
12 IncrementPushCount(did, repository string) error
13}
14
15// RegistryContext bundles all the context needed for registry operations
16// This includes both per-request data (DID, hold) and shared services
17type RegistryContext struct {
18 // Per-request identity and routing information
19 DID string // User's DID (e.g., "did:plc:abc123")
20 HoldDID string // Hold service DID (e.g., "did:web:hold01.atcr.io")
21 PDSEndpoint string // User's PDS endpoint URL
22 Repository string // Image repository name (e.g., "debian")
23 ServiceToken string // Service token for hold authentication (cached by middleware)
24 ATProtoClient *atproto.Client // Authenticated ATProto client for this user
25
26 // Shared services (same for all requests)
27 Database DatabaseMetrics // Metrics tracking database
28 Authorizer auth.HoldAuthorizer // Hold access authorization
29 Refresher *oauth.Refresher // OAuth session manager
30}