UNPKG

@sphereon/ssi-sdk.oid4vci-issuer-rest-api

Version:

1 lines 19.1 kB
{"version":3,"sources":["../src/index.ts","../../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.0_@types+node@20.19.25__@swc+core@1.15.2_@swc+_119fedc18e19d1717452bb9e989205b3/node_modules/tsup/assets/cjs_shims.js","../src/OID4VCIRestAPI.ts"],"sourcesContent":["/**\n * @public\n */\nexport * from './OID4VCIRestAPI'\nexport * from './types'\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","import { CredentialDataSupplier, CredentialSignerCallback, VcIssuer } from '@sphereon/oid4vci-issuer'\nimport { getBasePath, OID4VCIServer } from '@sphereon/oid4vci-issuer-server'\nimport { IOID4VCIServerOpts } from '@sphereon/oid4vci-issuer-server'\nimport { ExpressSupport } from '@sphereon/ssi-express-support'\nimport { isDidIdentifier, isIIdentifier } from '@sphereon/ssi-sdk-ext.identifier-resolution'\nimport { ensureRawDocument } from '@sphereon/ssi-sdk.data-store-types'\nimport { AddCredentialArgs, CredentialCorrelationType } from '@sphereon/ssi-sdk.credential-store'\nimport {\n createAuthRequestUriCallback,\n getAccessTokenSignerCallback,\n IIssuerInstanceArgs,\n IssuerInstance,\n createVerifyAuthResponseCallback,\n} from '@sphereon/ssi-sdk.oid4vci-issuer'\nimport { CredentialMapper, CredentialRole, OriginalVerifiableCredential } from '@sphereon/ssi-types'\nimport express, { Express, Request, Response, Router } from 'express'\nimport fs from 'fs'\nimport path from 'path'\nimport { fileURLToPath } from 'url'\nimport { IRequiredContext } from './types'\nimport swaggerUi from 'swagger-ui-express'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\nexport interface IOID4VCIRestAPIOpts extends IOID4VCIServerOpts {\n /**\n * When `true`, every credential issued through this OID4VCI REST API is persisted as a\n * {@link CredentialRole.ISSUER} `DigitalCredential` row via the `ICredentialStore` plugin\n * (agent method `crsAddCredential`). Requires the `credential-store` plugin to be present\n * on the agent. Defaults to `false`.\n *\n * Persistence failures are surfaced (fail-fast): when this flag is enabled and the store\n * call throws, the enclosing issuance request fails with an error rather than silently\n * dropping the row. That is intentional — a silent drop is exactly the defect DEV-35 fixes.\n */\n persistIssuedCredentials?: boolean\n}\n\nexport class OID4VCIRestAPI {\n private readonly _expressSupport: ExpressSupport\n private readonly _context: IRequiredContext\n private readonly _opts?: IOID4VCIRestAPIOpts\n private readonly _restApi: OID4VCIServer\n private readonly _instance: IssuerInstance\n private readonly _issuer: VcIssuer\n private readonly _router: Router\n private _baseUrl: URL\n private _basePath: string\n\n static async init(args: {\n context: IRequiredContext\n issuerInstanceArgs: IIssuerInstanceArgs\n credentialDataSupplier?: CredentialDataSupplier\n expressSupport: ExpressSupport\n opts?: IOID4VCIRestAPIOpts\n }): Promise<OID4VCIRestAPI> {\n const { issuerInstanceArgs, context } = args\n const opts = args.opts ?? {}\n const expressSupport = args.expressSupport\n const instance = await context.agent.oid4vciGetInstance(args.issuerInstanceArgs)\n const wrapCredentialSignerCallback = opts.persistIssuedCredentials\n ? OID4VCIRestAPI.buildPersistenceSignerWrapper({ context, instance })\n : undefined\n const issuer = await instance.get({ context, credentialDataSupplier: args.credentialDataSupplier, wrapCredentialSignerCallback })\n\n if (!opts.endpointOpts) {\n opts.endpointOpts = {}\n }\n if (!opts.endpointOpts.tokenEndpointOpts) {\n opts.endpointOpts.tokenEndpointOpts = {\n accessTokenIssuer: instance.metadataOptions.credentialIssuer ?? issuer.issuerMetadata.credential_issuer,\n }\n }\n if (\n opts?.endpointOpts.tokenEndpointOpts?.tokenEndpointDisabled !== true &&\n typeof opts?.endpointOpts.tokenEndpointOpts?.accessTokenSignerCallback !== 'function'\n ) {\n const idOpts = instance.issuerOptions.idOpts\n const tokenOpts = {\n iss: opts.endpointOpts.tokenEndpointOpts.accessTokenIssuer ?? instance.metadataOptions.credentialIssuer,\n didOpts: instance.issuerOptions.didOpts,\n idOpts,\n }\n\n opts.endpointOpts.tokenEndpointOpts.accessTokenSignerCallback = await getAccessTokenSignerCallback(\n {\n ...tokenOpts,\n },\n args.context,\n )\n }\n\n if (opts?.endpointOpts.authorizationChallengeOpts?.enabled === true) {\n if (!instance.issuerOptions.presentationDefinitionId) {\n throw Error(`Unable to set createAuthRequestUriCallback. No presentationDefinitionId present in issuer options`)\n }\n\n if (typeof opts?.endpointOpts.authorizationChallengeOpts.createAuthRequestUriCallback !== 'function') {\n if (!opts.endpointOpts.authorizationChallengeOpts?.createAuthRequestUriEndpointPath) {\n throw Error(`Unable to set createAuthRequestUriCallback. No createAuthRequestUriEndpointPath present in options`)\n }\n\n opts.endpointOpts.authorizationChallengeOpts.createAuthRequestUriCallback = await createAuthRequestUriCallback({\n path: opts.endpointOpts.authorizationChallengeOpts.createAuthRequestUriEndpointPath,\n presentationDefinitionId: instance.issuerOptions.presentationDefinitionId,\n })\n }\n\n if (typeof opts?.endpointOpts.authorizationChallengeOpts?.verifyAuthResponseCallback !== 'function') {\n if (!opts.endpointOpts.authorizationChallengeOpts?.verifyAuthResponseEndpointPath) {\n throw Error(`Unable to set verifyAuthResponseCallback. No createAuthRequestUriEndpointPath present in options`)\n }\n\n opts.endpointOpts.authorizationChallengeOpts.verifyAuthResponseCallback = await createVerifyAuthResponseCallback({\n path: opts.endpointOpts.authorizationChallengeOpts.verifyAuthResponseEndpointPath,\n presentationDefinitionId: instance.issuerOptions.presentationDefinitionId,\n })\n }\n }\n\n return new OID4VCIRestAPI({ context, issuerInstanceArgs, expressSupport, opts, instance, issuer })\n }\n\n /**\n * Builds a {@link CredentialSignerCallback} wrapper that persists each issued credential as a\n * {@link CredentialRole.ISSUER} `DigitalCredential` row after delegating the actual signing to\n * the underlying signer. Issuer identity is resolved from the *signed* credential (so any\n * issuer normalization performed by the signer is preserved in the persisted row). The\n * correlation type is derived from the resolved issuer id (`did:` prefix -> DID, otherwise URL),\n * matching the pattern used by the holder-side persistence in `OID4VCIHolder`.\n *\n * Persistence errors propagate to the caller (fail-fast). Callers that opt into\n * `persistIssuedCredentials` are explicitly requesting the row; a silent drop here would\n * reproduce the DEV-35 defect.\n */\n private static buildPersistenceSignerWrapper(args: {\n context: IRequiredContext\n instance: IssuerInstance\n }): (original: CredentialSignerCallback) => CredentialSignerCallback {\n const { context, instance } = args\n return (originalSigner: CredentialSignerCallback): CredentialSignerCallback => {\n return async (signerArgs) => {\n const signed = await originalSigner(signerArgs)\n const rawDocument = ensureRawDocument(signed as OriginalVerifiableCredential)\n const uniform = CredentialMapper.toUniformCredential(signed as OriginalVerifiableCredential)\n let issuerId = CredentialMapper.issuerCorrelationIdFromIssuerType(uniform.issuer)\n if (!issuerId) {\n const fromIdOpts = instance.issuerOptions.idOpts?.identifier ?? instance.issuerOptions.didOpts?.idOpts?.identifier\n if (typeof fromIdOpts === 'string') {\n issuerId = fromIdOpts\n }\n }\n if (!issuerId) {\n return Promise.reject(Error('Cannot persist issued credential: unable to determine issuer identifier from signed credential'))\n }\n\n const identifier = await context.agent.identifierManagedGet({\n identifier: issuerId,\n issuer: issuerId,\n vmRelationship: 'assertionMethod',\n })\n\n let issuerCorrelationId = identifier.issuer\n if (!issuerCorrelationId && isDidIdentifier(identifier.identifier)) {\n if (isIIdentifier(identifier.identifier)) {\n issuerCorrelationId = identifier.identifier.did\n } else if (typeof identifier.identifier === 'string') {\n issuerCorrelationId = identifier.identifier\n }\n }\n if (!issuerCorrelationId) {\n issuerCorrelationId = issuerId\n }\n\n const dc: AddCredentialArgs = {\n credential: {\n credentialRole: CredentialRole.ISSUER,\n kmsKeyRef: identifier.kmsKeyRef,\n identifierMethod: identifier.method,\n issuerCorrelationId,\n issuerCorrelationType: issuerCorrelationId.startsWith('did:') ? CredentialCorrelationType.DID : CredentialCorrelationType.URL,\n rawDocument,\n },\n }\n await context.agent.crsAddCredential(dc)\n return signed\n }\n }\n }\n\n private readonly OID4VCI_OPENAPI_FILE = path.join(__dirname, '..', 'oid4vci-openapi.yml')\n\n private constructor(args: {\n issuer: VcIssuer\n instance: IssuerInstance\n context: IRequiredContext\n issuerInstanceArgs: IIssuerInstanceArgs\n expressSupport: ExpressSupport\n opts: IOID4VCIRestAPIOpts\n }) {\n const { context, opts, issuerInstanceArgs } = args\n this._baseUrl = new URL(\n opts?.baseUrl ??\n process.env.BASE_URL ??\n opts?.issuer?.issuerMetadata?.credential_issuer ??\n issuerInstanceArgs.credentialIssuer ??\n 'http://localhost',\n )\n this._basePath = getBasePath(this._baseUrl)\n this._context = context\n this._opts = opts ?? {}\n this._expressSupport = args.expressSupport\n this._issuer = args.issuer\n this._instance = args.instance\n this._restApi = new OID4VCIServer(args.expressSupport, { ...opts, issuer: this._issuer })\n\n // The above setups the generic OID4VCI management and wallet APIs from the OID4VCI lib.\n // Below sets up the management of configurations\n this._router = express.Router()\n this.express.use(this._basePath, this._router)\n this.setupSwaggerUi()\n }\n\n private setupSwaggerUi() {\n const apiDocsPath = `/api-docs`\n const specPath = `/api-docs/spec.yaml`\n const fullSpecPath = `${this._basePath}${specPath}`\n\n if (!fs.existsSync(this.OID4VCI_OPENAPI_FILE)) {\n console.log(`[OID4VCI] OpenAPI spec not found at ${this.OID4VCI_OPENAPI_FILE}. Swagger UI disabled.`)\n return\n }\n\n console.log(`[OID4VCI] API docs available at ${this._baseUrl.origin}${this._basePath}${apiDocsPath}`)\n this.express.set('trust proxy', this.opts?.endpointOpts?.trustProxy ?? true)\n\n // Serve spec from local file\n this._router.get(specPath, (req: Request, res: Response): void => {\n res.type('text/yaml').sendFile(this.OID4VCI_OPENAPI_FILE)\n })\n\n // Swagger UI\n this._router.use(apiDocsPath, swaggerUi.serve, swaggerUi.setup(undefined, { swaggerOptions: { url: fullSpecPath } }))\n }\n\n get express(): Express {\n return this._expressSupport.express\n }\n\n get context(): IRequiredContext {\n return this._context\n }\n\n get opts(): IOID4VCIRestAPIOpts | undefined {\n return this._opts\n }\n\n get restApi(): OID4VCIServer {\n return this._restApi\n }\n\n get instance(): IssuerInstance {\n return this._instance\n }\n\n get issuer(): VcIssuer {\n return this._issuer\n }\n\n async stop(): Promise<boolean> {\n return this._expressSupport.stop()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACKA,IAAMA,mBAAmB,6BACvB,OAAOC,aAAa,cAChB,IAAIC,IAAI,QAAQC,UAAAA,EAAY,EAAEC,OAC7BH,SAASI,iBAAiBJ,SAASI,cAAcC,QAAQC,YAAW,MAAO,WAC1EN,SAASI,cAAcG,MACvB,IAAIN,IAAI,WAAWD,SAASQ,OAAO,EAAEL,MALpB;AAOlB,IAAMM,gBAAgCV,iCAAAA;;;ACX7C,mCAA2C;AAG3C,yBAA+C;AAC/C,qBAAkC;AAClC,IAAAW,kBAA6D;AAC7D,IAAAA,kBAMO;AACP,uBAA+E;AAC/E,qBAA4D;AAC5D,gBAAe;AACf,kBAAiB;AACjB,iBAA8B;AAE9B,gCAAsB;AAEtB,IAAMC,kBAAaC,0BAAc,aAAe;AAChD,IAAMC,YAAYC,YAAAA,QAAKC,QAAQJ,WAAAA;AAgBxB,IAAMK,iBAAN,MAAMA,gBAAAA;EAtCb,OAsCaA;;;EACMC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACTC;EACAC;EAER,aAAaC,KAAKC,MAMU;AAC1B,UAAM,EAAEC,oBAAoBC,QAAO,IAAKF;AACxC,UAAMG,OAAOH,KAAKG,QAAQ,CAAC;AAC3B,UAAMC,iBAAiBJ,KAAKI;AAC5B,UAAMC,WAAW,MAAMH,QAAQI,MAAMC,mBAAmBP,KAAKC,kBAAkB;AAC/E,UAAMO,+BAA+BL,KAA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AAQC,IAAI,mCAAmC,KAAK9F,SAAS+F,MAAM,GAAG,KAAK9F,SAAS,GAAGuF,WAAAA,EAAa;AACpG,SAAKJ,QAAQY,IAAI,eAAe,KAAK1F,MAAMY,cAAc+E,cAAc,IAAA;AAGvE,SAAKlG,QAAQiB,IAAIyE,UAAU,CAACS,KAAcC,QAAAA;AACxCA,UAAIC,KAAK,WAAA,EAAaC,SAAS,KAAKzB,oBAAoB;IAC1D,CAAA;AAGA,SAAK7E,QAAQuF,IAAIE,aAAac,0BAAAA,QAAUC,OAAOD,0BAAAA,QAAUE,MAAM1F,QAAW;MAAE2F,gBAAgB;QAAEC,KAAKhB;MAAa;IAAE,CAAA,CAAA;EACpH;EAEA,IAAIN,UAAmB;AACrB,WAAO,KAAK3F,gBAAgB2F;EAC9B;EAEA,IAAI/E,UAA4B;AAC9B,WAAO,KAAKX;EACd;EAEA,IAAIY,OAAwC;AAC1C,WAAO,KAAKX;EACd;EAEA,IAAIgH,UAAyB;AAC3B,WAAO,KAAK/G;EACd;EAEA,IAAIY,WAA2B;AAC7B,WAAO,KAAKX;EACd;EAEA,IAAIkB,SAAmB;AACrB,WAAO,KAAKjB;EACd;EAEA,MAAM8G,OAAyB;AAC7B,WAAO,KAAKnH,gBAAgBmH,KAAI;EAClC;AACF;","names":["getImportMetaUrl","document","URL","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","importMetaUrl","import_ssi_sdk","__filename","fileURLToPath","__dirname","path","dirname","OID4VCIRestAPI","_expressSupport","_context","_opts","_restApi","_instance","_issuer","_router","_baseUrl","_basePath","init","args","issuerInstanceArgs","context","opts","expressSupport","instance","agent","oid4vciGetInstance","wrapCredentialSignerCallback","persistIssuedCredentials","buildPersistenceSignerWrapper","undefined","issuer","get","credentialDataSupplier","endpointOpts","tokenEndpointOpts","accessTokenIssuer","metadataOptions","credentialIssuer","issuerMetadata","credential_issuer","tokenEndpointDisabled","accessTokenSignerCallback","idOpts","issuerOptions","tokenOpts","iss","didOpts","getAccessTokenSignerCallback","authorizationChallengeOpts","enabled","presentationDefinitionId","Error","createAuthRequestUriCallback","createAuthRequestUriEndpointPath","verifyAuthResponseCallback","verifyAuthResponseEndpointPath","createVerifyAuthResponseCallback","originalSigner","signerArgs","signed","rawDocument","ensureRawDocument","uniform","CredentialMapper","toUniformCredential","issuerId","issuerCorrelationIdFromIssuerType","fromIdOpts","identifier","Promise","reject","identifierManagedGet","vmRelationship","issuerCorrelationId","isDidIdentifier","isIIdentifier","did","dc","credential","credentialRole","CredentialRole","ISSUER","kmsKeyRef","identifierMethod","method","issuerCorrelationType","startsWith","CredentialCorrelationType","DID","URL","crsAddCredential","OID4VCI_OPENAPI_FILE","join","baseUrl","process","env","BASE_URL","getBasePath","OID4VCIServer","express","Router","use","setupSwaggerUi","apiDocsPath","specPath","fullSpecPath","fs","existsSync","console","log","origin","set","trustProxy","req","res","type","sendFile","swaggerUi","serve","setup","swaggerOptions","url","restApi","stop"]}