Add organization member management APIs#23
Open
PatriQ94 wants to merge 1 commit intoBlack-Cockpit:masterfrom
Open
Add organization member management APIs#23PatriQ94 wants to merge 1 commit intoBlack-Cockpit:masterfrom
PatriQ94 wants to merge 1 commit intoBlack-Cockpit:masterfrom
Conversation
Author
|
@hasnimehdi91 Review please 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds organization member management endpoints to the
IKcOrganizationsAPI and fixes a serialization bug in the organization models that prevents organization operations from working against Keycloak 26+.Bug Fix
KcOrganizationandKcOrganizationDomainmodels usedSystem.Text.Jsonattributes ([JsonPropertyName]), but the HTTP client base serializes request bodies withNewtonsoft.Json(JsonConvert.SerializeObject), which ignores those attributes. This caused property names to serialize as PascalCase (e.g.,"Name"instead of"name"), resulting in400 Bad Requestfrom Keycloak:Invalid json representation for OrganizationRepresentation. Unrecognized field "Name"Fixed by switching the two organization model files to use
[JsonProperty]from Newtonsoft.Json, consistent with all other models in the library.New Features
Added 9 organization member management methods to
IKcOrganizations:AddMemberAsync/{realm}/organizations/{id}/membersGetMembersAsync/{realm}/organizations/{id}/membersGetMembersCountAsync/{realm}/organizations/{id}/members/countGetMemberAsync/{realm}/organizations/{id}/members/{memberId}RemoveMemberAsync/{realm}/organizations/{id}/members/{memberId}GetMemberOrganizationsAsync/{realm}/organizations/{id}/members/{memberId}/organizationsGetUserOrganizationsAsync/{realm}/organizations/members/{userId}/organizationsInviteExistingUserAsync/{realm}/organizations/{id}/members/invite-existing-userInviteUserAsync/{realm}/organizations/{id}/members/invite-userAdded
KcOrganizationMemberFiltermodel for paginated member queries (supportsfirst,max,search,exact,membershipType).Files Changed
KcOrganization.cs,KcOrganizationDomain.cs—[JsonPropertyName]→[JsonProperty](bug fix)IKcOrganizations.cs— 9 new method signaturesKcOrganizations.cs— 9 new method implementationsKcOrganizationMemberFilter.cs— new filter modelKcOrganizationMemberHappyPathTests.cs— integration tests covering the full member lifecycleTesting
All 21 organization tests pass against Keycloak 26.5.1 (existing 10 + new 11, with
InviteExistingUserskipped when SMTP is not configured).