How to use @aws-sdk/credential-provider-ini - 4 common examples

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
  );
}
github aws / aws-sdk-js-v3 / packages / credential-provider-process / src / index.ts View on Github external
parseKnownFiles(init).then(profiles =>
      resolveProcessCredentials(getMasterProfileName(init), profiles, init)
    );
github aws / aws-sdk-js-v3 / packages / credential-provider-process / src / index.ts View on Github external
return () =>
    parseKnownFiles(init).then(profiles =>
      resolveProcessCredentials(getMasterProfileName(init), profiles, init)
    );
}

@aws-sdk/credential-provider-ini

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

Apache-2.0
Latest version published 3 days ago

Package Health Score

100 / 100
Full package analysis