tangled
alpha
login
or
join now
evan.jarrett.net
/
at-container-registry
66
fork
atom
A container registry that uses the AT Protocol for manifest storage and S3 for blob storage.
atcr.io
docker
container
atproto
go
66
fork
atom
overview
issues
1
pulls
pipelines
interface{} -> any
evan.jarrett.net
2 months ago
a7175f9e
aa4b32bb
verified
This commit was signed with the committer's
known signature
.
evan.jarrett.net
SSH Key Fingerprint:
SHA256:bznk0uVPp7XFOl67P0uTM1pCjf2A4ojeP/lsUE7uauQ=
+32
-32
13 changed files
expand all
collapse all
unified
split
cmd
appview
serve.go
docs
INTEGRATION_STRATEGY.md
SIGNATURE_INTEGRATION.md
examples
plugins
gatekeeper-provider
main.go.temp
ratify-verifier
README.md
verifier.go.temp
pkg
appview
db
oauth_store.go
handlers
images.go
atproto
directory_test.go
auth
hold_remote_test.go
token
handler_test.go
issuer_test.go
hold
pds
records_test.go
+1
-1
cmd/appview/serve.go
···
397
397
return
398
398
}
399
399
400
400
-
var metadataMap map[string]interface{}
400
400
+
var metadataMap map[string]any
401
401
if err := json.Unmarshal(metadataBytes, &metadataMap); err != nil {
402
402
http.Error(w, "Failed to unmarshal metadata", http.StatusInternalServerError)
403
403
return
+1
-1
docs/INTEGRATION_STRATEGY.md
···
251
251
return
252
252
}
253
253
254
254
-
json.NewEncoder(w).Encode(map[string]interface{}{
254
254
+
json.NewEncoder(w).Encode(map[string]any{
255
255
"verified": result.Verified,
256
256
"did": result.Signature.DID,
257
257
"signedAt": result.Signature.SignedAt,
+4
-4
docs/SIGNATURE_INTEGRATION.md
···
545
545
Name: v.name,
546
546
Type: v.Type(),
547
547
Message: fmt.Sprintf("Verified for DID %s", sigData.ATProto.DID),
548
548
-
Extensions: map[string]interface{}{
548
548
+
Extensions: map[string]any{
549
549
"did": sigData.ATProto.DID,
550
550
"handle": sigData.ATProto.Handle,
551
551
"signedAt": sigData.ATProto.SignedAt,
···
673
673
674
674
type ProviderResponse struct {
675
675
SystemError string `json:"system_error,omitempty"`
676
676
-
Responses []map[string]interface{} `json:"responses"`
676
676
+
Responses []map[string]any `json:"responses"`
677
677
}
678
678
679
679
func handleProvide(w http.ResponseWriter, r *http.Request) {
···
684
684
}
685
685
686
686
// Verify each image
687
687
-
responses := make([]map[string]interface{}, 0, len(req.Values))
687
687
+
responses := make([]map[string]any, 0, len(req.Values))
688
688
for _, image := range req.Values {
689
689
result, err := verifier.Verify(context.Background(), image)
690
690
691
691
-
response := map[string]interface{}{
691
691
+
response := map[string]any{
692
692
"image": image,
693
693
"verified": false,
694
694
}
+4
-4
examples/plugins/gatekeeper-provider/main.go.temp
···
35
35
// ProviderResponse is the response format to Gatekeeper.
36
36
type ProviderResponse struct {
37
37
SystemError string `json:"system_error,omitempty"`
38
38
-
Responses []map[string]interface{} `json:"responses"`
38
38
+
Responses []map[string]any `json:"responses"`
39
39
}
40
40
41
41
// VerificationResult holds the result of verifying a single image.
···
110
110
log.Printf("INFO: received verification request for %d images", len(req.Values))
111
111
112
112
// Verify each image
113
113
-
responses := make([]map[string]interface{}, 0, len(req.Values))
113
113
+
responses := make([]map[string]any, 0, len(req.Values))
114
114
for _, image := range req.Values {
115
115
result := s.verifyImage(r.Context(), image)
116
116
responses = append(responses, structToMap(result))
···
186
186
}
187
187
188
188
// structToMap converts a struct to a map for JSON encoding.
189
189
-
func structToMap(v interface{}) map[string]interface{} {
189
189
+
func structToMap(v any) map[string]any {
190
190
data, _ := json.Marshal(v)
191
191
-
var m map[string]interface{}
191
191
+
var m map[string]any
192
192
json.Unmarshal(data, &m)
193
193
return m
194
194
}
+1
-1
examples/plugins/ratify-verifier/README.md
···
196
196
Name string
197
197
Type string
198
198
Message string
199
199
-
Extensions map[string]interface{}
199
199
+
Extensions map[string]any
200
200
}
201
201
```
202
202
+2
-2
examples/plugins/ratify-verifier/verifier.go.temp
···
166
166
Name: v.name,
167
167
Type: v.Type(),
168
168
Message: fmt.Sprintf("Successfully verified ATProto signature for DID %s", sigData.ATProto.DID),
169
169
-
Extensions: map[string]interface{}{
169
169
+
Extensions: map[string]any{
170
170
"did": sigData.ATProto.DID,
171
171
"handle": sigData.ATProto.Handle,
172
172
"signedAt": sigData.ATProto.SignedAt,
···
203
203
Name: v.name,
204
204
Type: v.Type(),
205
205
Message: message,
206
206
-
Extensions: map[string]interface{}{
206
206
+
Extensions: map[string]any{
207
207
"error": message,
208
208
},
209
209
}
+5
-5
pkg/appview/db/oauth_store.go
···
339
339
340
340
// GetSessionStats returns statistics about stored OAuth sessions
341
341
// Useful for monitoring and debugging session health
342
342
-
func (s *OAuthStore) GetSessionStats(ctx context.Context) (map[string]interface{}, error) {
343
343
-
stats := make(map[string]interface{})
342
342
+
func (s *OAuthStore) GetSessionStats(ctx context.Context) (map[string]any, error) {
343
343
+
stats := make(map[string]any)
344
344
345
345
// Total sessions
346
346
var totalSessions int
···
392
392
393
393
// ListSessionsForMonitoring returns a list of all sessions with basic info for monitoring
394
394
// Returns: DID, session age (minutes), last update time
395
395
-
func (s *OAuthStore) ListSessionsForMonitoring(ctx context.Context) ([]map[string]interface{}, error) {
395
395
+
func (s *OAuthStore) ListSessionsForMonitoring(ctx context.Context) ([]map[string]any, error) {
396
396
rows, err := s.db.QueryContext(ctx, `
397
397
SELECT
398
398
account_did,
···
408
408
}
409
409
defer rows.Close()
410
410
411
411
-
var sessions []map[string]interface{}
411
411
+
var sessions []map[string]any
412
412
for rows.Next() {
413
413
var did, sessionID, createdAt, updatedAt string
414
414
var idleMinutes int
···
418
418
continue
419
419
}
420
420
421
421
-
sessions = append(sessions, map[string]interface{}{
421
421
+
sessions = append(sessions, map[string]any{
422
422
"did": did,
423
423
"session_id": sessionID,
424
424
"created_at": createdAt,
+1
-1
pkg/appview/handlers/images.go
···
95
95
96
96
w.Header().Set("Content-Type", "application/json")
97
97
w.WriteHeader(http.StatusConflict)
98
98
-
json.NewEncoder(w).Encode(map[string]interface{}{
98
98
+
json.NewEncoder(w).Encode(map[string]any{
99
99
"error": "confirmation_required",
100
100
"message": "This manifest has associated tags that will also be deleted",
101
101
"tags": tags,
+4
-4
pkg/atproto/directory_test.go
···
32
32
wg.Add(numGoroutines)
33
33
34
34
// Channel to collect all directory instances
35
35
-
instances := make(chan interface{}, numGoroutines)
35
35
+
instances := make(chan any, numGoroutines)
36
36
37
37
// Launch many goroutines concurrently accessing GetDirectory
38
38
for i := 0; i < numGoroutines; i++ {
···
48
48
close(instances)
49
49
50
50
// Collect all instances
51
51
-
var dirs []interface{}
51
51
+
var dirs []any
52
52
for dir := range instances {
53
53
dirs = append(dirs, dir)
54
54
}
···
72
72
func TestGetDirectorySequential(t *testing.T) {
73
73
t.Run("multiple calls in sequence", func(t *testing.T) {
74
74
// Get directory multiple times in sequence
75
75
-
dirs := make([]interface{}, 10)
75
75
+
dirs := make([]any, 10)
76
76
for i := 0; i < 10; i++ {
77
77
dirs[i] = GetDirectory()
78
78
}
···
122
122
var wg sync.WaitGroup
123
123
wg.Add(numGoroutines)
124
124
125
125
-
instances := make([]interface{}, numGoroutines)
125
125
+
instances := make([]any, numGoroutines)
126
126
var mu sync.Mutex
127
127
128
128
// Simulate many goroutines trying to get the directory simultaneously
+4
-4
pkg/auth/hold_remote_test.go
···
78
78
}
79
79
80
80
// Return mock response
81
81
-
response := map[string]interface{}{
81
81
+
response := map[string]any{
82
82
"uri": "at://did:web:test-hold/io.atcr.hold.captain/self",
83
83
"cid": "bafytest123",
84
84
-
"value": map[string]interface{}{
84
84
+
"value": map[string]any{
85
85
"$type": atproto.CaptainCollection,
86
86
"owner": "did:plc:owner123",
87
87
"public": true,
···
281
281
func TestCheckReadAccess_PublicHold(t *testing.T) {
282
282
// Create mock server that returns public captain record
283
283
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
284
284
-
response := map[string]interface{}{
284
284
+
response := map[string]any{
285
285
"uri": "at://did:web:test-hold/io.atcr.hold.captain/self",
286
286
"cid": "bafytest123",
287
287
-
"value": map[string]interface{}{
287
287
+
"value": map[string]any{
288
288
"$type": atproto.CaptainCollection,
289
289
"owner": "did:plc:owner123",
290
290
"public": true, // Public hold
+1
-1
pkg/auth/token/handler_test.go
···
513
513
}
514
514
515
515
// Verify JSON structure
516
516
-
var decoded map[string]interface{}
516
516
+
var decoded map[string]any
517
517
if err := json.Unmarshal(data, &decoded); err != nil {
518
518
t.Fatalf("Failed to unmarshal JSON: %v", err)
519
519
}
+3
-3
pkg/auth/token/issuer_test.go
···
207
207
}
208
208
209
209
// Parse and validate the token
210
210
-
token, err := jwt.ParseWithClaims(tokenString, &Claims{}, func(token *jwt.Token) (interface{}, error) {
210
210
+
token, err := jwt.ParseWithClaims(tokenString, &Claims{}, func(token *jwt.Token) (any, error) {
211
211
return issuer.publicKey, nil
212
212
})
213
213
if err != nil {
···
289
289
}
290
290
291
291
// x5c should be a slice of base64-encoded certificates
292
292
-
x5cSlice, ok := x5c.([]interface{})
292
292
+
x5cSlice, ok := x5c.([]any)
293
293
if !ok {
294
294
t.Fatal("Expected x5c to be a slice")
295
295
}
···
575
575
}
576
576
577
577
// Parse token and verify expiration
578
578
-
token, err := jwt.ParseWithClaims(tokenString, &Claims{}, func(token *jwt.Token) (interface{}, error) {
578
578
+
token, err := jwt.ParseWithClaims(tokenString, &Claims{}, func(token *jwt.Token) (any, error) {
579
579
return issuer.publicKey, nil
580
580
})
581
581
if err != nil {
+1
-1
pkg/hold/pds/records_test.go
···
614
614
records map[string]string // key -> cid
615
615
}
616
616
617
617
-
func (m *mockRepo) ForEach(ctx context.Context, prefix string, fn func(string, interface{}) error) error {
617
617
+
func (m *mockRepo) ForEach(ctx context.Context, prefix string, fn func(string, any) error) error {
618
618
for k, v := range m.records {
619
619
if err := fn(k, v); err != nil {
620
620
if err == repo.ErrDoneIterating {