(load: Effect.Effect<Redacted.Redacted, CredentialError>)
| 41 | typeof input === "object" && input !== null && "apply" in input && typeof input.apply === "function" |
| 42 | |
| 43 | const 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 | |
| 54 | const auth = (apply: Auth["apply"]): Auth => { |
| 55 | const self: Auth = { |
no test coverage detected