Revision e09fdcfa lib/http/auth.py
b/lib/http/auth.py | ||
---|---|---|
166 | 166 |
# Unsupported authentication scheme |
167 | 167 |
return False |
168 | 168 |
|
169 |
def _CheckBasicAuthorization(self, req, input):
|
|
169 |
def _CheckBasicAuthorization(self, req, in_data):
|
|
170 | 170 |
"""Checks credentials sent for basic authentication. |
171 | 171 |
|
172 | 172 |
@type req: L{http.server._HttpServerRequest} |
173 | 173 |
@param req: HTTP request context |
174 |
@type input: str
|
|
175 |
@param input: Username and password encoded as Base64
|
|
174 |
@type in_data: str
|
|
175 |
@param in_data: Username and password encoded as Base64
|
|
176 | 176 |
@rtype: bool |
177 | 177 |
@return: Whether user is allowed to execute request |
178 | 178 |
|
179 | 179 |
""" |
180 | 180 |
try: |
181 |
creds = base64.b64decode(input.encode('ascii')).decode('ascii')
|
|
181 |
creds = base64.b64decode(in_data.encode('ascii')).decode('ascii')
|
|
182 | 182 |
except (TypeError, binascii.Error, UnicodeError): |
183 | 183 |
logging.exception("Error when decoding Basic authentication credentials") |
184 | 184 |
return False |
Also available in: Unified diff