fix 500 when trying to use did

This commit is contained in:
Evan Jarrett
2026-04-07 21:59:34 -05:00
parent a68477033a
commit 03759713e9
+4 -3
View File
@@ -442,9 +442,10 @@ func (nr *NamespaceResolver) Repository(ctx context.Context, name reference.Name
}
// Create a new reference with identity/image format
// Use the identity (or DID) as the namespace to ensure canonical format
// This transforms: evan.jarrett.net/debian -> evan.jarrett.net/debian (keeps full path)
canonicalName := fmt.Sprintf("%s/%s", identityStr, imageName)
// Use the resolved handle (not raw DID) to ensure the name is valid per OCI reference grammar.
// DIDs contain colons which are illegal in reference path components.
// This transforms: did-plc-abc123/myimage -> alice.bsky.social/myimage
canonicalName := fmt.Sprintf("%s/%s", handle, imageName)
ref, err := reference.ParseNamed(canonicalName)
if err != nil {
return nil, fmt.Errorf("invalid image name %s: %w", imageName, err)