-
Notifications
You must be signed in to change notification settings - Fork 18
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
roles: keycloak role user mgt and kcadm updates #100
Conversation
6cfcbfa
to
828c66f
Compare
828c66f
to
cf19b68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG2M
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, see comments inside.
By the way, you say you add raise_on_error parameter, but I don't see it anywhere. Did you change your mind?
cf19b68
to
716a5a8
Compare
c24a3d5
to
1306baa
Compare
1306baa
to
a4933ef
Compare
a4933ef
to
eb1463a
Compare
eb1463a
to
ad3783c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to implement get() also for groups and unify the id property for both objects? I.e.:
@property
def id(self) -> str:
if self._id is None:
obj = self.get()
self._id = obj["id"]
return self._id
@id.setter
def id(self, value: str) --> None:
self._id = value
This way, you can avoid calling get() from the user's constructor when it is not needed for new users and both classes would handle it the same way.
ad3783c
to
6b5c25a
Compare
@pbrezina I updated the KeycloakGroup to add a get() method and modified the id setting. Let me know what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, now we need one more thing - since you call get() from KeycloackObject, you need to add it as abstract method there. E.g.
from abc import ABC, abstractmethod
class KeycloakObject(ABC, BaseObject[KeycloakHost, Keycloak]):
@abstractmethod
def get(self) -> dict[str, list[str]]:
"""docstring"""
pass
To avoid sssd_test_framework/roles/keycloak.py:100: error: "KeycloakObject" has no attribute "get" [attr-defined]
Remove the commented lines and we can merge.
eded39c
to
da39b9a
Compare
da39b9a
to
c432aef
Compare
@pbrezina, I added abstract get() method to KeycloakObject class and removed comments I found. Anything else for this one? I just pushed a fix for the tox error also. |
c432aef
to
7372cb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, thank you.
Adding new methods to KeycloakUser class to extend user management support: delete, modify, set_password Also update docstrings for kcadm to reflect that it returns SSHProcessResult. Also updating keycloak user add to include first and last name attributes.
* first/last name attributes for IPA/AD/LDAP User modify methods. * password_expiration to IPA User modify method * external IdP attributes to IPA User modify method * Do not fail if users OU already exists in LDAP * add ability to override the rdn user attribute from cn * add givenName attribute for LDAP users
7372cb3
to
20ec6e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
Adding new methods to KeycloakUser class to extend user management support: delete, modify, set_password
Adding raise_on_error parameter to KeycloakUser methods so that they can be called for expected failure scenarios. This required adding raise_on_error to kcadm exec call.