-
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, adding default domain password policy management #139
base: master
Are you sure you want to change the base?
Conversation
6ce3b2f
to
a0156fe
Compare
e63f374
to
fe86c02
Compare
super().__init__(role) | ||
|
||
def complexity(self, enable: bool) -> ADPasswordPolicy: | ||
""" |
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.
I'm not sure whether this documentation is needed if it is already present in the superclass.
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.
I'm going to change this back to a @property
, so it's not instantiated with every call, I forgot about that and I will put usage examples in that docstring.
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.
Making this function a property will not allow you to return a ADPasswordPolicy
object (self) in order to chain method invocations. I have nothing against it, but it doesn't align with the rest of your code. Do as you want.
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.
Ah that explains something I didn't quite understand. I made this decision change because it wouldn't automatically instantiate the object, but I do want the other behavior so I will change this back.
"minclasses": (self.cli.option.VALUE, 5), | ||
"priority": (self.cli.option.VALUE, 1), | ||
} | ||
self._add(attrs) |
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.
Why are you calling self._add()
here but self._modify()
in the else
section?
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.
It's the way the command is constructed. IPARole._add
is ipa pwpolicy add
, while IPARole._modify
is ipa pwpolicy modify
. If enabled, we are adding the values that don't exist, to disable it, we are modifying the existing values.
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.
What happens if the test has code like this?
ipp = IPAPasswordPolicy(...)
...
ipp.complexity(true)
...
ipp.complexity(false)
...
ipp.complexity(true)
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.
Nice catch, I'll go ahead and add something to check to see if the attribute exists and decide which function to use.
fe86c02
to
41c9628
Compare
3eab089
to
13eef9b
Compare
The tests are passing locally.
|
13eef9b
to
10992d0
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.
Going to put this on hold until after the holidays, but noted the changes I need to make when I get back.
"minclasses": (self.cli.option.VALUE, 5), | ||
"priority": (self.cli.option.VALUE, 1), | ||
} | ||
self._add(attrs) |
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.
Nice catch, I'll go ahead and add something to check to see if the attribute exists and decide which function to use.
Tests PR, SSSD/sssd#7728
This PR is larger than I expected.
misc.py
authentication.py
roles/ad.py, roles/ipa.py, roles/samba.py, roles/ldap.py
roles/generic.py