How to use the @aws-sdk/property-provider.memoize function in @aws-sdk/property-provider

To help you get started, we’ve selected a few @aws-sdk/property-provider examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-sdk-js-v3 / packages / region-provider / src / defaultProvider.ts View on Github external
export function defaultProvider(
  configuration: RegionProviderConfiguration = {}
): Provider {
  return memoize(
    chain(fromEnv(configuration), fromSharedConfigFiles(configuration))
  );
}
github aws / aws-sdk-js-v3 / packages / credential-provider-node / src / index.ts View on Github external
export function defaultProvider(
  init: FromIniInit & RemoteProviderInit & FromProcessInit = {}
): CredentialProvider {
  const { profile = process.env[ENV_PROFILE] } = init;
  const providerChain = profile
    ? fromIni(init)
    : chain(fromEnv(), fromIni(init), fromProcess(init), remoteProvider(init));

  return memoize(
    providerChain,
    credentials =>
      credentials.expiration !== undefined &&
      credentials.expiration - getEpochTs() < 300,
    credentials => credentials.expiration !== undefined
  );
}

@aws-sdk/property-provider

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/property-provider/latest.svg)](https://www.npmjs.com/package/@aws-sdk/property-provider) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/property-provider.svg)](https://www.npmjs.com/package/@

Apache-2.0
Latest version published 1 year ago

Package Health Score

72 / 100
Full package analysis

Similar packages