diff --git a/internal/bootstrap/app_bootstrap.go b/internal/bootstrap/app_bootstrap.go index 5e4a3bd2..5b342c48 100644 --- a/internal/bootstrap/app_bootstrap.go +++ b/internal/bootstrap/app_bootstrap.go @@ -29,14 +29,9 @@ type BootstrapApp struct { csrfCookieName string redirectCookieName string oauthSessionCookieName string -<<<<<<< HEAD - users []config.User - oauthWhitelist []string - oauthProviders map[string]config.OAuthServiceConfig -======= localUsers *[]model.LocalUser oauthProviders map[string]model.OAuthServiceConfig ->>>>>>> main + oauthWhitelist []string configuredProviders []controller.Provider oidcClients []model.OIDCClientConfig } diff --git a/internal/bootstrap/service_bootstrap.go b/internal/bootstrap/service_bootstrap.go index 2046beac..09485bd0 100644 --- a/internal/bootstrap/service_bootstrap.go +++ b/internal/bootstrap/service_bootstrap.go @@ -89,13 +89,8 @@ func (app *BootstrapApp) initServices(queries *repository.Queries) (Services, er services.oauthBrokerService = oauthBrokerService authService := service.NewAuthService(service.AuthServiceConfig{ -<<<<<<< HEAD - Users: app.context.users, - OauthWhitelist: app.context.oauthWhitelist, -======= LocalUsers: app.context.localUsers, - OauthWhitelist: app.config.OAuth.Whitelist, ->>>>>>> main + OauthWhitelist: app.context.oauthWhitelist, SessionExpiry: app.config.Auth.SessionExpiry, SessionMaxLifetime: app.config.Auth.SessionMaxLifetime, SecureCookie: app.config.Auth.SecureCookie, diff --git a/internal/utils/user_utils.go b/internal/utils/user_utils.go index 8db112a2..f154fe82 100644 --- a/internal/utils/user_utils.go +++ b/internal/utils/user_utils.go @@ -33,40 +33,10 @@ func ParseUsers(usersStr []string, userAttributes map[string]model.UserAttribute return &users, nil } -<<<<<<< HEAD -func GetUsers(usersCfg []string, usersPath string, userAttributes map[string]config.UserAttributes) ([]config.User, error) { +func GetUsers(usersCfg []string, usersPath string, userAttributes map[string]model.UserAttributes) (*[]model.LocalUser, error) { usersStr, err := GetStringList(usersCfg, usersPath) if err != nil { - return []config.User{}, err -======= -func GetUsers(usersCfg []string, usersPath string, userAttributes map[string]model.UserAttributes) (*[]model.LocalUser, error) { - var usersStr []string - - if len(usersCfg) == 0 && usersPath == "" { - return nil, nil - } - - if len(usersCfg) > 0 { - usersStr = append(usersStr, usersCfg...) - } - - if usersPath != "" { - contents, err := ReadFile(usersPath) - - if err != nil { - return nil, err - } - - lines := strings.SplitSeq(contents, "\n") - - for line := range lines { - lineTrimmed := strings.TrimSpace(line) - if lineTrimmed == "" { - continue - } - usersStr = append(usersStr, lineTrimmed) - } ->>>>>>> main + return nil, err } return ParseUsers(usersStr, userAttributes)