mirror of
https://github.com/docker/login-action.git
synced 2026-03-04 23:08:16 +00:00
151 lines
5.5 KiB
JavaScript
Generated
151 lines
5.5 KiB
JavaScript
Generated
export const id = 956;
|
|
export const ids = [956];
|
|
export const modules = {
|
|
|
|
/***/ 8079:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.fromTokenFile = void 0;
|
|
const client_1 = __webpack_require__(5152);
|
|
const property_provider_1 = __webpack_require__(8857);
|
|
const shared_ini_file_loader_1 = __webpack_require__(4964);
|
|
const node_fs_1 = __webpack_require__(3024);
|
|
const fromWebToken_1 = __webpack_require__(4453);
|
|
const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
|
|
const ENV_ROLE_ARN = "AWS_ROLE_ARN";
|
|
const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
|
|
const fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
|
|
init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
|
|
const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
|
|
const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
|
|
const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
|
|
if (!webIdentityTokenFile || !roleArn) {
|
|
throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified", {
|
|
logger: init.logger,
|
|
});
|
|
}
|
|
const credentials = await (0, fromWebToken_1.fromWebToken)({
|
|
...init,
|
|
webIdentityToken: shared_ini_file_loader_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ??
|
|
(0, node_fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }),
|
|
roleArn,
|
|
roleSessionName,
|
|
})(awsIdentityProperties);
|
|
if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
|
|
(0, client_1.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
|
|
}
|
|
return credentials;
|
|
};
|
|
exports.fromTokenFile = fromTokenFile;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 4453:
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
}));
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
}) : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = (this && this.__importStar) || (function () {
|
|
var ownKeys = function(o) {
|
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
var ar = [];
|
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
return ar;
|
|
};
|
|
return ownKeys(o);
|
|
};
|
|
return function (mod) {
|
|
if (mod && mod.__esModule) return mod;
|
|
var result = {};
|
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
})();
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
exports.fromWebToken = void 0;
|
|
const fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
|
|
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
|
|
let { roleAssumerWithWebIdentity } = init;
|
|
if (!roleAssumerWithWebIdentity) {
|
|
const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() => __importStar(__webpack_require__(1136)));
|
|
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
|
|
...init.clientConfig,
|
|
credentialProviderLogger: init.logger,
|
|
parentClientConfig: {
|
|
...awsIdentityProperties?.callerClientConfig,
|
|
...init.parentClientConfig,
|
|
},
|
|
}, init.clientPlugins);
|
|
}
|
|
return roleAssumerWithWebIdentity({
|
|
RoleArn: roleArn,
|
|
RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
|
|
WebIdentityToken: webIdentityToken,
|
|
ProviderId: providerId,
|
|
PolicyArns: policyArns,
|
|
Policy: policy,
|
|
DurationSeconds: durationSeconds,
|
|
});
|
|
};
|
|
exports.fromWebToken = fromWebToken;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9956:
|
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
|
|
|
|
|
|
var fromTokenFile = __webpack_require__(8079);
|
|
var fromWebToken = __webpack_require__(4453);
|
|
|
|
|
|
|
|
Object.prototype.hasOwnProperty.call(fromTokenFile, '__proto__') &&
|
|
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
Object.defineProperty(exports, '__proto__', {
|
|
enumerable: true,
|
|
value: fromTokenFile['__proto__']
|
|
});
|
|
|
|
Object.keys(fromTokenFile).forEach(function (k) {
|
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromTokenFile[k];
|
|
});
|
|
Object.prototype.hasOwnProperty.call(fromWebToken, '__proto__') &&
|
|
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
Object.defineProperty(exports, '__proto__', {
|
|
enumerable: true,
|
|
value: fromWebToken['__proto__']
|
|
});
|
|
|
|
Object.keys(fromWebToken).forEach(function (k) {
|
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromWebToken[k];
|
|
});
|
|
|
|
|
|
/***/ })
|
|
|
|
};
|
|
|
|
//# sourceMappingURL=956.index.js.map
|