Skip to content

Commit

Permalink
feat: update signed wellknown
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Sizov <[email protected]>
  • Loading branch information
mishasizov-SK committed Feb 26, 2024
1 parent f2ac6b9 commit 7a34e47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
7 changes: 1 addition & 6 deletions component/wallet-cli/pkg/wellknown/wellknown.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,7 @@ func getWellKnownOpenIDConfigurationJWTPayload(rawResponse string, vdrRegistry v
return nil, nil, fmt.Errorf("decode claims: %w", err)
}

sb, err := v.Get("well_known_openid_issuer_configuration").Object()
if err != nil {
return nil, nil, fmt.Errorf("fastjson.Parser Get well_known_openid_issuer_configuration: %w", err)
}

return sb.MarshalTo([]byte{}), v.GetStringBytes("iss"), nil
return credentialOfferPayload, v.GetStringBytes("iss"), nil
}

func (s *Service) GetIssuerDID() string {
Expand Down
12 changes: 7 additions & 5 deletions pkg/service/wellknown/provider/wellknown_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ type cryptoJWTSigner interface {
NewJWTSigned(claims interface{}, signerData *vc.Signer) (string, error)
}

// JWTWellKnownOpenIDIssuerConfigurationClaims is JWT Claims extension
// by WellKnownOpenIDIssuerConfiguration (with custom "well_known_openid_issuer_configuration" claim).
// JWTWellKnownOpenIDIssuerConfigurationClaims is JWT Claims extension by WellKnownOpenIDIssuerConfiguration.
type JWTWellKnownOpenIDIssuerConfigurationClaims struct {
*jwt.Claims

WellKnownOpenIDIssuerConfiguration *issuer.WellKnownOpenIDIssuerConfiguration `json:"well_known_openid_issuer_configuration,omitempty"` //nolint:lll
*issuer.WellKnownOpenIDIssuerConfiguration
}

type Config struct {
Expand Down Expand Up @@ -226,7 +224,11 @@ func (s *Service) buildCredentialConfigurationsSupported(
) *issuer.WellKnownOpenIDIssuerConfiguration_CredentialConfigurationsSupported {
credentialsConfigurationSupported := &issuer.WellKnownOpenIDIssuerConfiguration_CredentialConfigurationsSupported{}

credentialConfSupported := issuerProfile.CredentialMetaData.CredentialsConfigurationSupported
var credentialConfSupported map[string]*profileapi.CredentialsConfigurationSupported
if issuerProfile.CredentialMetaData != nil {
credentialConfSupported = issuerProfile.CredentialMetaData.CredentialsConfigurationSupported
}

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

Expand Down

0 comments on commit 7a34e47

Please sign in to comment.