fix: error when freeipa transforms external trusted user name when adding them to a group #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #21
When adding a trusted to an external group, multiple formats are allowed
DOMAIN\User
,DOMAIN\group
,username@domain
and it is case insensitive.However the added name is transformed to a lowercase upn format
username@domain
When a transformation of the name happens during the add, the creation of the membership succeeds on freeipa but the read operation fails on the next step because there is a mismatch between the resource declaration and the response from freeipa.
With this fix, I check after creation that the name defined in the resource is defined as a member of the group responded by freeipa. If not, I delete the user membership in freeipa and exit without saving the resource in the state.
If the name is a member of the group, then, I continue as normal and save the resource in the state.
This is implemented only for external user group member ship.