(t *testing.T)
| 197 | } |
| 198 | |
| 199 | func newSourceModeJWTHTTPTestHandler(t *testing.T) http.Handler { |
| 200 | t.Helper() |
| 201 | |
| 202 | dbPath := createSourceModeHTTPDB(t) |
| 203 | svc := newControlPlaneGraphQLTestServiceWithConfig(t, MCPConfig{}, dbPath, func(conf *Config) { |
| 204 | conf.Core.Mode = modeAgentic |
| 205 | conf.Core.Roles = append(conf.Core.Roles, core.Role{Name: "member"}) |
| 206 | conf.Serv.Auth = Auth{ |
| 207 | Type: "jwt", |
| 208 | JWT: JWTConfig{Secret: sourceModeHTTPJWTSecret}, |
| 209 | } |
| 210 | conf.Serv.AuthFailBlock = true |
| 211 | }) |
| 212 | |
| 213 | ah, err := auth.NewAuthHandlerFunc(svc.conf.Auth) |
| 214 | if err != nil { |
| 215 | t.Fatalf("new auth handler: %v", err) |
| 216 | } |
| 217 | hs := &HttpService{} |
| 218 | hs.Store(svc) |
| 219 | return hs.GraphQL(ah) |
| 220 | } |
| 221 | |
| 222 | func createSourceModeHTTPDB(t *testing.T) string { |
| 223 | t.Helper() |
no test coverage detected