You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
615 B
JavaScript
17 lines
615 B
JavaScript
11 months ago
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.loadGCPCredentials = void 0;
|
||
|
const deps_1 = require("../../deps");
|
||
|
/** @internal */
|
||
|
async function loadGCPCredentials(kmsProviders) {
|
||
|
const gcpMetadata = (0, deps_1.getGcpMetadata)();
|
||
|
if ('kModuleError' in gcpMetadata) {
|
||
|
return kmsProviders;
|
||
|
}
|
||
|
const { access_token: accessToken } = await gcpMetadata.instance({
|
||
|
property: 'service-accounts/default/token'
|
||
|
});
|
||
|
return { ...kmsProviders, gcp: { accessToken } };
|
||
|
}
|
||
|
exports.loadGCPCredentials = loadGCPCredentials;
|
||
|
//# sourceMappingURL=gcp.js.map
|