Пример #1
0
def _get_domain_mappings(module):
    domainMappings = list()

    for domainMapping in module.params['domain_mappings']:
        domainMappings.append(
            otypes.RegistrationDomainMapping(
                from_=otypes.Domain(name=domainMapping['source_name'], )
                if domainMapping['source_name'] else None,
                to=otypes.Domain(name=domainMapping['dest_name'], )
                if domainMapping['dest_name'] else None,
            ))
    return domainMappings
Пример #2
0
 def build_entity(self):
     return otypes.User(
         domain=otypes.Domain(name=self._module.params['authz_name']),
         user_name=username(self._module),
         principal=self._module.params['name'],
         namespace=self._module.params['namespace'],
     )
Пример #3
0
 def build_entity(self):
     return otypes.Group(
         domain=otypes.Domain(
             name=self._module.params['authz_name']
         ),
         name=self._module.params['name'],
         namespace=self._module.params['namespace'],
     )
def test_add_ldap_user(engine_api):
    engine = engine_api.system_service()
    users_service = engine.users_service()
    with engine_utils.wait_for_event(engine, 149):  # USER_ADD(149)
        users_service.add(
            types.User(
                user_name=AAA_LDAP_USER,
                domain=types.Domain(name=AAA_LDAP_AUTHZ_PROVIDER),
            ), )
def test_add_ldap_group(engine_api):
    engine = engine_api.system_service()
    groups_service = engine.groups_service()
    with engine_utils.wait_for_event(engine, 149):  # USER_ADD(149)
        groups_service.add(
            types.Group(
                name=AAA_LDAP_GROUP,
                domain=types.Domain(name=AAA_LDAP_AUTHZ_PROVIDER),
            ), )
Пример #6
0
def add_ldap_group(api):
    engine = api.system_service()
    groups_service = engine.groups_service()

    groups_service.add(
        types.Group(
            name=AAA_LDAP_GROUP,
            domain=types.Domain(
                name=AAA_LDAP_AUTHZ_PROVIDER
            ),
        ),
    )
Пример #7
0
def test_add_ldap_group(api_v4):
    engine = api_v4.system_service()
    groups_service = engine.groups_service()
    with test_utils.TestEvent(engine, 149): # USER_ADD(149)
        groups_service.add(
            types.Group(
                name=AAA_LDAP_GROUP,
                domain=types.Domain(
                    name=AAA_LDAP_AUTHZ_PROVIDER
                ),
            ),
        )
Пример #8
0
def test_add_ldap_user(api_v4):
    engine = api_v4.system_service()
    users_service = engine.users_service()
    with test_utils.TestEvent(engine, 149): # USER_ADD(149)
        users_service.add(
            types.User(
                user_name=AAA_LDAP_USER,
                domain=types.Domain(
                    name=AAA_LDAP_AUTHZ_PROVIDER
                ),
            ),
        )
Пример #9
0
logging.basicConfig(level=logging.DEBUG, filename='example.log')

# This example will connect to the server and add a group from a directory service:
# Create the connection to the server:
connection = sdk.Connection(
    url='https://engine40.example.com/ovirt-engine/api',
    username='******',
    password='******',
    ca_file='ca.pem',
    debug=True,
    log=logging.getLogger(),
)

# Get the reference to the groups service:
groups_service = connection.system_service().groups_service()

# Use the "add" method to add group from a directory service.
# Please note that domain name is name of the authorization provider (authz):
group = groups_service.add(
    types.Group(
        name='mygroup',
        domain=types.Domain(
            name='internal-authz'
        ),
    ),
)

# Close the connection to the server:
connection.close()
Пример #10
0
def engine_user_domain(keycloak_enabled):
    if keycloak_enabled:
        return types.Domain(name='internalkeycloak-authz')

    # use legacy AAA authentication for rhel
    return types.Domain(name='internal-authz')