Skip to content

Commit 60f8955

Browse files
committed
chore(release): 1.1.2
1 parent acceaa3 commit 60f8955

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+700
-132
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.2](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.1...v1.1.2) (2024-03-25)
6+
57
### [1.1.1](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.1.0...v1.1.1) (2024-03-16)
68

79
## [1.1.0](https://github.com/boilingdata/boilingdata-bdcli/compare/v1.0.39...v1.1.0) (2024-03-16)

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.1";
1+
export declare const VERSION = "1.1.2";

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.1";
4+
exports.VERSION = "1.1.2";

dist/cjs/bdcli/commands/account/bdcli-account-tap-token.d.ts renamed to dist/cjs/bdcli/commands/account/bdcli-account-tap-client-token.d.ts

File renamed without changes.

dist/cjs/bdcli/commands/account/bdcli-account-tap-token.js renamed to dist/cjs/bdcli/commands/account/bdcli-account-tap-client-token.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const auth_util_js_1 = require("../../utils/auth_util.js");
3131
const account_js_1 = require("../../../integration/boilingdata/account.js");
3232
const config_util_js_1 = require("../../utils/config_util.js");
3333
const output_util_js_1 = require("../../utils/output_util.js");
34-
const logger = (0, logger_util_js_1.getLogger)("bdcli-account-token");
34+
const logger = (0, logger_util_js_1.getLogger)("bdcli-account-tap-client-token");
3535
async function show(options, _command) {
3636
try {
3737
options = await (0, config_util_js_1.combineOptsWithSettings)(options, logger);
@@ -42,21 +42,21 @@ async function show(options, _command) {
4242
const { idToken: token, cached: idCached, region } = await (0, auth_util_js_1.getIdToken)(logger);
4343
(0, spinner_util_js_1.updateSpinnerText)(`Authenticating: ${idCached ? "cached" : "success"}`);
4444
(0, spinner_util_js_1.spinnerSuccess)();
45-
(0, spinner_util_js_1.updateSpinnerText)(`Getting BoilingData TAP token`);
45+
(0, spinner_util_js_1.updateSpinnerText)(`Getting BoilingData Client TAP token`);
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 });
4949
const { bdTapToken, cached: tapCached, ...rest } = await bdAccount.getTapToken(options.lifetime ?? "24h", options.sharingUser);
50-
(0, spinner_util_js_1.updateSpinnerText)(`Getting BoilingData TAP token: ${tapCached ? "cached" : "success"}`);
50+
(0, spinner_util_js_1.updateSpinnerText)(`Getting BoilingData Client TAP token: ${tapCached ? "cached" : "success"}`);
5151
(0, spinner_util_js_1.spinnerSuccess)();
5252
await (0, output_util_js_1.outputResults)({ bdTapToken, cached: tapCached, ...rest }, options.disableSpinner);
5353
}
5454
catch (err) {
5555
(0, spinner_util_js_1.spinnerError)(err?.message);
5656
}
5757
}
58-
const program = new cmd.Command("bdcli account tap-token")
59-
.addOption(new cmd.Option("--lifetime <lifetime>", "Expiration lifetime for the token, in string format, like '1h' (see https://github.com/vercel/ms)"))
58+
const program = new cmd.Command("bdcli account tap-client-token")
59+
.addOption(new cmd.Option("--lifetime <lifetime>", "Expiration lifetime for the token, in string format, like '24h' (see https://github.com/vercel/ms)"))
6060
.addOption(new cmd.Option("--sharing-user <emailOfTapSharingUser>", "A user has shared Tap for you so that you can write to it."))
6161
.action(async (options, command) => await show(options, command));
6262
(async () => {

dist/cjs/bdcli/commands/aws/bdcli-aws-iam.d.ts renamed to dist/cjs/bdcli/commands/account/bdcli-account-tap-master-secret.d.ts

File renamed without changes.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"use strict";
2+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3+
if (k2 === undefined) k2 = k;
4+
var desc = Object.getOwnPropertyDescriptor(m, k);
5+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6+
desc = { enumerable: true, get: function() { return m[k]; } };
7+
}
8+
Object.defineProperty(o, k2, desc);
9+
}) : (function(o, m, k, k2) {
10+
if (k2 === undefined) k2 = k;
11+
o[k2] = m[k];
12+
}));
13+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14+
Object.defineProperty(o, "default", { enumerable: true, value: v });
15+
}) : function(o, v) {
16+
o["default"] = v;
17+
});
18+
var __importStar = (this && this.__importStar) || function (mod) {
19+
if (mod && mod.__esModule) return mod;
20+
var result = {};
21+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22+
__setModuleDefault(result, mod);
23+
return result;
24+
};
25+
Object.defineProperty(exports, "__esModule", { value: true });
26+
const cmd = __importStar(require("commander"));
27+
const logger_util_js_1 = require("../../utils/logger_util.js");
28+
const spinner_util_js_1 = require("../../utils/spinner_util.js");
29+
const options_util_js_1 = require("../../utils/options_util.js");
30+
const auth_util_js_1 = require("../../utils/auth_util.js");
31+
const account_js_1 = require("../../../integration/boilingdata/account.js");
32+
const config_util_js_1 = require("../../utils/config_util.js");
33+
const output_util_js_1 = require("../../utils/output_util.js");
34+
const logger = (0, logger_util_js_1.getLogger)("bdcli-account-tap-master-secret");
35+
async function show(options, _command) {
36+
try {
37+
options = await (0, config_util_js_1.combineOptsWithSettings)(options, logger);
38+
if (options.lifetime)
39+
await (0, auth_util_js_1.validateTokenLifetime)(options.lifetime);
40+
if (!(0, auth_util_js_1.authSpinnerWithConfigCheck)())
41+
return;
42+
const { idToken: token, cached: idCached, region } = await (0, auth_util_js_1.getIdToken)(logger);
43+
(0, spinner_util_js_1.updateSpinnerText)(`Authenticating: ${idCached ? "cached" : "success"}`);
44+
(0, spinner_util_js_1.spinnerSuccess)();
45+
(0, spinner_util_js_1.updateSpinnerText)(`Getting BoilingData Master TAP secret`);
46+
if (!region)
47+
throw new Error("Pass --region parameter or set AWS_REGION env");
48+
const bdAccount = new account_js_1.BDAccount({ logger, authToken: token });
49+
const { bdTapMasterSecret, cached: tapCached, ...rest } = await bdAccount.getTapMasterSecret();
50+
(0, spinner_util_js_1.updateSpinnerText)(`Getting BoilingData Master TAP secret: ${tapCached ? "cached" : "success"}`);
51+
(0, spinner_util_js_1.spinnerSuccess)();
52+
await (0, output_util_js_1.outputResults)({ bdTapMasterSecret, cached: tapCached, ...rest }, options.disableSpinner);
53+
}
54+
catch (err) {
55+
(0, spinner_util_js_1.spinnerError)(err?.message);
56+
}
57+
}
58+
const program = new cmd.Command("bdcli account tap-master-secret")
59+
.addOption(new cmd.Option("--sharing-user <emailOfTapSharingUser>", "A user has shared Tap for you so that you can write to it."))
60+
.action(async (options, command) => await show(options, command));
61+
(async () => {
62+
await (0, options_util_js_1.addGlobalOptions)(program, logger);
63+
await program.parseAsync(process.argv);
64+
})();
File renamed without changes.

dist/cjs/bdcli/commands/aws/bdcli-aws-iam.js renamed to dist/cjs/bdcli/commands/aws/bdcli-aws-s3-iam.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ const logger_util_js_1 = require("../../utils/logger_util.js");
3030
const spinner_util_js_1 = require("../../utils/spinner_util.js");
3131
const options_util_js_1 = require("../../utils/options_util.js");
3232
const auth_util_js_1 = require("../../utils/auth_util.js");
33-
const iam_roles_js_1 = require("../../../integration/aws/iam_roles.js");
33+
const iam_role_js_1 = require("../../../integration/aws/iam_role.js");
3434
const account_js_1 = require("../../../integration/boilingdata/account.js");
3535
const dataset_js_1 = require("../../../integration/boilingdata/dataset.js");
3636
const bdIntegration_js_1 = require("../../../integration/bdIntegration.js");
3737
const config_util_js_1 = require("../../utils/config_util.js");
38-
const logger = (0, logger_util_js_1.getLogger)("bdcli-aws");
38+
const logger = (0, logger_util_js_1.getLogger)("bdcli-aws-iam");
3939
logger.setLogLevel(logger_util_js_1.ELogLevel.WARN);
4040
async function iamrole(options, _command) {
4141
try {
@@ -49,30 +49,32 @@ async function iamrole(options, _command) {
4949
const { idToken: token, cached, region } = await (0, auth_util_js_1.getIdToken)(logger);
5050
(0, spinner_util_js_1.updateSpinnerText)(cached ? "Authenticating: cached" : "Authenticating: success");
5151
(0, spinner_util_js_1.spinnerSuccess)();
52-
(0, spinner_util_js_1.updateSpinnerText)("Creating IAM Role");
52+
(0, spinner_util_js_1.updateSpinnerText)("Creating S3 IAM Role");
5353
if (!region)
5454
throw new Error("Pass --region parameter or set AWS_REGION env");
5555
const bdAccount = new account_js_1.BDAccount({ logger, authToken: token });
5656
const bdDataSources = new dataset_js_1.BDDataSourceConfig({ logger });
5757
await bdDataSources.readConfig(options.config);
58-
const bdRole = new iam_roles_js_1.BDIamRole({
58+
const stsClient = new sts.STSClient({ region });
59+
const bdRole = new iam_role_js_1.BDIamRole({
5960
...options,
6061
logger,
62+
roleType: iam_role_js_1.ERoleType.S3,
6163
iamClient: new iam.IAMClient({ region }),
62-
stsClient: new sts.STSClient({ region }),
64+
stsClient,
6365
username: await bdAccount.getUsername(),
6466
assumeAwsAccount: await bdAccount.getAssumeAwsAccount(),
6567
assumeCondExternalId: await bdAccount.getExtId(),
6668
});
67-
const bdIntegration = new bdIntegration_js_1.BDIntegration({ logger, bdAccount, bdRole, bdDataSources });
68-
const policyDocument = await bdIntegration.getPolicyDocument();
69+
const bdIntegration = new bdIntegration_js_1.BDIntegration({ logger, bdAccount, bdRole, bdDataSources, stsClient });
70+
const policyDocument = await bdIntegration.getS3PolicyDocument();
6971
const iamRoleArn = await bdRole.upsertRole(JSON.stringify(policyDocument));
70-
(0, spinner_util_js_1.updateSpinnerText)(`Creating IAM Role: ${iamRoleArn}`);
72+
(0, spinner_util_js_1.updateSpinnerText)(`Creating S3 IAM Role: ${iamRoleArn}`);
7173
(0, spinner_util_js_1.spinnerSuccess)();
7274
if (!options.createRoleOnly) {
73-
(0, spinner_util_js_1.updateSpinnerText)(`Registering IAM Role: ${iamRoleArn}`);
75+
(0, spinner_util_js_1.updateSpinnerText)(`Registering S3 IAM Role: ${iamRoleArn}`);
7476
const datasourcesConfig = bdDataSources.getDatasourcesConfig();
75-
await bdAccount.setIamRoleWithPayload(iamRoleArn, { datasourcesConfig });
77+
await bdAccount.setS3IamRoleWithPayload(iamRoleArn, { datasourcesConfig });
7678
(0, spinner_util_js_1.spinnerSuccess)();
7779
}
7880
}

dist/esm/bdcli/commands/account/bdcli-account-tap-token.d.ts renamed to dist/cjs/bdcli/commands/aws/bdcli-aws-taps-iam.d.ts

File renamed without changes.

0 commit comments

Comments
 (0)