Skip to content

Commit

Permalink
feat(sdk): update credential issuer metadata (#762)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Holovko <[email protected]>
  • Loading branch information
aholovko authored Mar 26, 2024
1 parent 6dd4279 commit 1a3bb62
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"cryptographic_binding_methods_supported": [
"ion"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ECDSASecp256k1DER"
],
"display": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@
"cryptographic_binding_methods_supported": [
"web"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ECDSAP256DER"
],
"proof_types": [
"jwt"
]
"proof_types_supported": {
"jwt": {
"proof_signing_alg_values_supported": [
"ECDSAP256DER"
]
}
}
}
},
"credential_endpoint": "[SERVER_URL]/oidc/credential",
Expand Down
2 changes: 1 addition & 1 deletion pkg/credentialschema/testdata/bank_issuer_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"cryptographic_binding_methods_supported": [
"orb"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ECDSASecp256k1DER"
],
"display": [
Expand Down
2 changes: 1 addition & 1 deletion pkg/credentialschema/testdata/issuer_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"cryptographic_binding_methods_supported": [
"ion"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ECDSASecp256k1DER"
],
"display": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cryptographic_binding_methods_supported": [
"ion"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ECDSASecp256k1DER"
],
"display": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"cryptographic_binding_methods_supported": [
"jwk"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ECDSAP256DER"
],
"display": [
Expand Down
16 changes: 10 additions & 6 deletions pkg/models/issuer/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ type CredentialConfigurationSupported struct {
// who possesses the Credential.
CryptographicBindingMethodsSupported []string `json:"cryptographic_binding_methods_supported,omitempty"`

// Array of case-sensitive strings that identify the cryptographic suites
// that are supported for the cryptographic_binding_methods_supported.
CryptographicSuitesSupported []string `json:"cryptographic_suites_supported,omitempty"`
// Array of case-sensitive strings that identify the algorithms that the Issuer uses to sign the issued Credential.
CredentialSigningAlgValuesSupported []string `json:"credential_signing_alg_values_supported,omitempty"`

// An array of objects, where each object contains the display properties of the
// supported credential for a certain language.
Expand All @@ -120,9 +119,8 @@ type CredentialConfigurationSupported struct {
// Array of the claim name values that lists them in the order they should be displayed by the Wallet.
Order []string `json:"order,omitempty"`

// A JSON array of case-sensitive strings, each representing proof_type that the Credential Issuer supports.
// If omitted, the default value is jwt.
ProofTypes []string `json:"proof_types,omitempty"`
// Object that describes specifics of the key proof(s) that the Credential Issuer supports.
ProofTypesSupported map[string]ProofTypeSupported `json:"proof_types_supported,omitempty"`

// A JSON string identifying the scope value that this Credential Issuer supports for this particular credential.
Scope string `json:"scope,omitempty"`
Expand Down Expand Up @@ -175,6 +173,12 @@ type CredentialResponseEncryptionSupported struct {
EncryptionRequired bool `json:"encryption_required"`
}

// ProofTypeSupported contains metadata about the proof type that the Credential Issuer supports.
type ProofTypeSupported struct {
// Array of case-sensitive strings that identify the algorithms that the Issuer supports for this proof type.
ProofSigningAlgValuesSupported []string `json:"proof_signing_alg_values_supported"`
}

// GetJWTKID returns the jwtKID field. This is exposed via this method instead of with an exported field because
// the linter expects all exported fields to have JSON tags, but the jwtKID field is only intended for use internally
// within Wallet-SDK.
Expand Down
12 changes: 8 additions & 4 deletions pkg/openid4ci/issuerinitiatedinteraction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func TestNewIssuerInitiatedInteraction(t *testing.T) {
"cryptographic_binding_methods_supported": [
"ion"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ED25519"
],
"display": [
Expand All @@ -357,9 +357,13 @@ func TestNewIssuerInitiatedInteraction(t *testing.T) {
}
],
"format": "jwt_vc_json_unsupported",
"proof_types": [
"jwt"
]
"proof_types_supported": {
"jwt": {
"proof_signing_alg_values_supported": [
"ED25519"
]
}
}
}
},
"credential_endpoint": "[SERVER_URL]/oidc/credential",
Expand Down
12 changes: 8 additions & 4 deletions pkg/openid4ci/testdata/sample_issuer_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"cryptographic_binding_methods_supported": [
"ion"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"ED25519"
],
"display": [
Expand All @@ -152,9 +152,13 @@
"doctype": "",
"format": "jwt_vc_json",
"order": null,
"proof_types": [
"jwt"
],
"proof_types_supported": {
"jwt": {
"proof_signing_alg_values_supported": [
"ED25519"
]
}
},
"scope": "",
"vct": ""
}
Expand Down
14 changes: 7 additions & 7 deletions test/integration/fixtures/profile/profiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"cryptographic_binding_methods_supported": [
"did"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"Ed25519Signature2018"
],
"display": [
Expand Down Expand Up @@ -357,7 +357,7 @@
"cryptographic_binding_methods_supported": [
"did"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"Ed25519Signature2018"
],
"display": [
Expand Down Expand Up @@ -541,7 +541,7 @@
"cryptographic_binding_methods_supported": [
"did"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"Ed25519Signature2018"
],
"display": [
Expand Down Expand Up @@ -718,7 +718,7 @@
"cryptographic_binding_methods_supported": [
"did"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"Ed25519Signature2018"
],
"display": [
Expand Down Expand Up @@ -852,7 +852,7 @@
"cryptographic_binding_methods_supported": [
"did"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"Ed25519Signature2018"
],
"display": [
Expand Down Expand Up @@ -985,7 +985,7 @@
"cryptographic_binding_methods_supported": [
"did"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"Ed25519Signature2018"
],
"display": [
Expand Down Expand Up @@ -1132,7 +1132,7 @@
"cryptographic_binding_methods_supported": [
"did"
],
"cryptographic_suites_supported": [
"credential_signing_alg_values_supported": [
"Ed25519Signature2018"
],
"display": [
Expand Down

0 comments on commit 1a3bb62

Please sign in to comment.