AuthProvider attaches authentication to outgoing requests to an upstream API. Implementations are constructed once per spec at boot time and reused across every operation against that spec. Apply mutates req in place. The hdrIn parameter carries headers from the *incoming* GraphJin request, enablin
| 24 | // retry once. Stateless providers (bearer with literal token, basic |
| 25 | // auth) implement this as a no-op. |
| 26 | type AuthProvider interface { |
| 27 | Apply(ctx context.Context, req *http.Request, hdrIn http.Header) error |
| 28 | OnUnauthorized(ctx context.Context) error |
| 29 | } |
| 30 | |
| 31 | // NewAuthProvider builds the right AuthProvider for cfg.Scheme. An empty |
| 32 | // or unrecognised scheme returns the no-op provider — operations against |
no outgoing calls
no test coverage detected