def parse_http_basic(authorization_header):
 (auth_scheme, auth_token) = require_split(authorization_header, 2)
 require((auth_scheme.lower() == 'basic'))
 try:
  auth_data = base64.b64decode(auth_token)
 except TypeError:
  raise RequirementException
 return require_split(auth_data, 2, ':')

def parse_http_basic ( authorization_header ) : ( auth_scheme , auth_token ) = require_split ( authorization_header , 2 ) require ( ( auth_scheme . lower ( ) == 'basic' ) ) try : auth_data = base64 . b64decode ( auth_token ) except TypeError : raise RequirementException return require_split ( auth_data , 2 , ':' )
parse the username/credentials out of an http basic auth header .