Skip to content

Commit 01b6a20

Browse files
feat: remove local apiconnect module to use publish one (#331)
- Add apiconnect utils and worker - Remove local apiconnect - Update the function to pass additional header
2 parents 9b8bb24 + d2c7462 commit 01b6a20

File tree

9 files changed

+47
-351
lines changed

9 files changed

+47
-351
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
"typescript-eslint": "^8.15.0"
8181
},
8282
"dependencies": {
83+
"@dashlane/apiconnect-utils": "^3.1.9",
84+
"@dashlane/apiconnect-worker": "^3.1.9",
8385
"@dashlane/nsm-attestation": "^1.0.2",
8486
"@inquirer/prompts": "^7.1.0",
8587
"@json2csv/plainjs": "^7.0.6",

src/modules/api-connect/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/modules/api-connect/makeCanonicalRequest.ts

Lines changed: 0 additions & 114 deletions
This file was deleted.

src/modules/api-connect/postRequestAPI.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/modules/api-connect/signRequest.ts

Lines changed: 0 additions & 97 deletions
This file was deleted.

src/modules/api-connect/types.ts

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/requestApi.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Response, HTTPError } from 'got';
2-
import { Authentication, postRequestAPI } from './modules/api-connect/index.js';
2+
import { Authentication, postRequestAPI } from '@dashlane/apiconnect-worker';
33
import { CLI_VERSION, cliVersionToString } from './cliVersion.js';
44
import { gotImplementation } from './utils/index.js';
55
import { logger } from './logger.js';
@@ -34,14 +34,6 @@ const dashlaneApiKeys = {
3434
appSecretKey: 'boUtXxmDgLUtNFaigCMQ3+u+LAx0tg1ePAUE13nkR7dto+Zwq1naOHZTwbxxM7iL',
3535
};
3636

37-
const makeStagingCloudflareHeaders = () =>
38-
process.env.CLOUDFLARE_SERVICE_TOKEN_ACCESS
39-
? {
40-
'CF-Access-Client-Id': process.env.CLOUDFLARE_SERVICE_TOKEN_ACCESS ?? '',
41-
'CF-Access-Client-Secret': process.env.CLOUDFLARE_SERVICE_TOKEN_SECRET ?? '',
42-
}
43-
: undefined;
44-
4537
const requestApi = async <T>(params: RequestApi): Promise<T> => {
4638
const { payload, path, authentication, isNitroEncryptionService } = params;
4739

@@ -53,7 +45,6 @@ const requestApi = async <T>(params: RequestApi): Promise<T> => {
5345
path: (isNitroEncryptionService ? 'v1-nitro-encryption-service/' : 'v1/') + path,
5446
payload,
5547
userAgent: `Dashlane CLI v${cliVersionToString(CLI_VERSION)}`,
56-
customHeaders: makeStagingCloudflareHeaders(),
5748
customHost: process.env.DCLI_STAGING_HOST,
5849
});
5950
} catch (error: unknown) {

0 commit comments

Comments
 (0)