-
Notifications
You must be signed in to change notification settings - Fork 104
feat: add support for accountId in imds #1621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
packages/credential-provider-imds/src/fromInstanceMetadata.spec.ts
Outdated
Show resolved
Hide resolved
}); | ||
|
||
beforeEach(() => { | ||
vi.mocked(staticStabilityProvider).mockImplementation((input) => input); | ||
vi.mocked(getInstanceMetadataEndpoint).mockResolvedValue({ hostname } as any); | ||
vi.mocked(loadConfig).mockReturnValue(() => Promise.resolve(false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is hard to understand because the mock is too broad. What config property is being targeted by this mock return value?
Can the mock be made more specific so we can tell what config property it is trying to intercept?
packages/credential-provider-imds/src/fromInstanceMetadata.spec.ts
Outdated
Show resolved
Hide resolved
packages/credential-provider-imds/src/fromInstanceMetadata.spec.ts
Outdated
Show resolved
Hide resolved
packages/credential-provider-imds/src/fromInstanceMetadata.spec.ts
Outdated
Show resolved
Hide resolved
packages/credential-provider-imds/src/fromInstanceMetadata.spec.ts
Outdated
Show resolved
Hide resolved
|
ae61133
to
1b4f991
Compare
packages/credential-provider-imds/src/fromInstanceMetadata.e2e.spec.ts
Outdated
Show resolved
Hide resolved
packages/credential-provider-imds/src/fromInstanceMetadata.e2e.spec.ts
Outdated
Show resolved
Hide resolved
comments for the PR as of June 26:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR is on hold
Issue #, if available:
Internal JS-5966
Description of changes:
This PR adds support for version 2.1 of the IMDS credentials provider. With this update, the provider can now retrieve credentials that include an account ID.
To support this functionality, the credentials provider first attempts to access the extended API endpoint, which ends with
-extended
. If this endpoint returns a 404, the provider falls back to the legacy API endpoint—the same one used in the IMDS credentials provider v2.0.This "try extended API, then fall back to legacy API" pattern is applied to both retrieving the IMDS instance profile name and fetching credentials.
Only the extended API can return credentials that include an account ID.
The PR also made the following IMDS credentials providers options configurable:
Disable IMDS credentials fetching
IMDS instance profile name
Both options can be configured via environment variables or a shared config file, with environment variables taking precedence over the config file.
ToDo:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.