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

Function credential

packages/llm/src/route/auth.ts:43–52  ·  view source on GitHub ↗
(load: Effect.Effect<Redacted.Redacted, CredentialError>)

Source from the content-addressed store, hash-verified

41 typeof input === "object" && input !== null && "apply" in input && typeof input.apply === "function"
42
43const credential = (load: Effect.Effect<Redacted.Redacted, CredentialError>): Credential => {
44 const self: Credential = {
45 load,
46 orElse: (that) => credential(load.pipe(Effect.catch(() => that.load))),
47 bearer: () => fromCredential(self, (secret) => ({ authorization: `Bearer ${secret}` })),
48 header: (name) => fromCredential(self, (secret) => ({ [name]: secret })),
49 pipe: (f) => f(self),
50 }
51 return self
52}
53
54const auth = (apply: Auth["apply"]): Auth => {
55 const self: Auth = {

Callers 3

credentialFromSecretFunction · 0.70
optionalFunction · 0.70
effectFunction · 0.70

Calls 1

fromCredentialFunction · 0.85

Tested by

no test coverage detected