Skip to content

Commit

Permalink
feat: Add EBSI support
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jan 10, 2024
1 parent 459754f commit 7577e3d
Show file tree
Hide file tree
Showing 5 changed files with 420 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,15 @@ describe('Credential Request Client ', () => {
});

describe('Credential Request Client with Walt.id ', () => {
it('should have correct metadata endpoints', async function () {
beforeAll(() => {
nock.cleanAll();
});

afterEach(() => {
nock.cleanAll();
});
it('should have correct metadata endpoints', async function () {
// nock.cleanAll();
const WALT_IRR_URI =
'openid-initiate-issuance://?issuer=https%3A%2F%2Fjff.walt.id%2Fissuer-api%2Foidc%2F&credential_type=OpenBadgeCredential&pre-authorized_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhOTUyZjUxNi1jYWVmLTQ4YjMtODIxYy00OTRkYzgyNjljZjAiLCJwcmUtYXV0aG9yaXplZCI6dHJ1ZX0.YE5DlalcLC2ChGEg47CQDaN1gTxbaQqSclIVqsSAUHE&user_pin_required=false';
const credentialOffer = await CredentialOfferClient.fromURI(WALT_IRR_URI);
Expand Down
5 changes: 4 additions & 1 deletion packages/client/lib/__tests__/MetadataClient.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { getIssuerFromCredentialOfferPayload, WellKnownEndpoints } from '@sphereon/oid4vci-common';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import nock from 'nock';

import { CredentialOfferClient } from '../CredentialOfferClient';
Expand Down Expand Up @@ -211,7 +213,8 @@ describe('Metadataclient with Walt-id should', () => {
});
});

describe('Metadataclient with SpruceId should', () => {
// Spruce gives back 404's these days, so test is disabled
describe.skip('Metadataclient with SpruceId should', () => {
beforeAll(() => {
nock.cleanAll();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/__tests__/SdJwt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('sd-jwt vc', () => {
uri: offerUri.uri,
});

expect(client.credentialOffer.credential_offer).toEqual({
expect(client.credentialOffer?.credential_offer).toEqual({
credential_issuer: 'https://example.com',
credentials: ['SdJwtCredentialId'],
grants: {
Expand Down
3 changes: 1 addition & 2 deletions packages/issuer/lib/VcIssuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
OID4VCICredentialFormat,
OpenId4VCIVersion,
QRCodeOpts,
SdJwtVcCredentialDefinition,
TokenErrorResponse,
toUniformCredentialOfferRequest,
TYP_ERROR,
Expand Down Expand Up @@ -95,7 +94,7 @@ export class VcIssuer<DIDDoc extends object> {
public async createCredentialOfferURI(opts: {
grants?: Grant
credentials?: (CredentialOfferFormat | string)[]
credentialDefinition?: JsonLdIssuerCredentialDefinition | SdJwtVcCredentialDefinition
credentialDefinition?: JsonLdIssuerCredentialDefinition
credentialOfferUri?: string
credentialDataSupplierInput?: CredentialDataSupplierInput // Optional storage that can help the credential Data Supplier. For instance to store credential input data during offer creation, if no additional data can be supplied later on
baseUri?: string
Expand Down
Loading

0 comments on commit 7577e3d

Please sign in to comment.