示例#1
0
文件: rpc.py 项目: apophys/freeipa
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)
示例#2
0
    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)
示例#3
0
文件: rpc.py 项目: shanyin/freeipa
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)
示例#4
0
    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)
示例#5
0
    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)
示例#6
0
    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)
示例#7
0
文件: rpc.py 项目: AvidehST/freeipa
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??)
示例#8
0
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))