@@ -64,11 +64,11 @@ func New(firewall *router.Firewall, errs chan<- error) (ui *AdminUI, err error)
64
64
return nil , fmt .Errorf ("admin ui failed to start as we could not get wag version: %s" , err )
65
65
}
66
66
67
- if ! config .Values .ManagementUI . OIDC .Enabled && ! * config .Values .ManagementUI .Password .Enabled {
67
+ if ! config .Values .Webserver . Management . OIDC .Enabled && ! * config .Values .Webserver . Management .Password .Enabled {
68
68
return nil , errors .New ("neither oidc or password authentication was enabled for the admin user interface, you wont be able to log in despite having it enabled" )
69
69
}
70
70
71
- if config .Values .ManagementUI .OIDC .Enabled {
71
+ if config .Values .Webserver . Management .OIDC .Enabled {
72
72
key , err := utils .GenerateRandom (32 )
73
73
if err != nil {
74
74
return nil , errors .New ("failed to get random key: " + err .Error ())
@@ -86,18 +86,18 @@ func New(firewall *router.Firewall, errs chan<- error) (ui *AdminUI, err error)
86
86
rp .WithVerifierOpts (rp .WithIssuedAtOffset (5 * time .Second )),
87
87
}
88
88
89
- u , err := url .Parse (config .Values .ManagementUI .Domain )
89
+ u , err := url .Parse (config .Values .Webserver . Management .Domain )
90
90
if err != nil {
91
- return nil , fmt .Errorf ("failed to parse admin url: %q, err: %s" , config .Values .ManagementUI .Domain , err )
91
+ return nil , fmt .Errorf ("failed to parse admin url: %q, err: %s" , config .Values .Webserver . Management .Domain , err )
92
92
}
93
93
94
94
u .Path = path .Join (u .Path , "/login/oidc/callback" )
95
95
log .Println ("[ADMINUI] OIDC callback: " , u .String ())
96
- log .Println ("[ADMINUI] Connecting to OIDC provider: " , config .Values .ManagementUI .OIDC .IssuerURL )
96
+ log .Println ("[ADMINUI] Connecting to OIDC provider: " , config .Values .Webserver . Management .OIDC .IssuerURL )
97
97
98
98
ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
99
99
100
- adminUI .oidcProvider , err = rp .NewRelyingPartyOIDC (ctx , config .Values .ManagementUI . OIDC .IssuerURL , config .Values .ManagementUI . OIDC .ClientID , config .Values .ManagementUI .OIDC .ClientSecret , u .String (), []string {"openid" }, options ... )
100
+ adminUI .oidcProvider , err = rp .NewRelyingPartyOIDC (ctx , config .Values .Webserver . Management . OIDC .IssuerURL , config .Values .Webserver . Management . OIDC .ClientID , config .Values .Webserver . Management .OIDC .ClientSecret , u .String (), []string {"openid" }, options ... )
101
101
cancel ()
102
102
if err != nil {
103
103
return nil , fmt .Errorf ("unable to connect to oidc provider for admin ui. err %s" , err )
@@ -106,7 +106,7 @@ func New(firewall *router.Firewall, errs chan<- error) (ui *AdminUI, err error)
106
106
log .Println ("[ADMINUI] Connected to admin oidc provider!" )
107
107
}
108
108
109
- if * config .Values .ManagementUI .Password .Enabled {
109
+ if * config .Values .Webserver . Management .Password .Enabled {
110
110
111
111
admins , err := adminUI .ctrl .ListAdminUsers ("" )
112
112
if err != nil {
@@ -172,7 +172,7 @@ func New(firewall *router.Firewall, errs chan<- error) (ui *AdminUI, err error)
172
172
allRoutes .HandleFunc ("GET /api/config" , adminUI .uiConfig )
173
173
allRoutes .HandleFunc ("POST /api/refresh" , adminUI .doAuthRefresh )
174
174
175
- if config .Values .ManagementUI .OIDC .Enabled {
175
+ if config .Values .Webserver . Management .OIDC .Enabled {
176
176
allRoutes .HandleFunc ("GET /login/oidc" , func (w http.ResponseWriter , r * http.Request ) {
177
177
rp .AuthURLHandler (func () string {
178
178
r , _ := utils .GenerateRandomHex (32 )
@@ -286,15 +286,15 @@ func New(firewall *router.Firewall, errs chan<- error) (ui *AdminUI, err error)
286
286
return nil , err
287
287
}
288
288
289
- log .Println ("[ADMINUI] Started Managemnt UI listening:" , config .Values .ManagementUI .ListenAddress )
289
+ log .Println ("[ADMINUI] Started Managemnt UI listening:" , config .Values .Webserver . Management .ListenAddress )
290
290
291
291
return & adminUI , nil
292
292
}
293
293
294
294
func (au * AdminUI ) uiConfig (w http.ResponseWriter , r * http.Request ) {
295
295
m := ConfigResponseDTO {
296
- SSO : config .Values .ManagementUI .OIDC .Enabled ,
297
- Password : * config .Values .ManagementUI .Password .Enabled ,
296
+ SSO : config .Values .Webserver . Management .OIDC .Enabled ,
297
+ Password : * config .Values .Webserver . Management .Password .Enabled ,
298
298
}
299
299
300
300
json .NewEncoder (w ).Encode (m )
@@ -330,7 +330,7 @@ func (au *AdminUI) doAuthRefresh(w http.ResponseWriter, r *http.Request) {
330
330
331
331
func (au * AdminUI ) doLogin (w http.ResponseWriter , r * http.Request ) {
332
332
333
- if ! * config .Values .ManagementUI .Password .Enabled {
333
+ if ! * config .Values .Webserver . Management .Password .Enabled {
334
334
http .NotFound (w , r )
335
335
return
336
336
}
@@ -428,7 +428,7 @@ func (au *AdminUI) Close() {
428
428
429
429
autotls .Do .Close (data .Management )
430
430
431
- if config .Values .ManagementUI .Enabled {
431
+ if config .Values .Webserver . Management .Enabled {
432
432
log .Println ("Stopped Management UI" )
433
433
}
434
434
0 commit comments