#NEWLINE# @ staticmethod #NEWLINE# def _get_credentials( request ) : #NEWLINE# #INDENT# authorization = AUTHORIZATION ( request . environ ) #NEWLINE# try : #NEWLINE# #INDENT# ( authmeth , auth ) = authorization . split ( ' ' , 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( authmeth . lower ( ) == 'basic' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# auth = auth . strip ( ) . decode ( 'base64' ) #NEWLINE# #UNINDENT# except binascii . Error : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( login , password ) = auth . split ( ':' , 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'login' : login , #NEWLINE# 'password' : authorization , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return None