MCPcopy
hub / github.com/dosco/graphjin / TestApiKeyAuthQuery

Function TestApiKeyAuthQuery

core/openapi/auth_test.go:109–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

107}
108
109func TestApiKeyAuthQuery(t *testing.T) {
110 p, _ := NewAuthProvider(AuthConfig{
111 Scheme: "api_key",
112 KeyName: "api_key",
113 KeyValue: "secret",
114 KeyIn: "query",
115 }, nil)
116 req := newTestRequest(t, "https://x/users")
117 _ = p.Apply(context.Background(), req, nil)
118 if !strings.Contains(req.URL.RawQuery, "api_key=secret") {
119 t.Errorf("RawQuery = %q, missing api_key", req.URL.RawQuery)
120 }
121}
122
123func TestOAuth2ClientCredentials(t *testing.T) {
124 var calls int32

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
NewAuthProviderFunction · 0.85
newTestRequestFunction · 0.85

Tested by

no test coverage detected