Add documentation for displaying the TOTP secret key during enrollment in IS 7.1 - #6301
Add documentation for displaying the TOTP secret key during enrollment in IS 7.1#6301JeethJJ wants to merge 1 commit into
Conversation
…t in IS 7.1 Extends the "Display the secret key during enrollment" section (added for 7.2.0 in wso2#6127) to cover IS 7.1.0, with the 7.1.0.100 update-level note and the version-specific screenshot. Related Issue: wso2-enterprise/wso2-iam-internal#7820
📝 WalkthroughWalkthroughChangesMFA TOTP version support
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@en/includes/guides/authentication/mfa/add-totp-login.md`:
- Around line 121-125: Update the availability note in the is_version template
block to use “and later” instead of “onwards,” and configure Vale to accept the
template directives or add “elif” to its vocabulary. Run Vale against
add-totp-login.md and ensure it completes without warnings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 74b3825d-aa21-44cf-95b4-093d4ce45d8e
⛔ Files ignored due to path filters (1)
en/identity-server/7.1.0/docs/assets/img/guides/mfa/totp/scan-qr-code-with-secret-key.pngis excluded by!**/*.png
📒 Files selected for processing (1)
en/includes/guides/authentication/mfa/add-totp-login.md
| {% if is_version == "7.2.0" %} | ||
| This configuration is available from update level **7.2.0.27** onwards. | ||
| {% elif is_version == "7.1.0" %} | ||
| This configuration is available from update level **7.1.0.100** onwards. | ||
| {% endif %} |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Files matching target/name:"
fd -a 'add-totp-login\.md$|Vale|vale' . | sed 's#^\./##' | head -100
echo
echo "Target excerpt:"
FILE="en/includes/guides/authentication/mfa/add-totp-login.md"
if [ -f "$FILE" ]; then
sed -n '110,130p' "$FILE" | nl -ba -v110
else
echo "target file not found"
fi
echo
echo "Search for Vale configuration:"
fd -a 'Vale|vale|\.vale|_vale|vocabulary|accept\.txt' . | sed 's#^\./##' | head -200
echo
echo "Search for is_version directives/templates:"
rg -n "is_version|{% if|{% elif|{% endif|" . -g '*.md' | head -200Repository: wso2/docs-is
Length of output: 1910
🌐 Web query:
Vale linter conditional directives ignore {% if elif endif {% raw %}
💡 Result:
To ignore template-based conditional directives (such as {% if %}, {% elif %}, {% endif %}) in Vale, you can use the TokenIgnores configuration option in your.vale.ini file [1][2]. Because these directives are typically inline-level patterns, TokenIgnores is the appropriate mechanism to prevent Vale from linting their content [2]. Add the following to your.vale.ini file to ignore these tags: [.md] TokenIgnores = ({%.+?%}) Explanation: 1. TokenIgnores: This configuration accepts a list of regular expressions that match the tokens you wish to exclude from linting [1][2]. The pattern ({%.+?%}) captures Liquid-style or template-style tags starting with {% and ending with %} [1]. 2. Scope: You can apply this to specific file formats (like [.md] or [.mdx]) to ensure it only runs where those directives exist [1][3]. 3. BlockIgnores: If your directives span multiple lines or wrap large blocks of text that you want to ignore entirely, use BlockIgnores with a multiline regex (using the (?s) flag) [4][1]. For example: BlockIgnores = (?s){% if.? %}.*?{% endif %} Additionally, if you need to ignore these sections only in specific parts of a document, you can use inline comment controls within your source file [5][6]: {% if condition %}... some content to ignore... {% endif %} This turns off linting entirely for the duration of the block [5]. Ensure you have the proper comment syntax enabled for your specific file format [7][3].
Citations:
- 1: https://mintlify.wiki/errata-ai/vale/reference/config/formats
- 2: https://docs.vale.sh/keys/tokenignores
- 3: https://docs.vale.sh/topics/.vale.ini
- 4: https://docs.vale.sh/keys/blockignores
- 5: https://rmoff.net/2024/12/11/disabling-vale-linting-selectively-in-asciidoc/
- 6: vale-cli/vale@57180ee
- 7: https://docs.vale.sh/formats/code.md
🌐 Web query:
Vale linter token ignores value {%if.*?%} regex parentheses
💡 Result:
In Vale, the TokenIgnores configuration allows you to exclude inline-level text patterns from being linted [1][2]. To correctly ignore patterns that include special characters like parentheses or braces (such as {%... %}), you must define a regular expression that captures the entire token within the first grouping [1][2][3]. For patterns like {%... %}, you can use the following configuration in your.vale.ini file: [*.md] TokenIgnores = ({%.+?%}) Key considerations for using TokenIgnores: 1. Capture Groups: The regex must capture the entire desired ignore-string in the first capture group [1][3]. 2. Format Support: TokenIgnores are only supported for markup formats that are converted to HTML (e.g., Markdown, reStructuredText, AsciiDoc, and Org Mode) [1][2][4]. 3. Special Characters: If your pattern contains characters that have special meaning in regex, such as curly braces or dollar signs, you must escape them (e.g., {, }, $) or ensure the pattern is accurately defined to match the literal characters [3][5]. 4. Embedded Formats: If you are trying to use TokenIgnores in a file type that is not natively supported (like.js or.jl), you must first assign an embedded markup format (e.g., [formats] js = md) in your configuration for the ignores to take effect [6][4][7]. If your regex seems to have no effect, ensure that the file format is correctly recognized and supported, and verify your capture group matches the intended token entirely [6][4][8].
Citations:
- 1: https://docs.vale.sh/keys/tokenignores
- 2: https://vale.sh/docs/keys/tokenignores
- 3: https://mintlify.wiki/errata-ai/vale/reference/config/formats
- 4: TokenIgnores not working as intended? vale-cli/vale#736
- 5: TokenIgnores not working vale-cli/vale#361
- 6: TokenIgnores has no effect vale-cli/vale#745
- 7: https://docs.vale.sh/formats/code.md
- 8:
TokenIgnoresdoes not seem to be taking effect vale-cli/vale#711
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Target excerpt:"
FILE="en/includes/guides/authentication/mfa/add-totp-login.md"
if [ -f "$FILE" ]; then
sed -n '110,130p' "$FILE" | nl -ba -v110
else
echo "target file not found"
fi
echo
echo "Locate Vale configs/vocab files:"
for name in .vale.ini .vale/_styles/ .vale/styles/ vale.ini; do
if [ -e "$name" ]; then
echo "FOUND: $name"
fi
done
find . -maxdepth 4 \( -name '.vale.ini' -o -path '*/.vale/styles*' -o -path '*/.vale/_styles*' -o -name 'vocab*' -o -name 'accept.txt' \) -print 2>/dev/null | head -200Repository: wso2/docs-is
Length of output: 1910
Resolve the remaining Vale warning in the availability note.
Configure Vale to ignore template directives or add elif to the accepted vocabulary. Replace onwards with and later, then run vale en/includes/guides/authentication/mfa/add-totp-login.md with no warnings.
🧰 Tools
🪛 GitHub Check: Vale style check
[warning] 124-124:
[vale] reported by reviewdog 🐶
Did you really mean 'onwards'?
Raw Output:
{"message":"Did you really mean 'onwards'?","location":{"path":"en/includes/guides/authentication/mfa/add-totp-login.md","range":{"start":{"line":124,"column":69},"end":{"line":124,"column":76}}},"severity":"WARNING","code":{"value":"Vale.Spelling"}}
[warning] 123-123:
[vale] reported by reviewdog 🐶
Did you really mean 'elif'?
Raw Output:
{"message":"Did you really mean 'elif'?","location":{"path":"en/includes/guides/authentication/mfa/add-totp-login.md","range":{"start":{"line":123,"column":4},"end":{"line":123,"column":8}}},"severity":"WARNING","code":{"value":"Vale.Spelling"}}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@en/includes/guides/authentication/mfa/add-totp-login.md` around lines 121 -
125, Update the availability note in the is_version template block to use “and
later” instead of “onwards,” and configure Vale to accept the template
directives or add “elif” to its vocabulary. Run Vale against add-totp-login.md
and ensure it completes without warnings.
Sources: Coding guidelines, Linters/SAST tools
Purpose
Documents the option to display the TOTP secret key alongside the QR code during enrollment in IS 7.1, so users can manually enter it when QR scanning isn't possible (single-device setup).
This extends the "Display the secret key during enrollment" section originally added for 7.2.0 in #6127 to also cover IS 7.1.0.