Skip to content

Commit

Permalink
🤖 🎨 Autoformat
Browse files Browse the repository at this point in the history
  • Loading branch information
dmihalcik-virtru authored and github-actions[bot] committed Apr 23, 2024
1 parent d893c38 commit e058d31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 1 addition & 5 deletions web-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 11 additions & 3 deletions web-app/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand All @@ -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 });
Expand Down

0 comments on commit e058d31

Please sign in to comment.