Files
query-orchestration/api/queryAPI/test_helpers.go
T
Jay Brown 2ff6e05ffc Merged in feature/permit-integration-1 (pull request #172)
Permit integration - part 1

* WIP permit integration

* slim down build

* Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/permit-integration-1

* omit swagger from auth

* clean build

* comment

* part 1 completed

this is the initial permitio parts and tests without integration. Also testing.md since we have a new test target `task test:permitio`

* feature flag for no jwt validation

* permit integration

* fix ci unit tests

* ci fix

* build fix

* fix home handler

* fix redirect

* test fix

* update docs for auth
2025-07-11 19:27:14 +00:00

54 lines
3.9 KiB
Go

package queryapi
import "log/slog"
// mockAuthConfig provides a minimal implementation of auth.ConfigProvider for testing
type mockAuthConfig struct{}
func (m *mockAuthConfig) GetAuthRegion() string { return "us-east-1" }
func (m *mockAuthConfig) SetAuthRegion(string) {}
func (m *mockAuthConfig) GetAuthUserPoolID() string { return "test-pool" }
func (m *mockAuthConfig) SetAuthUserPoolID(string) {}
func (m *mockAuthConfig) GetAuthClientSecret() string { return "test-secret" }
func (m *mockAuthConfig) SetAuthClientSecret(string) {}
func (m *mockAuthConfig) GetAuthDomain() string { return "test-domain" }
func (m *mockAuthConfig) SetAuthDomain(string) {}
func (m *mockAuthConfig) GetAuthClientID() string { return "test-client-id" }
func (m *mockAuthConfig) SetAuthClientID(string) {}
func (m *mockAuthConfig) GetAuthRedirectURI() string { return "http://localhost/callback" }
func (m *mockAuthConfig) SetAuthRedirectURI(string) {}
func (m *mockAuthConfig) GetAuthTokenURL() string { return "http://localhost/token" }
func (m *mockAuthConfig) SetAuthTokenURL(string) {}
func (m *mockAuthConfig) GetAuthJwksURL() string { return "http://localhost/jwks" }
func (m *mockAuthConfig) SetAuthJwksURL(string) {}
func (m *mockAuthConfig) GetAuthURL() string { return "http://localhost/auth" }
func (m *mockAuthConfig) SetAuthURL(string) {}
func (m *mockAuthConfig) GetAuthLogoutURL() string { return "http://localhost/logout" }
func (m *mockAuthConfig) SetAuthLogoutURL(string) {}
func (m *mockAuthConfig) GetAuthLoginPath() string { return "/login" }
func (m *mockAuthConfig) SetAuthLoginPath(string) {}
func (m *mockAuthConfig) GetAuthCallbackPath() string { return "/callback" }
func (m *mockAuthConfig) SetAuthCallbackPath(string) {}
func (m *mockAuthConfig) GetAuthHomePath() string { return "/home" }
func (m *mockAuthConfig) SetAuthHomePath(string) {}
func (m *mockAuthConfig) GetAuthLogoutPath() string { return "/logout" }
func (m *mockAuthConfig) SetAuthLogoutPath(string) {}
func (m *mockAuthConfig) GetHealthPath() string { return "/health" }
func (m *mockAuthConfig) SetHealthPath(string) {}
func (m *mockAuthConfig) GetAuthLogger() *slog.Logger { return slog.Default() }
func (m *mockAuthConfig) SetAuthLogger(*slog.Logger) {}
func (m *mockAuthConfig) GetAuthRoutePermissions() map[string][]string { return nil }
func (m *mockAuthConfig) SetAuthRoutePermissions(map[string][]string) {}
func (m *mockAuthConfig) GetPermitIOAPIKey() string { return "test-permit-key" }
func (m *mockAuthConfig) SetPermitIOAPIKey(string) {}
func (m *mockAuthConfig) GetPermitIOPDPURL() string { return "http://localhost:7766" }
func (m *mockAuthConfig) SetPermitIOPDPURL(string) {}
func (m *mockAuthConfig) InitializeAuthConfig(string, *slog.Logger) error { return nil }
func (m *mockAuthConfig) GetNoJWTValidation() bool { return false }
func (m *mockAuthConfig) SetNoJWTValidation(bool) {}
// NewTestControllers creates a Controllers instance for testing with a mock auth config
func NewTestControllers(services *Services) *Controllers {
return NewControllers(services, &mockAuthConfig{})
}