mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Add tests and clarifying comments
This commit is contained in:
parent
22b93e91f6
commit
57a0e88fa4
4 changed files with 188 additions and 32 deletions
13
packages/safe-chain/src/registryProxy/isImdsEndpoint.js
Normal file
13
packages/safe-chain/src/registryProxy/isImdsEndpoint.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Instance Metadata Service (IMDS) endpoints used by cloud providers.
|
||||
// Cloud SDK tools probe these to detect environment and retrieve credentials.
|
||||
// When outside cloud environments, connections timeout - we reduce timeout (3s vs 30s)
|
||||
// and suppress error logging since this is expected behavior.
|
||||
const imdsEndpoints = [
|
||||
"metadata.google.internal",
|
||||
"metadata.goog",
|
||||
"169.254.169.254",
|
||||
];
|
||||
|
||||
export function isImdsEndpoint(/** @type {string} */ host) {
|
||||
return imdsEndpoints.includes(host);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue