From f6eea2b7d2f16afc32a41b7d398b79a71c5fb862 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Wed, 6 Nov 2024 12:31:55 +0100 Subject: [PATCH] chore: removed OIDF stuff --- .../issuer-rest/lib/oid4vci-api-functions.ts | 11 ----- packages/issuer/lib/VcIssuer.ts | 40 ++++++++++++------- .../issuer/lib/builder/VcIssuerBuilder.ts | 8 ---- .../lib/types/OpenidFederationMetadata.ts | 3 -- packages/oid4vci-common/lib/types/index.ts | 1 - 5 files changed, 26 insertions(+), 37 deletions(-) delete mode 100644 packages/oid4vci-common/lib/types/OpenidFederationMetadata.ts diff --git a/packages/issuer-rest/lib/oid4vci-api-functions.ts b/packages/issuer-rest/lib/oid4vci-api-functions.ts index 382f4954..0c3f1079 100644 --- a/packages/issuer-rest/lib/oid4vci-api-functions.ts +++ b/packages/issuer-rest/lib/oid4vci-api-functions.ts @@ -404,17 +404,6 @@ export function getMetadataEndpoints(router: Router, issu return response.send(issuer.authorizationServerMetadata) } router.get(WellKnownEndpoints.OAUTH_AS, authorizationServerHandler) - - const openidFederationHandler = (request: Request, response: Response) => { - if(!issuer.openidFederationMetadata || !issuer.openidFederationMetadata.jwt) { - return response.status(404).send() - } - const asciiContent = Buffer.from(issuer.openidFederationMetadata.jwt, 'utf8').toString('ascii') - return response - .type('application/entity-statement+jwt') - .send(asciiContent) - } - router.get(WellKnownEndpoints.OPENID_FEDERATION, openidFederationHandler) } export function determinePath( diff --git a/packages/issuer/lib/VcIssuer.ts b/packages/issuer/lib/VcIssuer.ts index e2847eaf..2e64ae17 100644 --- a/packages/issuer/lib/VcIssuer.ts +++ b/packages/issuer/lib/VcIssuer.ts @@ -1,19 +1,24 @@ import { uuidv4 } from '@sphereon/oid4vc-common' import { ALG_ERROR, - AUD_ERROR, AuthorizationServerMetadata, + AUD_ERROR, + AuthorizationServerMetadata, CNonceState, CreateCredentialOfferURIResult, CREDENTIAL_MISSING_ERROR, CredentialConfigurationSupportedV1_0_13, CredentialDataSupplierInput, + CredentialEventNames, CredentialIssuerMetadata, + CredentialIssuerMetadataOptsV1_0_13, + CredentialOfferEventNames, CredentialOfferSession, CredentialOfferV1_0_13, CredentialRequest, CredentialRequestV1_0_13, CredentialResponse, DID_NO_DIDDOC_ERROR, + EVENTS, IAT_ERROR, ISSUER_CONFIG_ERROR, IssueStatus, @@ -35,19 +40,32 @@ import { TYP_ERROR, URIState } from '@sphereon/oid4vci-common' -import { CredentialEventNames, CredentialOfferEventNames, EVENTS } from '@sphereon/oid4vci-common' -import { CredentialIssuerMetadataOptsV1_0_13 } from '@sphereon/oid4vci-common' -import { OpenidFederationMetadata } from '@sphereon/oid4vci-common' -import { CompactSdJwtVc, CredentialMapper, InitiatorType, SubSystem, System, W3CVerifiableCredential } from '@sphereon/ssi-types' +import { + CompactSdJwtVc, + CredentialMapper, + InitiatorType, + SubSystem, + System, + W3CVerifiableCredential +} from '@sphereon/ssi-types' -import { assertValidPinNumber, createCredentialOfferObject, createCredentialOfferURIFromObject, CredentialOfferGrantInput } from './functions' +import { + assertValidPinNumber, + createCredentialOfferObject, + createCredentialOfferURIFromObject, + CredentialOfferGrantInput +} from './functions' import { LookupStateManager } from './state-manager' -import { CredentialDataSupplier, CredentialDataSupplierArgs, CredentialIssuanceInput, CredentialSignerCallback } from './types' +import { + CredentialDataSupplier, + CredentialDataSupplierArgs, + CredentialIssuanceInput, + CredentialSignerCallback +} from './types' export class VcIssuer { private readonly _issuerMetadata: CredentialIssuerMetadataOptsV1_0_13 private readonly _authorizationServerMetadata: AuthorizationServerMetadata - private readonly _openidFederationMetadata?: OpenidFederationMetadata private readonly _defaultCredentialOfferBaseUri?: string private readonly _credentialSignerCallback?: CredentialSignerCallback private readonly _jwtVerifyCallback?: JWTVerifyCallback @@ -61,7 +79,6 @@ export class VcIssuer { issuerMetadata: CredentialIssuerMetadataOptsV1_0_13, authorizationServerMetadata: AuthorizationServerMetadata, args: { - openidFederationMetadata?: OpenidFederationMetadata txCode?: TxCode baseUri?: string credentialOfferSessions: IStateManager @@ -77,7 +94,6 @@ export class VcIssuer { this.setDefaultTokenEndpoint(issuerMetadata) this._issuerMetadata = issuerMetadata this._authorizationServerMetadata = authorizationServerMetadata - this._openidFederationMetadata = args.openidFederationMetadata this._defaultCredentialOfferBaseUri = args.defaultCredentialOfferBaseUri this._credentialOfferSessions = args.credentialOfferSessions this._cNonces = args.cNonces @@ -671,8 +687,4 @@ export class VcIssuer { public get authorizationServerMetadata() { return this._authorizationServerMetadata } - - public get openidFederationMetadata() { - return this._openidFederationMetadata - } } diff --git a/packages/issuer/lib/builder/VcIssuerBuilder.ts b/packages/issuer/lib/builder/VcIssuerBuilder.ts index 5496886d..1091d133 100644 --- a/packages/issuer/lib/builder/VcIssuerBuilder.ts +++ b/packages/issuer/lib/builder/VcIssuerBuilder.ts @@ -13,7 +13,6 @@ import { TxCode, URIState } from '@sphereon/oid4vci-common' -import { OpenidFederationMetadata } from '@sphereon/oid4vci-common' import { VcIssuer } from '../VcIssuer' import { MemoryStates } from '../state-manager' @@ -25,7 +24,6 @@ export class VcIssuerBuilder { issuerMetadataBuilder?: IssuerMetadataBuilderV1_13 issuerMetadata: Partial = {} authorizationServerMetadata: Partial = {} - openidFederationMetadata: Partial = {} txCode?: TxCode defaultCredentialOfferBaseUri?: string userPinRequired?: boolean @@ -50,11 +48,6 @@ export class VcIssuerBuilder { return this } - public withOpenidFederationMetadata(openidFederationMetadata: OpenidFederationMetadata) { - this.openidFederationMetadata = openidFederationMetadata - return this - } - public withIssuerMetadataBuilder(builder: IssuerMetadataBuilderV1_13) { this.issuerMetadataBuilder = builder return this @@ -194,7 +187,6 @@ export class VcIssuerBuilder { return new VcIssuer(metadata as IssuerMetadataV1_0_13, this.authorizationServerMetadata as AuthorizationServerMetadata, { - openidFederationMetadata: this.openidFederationMetadata as OpenidFederationMetadata, //TODO: discuss this with Niels. I did not find this in the spec. but I think we should somehow communicate this ...(this.txCode && { txCode: this.txCode }), defaultCredentialOfferBaseUri: this.defaultCredentialOfferBaseUri, diff --git a/packages/oid4vci-common/lib/types/OpenidFederationMetadata.ts b/packages/oid4vci-common/lib/types/OpenidFederationMetadata.ts deleted file mode 100644 index 8c38fdb1..00000000 --- a/packages/oid4vci-common/lib/types/OpenidFederationMetadata.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface OpenidFederationMetadata { - jwt: string -} diff --git a/packages/oid4vci-common/lib/types/index.ts b/packages/oid4vci-common/lib/types/index.ts index 769e7a1c..5d60ee08 100644 --- a/packages/oid4vci-common/lib/types/index.ts +++ b/packages/oid4vci-common/lib/types/index.ts @@ -6,7 +6,6 @@ export * from './v1_0_09.types'; export * from './v1_0_11.types'; export * from './v1_0_13.types'; export * from './ServerMetadata'; -export * from './OpenidFederationMetadata'; export * from './OpenID4VCIErrors'; export * from './OpenID4VCIVersions.types'; export * from './StateManager.types';