* [PM-46898] fix: Name new My items collections with myItemsV2
The default user collection was named from the "myItems" key ("My Items"),
while the rest of the UI uses "myItemsV2" ("My items"). Switch the web,
browser, desktop and CLI paths that create the collection to "myItemsV2"
and drop the now-unused "myItems" key. Existing collections keep their
stored name.
* Use errorImportingMyItemsMultiCollectionV2 for the lowercase My items import error
* Label the My items shared folder from i18n in the vault table
* Label the My items shared folder from i18n in the item view and edit form
* Keep other members' emails on their My items collections and test the labels
`bw update` picked the first release zip whose URL contained `bw-<os>`.
It ignored which build was running and the CPU architecture, so OSS users
were sent the commercial build and arm64 users were sent the x64 build.
- Add `licenseType` to the CLI ServiceContainer ("oss"), overridden to
"bit" in the Bitwarden-licensed container, and pass it to UpdateCommand.
- Build the exact asset name, bw-{license}-{os}[-arm64]-{version}.zip,
from the license, process.platform, process.arch and the release tag,
and match it against asset names.
- Fall back to the release page when no matching asset exists or the
OS/architecture has no published build.
- Type the GitHub release response and remove @ts-strict-ignore.
Depends on the bw-bit-* asset rename (BRE-2408).
Commercial CLI zips were unprefixed (bw-linux-*, bw-macos-*, bw-windows-*)
while OSS zips use bw-oss-*. Set the commercial artifact_prefix to -bit so
both license types follow bw-{license}-{os}[-arm64]-{version}.zip, and point
the snap job and snapcraft.yaml at bw-bit-linux-*.
* Move SsoUrlService from libs/auth to libs/common
Relocates SsoUrlService and DESKTOP_SSO_CALLBACK to a new
libs/common/src/auth/sso-url feature folder. Browser, desktop, and CLI now
import them from @bitwarden/common/auth/sso-url.
* Rename sso-url feature folder to sso-login
* Move AuthRequestApiService from libs/auth to libs/common
Relocates AuthRequestApiServiceAbstraction and DefaultAuthRequestApiService
to a new libs/common/src/auth/auth-request-api feature folder. Consumers now
import them from @bitwarden/common/auth/auth-request-api, which also removes
a restricted @bitwarden/auth/common import from DeviceManagementComponent.
* Rename auth-request-api feature folder to login-via-auth-request
* [PM-38256] Remove pm-30110-sdk-sends-api feature flag
Remove the Pm30110SdkSendsApi feature flag and its checks so the SDK-backed
Send path is the only path.
- Drop the flag from the feature flag enum and defaults.
- Make Send decryption, key rotation and send push-notification sync
SDK-only, and always run the pending Send deletion retry on sync.
- Always apply the 500 MB file Send size limit.
- Delete SendApiServiceSelector and fold SendSdkApiService into
SendApiService. The merged class uses the SDK and makes REST calls itself
for new-file save, cross-instance (apiUrl) access, and the read-back after
each mutation.
- Remove getSend, getSends, putSendRemovePassword and deleteSend from the
SendApiService abstraction; nothing outside the class called them.
- Inject the concrete SendApiService into ShareLinkService so share links
keep resolving it.
- Update DI wiring and tests.
* [PM-38256] fix: Mock policiesByType$ in desktop send component spec
SendPolicyService now calls policiesByType$ unconditionally, so the
PolicyService mock must provide it.
* Rename Send removePassword/putSendRemovePassword to removeAuth (PM-42855)
The server collapsed the old password-only (V1) endpoint into remove-all-auth
(V2) logic a while back (server PR #6929 / PM-31497), so these methods remove
all auth on a Send today -- a password or an email-verification requirement
-- not just a password. Renames removePassword/putSendRemovePassword to
removeAuth/putSendRemoveAuth across SendApiService, SendSdkApiService,
SendApiServiceSelector, and every caller (DefaultSendFormService, send-details/
send-table/send-list components, web/desktop send components, the CLI's
internal call site), and corrects the matching user-facing copy that had the
same password-only framing bug.
Deliberately out of scope, left unchanged: the SDK's own remove_password
(WASM-exposed, a separate breaking change requiring its own SDK release), and
the CLI's public `remove-password` command name/class (SendRemovePasswordCommand)
-- only its internal call to the renamed service method was updated.
* [PM-42855] Show which kind of Send access control is being removed
Label the Send menu item, edit-page button, confirmation dialogs and success
toasts as "Remove password" or "Remove email verification" based on the
Send's authType, falling back to the generic wording when it is unknown. The
menu item now also appears for email-verified Sends.
Before this commit:
- POLICIES contains policies for confirmed organizations only, and is no longer used.
- POLICIES_NEW contains policies for accepted and confirmed organizations, and is used by policyService.
This commit copies POLICIES_NEW back to POLICIES; updates consumers to read from POLICIES; and drops POLICIES_NEW. This closes the loop so that we have a single state definition without the NEW suffix.
* [cli] aliases collection items as shared-folder
* [cli] add tests for org-shared-folder alias in edit and create
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* [cli] allow item-shared-folders in bw edit object validation
* [cli] add aliases in `delete` and `get template` methods as well
* [cli] document shared-folder aliases in CLI help text
* [cli] use the vfo1-foundation feature flag to control shared entity term
* [cli] filter terms based on flag for expected object text
* check flag value once up front
* [cli] rename sharedFolders var to useSharedFoldersTerm to express intent
* [cli] Update output terminology based on flag status
* [cli] add my-folder alias for folder objects, gated help text on flag
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* [PM-42408] feat: Push lock and logout from LockService and LogoutService
Lock clears the SDK client's in-memory user key before USER_KEY is wiped,
so the client can't do crypto while the account is already reported as
locked. Logout disposes the client before the logout broadcast.
* Explain why the SDK client locks before the caches are cleared
* [PM-45197] refactor: Move provider domain into libs/common/src/provider
* [PM-45197] refactor: Add barrel export for libs/common/src/provider Add libs/common/src/provider/index.ts and import provider types from
@bitwarden/common/provider outside libs/common, so the folder can move
again without touching every consumer. The service implementations stay
out of the barrel because the abstraction and the implementation are
both named ProviderService. Code inside libs/common keeps relative
imports to avoid circular imports. No behavior change.
Moves LogoutService, DefaultLogoutService, LogoutReason, and NewActiveUser to libs/common/src/auth/logout so libs/common code can depend on them. Updates all imports to @bitwarden/common/auth/logout and removes the no-restricted-imports suppressions that libs/common needed to import them from libs/auth. No behavior change.
* fix(logging): Performance marks and measures grow without limit
Marks and measures are recorded whether DevTools is open or not, and nothing clears them. When the app stays open for days, locked or unlocked with the session timeout set to "Never", they might use hundreds of megabytes of memory.
* simplifications
* [PM-42403] refactor: Extract KeyService.toUserEncryptedOrgKeys
Pushing organization keys into a long-lived SDK client needs the same
conversion that encryptedOrgKeys$ does, from paths that hold the user's
private key directly. Pull it into a helper that takes the private key and
provider keys as arguments, and cover encryptedOrgKeys$ with tests.
* [PM-42406] feat: Push unlock and organization keys ahead of their state writes
Unlock tries the long-lived SDK client first and falls back to the
register client when there is none. After every unlock, and whenever
organization keys change, KeyService pushes the user-encrypted
organization keys to SdkService before they are written to state.
Organization keys cross into SdkService as the SDK's UnsignedSharedKey,
converted from EncString in KeyService. Building the payload never fails
an unlock or a sync.
* Remove dead guard from toUserEncryptedOrgKeys
* Test buildSdkUnlockData with no stored organization keys
* refactor: Signal unlock with a boolean and read the user key from state
* refactor: Return the unlocked SDK client from unlock instead of a boolean
Each save rewrites the whole data.json, ~19 MB with a large vault, and
`bw get item` saved two values that were already stored. Compare the
stored JSON first and skip the write when it would not change. The
update is still emitted, as before.
The storage cache returns a copy on every get, and a command reads the
whole ciphers value (~16 MB for a large vault) at least once.
structuredClone took ~22 ms for it. The cache only ever holds plain JSON,
so a direct recursive copy gives the same result in ~6 ms.
Every storage read parsed the whole data.json. A single `bw get item`
reads storage 57 times, and with a large vault the file is ~19 MB, so
parsing it again dominated the command.
Keep the parsed contents and re-read only when the file's inode, size,
mtime or ctime show another process changed it. Values are copied on
get and stored as their JSON round-trip on save, so callers see exactly
what a re-read from disk used to return.
* Take the CLI storage file lock synchronously
Every storage access takes a cross-process lock on data.json. It was
acquired asynchronously, so concurrent accesses within one process
found the lock held by their own process and backed off 100-250 ms
each; 10 concurrent reads scheduled 45 backoffs.
The storage actions are synchronous, so take the lock with lockSync and
lock, act and release in one synchronous step. No other access of this
process can run while the lock is held, so it never waits for itself.
Only another process holding the lock still makes it wait, with the
same backoff as before.
* Remove unused @types/retry dependency
The retry import was dropped when the storage lock became
synchronous. Nothing references the types directly anymore.
* Exit the CLI once a command has finished
After printing its output, every command left the process idle until
leftover timers expired: the desktop IPC discovery timeout and RxJS
intervals kept the event loop alive for ~1.7 s per invocation.
Exit explicitly after the command's action resolves, except for serve,
which keeps running. stdout and stderr are flushed first, since a pipe
is asynchronous on macOS and exiting straight away could truncate
large output.
* Let serve stay pending until it stops
Replace the LONG_RUNNING_COMMANDS allowlist. serve now resolves when
its server closes or errors, so every command exits the same way:
the action resolves, then the CLI flushes and exits.
Await the export event collection and the import sync. The forced
exit could otherwise cut them short.
* Restore serve.command spec
An earlier commit overwrote the existing serve.command spec. Restore
it and move the untilStopped tests to their own spec.
Times the prod build of bw as a user runs it: time to first output and
time to process exit, per command, in interleaved rounds across variant
worktrees. Each variant logs in to its own data dir during untimed
setup, and every run's output is checked so a failing command is never
measured as fast.
* [PM-42819] Route CLI cross-instance Send receive through SendReceiveClient
Build a receive-scoped SDK client pointed at the Send link's server instead
of reintroducing a generic ephemeral client on SdkService. Gated behind
pm-30110-sdk-sends-api; same-instance receives are unchanged.
* [PM-42819] Mint cross-instance Send access tokens through SendReceiveClient
Run the whole cross-instance receive flow (token minting, password hashing,
email/OTP exchange, access, download, decrypt) through the receive-scoped SDK
client so nothing touches the signed-in instance. Pass the device identifier
and CLI user agent to the SDK client. Legacy path is unchanged when the flag
is off or the Send is on the configured server.
* [PM-42819] Use NotFound SDK variant and share send access token helpers
Detect a missing Send in the CLI receive command via the SDK's NotFound
variant instead of matching the error message. Move the SDK credential and
token-error helpers into libs/common send-access utils shared by
DefaultSendTokenService and the receive command.
* [PM-42819] Update sdk-internal to 0.2.0-main.1127
Pick up SendReceiveClient and the NotFound error variant from the merged
sdk-internal PR (bitwarden/sdk-internal#1586).
* Add 1Password direct import through the SDK on desktop and in the extension
* Apply the design feedback to the 1Password direct importer
* Keep the 1Password prompts open on a click outside or Escape
* Drop the desktop CORS header rewrite for 1Password
* Trim the 1Password importer tests to the ones that check logic
* Test the 1Password form rules directly and drop the overlapping specs
* Check for an org import without a collection before the 1Password prompts open
* Drop the null toast title from the 1Password importer
* Show a refused 1Password Secret Key and password in a toast
* Tell a 1Password account that signs in only with SSO before asking for its password
* Tell the user to check a 1Password email that 1Password refuses as malformed
---------
Co-authored-by: John Harrington <84741727+harr1424@users.noreply.github.com>
Co-authored-by: Alex Dragovich <46065570+itsadrago@users.noreply.github.com>
* [PM-34414] refactor: Always use progress-aware Azure attachment upload path
pm-34410-attachment-upload-progress is always true in production, so
AzureFileUploadService no longer needs to branch on it. Removes the
dead legacy (non-progress) upload path and the now-unused ConfigService
dependency, cascading through FileUploadService and its construction
sites.
* Always pass upload progress options through cipher attachment upload
* Remove unused pm-34410-attachment-upload-progress feature flag
* Check response status on progress-reporting attachment upload
ApiService.postAttachmentFile's XHR branch (used whenever onProgress is
set) never checked the response status before returning, unlike the
send() fallback and the Azure upload paths. A failed Direct (self-hosted)
attachment upload would resolve successfully with no thrown error, so
CipherFileUploadService never rolled back and the UI showed a false
success toast. Now always passing upload options through (PM-34414)
makes onProgress unconditional for these uploads, so this latent bug
needed fixing alongside it.
* Propagate XHR response headers so attachment upload errors keep server message
* [PM-34414] Guard XHR attachment upload against insecure API URLs
Add the same https:// check that fetch() enforces before calling
nativeXMLHttpRequest in postAttachmentFile, so bearer tokens are
not sent over plaintext HTTP for self-hosted users with http:// API URLs.
Add a test to assert InsecureUrlNotAllowedError is thrown and that
nativeXMLHttpRequest is never called when the API URL is insecure.
A long-lived SDK client keeps the feature flags it was given, so
ConfigService pushes them on every per-user config renewal, before the
new config is written to state. The manual-DI apps construct SdkService
(and the AppIdService it needs) before KeyService and ConfigService so
both can depend on it.
KeyService and ConfigService will take SdkService as a dependency, and
ApiService already reaches it at runtime through VaultTimeoutSettingsService
and KeyService. Taking those services as thunks lets SdkService be injected
into them without closing a construction cycle.
* Initial changes.
* Route direct logout paths through LogoutService and log callback logouts
Converts every direct messagingService.send("logout") site to
logoutService.logout(userId, reason). Introduces the reasons the new
sites needed: userInitiated, deauthorizedSessions, emailChanged,
kdfChanged, tooManyInvalidPinAttempts, keyConnectorError (existing).
Two paths cannot inject LogoutService and carry the reason on the message
payload instead: AccountService.delete (libs/common cannot depend on
libs/auth) and the Electron main-process menu (main process has no
Angular DI). LOGOUT_CALLBACK factory now logs the reason so
TokenService, SyncService, ServerNotifications, KeyConnector, and
ApiService paths get the same log line. Deletes an unreachable logOut
method from DefaultLoginDecryptionOptionsService.
* Log logout reason in browser background service worker
The browser background context wires its own logoutCallback into
TokenService, KeyConnectorService, SyncService, and
ServerNotificationsService. That callback bypassed the Angular DI
LOGOUT_CALLBACK factory that logs the reason, so background auth-failure
logouts (invalid access token, refresh-token retrieval failure,
key-connector error, sync-triggered accountDeleted or invalidSecurityStamp,
server logoutNotification) had no diagnostic log line.
Same one-line info log now fires at the callback entry, matching the
Angular factory.
* Assert new LogoutReason at each converted callsite in unit tests
Adds explicit expect(logoutService.logout).toHaveBeenCalledWith(userId, reason)
assertions to seven specs that were touched by the reason conversions but
did not verify the reason string. Prevents silent regressions if a reason
value is renamed or a callsite is refactored without updating the log.
Coverage added:
- AccountSecurityComponent logOut: userInitiated (or none when cancelled)
- ChangeEmailComponent submit: emailChanged
- ChangeKdfConfirmationComponent submit: kdfChanged (updates existing
messagingService.send assertion)
- UserKeyRotationService rotate paths: userKeyRotation (SDK and TypeScript
paths)
- LoginDecryptionOptionsComponent: missingEmailError on missing email,
userInitiated on user-cancelled logout dialog
- KeyRotationDialogService: userKeyRotation on all three rotation paths
- LockComponent: userInitiated on user log-out, noUnlockOptionsAvailable
on the fallback when no unlock options are available
* Fixed test input.
* Fixed incorrect "expired" property on msg.
* Made sure to get the right userId
* Add unit tests for logout-reason threading
Locks in behavior of the callers converted in this PR:
- RuntimeBackground.processMessage forwards `msg.logoutReason` (and
`msg.userId`) to `MainBackground.logout`. Guards against a
regression to the stale `msg.expired` field the prior code read.
- DefaultOrganizationInviteService passes
`"masterPasswordPolicyEnforcement"` when the MP-policy detour logs
the user out, on both `validateAndAcceptDirectOrgInvite` and
`acceptOpenOrgInvite`.
- AccountMenuComponent passes `"userInitiated"` when the user hits
the logout menu item.
- DeauthorizeSessionsComponent posts the security stamp then routes
through `LogoutService.logout(userId, "deauthorizedSessions")`
instead of the fire-and-forget `messagingService.send("logout")`.
* Drop unused MessagingService constructor dependency
`change-password.component.ts` and `set-initial-password.component.ts`
switched their sole `messagingService.send("logout")` call over to
`logoutService.logout(userId, ...)` earlier in this PR, leaving
`private messagingService: MessagingService` as a declared-but-unread
parameter property. The workspace has `noUnusedLocals` off and the
lint rule ignores unused parameter properties, so the compiler doesn't
catch it — every consumer still has to satisfy the dependency.
Removes the parameter and its import from both components, matching
the same cleanup this PR performed for
`DefaultLoginDecryptionOptionsService`/`WebLoginDecryptionOptionsService`.
* fix: prettier on account-menu.component.spec.ts
* Fixed test.
* Add missing log on app logout.
* Remove obsolete logout reason for KDF change.
* limit scenarios in which a basic auth challenge is automatically responded to
* constrain responses to challenges by allowlisted subresource types
* additional adjustments for Firefox
* further exclude subresources entirely from auth challenge response
* catch source errors
* ensure the user basic auth setting is rechecked upon account switch
* move the basic auth resolved state up to the autofill settings service
* skip basic auth for Safari
* Bulk decrypt with decrypt with failures new PR
* Implements rename feature for when a collection fails decryption via SDK call
* PR comments actioned on
* PR claude comment fixes
* PR claude comment fixes
* PR claude comments fixed
* PR Claude Comment fixes
* Rid of unused signal
* Fix up PR comments from Thomas
* Updates feature flag to proper key from epic
* Fix PR claude finding 1
* PR Claude comment fixes
* Fix PR comments
* Fix up message
* Rids of error badge in table to go back to existing behavior since no design/product capacity right now. Also rids of warning box above name of broken collection name