Spaces:
Runtime error
Runtime error
Download static/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts from kaab4321/NarrativeFlow: direct link, hf CLI and curl.
- Browser
- Download file 508 Bytes
-
https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts
- Command line
-
hf download hf://spaces/kaab4321/NarrativeFlow/static/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts
-
curl -L -o gcp.ts https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongodb/src/client-side-encryption/providers/gcp.ts
508 Bytes
| import { getGcpMetadata } from '../../deps'; | |
| import { type KMSProviders } from '.'; | |
| /** @internal */ | |
| export async function loadGCPCredentials(kmsProviders: KMSProviders): Promise<KMSProviders> { | |
| const gcpMetadata = getGcpMetadata(); | |
| if ('kModuleError' in gcpMetadata) { | |
| return kmsProviders; | |
| } | |
| const { access_token: accessToken } = await gcpMetadata.instance<{ access_token: string }>({ | |
| property: 'service-accounts/default/token' | |
| }); | |
| return { ...kmsProviders, gcp: { accessToken } }; | |
| } | |