128
128
129
129
def add_rq_dashboard_auth (blueprint ):
130
130
@blueprint .before_request
131
- @auth .oidc_auth ( 'sso' )
131
+ @auth .oidc_auth
132
132
def rq_dashboard_auth (* args , ** kwargs ): # pylint: disable=unused-argument,unused-variable
133
133
if 'rtp' not in session ['userinfo' ]['groups' ]:
134
134
abort (403 )
@@ -153,7 +153,7 @@ def forbidden(e):
153
153
154
154
@app .route ('/' )
155
155
@app .route ('/user/<string:user_view>' )
156
- @auth .oidc_auth ( 'sso' )
156
+ @auth .oidc_auth
157
157
def list_vms (user_view = None ):
158
158
user = User (session ['userinfo' ]['preferred_username' ])
159
159
rtp_view = False
@@ -190,15 +190,15 @@ def list_vms(user_view=None):
190
190
191
191
192
192
@app .route ('/isos' )
193
- @auth .oidc_auth ( 'sso' )
193
+ @auth .oidc_auth
194
194
def isos ():
195
195
proxmox = connect_proxmox ()
196
196
stored_isos = get_isos (proxmox , app .config ['PROXMOX_ISO_STORAGE' ])
197
197
return json .dumps ({'isos' : stored_isos })
198
198
199
199
200
200
@app .route ('/hostname/<string:name>' )
201
- @auth .oidc_auth ( 'sso' )
201
+ @auth .oidc_auth
202
202
def hostname (name ):
203
203
valid , available = check_hostname (starrs , name )
204
204
if not valid :
@@ -210,7 +210,7 @@ def hostname(name):
210
210
211
211
212
212
@app .route ('/vm/<string:vmid>' )
213
- @auth .oidc_auth ( 'sso' )
213
+ @auth .oidc_auth
214
214
def vm_details (vmid ):
215
215
user = User (session ['userinfo' ]['preferred_username' ])
216
216
connect_proxmox ()
@@ -230,7 +230,7 @@ def vm_details(vmid):
230
230
231
231
232
232
@app .route ('/vm/<string:vmid>/power/<string:action>' , methods = ['POST' ])
233
- @auth .oidc_auth ( 'sso' )
233
+ @auth .oidc_auth
234
234
def vm_power (vmid , action ):
235
235
user = User (session ['userinfo' ]['preferred_username' ])
236
236
connect_proxmox ()
@@ -270,7 +270,7 @@ def vm_console_stop(vmid):
270
270
271
271
272
272
@app .route ('/console/vm/<string:vmid>' , methods = ['POST' ])
273
- @auth .oidc_auth ( 'sso' )
273
+ @auth .oidc_auth
274
274
def vm_console (vmid ):
275
275
user = User (session ['userinfo' ]['preferred_username' ])
276
276
connect_proxmox ()
@@ -290,7 +290,7 @@ def vm_console(vmid):
290
290
291
291
292
292
@app .route ('/vm/<string:vmid>/cpu/<int:cores>' , methods = ['POST' ])
293
- @auth .oidc_auth ( 'sso' )
293
+ @auth .oidc_auth
294
294
def vm_cpu (vmid , cores ):
295
295
user = User (session ['userinfo' ]['preferred_username' ])
296
296
connect_proxmox ()
@@ -311,7 +311,7 @@ def vm_cpu(vmid, cores):
311
311
312
312
313
313
@app .route ('/vm/<string:vmid>/mem/<int:mem>' , methods = ['POST' ])
314
- @auth .oidc_auth ( 'sso' )
314
+ @auth .oidc_auth
315
315
def vm_mem (vmid , mem ):
316
316
user = User (session ['userinfo' ]['preferred_username' ])
317
317
connect_proxmox ()
@@ -332,7 +332,7 @@ def vm_mem(vmid, mem):
332
332
333
333
334
334
@app .route ('/vm/<string:vmid>/disk/<string:disk>/<int:size>' , methods = ['POST' ])
335
- @auth .oidc_auth ( 'sso' )
335
+ @auth .oidc_auth
336
336
def vm_disk (vmid , disk , size ):
337
337
user = User (session ['userinfo' ]['preferred_username' ])
338
338
connect_proxmox ()
@@ -348,7 +348,7 @@ def vm_disk(vmid, disk, size):
348
348
349
349
350
350
@app .route ('/vm/<string:vmid>/renew' , methods = ['POST' ])
351
- @auth .oidc_auth ( 'sso' )
351
+ @auth .oidc_auth
352
352
def vm_renew (vmid ):
353
353
user = User (session ['userinfo' ]['preferred_username' ])
354
354
connect_proxmox ()
@@ -364,7 +364,7 @@ def vm_renew(vmid):
364
364
365
365
366
366
@app .route ('/vm/<string:vmid>/eject' , methods = ['POST' ])
367
- @auth .oidc_auth ( 'sso' )
367
+ @auth .oidc_auth
368
368
def iso_eject (vmid ):
369
369
user = User (session ['userinfo' ]['preferred_username' ])
370
370
connect_proxmox ()
@@ -377,7 +377,7 @@ def iso_eject(vmid):
377
377
378
378
379
379
@app .route ('/vm/<string:vmid>/mount/<string:iso>' , methods = ['POST' ])
380
- @auth .oidc_auth ( 'sso' )
380
+ @auth .oidc_auth
381
381
def iso_mount (vmid , iso ):
382
382
user = User (session ['userinfo' ]['preferred_username' ])
383
383
connect_proxmox ()
@@ -391,7 +391,7 @@ def iso_mount(vmid, iso):
391
391
392
392
393
393
@app .route ('/vm/<string:vmid>/delete' , methods = ['POST' ])
394
- @auth .oidc_auth ( 'sso' )
394
+ @auth .oidc_auth
395
395
def delete (vmid ):
396
396
user = User (session ['userinfo' ]['preferred_username' ])
397
397
connect_proxmox ()
@@ -405,7 +405,7 @@ def delete(vmid):
405
405
406
406
407
407
@app .route ('/vm/<string:vmid>/boot_order' , methods = ['POST' ])
408
- @auth .oidc_auth ( 'sso' )
408
+ @auth .oidc_auth
409
409
def get_boot_order (vmid ):
410
410
user = User (session ['userinfo' ]['preferred_username' ])
411
411
connect_proxmox ()
@@ -421,7 +421,7 @@ def get_boot_order(vmid):
421
421
422
422
423
423
@app .route ('/vm/create' , methods = ['GET' , 'POST' ])
424
- @auth .oidc_auth ( 'sso' )
424
+ @auth .oidc_auth
425
425
def create ():
426
426
user = User (session ['userinfo' ]['preferred_username' ])
427
427
proxmox = connect_proxmox ()
@@ -494,7 +494,7 @@ def create():
494
494
495
495
496
496
@app .route ('/limits/<string:user>' , methods = ['POST' ])
497
- @auth .oidc_auth ( 'sso' )
497
+ @auth .oidc_auth
498
498
def set_limits (user ):
499
499
if 'rtp' in session ['userinfo' ]['groups' ]:
500
500
cpu = request .form ['cpu' ]
@@ -507,7 +507,7 @@ def set_limits(user):
507
507
508
508
509
509
@app .route ('/user/<string:user>/delete' , methods = ['POST' ])
510
- @auth .oidc_auth ( 'sso' )
510
+ @auth .oidc_auth
511
511
def delete_user (user ):
512
512
if 'rtp' in session ['userinfo' ]['groups' ]:
513
513
connect_proxmox ()
@@ -518,7 +518,7 @@ def delete_user(user):
518
518
519
519
520
520
@app .route ('/settings' )
521
- @auth .oidc_auth ( 'sso' )
521
+ @auth .oidc_auth
522
522
def settings ():
523
523
user = User (session ['userinfo' ]['preferred_username' ])
524
524
if user .rtp :
@@ -537,7 +537,7 @@ def settings():
537
537
538
538
539
539
@app .route ('/pool/<string:pool>/ignore' , methods = ['POST' , 'DELETE' ])
540
- @auth .oidc_auth ( 'sso' )
540
+ @auth .oidc_auth
541
541
def ignored_pools (pool ):
542
542
if 'rtp' in session ['userinfo' ]['groups' ]:
543
543
if request .method == 'POST' :
@@ -550,7 +550,7 @@ def ignored_pools(pool):
550
550
551
551
552
552
@app .route ('/user/<string:user>/allow' , methods = ['POST' , 'DELETE' ])
553
- @auth .oidc_auth ( 'sso' )
553
+ @auth .oidc_auth
554
554
def allowed_users (user ):
555
555
if 'rtp' in session ['userinfo' ]['groups' ]:
556
556
if request .method == 'POST' :
@@ -591,15 +591,15 @@ def cleanup_vnc():
591
591
592
592
593
593
@app .route ('/template/<string:template_id>/disk' )
594
- @auth .oidc_auth ( 'sso' )
594
+ @auth .oidc_auth
595
595
def template_disk (template_id ):
596
596
if template_id == 'none' :
597
597
return '0'
598
598
return get_template_disk (db , template_id )
599
599
600
600
601
601
@app .route ('/template/<string:template_id>/edit' , methods = ['POST' ])
602
- @auth .oidc_auth ( 'sso' )
602
+ @auth .oidc_auth
603
603
def template_edit (template_id ):
604
604
if 'rtp' in session ['userinfo' ]['groups' ]:
605
605
name = request .form ['name' ]
@@ -611,7 +611,7 @@ def template_edit(template_id):
611
611
612
612
613
613
@app .route ('/logout' )
614
- @auth .oidc_logout ( 'sso' )
614
+ @auth .oidc_logout
615
615
def logout ():
616
616
return redirect (url_for ('list_vms' ), 302 )
617
617
0 commit comments