@aws/cloudfront-hosting-toolkit
Version:
CloudFront Hosting Toolkit offers the convenience of a managed frontend hosting service while retaining full control over the hosting and deployment infrastructure to make it your own.
6 lines (5 loc) • 430 B
JavaScript
import { chain, memoize, TokenProviderError } from "@smithy/property-provider";
import { fromSso } from "./fromSso";
export const nodeProvider = (init = {}) => memoize(chain(fromSso(init), async () => {
throw new TokenProviderError("Could not load token from any providers", false);
}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);