mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-09 22:08:12 +00:00
fix: fix conflicts
This commit is contained in:
@@ -29,14 +29,9 @@ type BootstrapApp struct {
|
|||||||
csrfCookieName string
|
csrfCookieName string
|
||||||
redirectCookieName string
|
redirectCookieName string
|
||||||
oauthSessionCookieName string
|
oauthSessionCookieName string
|
||||||
<<<<<<< HEAD
|
|
||||||
users []config.User
|
|
||||||
oauthWhitelist []string
|
|
||||||
oauthProviders map[string]config.OAuthServiceConfig
|
|
||||||
=======
|
|
||||||
localUsers *[]model.LocalUser
|
localUsers *[]model.LocalUser
|
||||||
oauthProviders map[string]model.OAuthServiceConfig
|
oauthProviders map[string]model.OAuthServiceConfig
|
||||||
>>>>>>> main
|
oauthWhitelist []string
|
||||||
configuredProviders []controller.Provider
|
configuredProviders []controller.Provider
|
||||||
oidcClients []model.OIDCClientConfig
|
oidcClients []model.OIDCClientConfig
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,13 +89,8 @@ func (app *BootstrapApp) initServices(queries *repository.Queries) (Services, er
|
|||||||
services.oauthBrokerService = oauthBrokerService
|
services.oauthBrokerService = oauthBrokerService
|
||||||
|
|
||||||
authService := service.NewAuthService(service.AuthServiceConfig{
|
authService := service.NewAuthService(service.AuthServiceConfig{
|
||||||
<<<<<<< HEAD
|
|
||||||
Users: app.context.users,
|
|
||||||
OauthWhitelist: app.context.oauthWhitelist,
|
|
||||||
=======
|
|
||||||
LocalUsers: app.context.localUsers,
|
LocalUsers: app.context.localUsers,
|
||||||
OauthWhitelist: app.config.OAuth.Whitelist,
|
OauthWhitelist: app.context.oauthWhitelist,
|
||||||
>>>>>>> main
|
|
||||||
SessionExpiry: app.config.Auth.SessionExpiry,
|
SessionExpiry: app.config.Auth.SessionExpiry,
|
||||||
SessionMaxLifetime: app.config.Auth.SessionMaxLifetime,
|
SessionMaxLifetime: app.config.Auth.SessionMaxLifetime,
|
||||||
SecureCookie: app.config.Auth.SecureCookie,
|
SecureCookie: app.config.Auth.SecureCookie,
|
||||||
|
|||||||
@@ -33,40 +33,10 @@ func ParseUsers(usersStr []string, userAttributes map[string]model.UserAttribute
|
|||||||
return &users, nil
|
return &users, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
func GetUsers(usersCfg []string, usersPath string, userAttributes map[string]model.UserAttributes) (*[]model.LocalUser, error) {
|
||||||
func GetUsers(usersCfg []string, usersPath string, userAttributes map[string]config.UserAttributes) ([]config.User, error) {
|
|
||||||
usersStr, err := GetStringList(usersCfg, usersPath)
|
usersStr, err := GetStringList(usersCfg, usersPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []config.User{}, err
|
return nil, 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 ParseUsers(usersStr, userAttributes)
|
return ParseUsers(usersStr, userAttributes)
|
||||||
|
|||||||
Reference in New Issue
Block a user