From 97b87795b893eaede336387af9a209338da00213 Mon Sep 17 00:00:00 2001 From: "A.G.J. Cate" Date: Wed, 16 Oct 2024 11:53:25 +0200 Subject: [PATCH 1/2] feat: added DynamicRegistrationClientMetadata type and extended existing metadata for issuer and rp --- packages/common/lib/index.ts | 1 + packages/common/lib/jwt/Jwk.types.ts | 4 + .../oauth/DynamicClientRegistration.types.ts | 20 ++ packages/common/lib/oauth/index.ts | 1 + .../lib/types/ServerMetadata.ts | 5 +- .../ResponseRegistration.ts | 8 + .../AuthorizationResponseOpts.schema.ts | 261 +++++++++++------- .../DiscoveryMetadataPayload.schema.ts | 246 ++++++++++++++--- packages/siop-oid4vp/lib/types/SIOP.types.ts | 18 +- 9 files changed, 418 insertions(+), 146 deletions(-) create mode 100644 packages/common/lib/oauth/DynamicClientRegistration.types.ts create mode 100644 packages/common/lib/oauth/index.ts diff --git a/packages/common/lib/index.ts b/packages/common/lib/index.ts index a5a2147c..942f50b9 100644 --- a/packages/common/lib/index.ts +++ b/packages/common/lib/index.ts @@ -5,6 +5,7 @@ export const VCI_LOG_COMMON = VCI_LOGGERS.get('sphereon:oid4vci:common'); export * from './jwt'; export * from './dpop'; +export * from './oauth'; export { v4 as uuidv4 } from 'uuid'; export { defaultHasher } from './hasher'; diff --git a/packages/common/lib/jwt/Jwk.types.ts b/packages/common/lib/jwt/Jwk.types.ts index 4d493144..fb3a6204 100644 --- a/packages/common/lib/jwt/Jwk.types.ts +++ b/packages/common/lib/jwt/Jwk.types.ts @@ -32,3 +32,7 @@ export interface JWK extends BaseJWK { [propName: string]: unknown; } + +export type JWKS = { + keys: JWK[] +} diff --git a/packages/common/lib/oauth/DynamicClientRegistration.types.ts b/packages/common/lib/oauth/DynamicClientRegistration.types.ts new file mode 100644 index 00000000..b86abab6 --- /dev/null +++ b/packages/common/lib/oauth/DynamicClientRegistration.types.ts @@ -0,0 +1,20 @@ +import { JWKS } from '../jwt' + +// https://www.rfc-editor.org/rfc/rfc7591.html#section-2 +export interface DynamicRegistrationClientMetadata { + redirect_uris?: string[] + token_endpoint_auth_method?: string + grant_types?: string + response_types?: string + client_name?: string + client_uri?: string + logo_uri?: string + scope?: string + contacts?: string[] + tos_uri?: string + policy_uri?: string + jwks_uri?: string + jwks?: JWKS + software_id?: string + software_version?: string +} diff --git a/packages/common/lib/oauth/index.ts b/packages/common/lib/oauth/index.ts new file mode 100644 index 00000000..23c811df --- /dev/null +++ b/packages/common/lib/oauth/index.ts @@ -0,0 +1 @@ +export * from './DynamicClientRegistration.types'; diff --git a/packages/oid4vci-common/lib/types/ServerMetadata.ts b/packages/oid4vci-common/lib/types/ServerMetadata.ts index a17427c3..246bdd03 100644 --- a/packages/oid4vci-common/lib/types/ServerMetadata.ts +++ b/packages/oid4vci-common/lib/types/ServerMetadata.ts @@ -1,13 +1,12 @@ -import { SigningAlgo } from '@sphereon/oid4vc-common'; +import { DynamicRegistrationClientMetadata, SigningAlgo } from '@sphereon/oid4vc-common'; -export interface AuthorizationServerMetadata { +export interface AuthorizationServerMetadata extends DynamicRegistrationClientMetadata { issuer: string; authorization_endpoint?: string; token_endpoint?: string; token_endpoint_auth_methods_supported?: string[]; token_endpoint_auth_signing_alg_values_supported?: string[]; - jwks_uri?: string; registration_endpoint?: string; scopes_supported?: string[]; response_types_supported: string[]; diff --git a/packages/siop-oid4vp/lib/authorization-response/ResponseRegistration.ts b/packages/siop-oid4vp/lib/authorization-response/ResponseRegistration.ts index e6ec4869..8b852d32 100644 --- a/packages/siop-oid4vp/lib/authorization-response/ResponseRegistration.ts +++ b/packages/siop-oid4vp/lib/authorization-response/ResponseRegistration.ts @@ -16,6 +16,14 @@ export const createDiscoveryMetadataPayload = (opts: DiscoveryMetadataOpts): Dis client_id: opts.client_id, redirect_uris: opts.redirectUris, client_name: opts.clientName, + client_uri: opts.clientUri, + scope: opts.scope, + contacts: opts.contacts, + tos_uri: opts.tosUri, + policy_uri: opts.policyUri, + jwks: opts.jwks, + software_id: opts.softwareId, + software_version: opts.softwareVersion, token_endpoint_auth_method: opts.tokenEndpointAuthMethod, application_type: opts.applicationType, response_types: opts.responseTypes, diff --git a/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts b/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts index cdf66763..4b71ab59 100644 --- a/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/AuthorizationResponseOpts.schema.ts @@ -450,6 +450,33 @@ export const AuthorizationResponseOptsSchemaObj = { "clientName": { "type": "string" }, + "clientUri": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "tosUri": { + "type": "string" + }, + "policyUri": { + "type": "string" + }, + "jwks": { + "$ref": "#/definitions/JWKS" + }, + "softwareId": { + "type": "string" + }, + "softwareVersion": { + "type": "string" + }, "tokenEndpointAuthMethod": { "type": "string" }, @@ -858,6 +885,33 @@ export const AuthorizationResponseOptsSchemaObj = { "clientName": { "type": "string" }, + "clientUri": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "tosUri": { + "type": "string" + }, + "policyUri": { + "type": "string" + }, + "jwks": { + "$ref": "#/definitions/JWKS" + }, + "softwareId": { + "type": "string" + }, + "softwareVersion": { + "type": "string" + }, "tokenEndpointAuthMethod": { "type": "string" }, @@ -1395,6 +1449,117 @@ export const AuthorizationResponseOptsSchemaObj = { "distributed" ] }, + "JWKS": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "$ref": "#/definitions/JWK" + } + } + }, + "required": [ + "keys" + ], + "additionalProperties": false + }, + "JWK": { + "type": "object", + "properties": { + "kty": { + "type": "string" + }, + "crv": { + "type": "string" + }, + "x": { + "type": "string" + }, + "y": { + "type": "string" + }, + "e": { + "type": "string" + }, + "n": { + "type": "string" + }, + "alg": { + "type": "string" + }, + "d": { + "type": "string" + }, + "dp": { + "type": "string" + }, + "dq": { + "type": "string" + }, + "ext": { + "type": "boolean" + }, + "k": { + "type": "string" + }, + "key_ops": { + "type": "array", + "items": { + "type": "string" + } + }, + "kid": { + "type": "string" + }, + "oth": { + "type": "array", + "items": { + "type": "object", + "properties": { + "d": { + "type": "string" + }, + "r": { + "type": "string" + }, + "t": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "p": { + "type": "string" + }, + "q": { + "type": "string" + }, + "qi": { + "type": "string" + }, + "use": { + "type": "string" + }, + "x5c": { + "type": "array", + "items": { + "type": "string" + } + }, + "x5t": { + "type": "string" + }, + "x5t#S256": { + "type": "string" + }, + "x5u": { + "type": "string" + } + }, + "additionalProperties": {} + }, "Format": { "type": "object", "properties": { @@ -1677,102 +1842,6 @@ export const AuthorizationResponseOptsSchemaObj = { ], "additionalProperties": false }, - "JWK": { - "type": "object", - "properties": { - "kty": { - "type": "string" - }, - "crv": { - "type": "string" - }, - "x": { - "type": "string" - }, - "y": { - "type": "string" - }, - "e": { - "type": "string" - }, - "n": { - "type": "string" - }, - "alg": { - "type": "string" - }, - "d": { - "type": "string" - }, - "dp": { - "type": "string" - }, - "dq": { - "type": "string" - }, - "ext": { - "type": "boolean" - }, - "k": { - "type": "string" - }, - "key_ops": { - "type": "array", - "items": { - "type": "string" - } - }, - "kid": { - "type": "string" - }, - "oth": { - "type": "array", - "items": { - "type": "object", - "properties": { - "d": { - "type": "string" - }, - "r": { - "type": "string" - }, - "t": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "p": { - "type": "string" - }, - "q": { - "type": "string" - }, - "qi": { - "type": "string" - }, - "use": { - "type": "string" - }, - "x5c": { - "type": "array", - "items": { - "type": "string" - } - }, - "x5t": { - "type": "string" - }, - "x5t#S256": { - "type": "string" - }, - "x5u": { - "type": "string" - } - }, - "additionalProperties": {} - }, "JwtIssuerCustom": { "type": "object", "properties": { diff --git a/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts b/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts index a675aad4..80df8be0 100644 --- a/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts @@ -8,6 +8,57 @@ export const DiscoveryMetadataPayloadSchemaObj = { { "type": "object", "properties": { + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + } + }, + "token_endpoint_auth_method": { + "type": "string" + }, + "grant_types": { + "type": "string" + }, + "response_types": { + "type": "string" + }, + "client_name": { + "type": "string" + }, + "client_uri": { + "type": "string" + }, + "logo_uri": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "tos_uri": { + "type": "string" + }, + "policy_uri": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "jwks": { + "$ref": "#/definitions/JWKS" + }, + "software_id": { + "type": "string" + }, + "software_version": { + "type": "string" + }, "authorization_endpoint": { "anyOf": [ { @@ -105,9 +156,6 @@ export const DiscoveryMetadataPayloadSchemaObj = { "userinfo_endpoint": { "type": "string" }, - "jwks_uri": { - "type": "string" - }, "registration_endpoint": { "type": "string" }, @@ -358,35 +406,68 @@ export const DiscoveryMetadataPayloadSchemaObj = { "client_id": { "type": "string" }, + "application_type": { + "type": "string" + }, + "vp_formats": { + "$ref": "#/definitions/Format" + } + } + }, + { + "type": "object", + "properties": { "redirect_uris": { "type": "array", "items": { "type": "string" } }, + "token_endpoint_auth_method": { + "type": "string" + }, + "grant_types": { + "type": "string" + }, + "response_types": { + "type": "string" + }, "client_name": { "type": "string" }, - "token_endpoint_auth_method": { + "client_uri": { "type": "string" }, - "application_type": { + "logo_uri": { "type": "string" }, - "response_types": { + "scope": { "type": "string" }, - "grant_types": { + "contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "tos_uri": { + "type": "string" + }, + "policy_uri": { + "type": "string" + }, + "jwks_uri": { + "type": "string" + }, + "jwks": { + "$ref": "#/definitions/JWKS" + }, + "software_id": { + "type": "string" + }, + "software_version": { "type": "string" }, - "vp_formats": { - "$ref": "#/definitions/Format" - } - } - }, - { - "type": "object", - "properties": { "authorization_endpoint": { "anyOf": [ { @@ -484,9 +565,6 @@ export const DiscoveryMetadataPayloadSchemaObj = { "userinfo_endpoint": { "type": "string" }, - "jwks_uri": { - "type": "string" - }, "registration_endpoint": { "type": "string" }, @@ -737,33 +815,12 @@ export const DiscoveryMetadataPayloadSchemaObj = { "client_id": { "type": "string" }, - "redirect_uris": { - "type": "array", - "items": { - "type": "string" - } - }, - "client_name": { - "type": "string" - }, - "token_endpoint_auth_method": { - "type": "string" - }, "application_type": { "type": "string" }, - "response_types": { - "type": "string" - }, - "grant_types": { - "type": "string" - }, "vp_formats": { "$ref": "#/definitions/Format" }, - "logo_uri": { - "type": "string" - }, "client_purpose": { "type": "string" } @@ -1139,6 +1196,117 @@ export const DiscoveryMetadataPayloadSchemaObj = { } ] }, + "JWKS": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "$ref": "#/definitions/JWK" + } + } + }, + "required": [ + "keys" + ], + "additionalProperties": false + }, + "JWK": { + "type": "object", + "properties": { + "kty": { + "type": "string" + }, + "crv": { + "type": "string" + }, + "x": { + "type": "string" + }, + "y": { + "type": "string" + }, + "e": { + "type": "string" + }, + "n": { + "type": "string" + }, + "alg": { + "type": "string" + }, + "d": { + "type": "string" + }, + "dp": { + "type": "string" + }, + "dq": { + "type": "string" + }, + "ext": { + "type": "boolean" + }, + "k": { + "type": "string" + }, + "key_ops": { + "type": "array", + "items": { + "type": "string" + } + }, + "kid": { + "type": "string" + }, + "oth": { + "type": "array", + "items": { + "type": "object", + "properties": { + "d": { + "type": "string" + }, + "r": { + "type": "string" + }, + "t": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "p": { + "type": "string" + }, + "q": { + "type": "string" + }, + "qi": { + "type": "string" + }, + "use": { + "type": "string" + }, + "x5c": { + "type": "array", + "items": { + "type": "string" + } + }, + "x5t": { + "type": "string" + }, + "x5t#S256": { + "type": "string" + }, + "x5u": { + "type": "string" + } + }, + "additionalProperties": {} + }, "Schema": { "type": "string", "enum": [ diff --git a/packages/siop-oid4vp/lib/types/SIOP.types.ts b/packages/siop-oid4vp/lib/types/SIOP.types.ts index b44484cf..0868ca26 100644 --- a/packages/siop-oid4vp/lib/types/SIOP.types.ts +++ b/packages/siop-oid4vp/lib/types/SIOP.types.ts @@ -1,6 +1,6 @@ // noinspection JSUnusedGlobalSymbols import { JarmClientMetadata } from '@sphereon/jarm' -import { SigningAlgo } from '@sphereon/oid4vc-common' +import { DynamicRegistrationClientMetadata, JWKS, SigningAlgo } from '@sphereon/oid4vc-common' import { Format, PresentationDefinitionV1, PresentationDefinitionV2 } from '@sphereon/pex-models' import { AdditionalClaims, @@ -268,6 +268,14 @@ interface DiscoveryMetadataOptsVID1 extends DiscoveryMetadataCommonOpts { client_id?: string // from oidc4vp redirectUris?: string[] | string // from oidc4vp clientName?: string // from oidc4vp + clientUri?: string // from oidc4vp + scope?: string // from oidc4vp + contacts?: string[] // from oidc4vp + tosUri?: string // from oidc4vp + policyUri?: string // from oidc4vp + jwks?: JWKS // from oidc4vp + softwareId?: string // from oidc4vp + softwareVersion?: string // from oidc4vp tokenEndpointAuthMethod?: string // from oidc4vp applicationType?: string // from oidc4vp responseTypes?: string // from oidc4vp, also name suggests array @@ -350,19 +358,13 @@ interface DiscoveryMetadataCommonPayload { [x: string]: any } -interface DiscoveryMetadataPayloadVID1 extends DiscoveryMetadataCommonPayload { +interface DiscoveryMetadataPayloadVID1 extends DiscoveryMetadataCommonPayload, DynamicRegistrationClientMetadata { client_id?: string - redirect_uris?: string[] - client_name?: string - token_endpoint_auth_method?: string application_type?: string - response_types?: string - grant_types?: string vp_formats?: Format } interface JWT_VCDiscoveryMetadataPayload extends DiscoveryMetadataPayloadVID1 { - logo_uri?: string client_purpose?: string } From 2d3b5b7855ebe549f6dc8bd050ca37fa63563881 Mon Sep 17 00:00:00 2001 From: "A.G.J. Cate" Date: Wed, 16 Oct 2024 13:18:09 +0200 Subject: [PATCH 2/2] chore: schema generation fixes --- .../AuthorizationRequestPayloadVD11.schema.ts | 4 +- ...ationRequestPayloadVD12OID4VPD18.schema.ts | 4 +- ...ationRequestPayloadVD12OID4VPD20.schema.ts | 4 +- .../AuthorizationRequestPayloadVID1.schema.ts | 4 +- .../DiscoveryMetadataPayload.schema.ts | 324 +++++++++--------- .../RPRegistrationMetadataPayload.schema.ts | 4 +- packages/siop-oid4vp/lib/types/SIOP.types.ts | 2 +- 7 files changed, 173 insertions(+), 173 deletions(-) diff --git a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD11.schema.ts b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD11.schema.ts index f96cfebe..020c0299 100644 --- a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD11.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD11.schema.ts @@ -219,10 +219,10 @@ export const AuthorizationRequestPayloadVD11SchemaObj = { }, "logo_uri": { "anyOf": [ - {}, { "type": "string" - } + }, + {} ] }, "client_purpose": { diff --git a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD18.schema.ts b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD18.schema.ts index a0476c1b..bb6429d1 100644 --- a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD18.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD18.schema.ts @@ -225,10 +225,10 @@ export const AuthorizationRequestPayloadVD12OID4VPD18SchemaObj = { }, "logo_uri": { "anyOf": [ - {}, { "type": "string" - } + }, + {} ] }, "client_purpose": { diff --git a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD20.schema.ts b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD20.schema.ts index ca386902..42961fb7 100644 --- a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD20.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVD12OID4VPD20.schema.ts @@ -225,10 +225,10 @@ export const AuthorizationRequestPayloadVD12OID4VPD20SchemaObj = { }, "logo_uri": { "anyOf": [ - {}, { "type": "string" - } + }, + {} ] }, "client_purpose": { diff --git a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVID1.schema.ts b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVID1.schema.ts index d8d3ff89..0b78c774 100644 --- a/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVID1.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/AuthorizationRequestPayloadVID1.schema.ts @@ -191,10 +191,10 @@ export const AuthorizationRequestPayloadVID1SchemaObj = { }, "logo_uri": { "anyOf": [ - {}, { "type": "string" - } + }, + {} ] }, "client_purpose": { diff --git a/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts b/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts index 80df8be0..ba4f744b 100644 --- a/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/DiscoveryMetadataPayload.schema.ts @@ -8,57 +8,6 @@ export const DiscoveryMetadataPayloadSchemaObj = { { "type": "object", "properties": { - "redirect_uris": { - "type": "array", - "items": { - "type": "string" - } - }, - "token_endpoint_auth_method": { - "type": "string" - }, - "grant_types": { - "type": "string" - }, - "response_types": { - "type": "string" - }, - "client_name": { - "type": "string" - }, - "client_uri": { - "type": "string" - }, - "logo_uri": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "contacts": { - "type": "array", - "items": { - "type": "string" - } - }, - "tos_uri": { - "type": "string" - }, - "policy_uri": { - "type": "string" - }, - "jwks_uri": { - "type": "string" - }, - "jwks": { - "$ref": "#/definitions/JWKS" - }, - "software_id": { - "type": "string" - }, - "software_version": { - "type": "string" - }, "authorization_endpoint": { "anyOf": [ { @@ -156,6 +105,9 @@ export const DiscoveryMetadataPayloadSchemaObj = { "userinfo_endpoint": { "type": "string" }, + "jwks_uri": { + "type": "string" + }, "registration_endpoint": { "type": "string" }, @@ -403,20 +355,6 @@ export const DiscoveryMetadataPayloadSchemaObj = { "op_tos_uri": { "type": "string" }, - "client_id": { - "type": "string" - }, - "application_type": { - "type": "string" - }, - "vp_formats": { - "$ref": "#/definitions/Format" - } - } - }, - { - "type": "object", - "properties": { "redirect_uris": { "type": "array", "items": { @@ -456,9 +394,6 @@ export const DiscoveryMetadataPayloadSchemaObj = { "policy_uri": { "type": "string" }, - "jwks_uri": { - "type": "string" - }, "jwks": { "$ref": "#/definitions/JWKS" }, @@ -468,6 +403,20 @@ export const DiscoveryMetadataPayloadSchemaObj = { "software_version": { "type": "string" }, + "client_id": { + "type": "string" + }, + "application_type": { + "type": "string" + }, + "vp_formats": { + "$ref": "#/definitions/Format" + } + } + }, + { + "type": "object", + "properties": { "authorization_endpoint": { "anyOf": [ { @@ -565,6 +514,9 @@ export const DiscoveryMetadataPayloadSchemaObj = { "userinfo_endpoint": { "type": "string" }, + "jwks_uri": { + "type": "string" + }, "registration_endpoint": { "type": "string" }, @@ -812,6 +764,54 @@ export const DiscoveryMetadataPayloadSchemaObj = { "op_tos_uri": { "type": "string" }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + } + }, + "token_endpoint_auth_method": { + "type": "string" + }, + "grant_types": { + "type": "string" + }, + "response_types": { + "type": "string" + }, + "client_name": { + "type": "string" + }, + "client_uri": { + "type": "string" + }, + "logo_uri": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "tos_uri": { + "type": "string" + }, + "policy_uri": { + "type": "string" + }, + "jwks": { + "$ref": "#/definitions/JWKS" + }, + "software_id": { + "type": "string" + }, + "software_version": { + "type": "string" + }, "client_id": { "type": "string" }, @@ -1196,6 +1196,100 @@ export const DiscoveryMetadataPayloadSchemaObj = { } ] }, + "Schema": { + "type": "string", + "enum": [ + "openid:", + "openid-vc:" + ] + }, + "ResponseIss": { + "type": "string", + "enum": [ + "https://self-issued.me", + "https://self-issued.me/v2", + "https://self-issued.me/v2/openid-vc" + ] + }, + "ResponseType": { + "type": "string", + "enum": [ + "id_token", + "vp_token" + ] + }, + "Scope": { + "type": "string", + "enum": [ + "openid", + "openid did_authn", + "profile", + "email", + "address", + "phone" + ] + }, + "SubjectType": { + "type": "string", + "enum": [ + "public", + "pairwise" + ] + }, + "SigningAlgo": { + "type": "string", + "enum": [ + "EdDSA", + "RS256", + "PS256", + "ES256", + "ES256K" + ] + }, + "ResponseMode": { + "type": "string", + "enum": [ + "fragment", + "form_post", + "post", + "direct_post", + "query", + "direct_post.jwt", + "query.jwt", + "fragment.jwt" + ] + }, + "GrantType": { + "type": "string", + "enum": [ + "authorization_code", + "implicit" + ] + }, + "AuthenticationContextReferences": { + "type": "string", + "enum": [ + "phr", + "phrh" + ] + }, + "TokenEndpointAuthMethod": { + "type": "string", + "enum": [ + "client_secret_post", + "client_secret_basic", + "client_secret_jwt", + "private_key_jwt" + ] + }, + "ClaimType": { + "type": "string", + "enum": [ + "normal", + "aggregated", + "distributed" + ] + }, "JWKS": { "type": "object", "properties": { @@ -1307,100 +1401,6 @@ export const DiscoveryMetadataPayloadSchemaObj = { }, "additionalProperties": {} }, - "Schema": { - "type": "string", - "enum": [ - "openid:", - "openid-vc:" - ] - }, - "ResponseIss": { - "type": "string", - "enum": [ - "https://self-issued.me", - "https://self-issued.me/v2", - "https://self-issued.me/v2/openid-vc" - ] - }, - "ResponseType": { - "type": "string", - "enum": [ - "id_token", - "vp_token" - ] - }, - "Scope": { - "type": "string", - "enum": [ - "openid", - "openid did_authn", - "profile", - "email", - "address", - "phone" - ] - }, - "SubjectType": { - "type": "string", - "enum": [ - "public", - "pairwise" - ] - }, - "SigningAlgo": { - "type": "string", - "enum": [ - "EdDSA", - "RS256", - "PS256", - "ES256", - "ES256K" - ] - }, - "ResponseMode": { - "type": "string", - "enum": [ - "fragment", - "form_post", - "post", - "direct_post", - "query", - "direct_post.jwt", - "query.jwt", - "fragment.jwt" - ] - }, - "GrantType": { - "type": "string", - "enum": [ - "authorization_code", - "implicit" - ] - }, - "AuthenticationContextReferences": { - "type": "string", - "enum": [ - "phr", - "phrh" - ] - }, - "TokenEndpointAuthMethod": { - "type": "string", - "enum": [ - "client_secret_post", - "client_secret_basic", - "client_secret_jwt", - "private_key_jwt" - ] - }, - "ClaimType": { - "type": "string", - "enum": [ - "normal", - "aggregated", - "distributed" - ] - }, "Format": { "type": "object", "properties": { diff --git a/packages/siop-oid4vp/lib/schemas/RPRegistrationMetadataPayload.schema.ts b/packages/siop-oid4vp/lib/schemas/RPRegistrationMetadataPayload.schema.ts index 0d70016f..f3b2f432 100644 --- a/packages/siop-oid4vp/lib/schemas/RPRegistrationMetadataPayload.schema.ts +++ b/packages/siop-oid4vp/lib/schemas/RPRegistrationMetadataPayload.schema.ts @@ -103,10 +103,10 @@ export const RPRegistrationMetadataPayloadSchemaObj = { }, "logo_uri": { "anyOf": [ - {}, { "type": "string" - } + }, + {} ] }, "client_purpose": { diff --git a/packages/siop-oid4vp/lib/types/SIOP.types.ts b/packages/siop-oid4vp/lib/types/SIOP.types.ts index 0868ca26..2363b370 100644 --- a/packages/siop-oid4vp/lib/types/SIOP.types.ts +++ b/packages/siop-oid4vp/lib/types/SIOP.types.ts @@ -358,7 +358,7 @@ interface DiscoveryMetadataCommonPayload { [x: string]: any } -interface DiscoveryMetadataPayloadVID1 extends DiscoveryMetadataCommonPayload, DynamicRegistrationClientMetadata { +interface DiscoveryMetadataPayloadVID1 extends DynamicRegistrationClientMetadata, DiscoveryMetadataCommonPayload { client_id?: string application_type?: string vp_formats?: Format