Skip to content

[SM-2094] Adding prefix to machine accounts - #8372

Open
cd-bitwarden wants to merge 2 commits into
mainfrom
Sm-2093
Open

cd-bitwarden wants to merge 2 commits into
mainfrom
Sm-2093

Conversation

@cd-bitwarden

@cd-bitwarden cd-bitwarden commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

Add a prefix to newly created Machine Accounts "bw_"

TODO:
Ensure documentation referencing Machine Accounts communicates that old machine account names will not have this prefix - but new ones will. Both formats will function the same, and we also need to add this same context into the next release notes so that if a user happens to run into an issue where they were receiving the machine account from us and running into an error with their own code (maybe it was looking for 30 chars instead of 33) that we have this easily discoverable.

Notes
This PR was originally created by @maxkpower, and coauthored with by @cd-bitwarden

@cd-bitwarden cd-bitwarden added the ai-review Request a Claude code review label Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the bw_ prefix added to newly minted machine account access tokens in CreateAccessTokenCommand, the new MachineAccountTokenPrefix feature flag, and the accompanying unit and integration tests. The prefix is prepended before hashing and validation is hash-based in SecretsManagerApiKeyProvider, so previously issued tokens stay valid and the flag can be rolled back without invalidating prefixed tokens. Entropy is unchanged — the random portion remains 30 characters from the 62-character alphabet, and ClientSecretHash (max length 128) is unaffected by the longer plaintext secret. No server-side length assumptions on the client secret were found, and the PR description already tracks the documentation and release-note follow-up for the 30 → 33 character change for downstream consumers.

Code Review Details

No findings.

@codecov

codecov Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.52%. Comparing base (343b7a4) to head (3ca3de1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8372   +/-   ##
=======================================
  Coverage   64.52%   64.52%           
=======================================
  Files        2480     2480           
  Lines      106117   106122    +5     
  Branches     9625     9626    +1     
=======================================
+ Hits        68470    68474    +4     
- Misses      35308    35309    +1     
  Partials     2339     2339           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cd-bitwarden cd-bitwarden added the t:feature Change Type - Feature Development label Sep 17, 2026
@cd-bitwarden
cd-bitwarden marked this pull request as ready for review September 17, 2026 16:38
@cd-bitwarden
cd-bitwarden requested a review from r-tome September 17, 2026 16:46
@cd-bitwarden cd-bitwarden changed the title [SM-2093] Adding prefix to machine accounts [SM-2094] Adding prefix to machine accounts Sep 18, 2026

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.

2 participants