'Transform assertion to a dictionary.
The dictionary contains mapping of user name and group ids
based on mapping rules.
This function will iterate through the mapping rules to find
assertions that are valid.
:param assertion_data: an assertion containing values from an IdP
:type assertion_data: dict
Example assertion_data::
\'Email\': \'testacct@example.com\',
\'UserName\': \'testacct\',
\'FirstName\': \'Test\',
\'LastName\': \'Account\',
\'orgPersonType\': \'Tester\'
:returns: dictionary with user and group_ids
The expected return structure is::
\'name\': \'foobar\',
\'group_ids\': [\'abc123\', \'def456\'],
\'group_names\': [
\'name\': \'group_name_1\',
\'domain\': {
\'name\': \'domain1\'
\'name\': \'group_name_1_1\',
\'domain\': {
\'name\': \'domain1\'
\'name\': \'group_name_2\',
\'domain\': {
\'id\': \'xyz132\''

def process(self, assertion_data):

    LOG.debug('assertion    data:    %s', assertion_data)
    assertion = {n: v.split(';') for (n, v) in assertion_data.items() if isinstance(v, six.string_types)}
    LOG.debug('assertion:    %s', assertion)
    identity_values = []
    LOG.debug('rules:    %s', self.rules)
    for rule in self.rules:
        direct_maps = self._verify_all_requirements(rule['remote'], assertion)
        if (direct_maps is None):
            continue
        if (not direct_maps):
            identity_values += rule['local']
        else:
            for local in rule['local']:
                new_local = self._update_local_mapping(local, direct_maps)
                identity_values.append(new_local)
    LOG.debug('identity_values:    %s', identity_values)
    mapped_properties = self._transform(identity_values)
    LOG.debug('mapped_properties:    %s', mapped_properties)
    return mapped_properties
