Skip to content

Commit b440281

Browse files
committed
chore(release): 1.1.4
1 parent 5d023c4 commit b440281

File tree

14 files changed

+45
-23
lines changed

14 files changed

+45
-23
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [1.1.4](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.3...v1.1.4) (2024-05-09)
6+
57
### [1.1.3](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.2...v1.1.3) (2024-04-05)
68

79
### [1.1.2](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.1...v1.1.2) (2024-03-25)

dist/cjs/VERSION.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare const VERSION = "1.1.3";
1+
export declare const VERSION = "1.1.4";

dist/cjs/VERSION.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.VERSION = void 0;
4-
exports.VERSION = "1.1.3";
4+
exports.VERSION = "1.1.4";

dist/cjs/bdcli/commands/account/bdcli-account-tap-master-secret.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function show(options, _command) {
4646
if (!region)
4747
throw new Error("Pass --region parameter or set AWS_REGION env");
4848
const bdAccount = new account_js_1.BDAccount({ logger, authToken: token });
49-
const { bdTapMasterSecret, cached: tapCached, ...rest } = await bdAccount.getTapMasterSecret();
49+
const { bdTapMasterSecret, cached: tapCached, ...rest } = await bdAccount.getTapMasterSecret(options?.application);
5050
(0, spinner_util_js_1.updateSpinnerText)(`Getting BoilingData Master TAP secret: ${tapCached ? "cached" : "success"}`);
5151
(0, spinner_util_js_1.spinnerSuccess)();
5252
await (0, output_util_js_1.outputResults)({ bdTapMasterSecret, cached: tapCached, ...rest }, options.disableSpinner);
@@ -57,6 +57,7 @@ async function show(options, _command) {
5757
}
5858
const program = new cmd.Command("bdcli account tap-master-secret")
5959
.addOption(new cmd.Option("--sharing-user <emailOfTapSharingUser>", "A user has shared Tap for you so that you can write to it."))
60+
.addOption(new cmd.Option("--application <application>", "Data Taps supported application name, like 'github'"))
6061
.action(async (options, command) => await show(options, command));
6162
(async () => {
6263
await (0, options_util_js_1.addGlobalOptions)(program, logger);

dist/cjs/bdcli/utils/auth_util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ exports.authSpinnerWithConfigCheck = authSpinnerWithConfigCheck;
4949
async function validateTokenLifetime(lifetime, logger) {
5050
const lifetimeInMs = (0, ms_1.default)(`${lifetime}`);
5151
logger?.debug({ lifetimeInMs });
52-
if (!lifetimeInMs || lifetimeInMs < (0, ms_1.default)("10min") || lifetimeInMs > (0, ms_1.default)("24h")) {
52+
if (!lifetimeInMs || lifetimeInMs < (0, ms_1.default)("10min")) {
5353
throw new Error("Invalid token expiration time span, " +
5454
"please see https://github.com/vercel/ms for the format of the period. " +
55-
"Lifetime must be between 10min - 24h");
55+
"Lifetime must be at min. 10min. Free tier max is 24h.");
5656
}
5757
}
5858
exports.validateTokenLifetime = validateTokenLifetime;

dist/cjs/integration/boilingdata/account.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export declare class BDAccount {
1818
private bdStsToken;
1919
private bdTapToken;
2020
private bdTapMasterSecret;
21+
private bdTapMasterSecretApplication;
2122
private sharedTokens;
2223
private selectedToken;
2324
private decodedToken;
@@ -49,9 +50,10 @@ export declare class BDAccount {
4950
bdTapToken: string;
5051
cached: boolean;
5152
}>;
52-
getTapMasterSecret(): Promise<{
53+
getTapMasterSecret(application?: string): Promise<{
5354
bdTapMasterSecret: string;
5455
cached: boolean;
56+
application: string;
5557
}>;
5658
getStsToken(tokenLifetime: string, shareId?: string): Promise<{
5759
bdStsToken: string;

dist/cjs/integration/boilingdata/account.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class BDAccount {
3434
bdStsToken;
3535
bdTapToken;
3636
bdTapMasterSecret;
37+
bdTapMasterSecretApplication;
3738
sharedTokens;
3839
selectedToken;
3940
decodedToken;
@@ -304,12 +305,13 @@ class BDAccount {
304305
return resp;
305306
throw new Error(`Failed to get fresh TAP token from BD API`);
306307
}
307-
async getTapMasterSecret() {
308-
if (this.bdTapMasterSecret)
309-
return { bdTapMasterSecret: this.bdTapMasterSecret, cached: true };
308+
async getTapMasterSecret(application = "default") {
309+
if (this.bdTapMasterSecret && this.bdTapMasterSecretApplication === application) {
310+
return { bdTapMasterSecret: this.bdTapMasterSecret, cached: true, application };
311+
}
310312
const headers = await (0, boilingdata_api_js_1.getReqHeaders)(this.cognitoIdToken); // , { tokenLifetime, vendingSchedule, shareId });
311313
const method = "POST";
312-
const body = JSON.stringify({});
314+
const body = JSON.stringify({ application });
313315
this.logger.debug({ method, tapMasterSecretUrl: boilingdata_api_js_1.tapMasterSecretUrl, headers, body });
314316
const res = await fetch(boilingdata_api_js_1.tapMasterSecretUrl, { method, headers, body });
315317
const resBody = await res.json();
@@ -325,7 +327,12 @@ class BDAccount {
325327
throw new Error("Missing bdTapMasterSecret in BD API Response");
326328
}
327329
this.bdTapMasterSecret = resBody.bdTapMasterSecret;
328-
return { bdTapMasterSecret: resBody.bdTapMasterSecret, cached: false };
330+
this.bdTapMasterSecretApplication = resBody?.application ?? "default";
331+
return {
332+
bdTapMasterSecret: resBody.bdTapMasterSecret,
333+
cached: false,
334+
application: resBody?.application ?? "default",
335+
};
329336
}
330337
async getStsToken(tokenLifetime, shareId) {
331338
if (this.bdStsToken && !shareId) {

dist/esm/VERSION.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare const VERSION = "1.1.3";
1+
export declare const VERSION = "1.1.4";

dist/esm/VERSION.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = "1.1.3";
1+
export const VERSION = "1.1.4";

dist/esm/bdcli/commands/account/bdcli-account-tap-master-secret.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function show(options, _command) {
2121
if (!region)
2222
throw new Error("Pass --region parameter or set AWS_REGION env");
2323
const bdAccount = new BDAccount({ logger, authToken: token });
24-
const { bdTapMasterSecret, cached: tapCached, ...rest } = await bdAccount.getTapMasterSecret();
24+
const { bdTapMasterSecret, cached: tapCached, ...rest } = await bdAccount.getTapMasterSecret(options?.application);
2525
updateSpinnerText(`Getting BoilingData Master TAP secret: ${tapCached ? "cached" : "success"}`);
2626
spinnerSuccess();
2727
await outputResults({ bdTapMasterSecret, cached: tapCached, ...rest }, options.disableSpinner);
@@ -32,6 +32,7 @@ async function show(options, _command) {
3232
}
3333
const program = new cmd.Command("bdcli account tap-master-secret")
3434
.addOption(new cmd.Option("--sharing-user <emailOfTapSharingUser>", "A user has shared Tap for you so that you can write to it."))
35+
.addOption(new cmd.Option("--application <application>", "Data Taps supported application name, like 'github'"))
3536
.action(async (options, command) => await show(options, command));
3637
(async () => {
3738
await addGlobalOptions(program, logger);

0 commit comments

Comments
 (0)