def testSignedSharedAuthBackendFromUser(self): """ ensure we can build a cookie string for a user """ self.assertEqual( signed.loads(SharedAuthBackend.getCookieStr(self.user)), signed.loads(self.signed_str))
def userFromSignedStr(signed_str): """ encode a sign a string """ dct = signed.loads(signed_str) should_continue = True extra_params_consumer = getattr(settings, 'EXTRA_PARAMS_CONSUMER', None) if extra_params_consumer: extra_params_consumer = get_callable(extra_params_consumer) try: should_continue, user = extra_params_consumer(dct['u'], dct['extra_params']) except KeyError, e: logger.warning('Invalid signed_str data: %s' % e) should_continue = False
def userFromSignedStr(signed_str): """ encode a sign a string """ dct = signed.loads(signed_str) should_continue = True extra_params_consumer = getattr(settings, 'EXTRA_PARAMS_CONSUMER', None) if extra_params_consumer: extra_params_consumer = get_callable(extra_params_consumer) try: should_continue, user = extra_params_consumer(dct['u'], dct['extra_params']) except KeyError, e: if LOGGIN: logger.warning('Invalid signed_str data: %s' % e) should_continue = False
def userFromSignedStr(signed_str): """ encode a sign a string """ logger.debug('extracting user record from signed cookie') dct = signed.loads(signed_str) should_continue = True extra_params_consumer = getattr(settings, 'EXTRA_PARAMS_CONSUMER', None) if extra_params_consumer: logger.debug('1 attempting to execute EXTRA_PARAMS_CONSUMER %s'%(extra_params_consumer)) extra_params_consumer = get_callable(extra_params_consumer) try: should_continue, user = extra_params_consumer(dct['u'], dct['extra_params']) except KeyError, e: logger.warning('Invalid signed_str data: %s' % e) should_continue = False logger.debug('2 completed execution of EXTRA_PARAMS_CONSUMER %s'%(extra_params_consumer))
def userFromSignedStr(signed_str): """ encode a sign a string """ if LOGGIN: logger.debug('extracting user record from signed cookie') dct = signed.loads(signed_str) should_continue = True extra_params_consumer = getattr(settings, 'EXTRA_PARAMS_CONSUMER', None) if extra_params_consumer: if LOGGIN: logger.debug('1 attempting to execute EXTRA_PARAMS_CONSUMER %s'%(extra_params_consumer)) extra_params_consumer = get_callable(extra_params_consumer) try: should_continue, user = extra_params_consumer(dct['u'], dct['extra_params']) except KeyError, e: if LOGGIN: logger.warning('Invalid signed_str data: %s' % e) should_continue = False if LOGGIN: logger.debug('2 completed execution of EXTRA_PARAMS_CONSUMER %s'%(extra_params_consumer))
def userFromSignedStr(signed_str): """ encode a sign a string """ return SharedAuthBackend.userFromDict(signed.loads(signed_str))
def testSignedSharedAuthBackendFromUser(self): """ ensure we can build a cookie string for a user """ self.assertEqual(signed.loads(SharedAuthBackend.getCookieStr(self.user)), signed.loads(self.signed_str))