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

fix(2fa): Handle twofactor_enforced configuration parameter as boolean #44090

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jlehtoranta
Copy link
Contributor

Summary

The twofactor_enforced configuration parameter should be handled as a boolean value like all the other boolean configuration parameters. This reduces configuration errors at least for those, who might edit config.php directly.

TODO

  • Should we migrate the string values to boolean on current installations? Or make getSystemValueBool return the correct value regardless if it's e.g. 'true' or true?

Checklist

Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

Fine by me, but didn't take the time to see if that behaves well on updates

@miaulalala miaulalala removed their request for review March 13, 2024 11:32
@susnux susnux added this to the Nextcloud 30 milestone Apr 18, 2024
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution.

However, this will break existing installations that are using a string, e.g. "false" will evaluate to true when cast to a boolean. I get where you are coming from but let's not refactor what is not broken. I don't know if it is a good idea to migrate config.php files.

Code example: https://3v4l.org/HMTpE

@nickvergessen
Copy link
Member

However, this will break existing installations that are using a string, e.g. "false" will evaluate to true when cast to a boolean.

I always thought getSystemValueBool would cover that....
It definetly should from my POV?

@st3iny
Copy link
Member

st3iny commented Jun 7, 2024

The current implementation is a bit naive: https://github.com/nextcloud/server/blob/master/lib%2Fprivate%2FAllConfig.php#L111

This was referenced Jul 30, 2024
@Altahrim Altahrim mentioned this pull request Aug 5, 2024
@skjnldsv skjnldsv added 2. developing Work in progress stale Ticket or PR with no recent activity and removed 3. to review Waiting for reviews labels Aug 6, 2024
@Altahrim Altahrim mentioned this pull request Aug 7, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress feature: settings stale Ticket or PR with no recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants