refactor: use centralized config in auth service

This commit is contained in:
Stavros
2025-04-06 18:55:24 +03:00
parent 07ddd4f917
commit 5cf4e208c6
7 changed files with 252 additions and 200 deletions

View File

@@ -38,6 +38,15 @@ var handlersConfig = types.HandlersConfig{
GenericName: "Generic",
}
// Simple auth config for tests
var authConfig = types.AuthConfig{
Users: types.Users{},
OauthWhitelist: []string{},
SessionExpiry: 3600,
LoginTimeout: 0,
LoginMaxRetries: 0,
}
// Cookie
var cookie string
@@ -61,12 +70,13 @@ func getAPI(t *testing.T) *api.API {
}
// Create auth service
auth := auth.NewAuth(docker, types.Users{
authConfig.Users = types.Users{
{
Username: user.Username,
Password: user.Password,
},
}, nil, apiConfig.SessionExpiry, 300, 5)
}
auth := auth.NewAuth(authConfig, docker)
// Create providers service
providers := providers.NewProviders(types.OAuthConfig{})