@aws-sdk/credential-providers
Advanced tools
Comparing version 3.712.0 to 3.713.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createCredentialChain = void 0; | ||
exports.propertyProviderChain = exports.createCredentialChain = void 0; | ||
const property_provider_1 = require("@smithy/property-provider"); | ||
const createCredentialChain = (...credentialProviders) => { | ||
let expireAfter = -1; | ||
const baseFunction = async () => { | ||
const credentials = await (0, property_provider_1.chain)(...credentialProviders)(); | ||
const baseFunction = async (awsIdentityProperties) => { | ||
const credentials = await (0, exports.propertyProviderChain)(...credentialProviders)(awsIdentityProperties); | ||
if (!credentials.expiration && expireAfter !== -1) { | ||
@@ -26,1 +26,22 @@ credentials.expiration = new Date(Date.now() + expireAfter); | ||
exports.createCredentialChain = createCredentialChain; | ||
const propertyProviderChain = (...providers) => async (awsIdentityProperties) => { | ||
if (providers.length === 0) { | ||
throw new property_provider_1.ProviderError("No providers in chain"); | ||
} | ||
let lastProviderError; | ||
for (const provider of providers) { | ||
try { | ||
const credentials = await provider(awsIdentityProperties); | ||
return credentials; | ||
} | ||
catch (err) { | ||
lastProviderError = err; | ||
if (err?.tryNextLink) { | ||
continue; | ||
} | ||
throw err; | ||
} | ||
} | ||
throw lastProviderError; | ||
}; | ||
exports.propertyProviderChain = propertyProviderChain; |
@@ -1,6 +0,6 @@ | ||
import { chain as propertyProviderChain } from "@smithy/property-provider"; | ||
import { ProviderError } from "@smithy/property-provider"; | ||
export const createCredentialChain = (...credentialProviders) => { | ||
let expireAfter = -1; | ||
const baseFunction = async () => { | ||
const credentials = await propertyProviderChain(...credentialProviders)(); | ||
const baseFunction = async (awsIdentityProperties) => { | ||
const credentials = await propertyProviderChain(...credentialProviders)(awsIdentityProperties); | ||
if (!credentials.expiration && expireAfter !== -1) { | ||
@@ -22,1 +22,21 @@ credentials.expiration = new Date(Date.now() + expireAfter); | ||
}; | ||
export const propertyProviderChain = (...providers) => async (awsIdentityProperties) => { | ||
if (providers.length === 0) { | ||
throw new ProviderError("No providers in chain"); | ||
} | ||
let lastProviderError; | ||
for (const provider of providers) { | ||
try { | ||
const credentials = await provider(awsIdentityProperties); | ||
return credentials; | ||
} | ||
catch (err) { | ||
lastProviderError = err; | ||
if (err?.tryNextLink) { | ||
continue; | ||
} | ||
throw err; | ||
} | ||
} | ||
throw lastProviderError; | ||
}; |
@@ -0,1 +1,2 @@ | ||
import type { RuntimeConfigAwsCredentialIdentityProvider, RuntimeConfigIdentityProvider } from "@aws-sdk/types"; | ||
import type { AwsCredentialIdentityProvider } from "@smithy/types"; | ||
@@ -44,2 +45,6 @@ export interface CustomCredentialChainOptions { | ||
*/ | ||
export declare const createCredentialChain: (...credentialProviders: AwsCredentialIdentityProvider[]) => AwsCredentialIdentityProvider & CustomCredentialChainOptions; | ||
export declare const createCredentialChain: (...credentialProviders: RuntimeConfigAwsCredentialIdentityProvider[]) => RuntimeConfigAwsCredentialIdentityProvider & CustomCredentialChainOptions; | ||
/** | ||
* @internal | ||
*/ | ||
export declare const propertyProviderChain: <T>(...providers: RuntimeConfigIdentityProvider<T>[]) => RuntimeConfigIdentityProvider<T>; |
@@ -45,2 +45,2 @@ import type { CognitoIdentityClientConfig } from "@aws-sdk/client-cognito-identity"; | ||
*/ | ||
export declare const fromCognitoIdentity: (options: FromCognitoIdentityParameters) => _CognitoIdentityCredentialProvider; | ||
export declare const fromCognitoIdentity: (options: FromCognitoIdentityParameters) => CognitoIdentityCredentialProvider; |
import { FromIniInit } from "@aws-sdk/credential-provider-ini"; | ||
import { AwsCredentialIdentityProvider } from "@smithy/types"; | ||
import type { RuntimeConfigAwsCredentialIdentityProvider } from "@aws-sdk/types"; | ||
/** | ||
@@ -42,2 +42,2 @@ * Creates a credential provider function that reads from a shared credentials file at `~/.aws/credentials` and a | ||
*/ | ||
export declare const fromIni: (init?: FromIniInit) => AwsCredentialIdentityProvider; | ||
export declare const fromIni: (init?: FromIniInit) => RuntimeConfigAwsCredentialIdentityProvider; |
@@ -0,1 +1,5 @@ | ||
import { | ||
RuntimeConfigAwsCredentialIdentityProvider, | ||
RuntimeConfigIdentityProvider, | ||
} from "@aws-sdk/types"; | ||
import { AwsCredentialIdentityProvider } from "@smithy/types"; | ||
@@ -8,3 +12,6 @@ export interface CustomCredentialChainOptions { | ||
export declare const createCredentialChain: ( | ||
...credentialProviders: AwsCredentialIdentityProvider[] | ||
) => AwsCredentialIdentityProvider & CustomCredentialChainOptions; | ||
...credentialProviders: RuntimeConfigAwsCredentialIdentityProvider[] | ||
) => RuntimeConfigAwsCredentialIdentityProvider & CustomCredentialChainOptions; | ||
export declare const propertyProviderChain: <T>( | ||
...providers: RuntimeConfigIdentityProvider<T>[] | ||
) => RuntimeConfigIdentityProvider<T>; |
@@ -17,2 +17,2 @@ import { CognitoIdentityClientConfig } from "@aws-sdk/client-cognito-identity"; | ||
options: FromCognitoIdentityParameters | ||
) => _CognitoIdentityCredentialProvider; | ||
) => CognitoIdentityCredentialProvider; |
import { FromIniInit } from "@aws-sdk/credential-provider-ini"; | ||
import { AwsCredentialIdentityProvider } from "@smithy/types"; | ||
import { RuntimeConfigAwsCredentialIdentityProvider } from "@aws-sdk/types"; | ||
export declare const fromIni: ( | ||
init?: FromIniInit | ||
) => AwsCredentialIdentityProvider; | ||
) => RuntimeConfigAwsCredentialIdentityProvider; |
{ | ||
"name": "@aws-sdk/credential-providers", | ||
"version": "3.712.0", | ||
"version": "3.713.0", | ||
"description": "A collection of credential providers, without requiring service clients like STS, Cognito", | ||
@@ -33,15 +33,15 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@aws-sdk/client-cognito-identity": "3.712.0", | ||
"@aws-sdk/client-sso": "3.712.0", | ||
"@aws-sdk/client-sts": "3.712.0", | ||
"@aws-sdk/core": "3.709.0", | ||
"@aws-sdk/credential-provider-cognito-identity": "3.712.0", | ||
"@aws-sdk/credential-provider-env": "3.709.0", | ||
"@aws-sdk/credential-provider-http": "3.709.0", | ||
"@aws-sdk/credential-provider-ini": "3.712.0", | ||
"@aws-sdk/credential-provider-node": "3.712.0", | ||
"@aws-sdk/credential-provider-process": "3.709.0", | ||
"@aws-sdk/credential-provider-sso": "3.712.0", | ||
"@aws-sdk/credential-provider-web-identity": "3.709.0", | ||
"@aws-sdk/types": "3.709.0", | ||
"@aws-sdk/client-cognito-identity": "3.713.0", | ||
"@aws-sdk/client-sso": "3.713.0", | ||
"@aws-sdk/client-sts": "3.713.0", | ||
"@aws-sdk/core": "3.713.0", | ||
"@aws-sdk/credential-provider-cognito-identity": "3.713.0", | ||
"@aws-sdk/credential-provider-env": "3.713.0", | ||
"@aws-sdk/credential-provider-http": "3.713.0", | ||
"@aws-sdk/credential-provider-ini": "3.713.0", | ||
"@aws-sdk/credential-provider-node": "3.713.0", | ||
"@aws-sdk/credential-provider-process": "3.713.0", | ||
"@aws-sdk/credential-provider-sso": "3.713.0", | ||
"@aws-sdk/credential-provider-web-identity": "3.713.0", | ||
"@aws-sdk/types": "3.713.0", | ||
"@smithy/credential-provider-imds": "^3.2.8", | ||
@@ -48,0 +48,0 @@ "@smithy/property-provider": "^3.1.11", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99104
1033
5
16
105
+ Added@aws-sdk/client-cognito-identity@3.713.0(transitive)
+ Added@aws-sdk/client-sso@3.713.0(transitive)
+ Added@aws-sdk/client-sso-oidc@3.713.0(transitive)
+ Added@aws-sdk/client-sts@3.713.0(transitive)
+ Added@aws-sdk/core@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-cognito-identity@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-env@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-http@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-ini@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-node@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-process@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-sso@3.713.0(transitive)
+ Added@aws-sdk/credential-provider-web-identity@3.713.0(transitive)
+ Added@aws-sdk/middleware-host-header@3.713.0(transitive)
+ Added@aws-sdk/middleware-logger@3.713.0(transitive)
+ Added@aws-sdk/middleware-recursion-detection@3.713.0(transitive)
+ Added@aws-sdk/middleware-user-agent@3.713.0(transitive)
+ Added@aws-sdk/region-config-resolver@3.713.0(transitive)
+ Added@aws-sdk/token-providers@3.713.0(transitive)
+ Added@aws-sdk/types@3.713.0(transitive)
+ Added@aws-sdk/util-endpoints@3.713.0(transitive)
+ Added@aws-sdk/util-user-agent-browser@3.713.0(transitive)
+ Added@aws-sdk/util-user-agent-node@3.713.0(transitive)
- Removed@aws-sdk/client-cognito-identity@3.712.0(transitive)
- Removed@aws-sdk/client-sso@3.712.0(transitive)
- Removed@aws-sdk/client-sso-oidc@3.712.0(transitive)
- Removed@aws-sdk/client-sts@3.712.0(transitive)
- Removed@aws-sdk/core@3.709.0(transitive)
- Removed@aws-sdk/credential-provider-cognito-identity@3.712.0(transitive)
- Removed@aws-sdk/credential-provider-env@3.709.0(transitive)
- Removed@aws-sdk/credential-provider-http@3.709.0(transitive)
- Removed@aws-sdk/credential-provider-ini@3.712.0(transitive)
- Removed@aws-sdk/credential-provider-node@3.712.0(transitive)
- Removed@aws-sdk/credential-provider-process@3.709.0(transitive)
- Removed@aws-sdk/credential-provider-sso@3.712.0(transitive)
- Removed@aws-sdk/credential-provider-web-identity@3.709.0(transitive)
- Removed@aws-sdk/middleware-host-header@3.709.0(transitive)
- Removed@aws-sdk/middleware-logger@3.709.0(transitive)
- Removed@aws-sdk/middleware-recursion-detection@3.709.0(transitive)
- Removed@aws-sdk/middleware-user-agent@3.709.0(transitive)
- Removed@aws-sdk/region-config-resolver@3.709.0(transitive)
- Removed@aws-sdk/token-providers@3.709.0(transitive)
- Removed@aws-sdk/types@3.709.0(transitive)
- Removed@aws-sdk/util-endpoints@3.709.0(transitive)
- Removed@aws-sdk/util-user-agent-browser@3.709.0(transitive)
- Removed@aws-sdk/util-user-agent-node@3.712.0(transitive)
Updated@aws-sdk/client-sso@3.713.0
Updated@aws-sdk/client-sts@3.713.0
Updated@aws-sdk/core@3.713.0
Updated@aws-sdk/credential-provider-cognito-identity@3.713.0
Updated@aws-sdk/types@3.713.0