From e058d31db2fd646fa5e516bedf78427538a2b76f Mon Sep 17 00:00:00 2001 From: dmihalcik-virtru Date: Tue, 23 Apr 2024 19:32:06 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20=F0=9F=8E=A8=20Autoformat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-app/src/App.tsx | 6 +----- web-app/src/session.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/web-app/src/App.tsx b/web-app/src/App.tsx index b8fb2370..133f8235 100644 --- a/web-app/src/App.tsx +++ b/web-app/src/App.tsx @@ -2,11 +2,7 @@ import { clsx } from 'clsx'; import { useState, useEffect, type ChangeEvent } from 'react'; import { showSaveFilePicker } from 'native-file-system-adapter'; import './App.css'; -import { - TDF3Client, - type DecryptSource, - NanoTDFClient, -} from '@opentdf/client'; +import { TDF3Client, type DecryptSource, NanoTDFClient } from '@opentdf/client'; import { type SessionInformation, OidcClient } from './session.js'; function decryptedFileName(encryptedFileName: string): string { diff --git a/web-app/src/session.ts b/web-app/src/session.ts index 86d984aa..e5714edf 100644 --- a/web-app/src/session.ts +++ b/web-app/src/session.ts @@ -360,7 +360,11 @@ export class OidcClient implements AuthProvider { ]); this._sessions.k = k.map((e) => base64.encodeArrayBuffer(e)); } - console.info(`signing token request with DPoP key ${JSON.stringify(await crypto.subtle.exportKey("jwk", signingKey.publicKey))}`); + console.info( + `signing token request with DPoP key ${JSON.stringify( + await crypto.subtle.exportKey('jwk', signingKey.publicKey) + )}` + ); headers.DPoP = await dpopFn( signingKey, 'http://localhost:8888/auth/realms/opentdf/protocol/openid-connect/token', @@ -404,7 +408,11 @@ export class OidcClient implements AuthProvider { console.error('missing DPoP key'); return httpReq; } - console.info(`signing request for ${httpReq.url} with DPoP key ${JSON.stringify(await crypto.subtle.exportKey("jwk", this.signingKey.publicKey))}`); + console.info( + `signing request for ${httpReq.url} with DPoP key ${JSON.stringify( + await crypto.subtle.exportKey('jwk', this.signingKey.publicKey) + )}` + ); const dpopToken = await dpopFn( signingKey, httpReq.url, @@ -413,7 +421,7 @@ export class OidcClient implements AuthProvider { accessToken ); if (this.wrapperPubKey) { - httpReq = withHeaders(httpReq, {"X-VirtruPubKey": this.wrapperPubKey}) + httpReq = withHeaders(httpReq, { 'X-VirtruPubKey': this.wrapperPubKey }); } // TODO: Consider: only set DPoP if cnf.jkt is present in access token? return withHeaders(httpReq, { Authorization: `Bearer ${accessToken}`, DPoP: dpopToken });