Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update credential issuer metadata #1684

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
375 changes: 188 additions & 187 deletions api/spec/openapi.gen.go

Large diffs are not rendered by default.

38 changes: 26 additions & 12 deletions docs/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,9 @@ components:
description: ID of the credential template.
nullable: true
override_issuer:
type: boolean
description: Override issuer.
nullable: true
type: boolean
description: Override issuer.
nullable: true
override_subject_did:
type: boolean
description: Override credential subject did.
Expand Down Expand Up @@ -2097,21 +2097,21 @@ components:
description: A JSON string identifying the scope value that this Credential Issuer supports for this particular credential.
cryptographic_binding_methods_supported:
type: array
description: Array of case sensitive strings that identify how the Credential is bound to the identifier of the End-User who possesses the Credential.
items:
type: string
description: Array of case sensitive strings that identify how the Credential is bound to the identifier of the End-User who possesses the Credential.
cryptographic_suites_supported:
credential_signing_alg_values_supported:
type: array
description: Array of case sensitive strings that identify the algorithms that the Issuer uses to sign the issued Credential.
items:
type: string
description: Array of case sensitive strings that identify the cryptographic suites that are supported for the cryptographic_binding_methods_supported.
credential_definition:
$ref: ./common.yaml#/components/schemas/CredentialDefinition
order:
type: array
description: Array of the claim name values that lists them in the order they should be displayed by the Wallet.
items:
type: string
description: Array of the claim name values that lists them in the order they should be displayed by the Wallet.
doctype:
type: string
description: 'For mso_mdoc vc only. String identifying the Credential type, as defined in [ISO.18013-5].'
Expand All @@ -2121,18 +2121,32 @@ components:
claims:
type: object
description: 'For mso_mdoc and vc+sd-jwt vc only. Object containing a list of name/value pairs, where each name identifies a claim about the subject offered in the Credential. The value can be another such object (nested data structures), or an array of such objects.'
proof_types:
type: array
items:
type: string
description: 'A JSON array of case sensitive strings, each representing proof_type that the Credential Issuer supports. If omitted, the default value is jwt.'
proof_types_supported:
description: 'Object that describes specifics of the key proof(s) that the Credential Issuer supports.'
type: object
additionalProperties:
$ref: '#/components/schemas/ProofTypeSupported'
display:
type: array
description: 'An array of objects, where each object contains the display properties of the supported credential for a certain language.'
items:
$ref: '#/components/schemas/CredentialDisplay'
required:
- format
ProofTypeSupported:
title: ProofTypeSupported
x-tags:
- issuer
type: object
description: Object that contains metadata about the proof type that the Credential Issuer supports.
properties:
proof_signing_alg_values_supported:
type: array
description: Array of case sensitive strings that identify the algorithms that the Issuer supports for this proof type.
items:
type: string
required:
- proof_signing_alg_values_supported
InitiateIssuanceCredentialConfiguration:
title: InitiateIssuanceCredentialConfiguration object definition.
x-tags:
Expand Down
2 changes: 1 addition & 1 deletion pkg/kms/aws/service_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/kms/mocks/kms_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 69 additions & 5 deletions pkg/restapi/v1/issuer/openapi.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions pkg/service/wellknown/provider/wellknown_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,26 +229,34 @@ func (s *Service) buildCredentialConfigurationsSupported(
}

for credentialConfigurationID, credentialSupported := range credentialConfSupported {
var cryptographicBindingMethodsSupported, cryptographicSuitesSupported []string
var cryptographicBindingMethodsSupported, signingAlgValuesSupported []string

if issuerProfile.VCConfig != nil {
cryptographicBindingMethodsSupported = []string{string(issuerProfile.VCConfig.DIDMethod)}
cryptographicSuitesSupported = []string{string(issuerProfile.VCConfig.KeyType)}
signingAlgValuesSupported = []string{string(issuerProfile.VCConfig.KeyType)}
}

display := s.buildCredentialConfigurationsSupportedDisplay(credentialSupported.Display)
credentialDefinition := s.buildCredentialDefinition(credentialSupported.CredentialDefinition)

proofTypeSupported := &issuer.CredentialConfigurationsSupported_ProofTypesSupported{
AdditionalProperties: map[string]issuer.ProofTypeSupported{
"jwt": {
ProofSigningAlgValuesSupported: []string{string(issuerProfile.VCConfig.KeyType)},
},
},
}

credentialsConfigurationSupported.Set(credentialConfigurationID, issuer.CredentialConfigurationsSupported{
Claims: lo.ToPtr(credentialSupported.Claims),
CredentialDefinition: credentialDefinition,
CryptographicBindingMethodsSupported: lo.ToPtr(cryptographicBindingMethodsSupported),
CryptographicSuitesSupported: lo.ToPtr(cryptographicSuitesSupported),
CredentialSigningAlgValuesSupported: lo.ToPtr(signingAlgValuesSupported),
Display: lo.ToPtr(display),
Doctype: lo.ToPtr(credentialSupported.Doctype),
Format: string(credentialSupported.Format),
Order: lo.ToPtr(credentialSupported.Order),
ProofTypes: lo.ToPtr([]string{"jwt"}),
ProofTypesSupported: proofTypeSupported,
Scope: lo.ToPtr(credentialSupported.Scope),
Vct: lo.ToPtr(credentialSupported.Vct),
})
Expand Down
13 changes: 11 additions & 2 deletions pkg/service/wellknown/provider/wellknown_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func checkWellKnownOpenIDIssuerConfiguration(
assert.Equal(t, []string{"https://example.com/context/1"}, lo.FromPtr(definition.Context))

assert.Equal(t, []string{"orb"}, lo.FromPtr(credentialConfigurationSupported.CryptographicBindingMethodsSupported))
assert.Equal(t, []string{"ECDSASecp256k1DER"}, lo.FromPtr(credentialConfigurationSupported.CryptographicSuitesSupported))
assert.Equal(t, []string{"ECDSASecp256k1DER"}, lo.FromPtr(credentialConfigurationSupported.CredentialSigningAlgValuesSupported))

credentialConfigurationSupportedDisplay := lo.FromPtr(credentialConfigurationSupported.Display)
assert.Equal(t, 1, len(credentialConfigurationSupportedDisplay))
Expand All @@ -244,7 +244,16 @@ func checkWellKnownOpenIDIssuerConfiguration(
assert.Equal(t, "doctype1", lo.FromPtr(credentialConfigurationSupported.Doctype))
assert.Equal(t, "ldp_vc", credentialConfigurationSupported.Format)
assert.Equal(t, []string{"claimName1", "claimName2", "claimName3"}, lo.FromPtr(credentialConfigurationSupported.Order))
assert.Equal(t, []string{"jwt"}, lo.FromPtr(credentialConfigurationSupported.ProofTypes))

expectedProofTypeSupported := issuer.CredentialConfigurationsSupported_ProofTypesSupported{
AdditionalProperties: map[string]issuer.ProofTypeSupported{
"jwt": {
ProofSigningAlgValuesSupported: []string{"ECDSASecp256k1DER"},
},
},
}

assert.Equal(t, expectedProofTypeSupported, lo.FromPtr(credentialConfigurationSupported.ProofTypesSupported))
assert.Equal(t, "VerifiedEmployeeCredential", lo.FromPtr(credentialConfigurationSupported.Scope))
assert.Equal(t, "vct1", lo.FromPtr(credentialConfigurationSupported.Vct))
}
Expand Down
Loading