Skip to content

fix(jans-cli-tui): only one of one time use or rotate can be checked for SSA - #14626

Merged
yuriyz merged 4 commits into
mainfrom
jans-cli-tui-ssa-one-time-rotation-14625
Jul 27, 2026
Merged

fix(jans-cli-tui): only one of one time use or rotate can be checked for SSA#14626
yuriyz merged 4 commits into
mainfrom
jans-cli-tui-ssa-one-time-rotation-14625

Conversation

@devrimyatar

@devrimyatar devrimyatar commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Prepare


Description

Target issue

closes #14625

Implementation Details


Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

Summary by CodeRabbit

  • Bug Fixes
    • Improved SSA configuration checkboxes so “One Time Use” and “Rotate SSA” cannot be selected simultaneously.
    • Selecting one option automatically clears the other when necessary.
    • Updated the edit dialog’s checkbox controls to ensure consistent mutual exclusivity.

@devrimyatar devrimyatar added kind-bug Issue or PR is a bug in existing functionality comp-jans-cli-tui Component affected by issue or PR labels Jul 24, 2026
@mo-auto

mo-auto commented Jul 24, 2026

Copy link
Copy Markdown
Member

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fde6e755-5ccd-4d2d-9bb2-fcf13e489277

📥 Commits

Reviewing files that changed from the base of the PR and between 6f2002d and 88d3b78.

📒 Files selected for processing (1)
  • jans-cli-tui/cli_tui/plugins/010_auth_server/ssa.py

📝 Walkthrough

Walkthrough

The SSA edit dialog now uses stored checkbox widgets with a shared handler that prevents “One Time Use” and “Rotate SSA” from being enabled simultaneously.

Changes

SSA checkbox behavior

Layer / File(s) Summary
Checkbox synchronization and dialog wiring
jans-cli-tui/cli_tui/plugins/010_auth_server/ssa.py
Adds check_one_time_rotate, creates callback-enabled checkbox widgets from existing SSA data, and inserts those widgets into the dialog layout.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: yuriyz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making SSA one-time use and rotation mutually exclusive in the TUI.
Description check ✅ Passed The PR follows the template, names the target issue, and confirms no docs impact; the implementation details section is sparse.
Linked Issues check ✅ Passed The change matches #14625 by preventing both SSA one-time use and rotation from being selected together.
Out of Scope Changes check ✅ Passed The only code change described is the SSA checkbox synchronization needed for the linked issue, with no unrelated scope visible.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jans-cli-tui-ssa-one-time-rotation-14625

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devrimyatar devrimyatar changed the title fix(jans-cli-tui): only one of time use or rotate can be checked for SSA fix(jans-cli-tui): only one of one time use or rotate can be checked for SSA Jul 24, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@jans-cli-tui/cli_tui/plugins/010_auth_server/ssa.py`:
- Around line 471-486: Before constructing the widgets in the SSA initialization
flow, normalize the stored one_time_use and rotate_ssa values so they cannot
both remain true; apply an explicit precedence rule, preserving the existing
callback behavior for later user changes. Use the normalized values when setting
checked in the one_time_use_checkbox and rotate_checkbox definitions.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bc1c5c45-0de7-4296-a803-dead885a7c15

📥 Commits

Reviewing files that changed from the base of the PR and between c276fd5 and 6f2002d.

📒 Files selected for processing (1)
  • jans-cli-tui/cli_tui/plugins/010_auth_server/ssa.py

Comment thread jans-cli-tui/cli_tui/plugins/010_auth_server/ssa.py
…ting the widgets

Signed-off-by: Mustafa Baser <mbaser@mail.com>
@devrimyatar
devrimyatar requested review from yurem and yuriyz July 24, 2026 16:55
@yuriyz
yuriyz merged commit 373bd49 into main Jul 27, 2026
1 of 3 checks passed
@yuriyz
yuriyz deleted the jans-cli-tui-ssa-one-time-rotation-14625 branch July 27, 2026 07:56
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-jans-cli-tui Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(jans-cli-tui): TUI should not allow both one time use and enable rotation for SSA

3 participants