Skip to content

Commit

Permalink
chore: removed OIDF stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Nov 6, 2024
1 parent 65fde90 commit f6eea2b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 37 deletions.
11 changes: 0 additions & 11 deletions packages/issuer-rest/lib/oid4vci-api-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,17 +404,6 @@ export function getMetadataEndpoints<DIDDoc extends object>(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(
Expand Down
40 changes: 26 additions & 14 deletions packages/issuer/lib/VcIssuer.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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<DIDDoc extends object> {
private readonly _issuerMetadata: CredentialIssuerMetadataOptsV1_0_13
private readonly _authorizationServerMetadata: AuthorizationServerMetadata
private readonly _openidFederationMetadata?: OpenidFederationMetadata
private readonly _defaultCredentialOfferBaseUri?: string
private readonly _credentialSignerCallback?: CredentialSignerCallback<DIDDoc>
private readonly _jwtVerifyCallback?: JWTVerifyCallback<DIDDoc>
Expand All @@ -61,7 +79,6 @@ export class VcIssuer<DIDDoc extends object> {
issuerMetadata: CredentialIssuerMetadataOptsV1_0_13,
authorizationServerMetadata: AuthorizationServerMetadata,
args: {
openidFederationMetadata?: OpenidFederationMetadata
txCode?: TxCode
baseUri?: string
credentialOfferSessions: IStateManager<CredentialOfferSession>
Expand All @@ -77,7 +94,6 @@ export class VcIssuer<DIDDoc extends object> {
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
Expand Down Expand Up @@ -671,8 +687,4 @@ export class VcIssuer<DIDDoc extends object> {
public get authorizationServerMetadata() {
return this._authorizationServerMetadata

Check warning on line 688 in packages/issuer/lib/VcIssuer.ts

View check run for this annotation

Codecov / codecov/patch

packages/issuer/lib/VcIssuer.ts#L687-L688

Added lines #L687 - L688 were not covered by tests
}

public get openidFederationMetadata() {
return this._openidFederationMetadata
}
}
8 changes: 0 additions & 8 deletions packages/issuer/lib/builder/VcIssuerBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -25,7 +24,6 @@ export class VcIssuerBuilder<DIDDoc extends object> {
issuerMetadataBuilder?: IssuerMetadataBuilderV1_13
issuerMetadata: Partial<CredentialIssuerMetadataOptsV1_0_13> = {}
authorizationServerMetadata: Partial<AuthorizationServerMetadata> = {}
openidFederationMetadata: Partial<OpenidFederationMetadata> = {}
txCode?: TxCode
defaultCredentialOfferBaseUri?: string
userPinRequired?: boolean
Expand All @@ -50,11 +48,6 @@ export class VcIssuerBuilder<DIDDoc extends object> {
return this
}

public withOpenidFederationMetadata(openidFederationMetadata: OpenidFederationMetadata) {
this.openidFederationMetadata = openidFederationMetadata
return this
}

public withIssuerMetadataBuilder(builder: IssuerMetadataBuilderV1_13) {
this.issuerMetadataBuilder = builder
return this
Expand Down Expand Up @@ -194,7 +187,6 @@ export class VcIssuerBuilder<DIDDoc extends object> {
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,
Expand Down
3 changes: 0 additions & 3 deletions packages/oid4vci-common/lib/types/OpenidFederationMetadata.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/oid4vci-common/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit f6eea2b

Please sign in to comment.