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

Function withAuth

packages/opencode/test/provider/digitalocean.test.ts:29–41  ·  view source on GitHub ↗
(metadata: Record<string, string> | undefined, effect: Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

27 )
28
29const withAuth = <A, E, R>(metadata: Record<string, string> | undefined, effect: Effect.Effect<A, E, R>) =>
30 withEnv(
31 {
32 OPENCODE_AUTH_CONTENT: JSON.stringify({
33 digitalocean: {
34 type: "api",
35 key: "sk_do_test",
36 ...(metadata ? { metadata } : {}),
37 },
38 }),
39 },
40 effect,
41 )
42
43it.instance(
44 "digitalocean provider autoloads from DIGITALOCEAN_ACCESS_TOKEN",

Callers 1

Calls 1

withEnvFunction · 0.70

Tested by

no test coverage detected