@aws-sdk/credential-provider-http
Advanced tools
Comparing version 3.422.0 to 3.422.1
@@ -0,1 +1,7 @@ | ||
/** | ||
* @internal | ||
* | ||
* @param url - to be validated. | ||
* @throws if not acceptable to this provider. | ||
*/ | ||
export declare const checkUrl: (url: URL) => void; |
import { AwsCredentialIdentityProvider } from "@smithy/types"; | ||
import { FromHttpOptions } from "./fromHttpTypes"; | ||
export declare const fromHttp: ( | ||
options: FromHttpOptions | ||
) => AwsCredentialIdentityProvider; | ||
/** | ||
* Creates a provider that gets credentials via HTTP request. | ||
*/ | ||
export declare const fromHttp: (options: FromHttpOptions) => AwsCredentialIdentityProvider; |
import { AwsCredentialIdentityProvider } from "@smithy/types"; | ||
import { FromHttpOptions } from "./fromHttpTypes"; | ||
export declare const fromHttp: ( | ||
options: FromHttpOptions | ||
) => AwsCredentialIdentityProvider; | ||
/** | ||
* Creates a provider that gets credentials via HTTP request. | ||
*/ | ||
export declare const fromHttp: (options: FromHttpOptions) => AwsCredentialIdentityProvider; |
@@ -0,17 +1,68 @@ | ||
/** | ||
* @public | ||
* | ||
* Input for the fromHttp function in the HTTP Credentials Provider for Node.js. | ||
*/ | ||
export interface FromHttpOptions { | ||
awsContainerCredentialsFullUri?: string; | ||
awsContainerCredentialsRelativeUri?: string; | ||
awsContainerAuthorizationTokenFile?: string; | ||
awsContainerAuthorizationToken?: string; | ||
credentialsFullUri?: string; | ||
authorizationToken?: string; | ||
maxRetries?: number; | ||
timeout?: number; | ||
/** | ||
* If this value is provided, it will be used as-is. | ||
* | ||
* For browser environments, use instead {@link credentialsFullUri}. | ||
*/ | ||
awsContainerCredentialsFullUri?: string; | ||
/** | ||
* If this value is provided instead of the full URI, it | ||
* will be appended to the default link local host of 169.254.170.2. | ||
* | ||
* Not supported in browsers. | ||
*/ | ||
awsContainerCredentialsRelativeUri?: string; | ||
/** | ||
* Will be read on each credentials request to | ||
* add an Authorization request header value. | ||
* | ||
* Not supported in browsers. | ||
*/ | ||
awsContainerAuthorizationTokenFile?: string; | ||
/** | ||
* An alternative to awsContainerAuthorizationTokenFile, | ||
* this is the token value itself. | ||
* | ||
* For browser environments, use instead {@link authorizationToken}. | ||
*/ | ||
awsContainerAuthorizationToken?: string; | ||
/** | ||
* BROWSER ONLY. | ||
* | ||
* In browsers, a relative URI is not allowed, and a full URI must be provided. | ||
* HTTPS is required. | ||
* | ||
* This value is required for the browser environment. | ||
*/ | ||
credentialsFullUri?: string; | ||
/** | ||
* BROWSER ONLY. | ||
* | ||
* Providing this value will set an "Authorization" request | ||
* header value on the GET request. | ||
*/ | ||
authorizationToken?: string; | ||
/** | ||
* Default is 3 retry attempts or 4 total attempts. | ||
*/ | ||
maxRetries?: number; | ||
/** | ||
* Default is 1000ms. Time in milliseconds to spend waiting between retry attempts. | ||
*/ | ||
timeout?: number; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export type HttpProviderCredentials = { | ||
AccessKeyId: string; | ||
SecretAccessKey: string; | ||
Token: string; | ||
AccountId?: string; | ||
Expiration: string; | ||
AccessKeyId: string; | ||
SecretAccessKey: string; | ||
Token: string; | ||
AccountId?: string; | ||
Expiration: string; | ||
}; |
import { AwsCredentialIdentity } from "@aws-sdk/types"; | ||
import { HttpRequest } from "@smithy/protocol-http"; | ||
import { HttpResponse } from "@smithy/types"; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function createGetRequest(url: URL): HttpRequest; | ||
export declare function getCredentials( | ||
response: HttpResponse | ||
): Promise<AwsCredentialIdentity>; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function getCredentials(response: HttpResponse): Promise<AwsCredentialIdentity>; |
@@ -0,8 +1,10 @@ | ||
/** | ||
* @internal | ||
*/ | ||
export interface RetryableProvider<T> { | ||
(): Promise<T>; | ||
(): Promise<T>; | ||
} | ||
export declare const retryWrapper: <T>( | ||
toRetry: RetryableProvider<T>, | ||
maxRetries: number, | ||
delayMs: number | ||
) => RetryableProvider<T>; | ||
/** | ||
* @internal | ||
*/ | ||
export declare const retryWrapper: <T>(toRetry: RetryableProvider<T>, maxRetries: number, delayMs: number) => RetryableProvider<T>; |
export * from "./fromHttp/fromHttp"; | ||
export { fromHttp as fromHttpForBrowser } from "./fromHttp/fromHttp.browser"; | ||
export { | ||
FromHttpOptions, | ||
HttpProviderCredentials, | ||
} from "./fromHttp/fromHttpTypes"; | ||
export { FromHttpOptions, HttpProviderCredentials } from "./fromHttp/fromHttpTypes"; |
{ | ||
"name": "@aws-sdk/credential-provider-http", | ||
"version": "3.422.0", | ||
"version": "3.422.1", | ||
"description": "AWS credential provider for containers and HTTP sources", | ||
@@ -5,0 +5,0 @@ "main": "./dist-cjs/index.js", |
27142
625