Name the issued credential on the one-time secret screen - #4790
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe one-time secret screen now selects titles, guidance, labels, and copy actions based on whether it displays a client secret, Flow Secret, or both. Tests cover the new secret states and copy-button selectors. ChangesApplication secret display
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
frontend/apps/console/src/features/applications/components/create-application/ShowClientSecret.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. frontend/apps/console/src/features/applications/components/create-application/__tests__/ShowClientSecret.test.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. 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: 2
🤖 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
`@frontend/apps/console/src/features/applications/components/create-application/__tests__/ShowClientSecret.test.tsx`:
- Around line 79-105: Extend the tests for the Flow Secret-only and dual-secret
cases in the ShowClientSecret test suite to assert the exact saveSubtitle text
for each mode. Add these assertions alongside the existing heading and
security-text checks, using the rendered subtitle element or established
selector, while preserving the current copy-label and secret-value assertions.
In
`@frontend/apps/console/src/features/applications/components/create-application/ShowClientSecret.tsx`:
- Around line 72-98: Update resolveCopy to accept and pass fallback strings for
the client-secret, flow-secret, and both-secret translation modes, and provide
appropriate fallbacks at each saveTitle, saveSubtitle, and
securityReminderDescription call. Add fallback strings to both branches of
copySecretLabel and to the applications:clientSecret.copied translation,
preserving the existing mode-specific text selection.
🪄 Autofix
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.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b2441ae6-b15c-4841-81cc-8baec2418f8b
📒 Files selected for processing (3)
frontend/apps/console/src/features/applications/components/create-application/ShowClientSecret.tsxfrontend/apps/console/src/features/applications/components/create-application/__tests__/ShowClientSecret.test.tsxfrontend/packages/i18n/src/locales/en-US.ts
82504bb to
b7b1687
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
b7b1687 to
7cd7f45
Compare
The one-time secret screen was hardcoded to client secret copy, so applications issued only a Flow Secret were told to save a client secret they do not have. Pick the title, subtitle, security reminder and copy button label based on which credentials are shown. Fixes thunder-id#4742
7cd7f45 to
1de2633
Compare
Purpose
Applications created with the embedded login flow option are issued a Flow Secret and no client secret. The one-time secret screen rendered the Flow Secret field correctly, but the surrounding chrome was hardcoded to client secret copy, so the screen told the user to save a "Client Secret" the application does not have.
This fixes the title, subtitle, security reminder and copy button so they name the credential (or credentials) actually shown.
Approach
ShowClientSecretnow picks its copy set from which credentials are present:New keys were added under
applications:flowSecret.*andapplications:secrets.*infrontend/packages/i18n/src/locales/en-US.ts.applications:clientSecret.copySecretchanged from "Copy Secret" to "Copy Client Secret" for the same reason. The footer button gained adata-testidbecause its accessible name is now shared with the client secret field copy button.The same component backs both the create flow and the post-create dialog on the application edit page, so both surfaces are covered.
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks
Summary by CodeRabbit
New Features
Bug Fixes
Tests