Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function remoteProvider(init: RemoteProviderInit): CredentialProvider {
if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
return fromContainerMetadata(init);
}
if (process.env[ENV_IMDS_DISABLED]) {
return () =>
Promise.reject(
new ProviderError("EC2 Instance Metadata Service access disabled")
);
}
return fromInstanceMetadata(init);
}
function remoteProvider(init: RemoteProviderInit): CredentialProvider {
if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
return fromContainerMetadata(init);
}
if (process.env[ENV_IMDS_DISABLED]) {
return () =>
Promise.reject(
new ProviderError("EC2 Instance Metadata Service access disabled")
);
}
return fromInstanceMetadata(init);
}