Skip to content

Commit

Permalink
rework URL handling
Browse files Browse the repository at this point in the history
  • Loading branch information
eike-hass committed Jun 7, 2024
1 parent b561a25 commit 894d65c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions oid4vc/TangleLabs/src/grpcService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const createService = async (
const requestId = crypto.randomUUID();
const request = await rp.createRequest({
requestBy: "reference",
requestUri: `${process.env.PUBLIC_URL}/api/offer/${requestId}`,
requestUri: new URL(`/api/offer/${requestId}`, process.env.PUBLIC_URL).toString(),
responseType: "id_token",
state: call.request.state,
nonce: call.request.nonce,
Expand Down Expand Up @@ -63,7 +63,7 @@ export const createService = async (
const request = await rp.createRequest({
presentationDefinition: struct.decode(call.request.presentationDefinition) as unknown as PresentationDefinitionV2,
requestBy: "reference",
requestUri: `${process.env.PUBLIC_URL}/api/offer/${requestId}`,
requestUri: new URL(`/api/offer/${requestId}`, process.env.PUBLIC_URL).toString(),
responseType: "vp_token",
state: call.request.state,
nonce: call.request.nonce,
Expand Down Expand Up @@ -92,7 +92,7 @@ export const createService = async (
{
credentials: call.request.credentials,
requestBy: "reference",
credentialOfferUri: `${process.env.PUBLIC_URL}/api/credential-offer/${requestId}`,
credentialOfferUri: new URL(`/api/credential-offer/${requestId}`, process.env.PUBLIC_URL).toString(),
},
{ state: call.request.state }
);
Expand Down
10 changes: 5 additions & 5 deletions oid4vc/TangleLabs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ import {Cache} from './cache';
did: process.env.RP_DID,
kid: `${process.env.RP_DID}#${process.env.KEY_FRAGMENT}`,
signer: remoteSigner(process.env.SIGNER_KEYID),
redirectUri: `${process.env.PUBLIC_URL}/api/auth`,
redirectUri: new URL('/api/auth', process.env.PUBLIC_URL).toString(),
resolver,
});

const issuer = new VcIssuer({
batchCredentialEndpoint: `${process.env.PUBLIC_URL}/api/credential`,
credentialEndpoint: `${process.env.PUBLIC_URL}/api/credential`,
credentialIssuer: `${process.env.PUBLIC_URL}/`, // should be DID?
batchCredentialEndpoint: new URL('api/credential', process.env.PUBLIC_URL).toString(),
credentialEndpoint: new URL('api/credential', process.env.PUBLIC_URL).toString(),
credentialIssuer: new URL(process.env.PUBLIC_URL).toString(), // should be DID?
proofTypesSupported: ["jwt"],
cryptographicBindingMethodsSupported: ["did:key"], //TODO: did:jwk?
resolver,
Expand All @@ -59,7 +59,7 @@ import {Cache} from './cache';
kid: `${process.env.RP_DID}#${process.env.KEY_FRAGMENT}`,
credentialSigningAlgValuesSupported: [SigningAlgs.EdDSA],
store: createStore(),
tokenEndpoint: `${process.env.PUBLIC_URL}/api/token`,
tokenEndpoint: new URL('/api/token', process.env.PUBLIC_URL).toString(),
supportedCredentials: [
{
name: "wa_driving_license",
Expand Down

0 comments on commit 894d65c

Please sign in to comment.