Skip to main content

createStaticCredentialResolver

@forge/monorepo


@forge/monorepo / backend/src / createStaticCredentialResolver

Function: createStaticCredentialResolver()

createStaticCredentialResolver(secrets): CredentialResolver

Defined in: backend/src/tools/credentials.ts:203

A resolver over a plain map, for a single-tenant deployment and for tests.

Shipped because the alternative is every host writing the same six lines, and the sixth one writing it with a fallback to process.env — which is the thing this module exists to prevent. Explicitly not environment backed: a host that wants that passes { github: process.env.GITHUB_TOKEN ?? "" } and can see it doing so.

A bare string still works, and stays the common case: it means a bearer token, which is what it meant before #260. The single-tenant path must not get harder because multi-tenant got possible.

Parameters

secrets

Readonly<Record<string, string | Credential>>

Returns

CredentialResolver