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

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

Merged
merged 5 commits into from
Jan 30, 2025

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jan 18, 2025

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
Copy link
Member

@juliusknorr juliusknorr left a comment

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 👍

* 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 <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
@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
46 of 49 checks passed
@susnux susnux deleted the feat/support-password-context branch January 30, 2025 15:34
@susnux
Copy link
Contributor Author

susnux commented Jan 30, 2025

/backport to stable31

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
3 participants