Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycloak::types::UnmanagedAttributePolicy has incorrect serialization #126

Closed
1 task
vipul43 opened this issue Aug 1, 2024 · 0 comments · Fixed by #127
Closed
1 task

keycloak::types::UnmanagedAttributePolicy has incorrect serialization #126

vipul43 opened this issue Aug 1, 2024 · 0 comments · Fixed by #127
Assignees
Milestone

Comments

@vipul43
Copy link

vipul43 commented Aug 1, 2024

Area

admin/api

Describe the bug

To access PUT /admin/realms/{realm}/users/profile endpoint of Keycloak Admin Rest API, the required body parameter is UPConfig(Described here). Which has a parameter unmanagedAttributePolicy, and its allowed values are ENABLED, ADMIN_EDIT, ADMIN_VIEW. But keycloak::types::UnmanagedAttributePolicy does not have appropriate serialization, it gets serialized to Enabled, AdminView, AdminEdit which results in a 400 status code from the keycloak endpoint.

Version

25.0.0

Regression

  • The issue is a regression

Expected behavior

https://docs.rs/keycloak/latest/keycloak/types/enum.UnmanagedAttributePolicy.html# should be serialized to SCREAMING_SNAKE_CASE

Actual behavior

https://docs.rs/keycloak/latest/keycloak/types/enum.UnmanagedAttributePolicy.html# is serialized to PascalCase

How to Reproduce?

Make request to GET {{keycloak_url}}/admin/realms/{{realm}}/users/profile, which returns the UPConfig object.
Make request to PUT {{keycloak_urll}}/admin/realms/{{realm}}/users/profile, with body as the UPConfig object fetched in the above request, and changing the unmanagedAttributePolicy value to Enabled or AdminEdit or AdminView

@kilork kilork self-assigned this Aug 1, 2024
@kilork kilork linked a pull request Aug 1, 2024 that will close this issue
@kilork kilork added this to the 25.0.200 milestone Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants