Skip to content

Realm role mapping support#233

Merged
treydock merged 6 commits intotreydock:masterfrom
Puppet-Finland:realm_role_mapping
Feb 10, 2022
Merged

Realm role mapping support#233
treydock merged 6 commits intotreydock:masterfrom
Puppet-Finland:realm_role_mapping

Conversation

@mattock
Copy link
Contributor

@mattock mattock commented Jan 13, 2022

This is simplified version of the earlier PR (#175). All it does is add realm role mapping support for users and groups.

@mattock
Copy link
Contributor Author

mattock commented Jan 13, 2022

I will add tests next.

@mattock mattock force-pushed the realm_role_mapping branch from 1ee89de to e5dc537 Compare January 14, 2022 07:43
@treydock
Copy link
Owner

The tests be good to add is unit test for provider and more importantly the acceptance tests. The code changes look good.

@mattock
Copy link
Contributor Author

mattock commented Jan 20, 2022

Acceptance tests added. As getting role mappings for users and groups took more than one command I created a Ruby wrapper script that provides role mappings in a format the tests can easily use.

@mattock
Copy link
Contributor Author

mattock commented Jan 24, 2022

I'll look into the provider tests this week. I've never had to implement them, so wish me luck :).

Samuli Seppänen and others added 6 commits February 10, 2022 14:17
This is required for cases where a JSON file is not passed in as input. Some
examples are get-roles and add-roles.

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
This new type allows attaching client and realm roles into users and groups.
Using the normal JSON payload approach ended up being overly complex as well as
much less performant than this simplistic approach.

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
This is required for provider tests because the realm_roles method has to be
mocked, which means the instance variable won't be populated at all.

Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
Signed-off-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
@mattock
Copy link
Contributor Author

mattock commented Feb 10, 2022

Simple provider tests added. I've never written any before, so feedback is welcome. But at least the relevant codepaths (imho) are being exercised. I had to make a minor change to the provider code to make the tests work, but it should not have any behavioral impact.

@treydock treydock merged commit 681d3fa into treydock:master Feb 10, 2022
@treydock
Copy link
Owner

@mattock Thanks! This will be released as v7.13.0 once Github Actions complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants