mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-19 00:34:16 +00:00
interface{} -> any
This commit is contained in:
@@ -35,7 +35,7 @@ type ProviderRequest struct {
|
||||
// ProviderResponse is the response format to Gatekeeper.
|
||||
type ProviderResponse struct {
|
||||
SystemError string `json:"system_error,omitempty"`
|
||||
Responses []map[string]interface{} `json:"responses"`
|
||||
Responses []map[string]any `json:"responses"`
|
||||
}
|
||||
|
||||
// VerificationResult holds the result of verifying a single image.
|
||||
@@ -110,7 +110,7 @@ func (s *Server) handleProvide(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("INFO: received verification request for %d images", len(req.Values))
|
||||
|
||||
// Verify each image
|
||||
responses := make([]map[string]interface{}, 0, len(req.Values))
|
||||
responses := make([]map[string]any, 0, len(req.Values))
|
||||
for _, image := range req.Values {
|
||||
result := s.verifyImage(r.Context(), image)
|
||||
responses = append(responses, structToMap(result))
|
||||
@@ -186,9 +186,9 @@ func (s *Server) handleReady(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// structToMap converts a struct to a map for JSON encoding.
|
||||
func structToMap(v interface{}) map[string]interface{} {
|
||||
func structToMap(v any) map[string]any {
|
||||
data, _ := json.Marshal(v)
|
||||
var m map[string]interface{}
|
||||
var m map[string]any
|
||||
json.Unmarshal(data, &m)
|
||||
return m
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ type VerifierResult struct {
|
||||
Name string
|
||||
Type string
|
||||
Message string
|
||||
Extensions map[string]interface{}
|
||||
Extensions map[string]any
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ func (v *ATProtoVerifier) VerifyReference(
|
||||
Name: v.name,
|
||||
Type: v.Type(),
|
||||
Message: fmt.Sprintf("Successfully verified ATProto signature for DID %s", sigData.ATProto.DID),
|
||||
Extensions: map[string]interface{}{
|
||||
Extensions: map[string]any{
|
||||
"did": sigData.ATProto.DID,
|
||||
"handle": sigData.ATProto.Handle,
|
||||
"signedAt": sigData.ATProto.SignedAt,
|
||||
@@ -203,7 +203,7 @@ func (v *ATProtoVerifier) failureResult(message string) verifier.VerifierResult
|
||||
Name: v.name,
|
||||
Type: v.Type(),
|
||||
Message: message,
|
||||
Extensions: map[string]interface{}{
|
||||
Extensions: map[string]any{
|
||||
"error": message,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user