WithAuthHeader provides HTTP headers for authorization We need to merge instead of replacing because header may be set by a per-host hosts.toml or/AND by a global header config (e.g., cri.config.headers)
(hdr http.Header)
| 74 | // We need to merge instead of replacing because header may be set by |
| 75 | // a per-host hosts.toml or/AND by a global header config (e.g., cri.config.headers) |
| 76 | func WithAuthHeader(hdr http.Header) AuthorizerOpt { |
| 77 | return func(opt *authorizerConfig) { |
| 78 | if opt.header == nil { |
| 79 | opt.header = hdr.Clone() |
| 80 | } else { |
| 81 | for k, v := range hdr { |
| 82 | opt.header[k] = append(opt.header[k], v...) |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // OnFetchRefreshToken is called on fetching request token. |
| 89 | type OnFetchRefreshToken func(ctx context.Context, refreshToken string, req *http.Request) |
no outgoing calls
no test coverage detected
searching dependent graphs…