Skip to content

feat: Allow to configure different policies per password context#717

Merged
susnux merged 5 commits into
masterfrom
feat/support-password-context
Jan 30, 2025
Merged

feat: Allow to configure different policies per password context#717
susnux merged 5 commits into
masterfrom
feat/support-password-context

Conversation

@susnux

@susnux susnux commented Jan 18, 2025

Copy link
Copy Markdown
Contributor

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

  • The validators and generator classes just got a new optional parameter for the password context
  • The config now supports the context parameter as well allowing to get different values for different contexts
    • The context specific values are saved with the context as the suffix in the app settings
  • The new policies are provided by the capabilities
    • No need to duplicate as initial state, so only access it via capabilities

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.

@susnux susnux added this to the Nextcloud 31 milestone Jan 18, 2025
@susnux
susnux force-pushed the feat/support-password-context branch from d87ea09 to f3d9920 Compare January 18, 2025 15:01
@susnux susnux changed the title Feat/support password context feat: Allow to configure different policies per password context Jan 18, 2025
Comment thread lib/PasswordPolicyConfig.php

@juliusknorr juliusknorr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, changes seem good and I also gave some smoke test 👍

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>
@susnux
susnux force-pushed the feat/support-password-context branch from f3d9920 to 0290c4f Compare January 30, 2025 14:43
@susnux
susnux merged commit 22825bb into master Jan 30, 2025
@susnux
susnux deleted the feat/support-password-context branch January 30, 2025 15:34
@susnux

susnux commented Jan 30, 2025

Copy link
Copy Markdown
Contributor Author

/backport to stable31

@skjnldsv skjnldsv modified the milestones: Nextcloud 33, Nextcloud 32 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different share link password policy

4 participants