Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class OpenId4VcController extends ConsumptionBaseController {
return { status: serverResponse.status, message: serverResponse.body };
}

public async createPresentationForToken(credential: VerifiableCredential): Promise<VerifiablePresentation> {
return await this.holder.createPresentationForToken(credential);
public async createPresentationTokenContent(credential: VerifiableCredential): Promise<VerifiablePresentation> {
return await this.holder.createPresentationTokenContent(credential);
}
}
2 changes: 1 addition & 1 deletion packages/consumption/src/modules/openid4vc/local/Holder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class Holder extends BaseAgent<ReturnType<typeof getOpenIdHolderModules>>

// hacky solution because credo doesn't support credentials without key binding
// TODO: use credentials without key binding once supported
public async createPresentationForToken(credential: VerifiableCredential): Promise<VerifiablePresentation> {
public async createPresentationTokenContent(credential: VerifiableCredential): Promise<VerifiablePresentation> {
if (credential.type !== ClaimFormat.SdJwtDc) throw new Error("Only SD-JWT credentials have been tested so far with token presentation");

const sdJwtVcApi = this.agent.dependencyManager.resolve(SdJwtVcApi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export class CreatePresentationTokenUseCase extends UseCase<CreatePresentationTo
const attribute = await this.attributesController.getLocalAttribute(CoreId.from(request.attributeId));
if (!(attribute?.content.value instanceof VerifiableCredential)) return Result.fail(RuntimeErrors.general.recordNotFound("Attribute with Verifiable Credential"));

const presentation = await this.openId4VcController.createPresentationForToken(attribute.content.value);
const presentationTokenContent = await this.openId4VcController.createPresentationTokenContent(attribute.content.value);

const token = await this.tokenController.sendToken({
content: presentation.toJSON(),
content: presentationTokenContent.toJSON(),
expiresAt: CoreDate.utc().add({ minutes: 1 }),
ephemeral: true
});
Expand Down