Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/credential-providers

Package Overview
Dependencies
Maintainers
5
Versions
352
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/credential-providers - npm Package Compare versions

Comparing version 3.712.0 to 3.713.0

27

dist-cjs/createCredentialChain.js
"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>;

2

dist-types/fromCognitoIdentity.d.ts

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc