Repository navigation
feat: improved masked inputs management - #8629
albertasaftei wants to merge 12 commits into
Conversation
WalkthroughSecret masking now depends on field values across collection and request authentication editors. The shared masking utility is added, and masked-editor updates occur synchronously after input reads. ChangesAuthentication masking
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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. Secrets hide, then variables gleam, Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/PasswordCredentials/index.js (2)
58-60: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAvoid single-line abstractions.
As per coding guidelines, avoid single-line abstractions that only add a call-stack frame. You can map this directly to
saveinstead of wrapping it inhandleSave.♻️ Proposed refactor
- const handleSave = () => { - save(); - }; + const handleSave = save;🤖 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 `@packages/bruno-app/src/components/RequestPane/Auth/OAuth2/PasswordCredentials/index.js` around lines 58 - 60, Remove the redundant handleSave wrapper and pass the existing save function directly to the relevant consumer in the PasswordCredentials component, preserving the current save behavior.Source: Coding guidelines
23-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueKeep function parameters on a single line.
As per coding guidelines, do not add newlines inside function parentheses. Please revert the formatting of these parameters to a single line to maintain compliance.
♻️ Proposed formatting fix
-const OAuth2PasswordCredentials = ({ - save, - item = {}, - request, - handleRun, - updateAuth, - collection -}) => { +const OAuth2PasswordCredentials = ({ save, item = {}, request, handleRun, updateAuth, collection }) => {🤖 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 `@packages/bruno-app/src/components/RequestPane/Auth/OAuth2/PasswordCredentials/index.js` around lines 23 - 30, Reformat the OAuth2PasswordCredentials function declaration so all parameters remain on a single line inside the parentheses, without changing the function’s behavior or parameter list.Source: Coding guidelines
packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/index.js (1)
22-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove leftover debug statement.
This
console.logappears to be a leftover debug artifact and should be removed.♻️ Proposed fix
- console.log({ bearerToken });🤖 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 `@packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/index.js` at line 22, Remove the leftover console.log statement that logs bearerToken in the BearerAuth component, leaving the surrounding authentication logic unchanged.
🤖 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 `@packages/bruno-app/src/utils/auth/index.js`:
- Around line 110-113: Update shouldMaskValue to detect Bruno environment
variables only when the value contains the double-curly-brace marker "{{",
rather than any single "{". Preserve the existing masking behavior for empty,
non-string, and marker-free values.
---
Nitpick comments:
In
`@packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/index.js`:
- Line 22: Remove the leftover console.log statement that logs bearerToken in
the BearerAuth component, leaving the surrounding authentication logic
unchanged.
In
`@packages/bruno-app/src/components/RequestPane/Auth/OAuth2/PasswordCredentials/index.js`:
- Around line 58-60: Remove the redundant handleSave wrapper and pass the
existing save function directly to the relevant consumer in the
PasswordCredentials component, preserving the current save behavior.
- Around line 23-30: Reformat the OAuth2PasswordCredentials function declaration
so all parameters remain on a single line inside the parentheses, without
changing the function’s behavior or parameter list.
🪄 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.yaml
Review profile: CHILL
Plan: Pro
Run ID: 19c58acb-1c5c-4796-a5c3-f809a1bc3e63
📒 Files selected for processing (21)
packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/DigestAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/EdgeGridAuth/index.tsxpackages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/WsseAuth/index.jspackages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.jspackages/bruno-app/src/components/RequestPane/Auth/AwsV4Auth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/DigestAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/EdgeGridAuth/index.tsxpackages/bruno-app/src/components/RequestPane/Auth/NTLMAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth1/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/ClientCredentials/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/PasswordCredentials/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.jspackages/bruno-app/src/utils/auth/index.jspackages/bruno-app/src/utils/common/masked-editor.js
|
Hey @albertasaftei We're aligned with the change, but the PR diff is much larger than it needs to be. It looks like your editor has introduced a number of formatting-only changes. Would you be able to remove those and keep the diff limited to just the changes required for this PR? |
|
hello @helloanoop, i'm removing all the formatting edits. Wouldn't it be better to add a .pretierrc file just to keep formatting edits the same for all the contributors? |
|
Thank you. We have eslint to help with lint. As far as our stance on prettier, I'd let @bijin-bruno / @sid-bruno comment it. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/bruno-app/src/utils/common/masked-editor.js (1)
357-366: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRevert unrelated formatting-only edits in this cohort.
These hunks do not change masking behavior and make the PR harder to review. Restore the existing formatting and retain only the required masking changes; Line 360-366 also introduces newlines inside
markText(...).As per coding guidelines,
**/*diffs must remain minimal and avoid unnecessary whitespace changes. The PR objectives likewise call for removing editor-introduced formatting changes.🤖 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 `@packages/bruno-app/src/utils/common/masked-editor.js` around lines 357 - 366, Revert formatting-only changes while preserving required behavior: restore the existing formatting around maskedNode and markText in packages/bruno-app/src/utils/common/masked-editor.js:357-366, including the original single-line markText call. Also restore prior formatting, with no functional changes, at packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/index.js:17,74; BearerAuth/index.js:17,46-48; DigestAuth/index.js:17,74; NTLMAuth/index.js:17,23-34,88-90; WsseAuth/index.js:17,74; packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js:9,84; OAuth2/PasswordCredentials/index.js:7,17,45,79-86,108-110,135-138,139-152,172-224,264-301; and WsseAuth/index.js:9,84.Source: Coding guidelines
🧹 Nitpick comments (1)
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.js (1)
19-27: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftRevert unrelated editor formatting changes.
Keep this PR focused on value-aware masking; the reformatting expands review and blame churn.
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.js#L19-L27: revert unrelated component reformatting.packages/bruno-app/src/utils/auth/index.js#L2-L4: restore the prior import formatting.packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js#L44-L48: revert unrelated schema formatting.packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.js#L17-L19: revert unrelated declaration reformatting.packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js#L9-L9: restore the prior import formatting.packages/bruno-app/src/components/RequestPane/Auth/DigestAuth/index.js#L8-L8: restore the prior import formatting.packages/bruno-app/src/components/RequestPane/Auth/NTLMAuth/index.js#L9-L9: restore the prior import formatting.packages/bruno-app/src/components/RequestPane/Auth/OAuth1/index.js#L6-L13: restore unrelated import reformatting.packages/bruno-app/src/components/RequestPane/Auth/OAuth2/ClientCredentials/index.js#L17-L17: revert unrelated component reformatting.As per coding guidelines, “Keep diffs minimal, avoid unnecessary whitespace changes.”
🤖 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 `@packages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.js` around lines 19 - 27, Revert unrelated formatting changes while preserving the value-aware masking changes: restore prior formatting in packages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.js (19-27), packages/bruno-app/src/utils/auth/index.js (2-4), packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js (44-48), packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.js (17-19), packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js (9), packages/bruno-app/src/components/RequestPane/Auth/DigestAuth/index.js (8), packages/bruno-app/src/components/RequestPane/Auth/NTLMAuth/index.js (9), packages/bruno-app/src/components/RequestPane/Auth/OAuth1/index.js (6-13), and packages/bruno-app/src/components/RequestPane/Auth/OAuth2/ClientCredentials/index.js (17). Keep functional changes intact and avoid additional whitespace or declaration/import reformatting.Source: Coding guidelines
🤖 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
`@packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/index.js`:
- Line 71: Restrict shouldMaskValue in
packages/bruno-app/src/utils/auth/index.js to return the variable-reference
result only for the exact supported environment-variable syntax/prefix, while
masking literal secrets containing braces. Add regressions covering literal
braces and valid variable references. Apply the corrected predicate at
packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/index.js:71,
packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/index.js:45,
packages/bruno-app/src/components/CollectionSettings/Auth/DigestAuth/index.js:71,
packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js:87,
packages/bruno-app/src/components/CollectionSettings/Auth/WsseAuth/index.js:71,
packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js:81,
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/PasswordCredentials/index.js:105,
and packages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.js:81.
---
Outside diff comments:
In `@packages/bruno-app/src/utils/common/masked-editor.js`:
- Around line 357-366: Revert formatting-only changes while preserving required
behavior: restore the existing formatting around maskedNode and markText in
packages/bruno-app/src/utils/common/masked-editor.js:357-366, including the
original single-line markText call. Also restore prior formatting, with no
functional changes, at
packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/index.js:17,74;
BearerAuth/index.js:17,46-48; DigestAuth/index.js:17,74;
NTLMAuth/index.js:17,23-34,88-90; WsseAuth/index.js:17,74;
packages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.js:9,84;
OAuth2/PasswordCredentials/index.js:7,17,45,79-86,108-110,135-138,139-152,172-224,264-301;
and WsseAuth/index.js:9,84.
---
Nitpick comments:
In
`@packages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.js`:
- Around line 19-27: Revert unrelated formatting changes while preserving the
value-aware masking changes: restore prior formatting in
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.js
(19-27), packages/bruno-app/src/utils/auth/index.js (2-4),
packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js
(44-48),
packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.js
(17-19), packages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.js
(9), packages/bruno-app/src/components/RequestPane/Auth/DigestAuth/index.js (8),
packages/bruno-app/src/components/RequestPane/Auth/NTLMAuth/index.js (9),
packages/bruno-app/src/components/RequestPane/Auth/OAuth1/index.js (6-13), and
packages/bruno-app/src/components/RequestPane/Auth/OAuth2/ClientCredentials/index.js
(17). Keep functional changes intact and avoid additional whitespace or
declaration/import reformatting.
🪄 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.yaml
Review profile: CHILL
Plan: Pro
Run ID: 730bf81f-161e-4a82-9f79-717156e3e219
📒 Files selected for processing (19)
packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/DigestAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.jspackages/bruno-app/src/components/CollectionSettings/Auth/WsseAuth/index.jspackages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.jspackages/bruno-app/src/components/RequestPane/Auth/AwsV4Auth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BasicAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/BearerAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/DigestAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/NTLMAuth/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth1/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/AuthorizationCode/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/ClientCredentials/index.jspackages/bruno-app/src/components/RequestPane/Auth/OAuth2/PasswordCredentials/index.jspackages/bruno-app/src/components/RequestPane/Auth/WsseAuth/index.jspackages/bruno-app/src/utils/auth/index.jspackages/bruno-app/src/utils/common/masked-editor.js
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/bruno-app/src/components/RequestPane/Auth/AwsV4Auth/index.js
|
TLDR; Prettier for whitespace-only changes sounds reasonable in theory, but as the trail of changes you saw shows, it diverges quite a bit from our existing code style and what it currently allows. There's also a secondary risk: larger merge conflicts between the OSS and Distribution repo, which adds to maintainer overhead. I want to make contributing easier, but not at the cost of reviewers having to manually re-read every line to confirm which changes were actually relevant, or losing the guarantee that OSS and Distribution changes stay validated together. That's real engineering bandwidth we'd be trading away. On the conflict side specifically - GitHub and git do support ignoring whitespace changes (e.g. Antfu's post also covers the line-wrap noise this introduces, which is worth avoiding. Practically, it makes more sense to just ask contributors to save files without their formatters running, rather than having a few team members repeatedly spend time untangling merges. There's also the problem where if we now run |
…m/albertasaftei/bruno into feature/masked-inputs-improvement
fixes: #8630
Internal Jira: BRU-3895
Description
Changed the masked inputs logic so if the user starts by inserting an env variable, it won't show masked by default. While writing it manually, it will normally be shown as masked
This is the same behaviour Postman is using and I find it useful. It removes an additional click to unmask the env var.
Screen.Recording.2026-07-15.at.16.26.02.mov
Added a reusable utility that will be used for masked inputs, approach is simple yet effective.
Contribution Checklist:
Summary by CodeRabbit
Summary
New Features
shouldMaskValueutility to determine when secret values should be masked.Bug Fixes