-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: Allow to configure different policies per password context #717
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* Add support for multiple password policies (per context) * Split Vue files into components * Use Typescript (also for the script part of Vue files) Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
d87ea09
to
f3d9920
Compare
public function getMinLength(): int { | ||
return max(0, $this->appConfig->getValueInt(Application::APP_ID, 'minLength', 10)); | ||
public function getMinLength(?PasswordContext $context = null): int { | ||
$key = $this->getScopedAppConfig('minLength', $context); |
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.
Do I get this right that there is now only the scoped policies and no longer one default policy? If we do that we should add a migration step for existing configs. Otherwise we could have a default policy and fall back to that if no custom one is configured
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.
That is what is done, if e.g. there is no policy for sharing the default one is applied.
The server already emits the events with password context information (new with Nextcloud 31), so this implements the support to configure different policies for different contexts.
For the reviewers: Please first check the backend stuff - if there is anything we need to adjust we should do this first before adjusting the frontend.
Summary
Possible improvement
Maybe it would be easier to make the server enum backed with the string value.
That would remove 2 functions here and make some functions easier.