Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sksadjad committed Jun 25, 2024
1 parent 4e86fca commit 5ee0d0d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { KeyObject } from 'crypto'

import {
CredentialRequestClientBuilder,
ProofOfPossessionBuilder,
} from '@sphereon/oid4vci-client'
import { CredentialRequestClientBuilder, ProofOfPossessionBuilder } from '@sphereon/oid4vci-client'
import {
Alg,
CNonceState,
Expand Down
28 changes: 14 additions & 14 deletions packages/client/lib/CredentialRequestClientBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
ExperimentalSubjectIssuance,
OID4VCICredentialFormat,
OpenId4VCIVersion,
UniformCredentialOfferRequest
} from '@sphereon/oid4vci-common'
import { CredentialFormat } from '@sphereon/ssi-types'
UniformCredentialOfferRequest,
} from '@sphereon/oid4vci-common';
import { CredentialFormat } from '@sphereon/ssi-types';

import { CredentialOfferClient } from './CredentialOfferClient';
import { CredentialRequestClientBuilderV1_0_11 } from './CredentialRequestClientBuilderV1_0_11';
Expand All @@ -30,12 +30,12 @@ export class CredentialRequestClientBuilder {
}

public static fromCredentialIssuer({
credentialIssuer,
metadata,
version,
credentialIdentifier,
credentialTypes,
}: {
credentialIssuer,
metadata,
version,
credentialIdentifier,
credentialTypes,
}: {
credentialIssuer: string;
metadata?: EndpointMetadata;
version?: OpenId4VCIVersion;
Expand Down Expand Up @@ -99,9 +99,9 @@ export class CredentialRequestClientBuilder {
}

public static fromCredentialOffer({
credentialOffer,
metadata,
}: {
credentialOffer,
metadata,
}: {
credentialOffer: CredentialOfferRequestWithBaseUrl;
metadata?: EndpointMetadata;
}): CredentialRequestClientBuilder {
Expand Down Expand Up @@ -129,9 +129,9 @@ export class CredentialRequestClientBuilder {

public withCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadata | CredentialIssuerMetadataV1_0_13): this {
if (isV1_0_13(this._builder)) {
this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadataV1_0_13)
this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadataV1_0_13);
} else {
this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadata)
this._builder.withCredentialEndpointFromMetadata(metadata as CredentialIssuerMetadata);
}
return this;
}
Expand Down
44 changes: 23 additions & 21 deletions packages/client/lib/__tests__/IT.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {
AccessTokenResponse,
Alg, CredentialOfferPayloadV1_0_13,
Alg,
CredentialOfferPayloadV1_0_13,
CredentialOfferRequestWithBaseUrl,
Jwt,
OpenId4VCIVersion,
ProofOfPossession, resolveCredentialOfferURI,
WellKnownEndpoints
} from '@sphereon/oid4vci-common'
ProofOfPossession,
resolveCredentialOfferURI,
WellKnownEndpoints,
} from '@sphereon/oid4vci-common';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import nock from 'nock';
Expand Down Expand Up @@ -311,25 +313,25 @@ describe('OID4VCI-Client should', () => {
});

nock(ISSUER_URL)
.post(/token.*/)
.reply(200, JSON.stringify(mockedAccessTokenResponse));
.post(/token.*/)
.reply(200, JSON.stringify(mockedAccessTokenResponse));

/* The actual access token calls */
const accessTokenClient: AccessTokenClient = new AccessTokenClient();
const accessTokenResponse = await accessTokenClient.acquireAccessToken({ credentialOffer: credentialOffer, pin: '1234' });
expect(accessTokenResponse.successBody).toEqual(mockedAccessTokenResponse);
// Get the credential
nock(ISSUER_URL)
.post(/credential/)
.reply(200, {
format: 'jwt-vc',
credential: mockedVC,
});
.post(/credential/)
.reply(200, {
format: 'jwt-vc',
credential: mockedVC,
});
const credReqClient = CredentialRequestClientBuilder.fromCredentialOffer({ credentialOffer: credentialOffer })
.withFormat('jwt_vc')
.withFormat('jwt_vc')

.withTokenFromResponse(accessTokenResponse.successBody!)
.build();
.withTokenFromResponse(accessTokenResponse.successBody!)
.build();

const proof: ProofOfPossession = await ProofOfPossessionBuilder.fromJwt({
jwt: jwtDid,
Expand All @@ -338,13 +340,13 @@ describe('OID4VCI-Client should', () => {
},
version: OpenId4VCIVersion.VER_1_0_11,
})
.withEndpointMetadata({
issuer: 'https://issuer.research.identiproof.io',
credential_endpoint: 'https://issuer.research.identiproof.io/credential',
token_endpoint: 'https://issuer.research.identiproof.io/token',
})
.withKid('did:example:ebfeb1f712ebc6f1c276e12ec21/keys/1')
.build();
.withEndpointMetadata({
issuer: 'https://issuer.research.identiproof.io',
credential_endpoint: 'https://issuer.research.identiproof.io/credential',
token_endpoint: 'https://issuer.research.identiproof.io/token',
})
.withKid('did:example:ebfeb1f712ebc6f1c276e12ec21/keys/1')
.build();
const credResponse = await credReqClient.acquireCredentialsUsingProof({
proofInput: proof,
credentialTypes: credentialOffer.original_credential_offer.credential_configuration_ids[0],
Expand Down

0 comments on commit 5ee0d0d

Please sign in to comment.