File tree Expand file tree Collapse file tree 3 files changed +39
-27
lines changed Expand file tree Collapse file tree 3 files changed +39
-27
lines changed Original file line number Diff line number Diff line change @@ -449,18 +449,22 @@ def ecp(self):
449
449
try :
450
450
authz_info = self .environ ["HTTP_AUTHORIZATION" ]
451
451
if authz_info .startswith ("Basic " ):
452
- _info = base64 .b64decode (authz_info [6 :])
453
- logger .debug ("Authz_info: %s" % _info )
454
452
try :
455
- (user , passwd ) = _info .split (":" )
456
- if PASSWD [user ] != passwd :
457
- resp = Unauthorized ()
458
- self .user = user
459
- self .environ [
460
- "idp.authn" ] = AUTHN_BROKER .get_authn_by_accr (
461
- PASSWORD )
462
- except ValueError :
453
+ _info = base64 .b64decode (authz_info [6 :])
454
+ except TypeError :
463
455
resp = Unauthorized ()
456
+ else :
457
+ logger .debug ("Authz_info: %s" % _info )
458
+ try :
459
+ (user , passwd ) = _info .split (":" )
460
+ if PASSWD [user ] != passwd :
461
+ resp = Unauthorized ()
462
+ self .user = user
463
+ self .environ [
464
+ "idp.authn" ] = AUTHN_BROKER .get_authn_by_accr (
465
+ PASSWORD )
466
+ except ValueError :
467
+ resp = Unauthorized ()
464
468
else :
465
469
resp = Unauthorized ()
466
470
except KeyError :
Original file line number Diff line number Diff line change @@ -419,18 +419,22 @@ def ecp(self):
419
419
try :
420
420
authz_info = self .environ ["HTTP_AUTHORIZATION" ]
421
421
if authz_info .startswith ("Basic " ):
422
- _info = base64 .b64decode (authz_info [6 :])
423
- logger .debug ("Authz_info: %s" % _info )
424
422
try :
425
- (user , passwd ) = _info .split (":" )
426
- if PASSWD [user ] != passwd :
427
- resp = Unauthorized ()
428
- self .user = user
429
- self .environ [
430
- "idp.authn" ] = AUTHN_BROKER .get_authn_by_accr (
431
- PASSWORD )
432
- except ValueError :
423
+ _info = base64 .b64decode (authz_info [6 :])
424
+ except TypeError :
433
425
resp = Unauthorized ()
426
+ else :
427
+ logger .debug ("Authz_info: %s" % _info )
428
+ try :
429
+ (user , passwd ) = _info .split (":" )
430
+ if PASSWD [user ] != passwd :
431
+ resp = Unauthorized ()
432
+ self .user = user
433
+ self .environ [
434
+ "idp.authn" ] = AUTHN_BROKER .get_authn_by_accr (
435
+ PASSWORD )
436
+ except ValueError :
437
+ resp = Unauthorized ()
434
438
else :
435
439
resp = Unauthorized ()
436
440
except KeyError :
Original file line number Diff line number Diff line change @@ -406,15 +406,19 @@ def ecp(self):
406
406
try :
407
407
authz_info = self .environ ["HTTP_AUTHORIZATION" ]
408
408
if authz_info .startswith ("Basic " ):
409
- _info = base64 .b64decode (authz_info [6 :])
410
- logger .debug ("Authz_info: %s" % _info )
411
409
try :
412
- (user , passwd ) = _info .split (":" )
413
- if PASSWD [user ] != passwd :
414
- resp = Unauthorized ()
415
- self .user = user
416
- except ValueError :
410
+ _info = base64 .b64decode (authz_info [6 :])
411
+ except TypeError :
417
412
resp = Unauthorized ()
413
+ else :
414
+ logger .debug ("Authz_info: %s" % _info )
415
+ try :
416
+ (user , passwd ) = _info .split (":" )
417
+ if PASSWD [user ] != passwd :
418
+ resp = Unauthorized ()
419
+ self .user = user
420
+ except (ValueError , TypeError ):
421
+ resp = Unauthorized ()
418
422
else :
419
423
resp = Unauthorized ()
420
424
except KeyError :
You can’t perform that action at this time.
0 commit comments