(request_handler)
| 73 | |
| 74 | |
| 75 | def find_basic_auth_username(request_handler): |
| 76 | auth_header = request_handler.request.headers.get('Authorization') |
| 77 | if (auth_header is None) or (not auth_header.lower().startswith('basic ')): |
| 78 | return None |
| 79 | |
| 80 | encoding = sys.getdefaultencoding() |
| 81 | credential_bytes = base64.b64decode(auth_header[6:]) |
| 82 | credentials = credential_bytes.decode(encoding) |
| 83 | username = credentials.split(':')[0] |
| 84 | |
| 85 | return username |
| 86 | |
| 87 | |
| 88 | def get_audit_username(all_audit_names): |
no test coverage detected