@lightdash/cli 0.1973.2 → 0.1974.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,18 +77,27 @@ const convertBigquerySchema = async (target) => {
|
|
77
77
|
}
|
78
78
|
if (target.project === undefined && target.method !== 'oauth')
|
79
79
|
throw new common_1.ParseError(`BigQuery project is required for ${target.method} authentication method`);
|
80
|
-
|
80
|
+
const result = {
|
81
81
|
type: common_1.WarehouseTypes.BIGQUERY,
|
82
82
|
project: target.project || '',
|
83
83
|
dataset: target.dataset || target.schema,
|
84
84
|
timeoutSeconds: target.timeout_seconds,
|
85
85
|
priority: target.priority,
|
86
|
-
keyfileContents:
|
86
|
+
keyfileContents: {},
|
87
87
|
retries: target.retries,
|
88
88
|
maximumBytesBilled: target.maximum_bytes_billed,
|
89
89
|
location: target.location,
|
90
90
|
executionProject: target.execution_project,
|
91
91
|
};
|
92
|
+
const oauthOrKeyResult = await getBigqueryCredentials(target);
|
93
|
+
if (oauthOrKeyResult.authenticationType ===
|
94
|
+
common_1.BigqueryAuthenticationType.ADC) {
|
95
|
+
result.authenticationType = common_1.BigqueryAuthenticationType.ADC;
|
96
|
+
}
|
97
|
+
else {
|
98
|
+
result.keyfileContents = oauthOrKeyResult;
|
99
|
+
}
|
100
|
+
return result;
|
92
101
|
}
|
93
102
|
const errs = (0, better_ajv_errors_1.default)(exports.bigqueryTargetJsonSchema, target, validate.errors || []);
|
94
103
|
throw new common_1.ParseError(`Couldn't read profiles.yml file for ${target.type}:\n${errs}`);
|
@@ -20,6 +20,13 @@ const getBigqueryCredentialsFromOauth = async () => {
|
|
20
20
|
}
|
21
21
|
throw new common_1.ParseError(`Cannot get credentials from UserRefreshClient`);
|
22
22
|
}
|
23
|
+
else if (credentials.credential instanceof google_auth_library_1.ExternalAccountClient) {
|
24
|
+
// Support ADC via workforce identity federation / external_account configuration.
|
25
|
+
// In this case we should rely on ADC at runtime and not pass explicit credentials.
|
26
|
+
return {
|
27
|
+
authenticationType: common_1.BigqueryAuthenticationType.ADC,
|
28
|
+
};
|
29
|
+
}
|
23
30
|
else if ('email' in credentials.credential &&
|
24
31
|
'key' in credentials.credential) {
|
25
32
|
// Works with service credentials
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lightdash/cli",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.1974.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"bin": {
|
6
6
|
"lightdash": "dist/index.js"
|
@@ -32,8 +32,8 @@
|
|
32
32
|
"parse-node-version": "^2.0.0",
|
33
33
|
"unique-names-generator": "^4.7.1",
|
34
34
|
"uuid": "^11.0.3",
|
35
|
-
"@lightdash/
|
36
|
-
"@lightdash/
|
35
|
+
"@lightdash/warehouses": "0.1974.0",
|
36
|
+
"@lightdash/common": "0.1974.0"
|
37
37
|
},
|
38
38
|
"description": "Lightdash CLI tool",
|
39
39
|
"devDependencies": {
|