#NEWLINE# def discovery_endpoint( self , request , handle = None , **kwargs ) : #NEWLINE# #INDENT# '\n        :param request:\n        :param handle:\n        ' #NEWLINE# _log_debug = logger . debug #NEWLINE# _log_debug ( '@discovery_endpoint' ) #NEWLINE# request = DiscoveryRequest ( ) . deserialize ( request , 'urlencoded' ) #NEWLINE# _log_debug ( ( 'discovery_request:%s' % ( request . to_dict ( ) , ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# assert ( request [ 'service' ] == SWD_ISSUER ) #NEWLINE# #UNINDENT# except AssertionError : #NEWLINE# #INDENT# return BadRequest ( 'Unsupported service' ) #NEWLINE# #UNINDENT# _response = DiscoveryResponse ( locations = [ self . baseurl ] ) #NEWLINE# _log_debug ( ( 'discovery_response:%s' % ( _response . to_dict ( ) , ) ) ) #NEWLINE# headers = [ ( 'Cache-Control' , 'no-store' ) ] #NEWLINE# ( key , timestamp ) = handle #NEWLINE# if ( key . startswith ( STR ) and key . endswith ( STR ) ) : #NEWLINE# #INDENT# cookie = self . cookie_func ( key , _response . cookie_name , 'disc' , self . sso_ttl ) #NEWLINE# headers . append ( cookie ) #NEWLINE# #UNINDENT# return Response ( _response . to_json ( ) , content = 'application/json' , headers = headers )