Skip to content

[SM-2126] Limit request access note to 1000 characters - #24445

Open
cd-bitwarden wants to merge 2 commits into
mainfrom
SM-2126
Open

cd-bitwarden wants to merge 2 commits into
mainfrom
SM-2126

Conversation

@cd-bitwarden

@cd-bitwarden cd-bitwarden commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/SM-2126

📔 Objective

Client-side counterpart to bitwarden/server#8809, which caps the Secrets Manager access-request note (EmailContent on RequestSMAccessRequestModel) at 1,000 characters.

  • Adds Validators.maxLength(1000) to the note field on the request-access form so the form blocks submission before the server rejects it. The component library already renders the localized "must not exceed N characters" error.
  • Adds a bit-hint under the textarea showing the character maximum, reusing the existing characterMaximum string (no new translations).
  • Adds a spec covering the default text, the required rule, and the 1,000-character boundary.

The longest translated default note is under 700 characters, so the prefilled text never trips the validator.

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.14%. Comparing base (a8897f0) to head (a98f320).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #24445   +/-   ##
=======================================
  Coverage   62.13%   62.14%           
=======================================
  Files        4920     4920           
  Lines      158013   158014    +1     
  Branches    25252    25252           
=======================================
+ Hits        98175    98190   +15     
+ Misses      53179    53165   -14     
  Partials     6659     6659           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cd-bitwarden cd-bitwarden added ai-review Request a Claude code review t:feature Change Type - Feature Development labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds a 1,000-character limit to the Secrets Manager request-access note in the browser, matching the limit the server already enforces. The form control now uses Validators.maxLength(this.maxEmailContentLength), and the textarea shows a bit-hint that reuses the existing characterMaximum string, so no new translation keys are needed. The submit handler already returns early when the form is invalid, so a note that is too long is never sent to requestSMAccessFromAdmins. The new spec passes its mocks in the same order as the constructor and tests the default text, the required rule, and both sides of the limit (1,000 and 1,001 characters). The English default note is about 550 characters, well under the limit.

@cd-bitwarden
cd-bitwarden marked this pull request as ready for review November 5, 2026 21:35

This branch has not been deployed

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

Labels

ai-review Request a Claude code review t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant