Spaces:
Runtime error
Runtime error
Download static/node_modules/mongodb/lib/client-side-encryption/providers/aws.js from kaab4321/NarrativeFlow: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongodb/lib/client-side-encryption/providers/aws.js
- Command line
-
hf download hf://spaces/kaab4321/NarrativeFlow/static/node_modules/mongodb/lib/client-side-encryption/providers/aws.js
-
curl -L -o aws.js https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongodb/lib/client-side-encryption/providers/aws.js
1.17 kB
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.loadAWSCredentials = void 0; | |
| const aws_temporary_credentials_1 = require("../../cmap/auth/aws_temporary_credentials"); | |
| /** | |
| * @internal | |
| */ | |
| async function loadAWSCredentials(kmsProviders) { | |
| const credentialProvider = new aws_temporary_credentials_1.AWSSDKCredentialProvider(); | |
| // We shouldn't ever receive a response from the AWS SDK that doesn't have a `SecretAccessKey` | |
| // or `AccessKeyId`. However, TS says these fields are optional. We provide empty strings | |
| // and let libmongocrypt error if we're unable to fetch the required keys. | |
| const { SecretAccessKey = '', AccessKeyId = '', Token } = await credentialProvider.getCredentials(); | |
| const aws = { | |
| secretAccessKey: SecretAccessKey, | |
| accessKeyId: AccessKeyId | |
| }; | |
| // the AWS session token is only required for temporary credentials so only attach it to the | |
| // result if it's present in the response from the aws sdk | |
| Token != null && (aws.sessionToken = Token); | |
| return { ...kmsProviders, aws }; | |
| } | |
| exports.loadAWSCredentials = loadAWSCredentials; | |
| //# sourceMappingURL=aws.js.map |