def update_persistent_client_session_data(principal, data): """ Given a principal create or update the session data for that principal in the persistent secure storage. Raises ValueError if unable to perform the action for any reason. """ try: keyname = client_session_keyring_keyname(principal) except Exception as e: raise ValueError(str(e)) # kernel_keyring only raises ValueError (why??) kernel_keyring.update_key(keyname, data)
def test_04(self): """ Update the value in a key """ kernel_keyring.update_key(TEST_KEY, UPDATE_VALUE) result = kernel_keyring.read_key(TEST_KEY) assert(result == UPDATE_VALUE) # Now update it 10 times for i in xrange(10): kernel_keyring.update_key(TEST_KEY, 'test %d' % i) result = kernel_keyring.read_key(TEST_KEY) assert(result == 'test %d' % i) kernel_keyring.del_key(TEST_KEY)
def update_persistent_client_session_data(principal, data): ''' Given a principal create or update the session data for that principal in the persistent secure storage. Raises ValueError if unable to perform the action for any reason. ''' try: keyname = client_session_keyring_keyname(principal) except Exception as e: raise ValueError(str(e)) # kernel_keyring only raises ValueError (why??) kernel_keyring.update_key(keyname, data)
def test_04(self): """ Update the value in a key """ kernel_keyring.update_key(TEST_KEY, UPDATE_VALUE) result = kernel_keyring.read_key(TEST_KEY) assert (result == UPDATE_VALUE) # Now update it 10 times for i in xrange(10): kernel_keyring.update_key(TEST_KEY, 'test %d' % i) result = kernel_keyring.read_key(TEST_KEY) assert (result == 'test %d' % i) kernel_keyring.del_key(TEST_KEY)
def test_04(self): """ Update the value in a key """ kernel_keyring.update_key(TEST_KEY, UPDATE_VALUE) result = kernel_keyring.read_key(TEST_KEY) assert (result == UPDATE_VALUE) # Now update it 10 times for i in range(10): value = ('test %d' % i).encode('ascii') kernel_keyring.update_key(TEST_KEY, value) result = kernel_keyring.read_key(TEST_KEY) assert (result == value) kernel_keyring.del_key(TEST_KEY)
def test_04(self): """ Update the value in a key """ kernel_keyring.update_key(TEST_KEY, UPDATE_VALUE) result = kernel_keyring.read_key(TEST_KEY) assert(result == UPDATE_VALUE) # Now update it 10 times for i in range(10): value = ('test %d' % i).encode('ascii') kernel_keyring.update_key(TEST_KEY, value) result = kernel_keyring.read_key(TEST_KEY) assert(result == value) kernel_keyring.del_key(TEST_KEY)
def update_persistent_client_session_data(principal, data): ''' Given a principal create or update the session data for that principal in the persistent secure storage. Raises ValueError if unable to perform the action for any reason. ''' try: keyname = client_session_keyring_keyname(principal) except Exception, e: raise ValueError(str(e)) # kernel_keyring only raises ValueError (why??) kernel_keyring.update_key(keyname, data) def read_persistent_client_session_data(principal): ''' Given a principal return the stored session data for that principal from the persistent secure storage. Raises ValueError if unable to perform the action for any reason. ''' try: keyname = client_session_keyring_keyname(principal) except Exception, e: raise ValueError(str(e)) # kernel_keyring only raises ValueError (why??)
def update_persistent_client_session_data(principal, data): ''' Given a principal create or update the session data for that principal in the persistent secure storage. Raises ValueError if unable to perform the action for any reason. ''' try: keyname = client_session_keyring_keyname(principal) except Exception, e: raise ValueError(str(e)) # kernel_keyring only raises ValueError (why??) kernel_keyring.update_key(keyname, data) def read_persistent_client_session_data(principal): ''' Given a principal return the stored session data for that principal from the persistent secure storage. Raises ValueError if unable to perform the action for any reason. ''' try: keyname = client_session_keyring_keyname(principal) except Exception, e: raise ValueError(str(e))