@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
15 lines (14 loc) • 599 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ROLE_SESSION_NAME_POLICIES = void 0;
exports.resolveRoleSessionName = resolveRoleSessionName;
exports.ROLE_SESSION_NAME_POLICIES = ["userId", "email"];
/** A bad value must fail synth — the API would silently fall back to the sub. */
function resolveRoleSessionName(cfg) {
if (cfg === undefined)
return "userId";
if (!exports.ROLE_SESSION_NAME_POLICIES.includes(cfg)) {
throw new Error(`roleSessionName must be "userId" or "email" (got ${JSON.stringify(cfg)}).`);
}
return cfg;
}