UNPKG

@fntio/infra-client

Version:

Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.

14 lines (13 loc) • 616 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolvePersonalAccessTokens = resolvePersonalAccessTokens; /** A bad lifetime must fail synth — the API would silently fall back to the default. */ function resolvePersonalAccessTokens(cfg) { if (!cfg) return undefined; const max = cfg.maxLifetimeDays ?? 90; if (!Number.isInteger(max) || max < 1 || max > 365) { throw new Error(`personalAccessTokens.maxLifetimeDays must be an integer from 1 to 365 (got ${String(max)}).`); } return { enabled: cfg.enabled === true, maxLifetimeDays: max }; }