MCPcopy Index your code
hub / github.com/pyload/pyload / parse_auth

Function parse_auth

module/lib/bottle.py:1878–1887  ·  view source on GitHub ↗

Parse rfc2617 HTTP authentication header string (basic) and return (user,pass) tuple or None

(header)

Source from the content-addressed store, hash-verified

1876
1877
1878def parse_auth(header):
1879 """ Parse rfc2617 HTTP authentication header string (basic) and return (user,pass) tuple or None"""
1880 try:
1881 method, data = header.split(None, 1)
1882 if method.lower() == 'basic':
1883 #TODO: Add 2to3 save base64[encode/decode] functions.
1884 user, pwd = touni(base64.b64decode(tob(data))).split(':',1)
1885 return user, pwd
1886 except (KeyError, ValueError):
1887 return None
1888
1889
1890def _lscmp(a, b):

Callers 1

authMethod · 0.85

Calls 3

touniFunction · 0.85
tobFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected