#NEWLINE# def get_itoken( self , env ) : #NEWLINE# #INDENT# "Returns the current internal token to use for the auth system's own\n        actions with other services. Each process will create its own\n        itoken and the token will be deleted and recreated based on the\n        token_life configuration value. The itoken information is stored in\n        memcache because the auth process that is asked by Swift to validate\n        the token may not be the same as the auth process that created the\n        token.\n        " #NEWLINE# if ( ( not self . itoken ) or ( self . itoken_expires < time ( ) ) or ( env . get ( 'HTTP_X_AUTH_NEW_TOKEN' , 'false' ) . lower ( ) in TRUE_VALUES ) ) : #NEWLINE# #INDENT# self . itoken = ( '%sitk%s' % ( self . reseller_prefix , uuid4 ( ) . hex ) ) #NEWLINE# memcache_key = ( '%s/auth/%s' % ( self . reseller_prefix , self . itoken ) ) #NEWLINE# self . itoken_expires = ( time ( ) + self . token_life ) #NEWLINE# memcache_client = cache_from_env ( env ) #NEWLINE# if ( not self ) : #NEWLINE# #INDENT# raise Exception ( 'No memcache set up; required for Swauth middleware' ) #NEWLINE# #UNINDENT# memcache_client . set ( memcache_key , ( self . itoken_expires , ( '.auth,.reseller_admin,%s.auth' % self . reseller_prefix ) ) , time = self . token_life ) #NEWLINE# #UNINDENT# return self . itoken