How to use the @aws-sdk/credential-provider-ini.fromIni function in @aws-sdk/credential-provider-ini

To help you get started, we’ve selected a few @aws-sdk/credential-provider-ini 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 / 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
  );
}
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/credential-provider-ini

AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config

Apache-2.0
Latest version published 5 days ago

Package Health Score

100 / 100
Full package analysis