Skip to content

Commit

Permalink
Merge pull request #161 from Sphereon-Opensource/feature/SPRIND-76
Browse files Browse the repository at this point in the history
feat/SPRIND-76
  • Loading branch information
nklomp authored Oct 21, 2024
2 parents f4f0362 + 2d3b5b7 commit 71e72e8
Show file tree
Hide file tree
Showing 14 changed files with 406 additions and 134 deletions.
1 change: 1 addition & 0 deletions packages/common/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
4 changes: 4 additions & 0 deletions packages/common/lib/jwt/Jwk.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ export interface JWK extends BaseJWK {

[propName: string]: unknown;
}

export type JWKS = {
keys: JWK[]
}
20 changes: 20 additions & 0 deletions packages/common/lib/oauth/DynamicClientRegistration.types.ts
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions packages/common/lib/oauth/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './DynamicClientRegistration.types';
5 changes: 2 additions & 3 deletions packages/oid4vci-common/lib/types/ServerMetadata.ts
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ export const AuthorizationRequestPayloadVD11SchemaObj = {
},
"logo_uri": {
"anyOf": [
{},
{
"type": "string"
}
},
{}
]
},
"client_purpose": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ export const AuthorizationRequestPayloadVD12OID4VPD18SchemaObj = {
},
"logo_uri": {
"anyOf": [
{},
{
"type": "string"
}
},
{}
]
},
"client_purpose": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ export const AuthorizationRequestPayloadVD12OID4VPD20SchemaObj = {
},
"logo_uri": {
"anyOf": [
{},
{
"type": "string"
}
},
{}
]
},
"client_purpose": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ export const AuthorizationRequestPayloadVID1SchemaObj = {
},
"logo_uri": {
"anyOf": [
{},
{
"type": "string"
}
},
{}
]
},
"client_purpose": {
Expand Down
Loading

0 comments on commit 71e72e8

Please sign in to comment.