(t *testing.T)
| 93 | } |
| 94 | |
| 95 | func TestApiKeyAuthHeader(t *testing.T) { |
| 96 | p, _ := NewAuthProvider(AuthConfig{ |
| 97 | Scheme: "api_key", |
| 98 | KeyName: "X-API-Key", |
| 99 | KeyValue: "secret", |
| 100 | KeyIn: "header", |
| 101 | }, nil) |
| 102 | req := newTestRequest(t, "https://x") |
| 103 | _ = p.Apply(context.Background(), req, nil) |
| 104 | if got := req.Header.Get("X-API-Key"); got != "secret" { |
| 105 | t.Errorf("X-API-Key = %q", got) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func TestApiKeyAuthQuery(t *testing.T) { |
| 110 | p, _ := NewAuthProvider(AuthConfig{ |
nothing calls this directly
no test coverage detected