Skip to content

Commit

Permalink
feat: add credential scope field
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Dec 20, 2023
1 parent f0ff3b7 commit 0d091df
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/happy-adults-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@smithy/middleware-endpoint": minor
"@smithy/types": minor
---

support credential scope
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export const createConfigValueProvider = <Config extends Record<string, unknown>
}
return configValue;
};
if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
return async () => {
const credentials = typeof config.credentials === 'function' ? await config.credentials() : config.credentials;
const configValue: unknown = credentials?.credentialScope ?? credentials?.CredentialScope;
return configValue;
};
}
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
return async () => {
const endpoint = await configProvider();
Expand Down
5 changes: 5 additions & 0 deletions packages/types/src/identity/awsCredentialIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export interface AwsCredentialIdentity extends Identity {
* present for temporary credentials.
*/
readonly sessionToken?: string;

/**
* AWS credential scope for this set of credentials.
*/
readonly credentialScope?: string;
}

/**
Expand Down

0 comments on commit 0d091df

Please sign in to comment.