MCPcopy Create free account
hub / github.com/anomalyco/opencode / fromCredential

Function fromCredential

packages/llm/src/route/auth.ts:65–68  ·  view source on GitHub ↗
(source: Credential, render: (secret: string) => Headers.Input)

Source from the content-addressed store, hash-verified

63}
64
65const fromCredential = (source: Credential, render: (secret: string) => Headers.Input) =>
66 auth((input) =>
67 source.load.pipe(Effect.map((secret) => Headers.setAll(input.headers, render(Redacted.value(secret))))),
68 )
69
70const secretEffect = (secret: string | Redacted.Redacted, source: string) => {
71 const redacted = typeof secret === "string" ? Redacted.make(secret) : secret

Callers 2

credentialFunction · 0.85
renderFunction · 0.85

Calls 2

authFunction · 0.70
renderFunction · 0.70

Tested by

no test coverage detected