mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-07 21:08:12 +00:00
fix: fix conflicts
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user