Skip to content

Document SECURITY_TWO_FACTOR and related 2FA config settings#2340

Merged
Flix6x merged 1 commit into
FlexMeasures:mainfrom
sankalpsthakur:docs/security-two-factor-config
Jul 22, 2026
Merged

Document SECURITY_TWO_FACTOR and related 2FA config settings#2340
Flix6x merged 1 commit into
FlexMeasures:mainfrom
sankalpsthakur:docs/security-two-factor-config

Conversation

@sankalpsthakur

@sankalpsthakur sankalpsthakur commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

  • Document SECURITY_TWO_FACTOR in documentation/configuration.rst (Security section)
  • Document closely related 2FA settings: enabled methods, always-validate / login validity, rescue mail, TOTP issuer
  • Cross-link the existing installation walkthrough and note that SECURITY_TOTP_SECRETS is required when 2FA is on
  • Added changelog item in documentation/changelog.rst

Look & Feel

New entries under Security in the configuration docs (same style as SECURITY_TOKEN_* / SECURITY_TOTP_SECRETS):

  • SECURITY_TWO_FACTOR
  • SECURITY_TWO_FACTOR_ENABLED_METHODS
  • SECURITY_TWO_FACTOR_ALWAYS_VALIDATE
  • SECURITY_TWO_FACTOR_LOGIN_VALIDITY
  • SECURITY_TWO_FACTOR_RESCUE_MAIL
  • SECURITY_TOTP_ISSUER

SECURITY_TOTP_SECRETS already had a section; it now notes that it is required when SECURITY_TWO_FACTOR is enabled.

How to test

Docs-only change. Spot-check the rendered Security section of the configuration docs, or:

# if docs deps are available
uv run poe update-docs
# then open documentation/_build/html/configuration.html

Further Improvements

None planned.

Related Items

Fixes #1760


Sign-off

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

@Flix6x Flix6x added the documentation Improvements or additions to documentation label Jul 22, 2026
@Flix6x Flix6x added this to the 1.0.0 milestone Jul 22, 2026
@Flix6x
Flix6x self-requested a review July 22, 2026 13:36
@sankalpsthakur
sankalpsthakur force-pushed the docs/security-two-factor-config branch from 9cc4a93 to 28f80c2 Compare July 22, 2026 13:49
Add configuration reference entries for two-factor authentication
settings that were only covered in the installation guide. Link the
new entries to a dedicated installation walkthrough anchor and reference
only the PR in the changelog entry.

Fixes FlexMeasures#1760

Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
@Flix6x

Flix6x commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thanks @sankalpsthakur, nice contribution — the new entries slot neatly into the Security section, and the defaults all check out against the code.

A note on the two commits I pushed to your branch earlier today (I see you've since squashed them into yours, which works too):

  1. Linked the cross-reference straight to the "Two-factor authentication" section of the installation docs (it needed a label, installation_two_factor), rather than to the top of the page.
  2. Trimmed the changelog entry to reference just the PR — the issue linkage is already covered by "Fixes Missing configuration docs for SECURITY_TWO_FACTOR #1760" in the description.

One heads-up for future PRs re. DCO: if you set git config --global format.signOff true (or just habitually use git commit -s), every commit gets the Signed-off-by line from the start, and you won't need to rewrite history to make the DCO check happy. If you do end up with unsigned commits, git rebase --signoff main fixes them all in one go.

While reviewing, we also noticed that SECURITY_TWO_FACTOR wasn't actually read from the environment, despite what the installation docs (and now these config docs) say — that's fixed in #2341, so your docs will be accurate on both counts. I'll merge this once CI is green.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 flexmeasures | 🛠️ Build #33707978 | 📁 Comparing 270e1f4 against latest (d800b8f)

  🔍 Preview build  

4 files changed
± changelog.html
± configuration.html
± api/v3_0.html
± host/installation.html

@Flix6x Flix6x 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.

Thanks!

@Flix6x
Flix6x merged commit 9acc4eb into FlexMeasures:main Jul 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing configuration docs for SECURITY_TWO_FACTOR

2 participants