1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00

fix: fixes roles for proxy to default to all (#4145)

This commit is contained in:
Amir Raminfar
2025-09-25 14:01:50 -07:00
committed by GitHub
parent bc3c812c74
commit 5675389049

View File

@@ -48,7 +48,10 @@ func (p *proxyAuthContext) AuthMiddleware(next http.Handler) http.Handler {
if err != nil {
log.Fatal().Str("filter", r.Header.Get(p.headerFilter)).Msg("Failed to parse container filter")
}
userRoles := ParseRole(r.Header.Get(p.headerRoles))
userRoles := All
if r.Header.Get(p.headerRoles) != "" {
userRoles = ParseRole(r.Header.Get(p.headerRoles))
}
user := newUser(r.Header.Get(p.headerUser), r.Header.Get(p.headerEmail), r.Header.Get(p.headerName), containerFilter, userRoles)
ctx := context.WithValue(r.Context(), remoteUser, user)
next.ServeHTTP(w, r.WithContext(ctx))