1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00
Commit Graph

53 Commits

Author SHA1 Message Date
Addison Beck
26caeb3083 Implement and extend tsconfig.base across projects (#14554)
* Implement and extend tsconfig.base across projects

* fixup! Merge remote-tracking branch 'origin/main' into rename-tsconfig

* fix: import tsconfig.base from components

* fix: skip typechecking node modules

* fixing tests

* fix the tests for real

* undo accidentally change
2025-06-02 20:38:17 +00:00
✨ Audrey ✨
97a591e738 [PM-16793] port credential generator service to providers (#14071)
* introduce extension service
* deprecate legacy forwarder types
* eliminate repeat algorithm emissions
* extend logging to preference management
* align forwarder ids with vendor ids
* fix duplicate policy emissions; debugging required logger enhancements

-----

Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
2025-05-27 09:51:14 -04:00
Oscar Hinton
c8629b92d3 [CL-694] Remove unused imports (#14795)
* Remove unused imports

* Remove more unused imports
2025-05-16 17:11:18 +02:00
SmithThe4th
ad3121f535 [PM-12423] Migrate Cipher Decryption to Use SDK (#14206)
* Created mappings for client domain object to SDK

* Add abstract decrypt observable

* Added todo for future consideration

* Added implementation to cipher service

* Added adapter and unit tests

* Created cipher encryption abstraction and service

* Register cipher encryption service

* Added tests for the cipher encryption service

* changed signature

* Updated feature flag name

* added new function to be used for decrypting ciphers

* Added new encryptedKey field

* added new function to be used for decrypting ciphers

* Manually set fields

* Added encrypted key in attachment view

* Fixed test

* Updated references to use decrypt with feature flag

* Added dependency

* updated package.json

* lint fix

* fixed tests

* Fixed small mapping issues

* Fixed test

* Added function to decrypt fido2 key value

* Added function to decrypt fido2 key value and updated test

* updated to use sdk function without prociding the key

* updated localdata sdk type change

* decrypt attachment content using sdk

* Fixed dependency issues

* updated package.json

* Refactored service to handle getting decrypted buffer using the legacy and sdk implementations

* updated services and component to use refactored version

* Updated decryptCiphersWithSdk to use decryptManyLegacy for batch decryption, ensuring the SDK is only called once per batch

* Fixed merge conflicts

* Fixed merge conflicts

* Fixed merge conflicts

* Fixed lint issues

* Moved getDecryptedAttachmentBuffer to cipher service

* Moved getDecryptedAttachmentBuffer to cipher service

* ensure CipherView properties are null instead of undefined

* Fixed test

* ensure AttachmentView properties are null instead of undefined

* Linked ticket in comment

* removed unused orgKey
2025-05-14 07:30:01 -07:00
Patrick-Pimentel-Bitwarden
0b0397c3f0 fix(enums-eslint): Enum Rule for ESLint (#14650)
* fix(enums-eslint): Enum Rule for ESLint - Added enums in the warnings for eslint.

* fix(enums-eslint): Enum Rule for ESLint - Updated to error in both places for enums.

* fix(enums-eslint): Enum Rule for ESLint - Added new eslint plugin for warning on enums.

* fix(enums-eslint): Enum Rule for ESLint - Changed based on suggestion.

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>

* refactor(browser-platform-utils): Remove Deprecation and Fix Code - Changed usages of firefox to private and moved the usages to the preferred public method and removed the deprecations.

* fix(enums-eslint): Enum Rule for ESLint - Updated to error and added disable rules for all other places.

* fix(enums-eslint): Enum Rule for ESLint - Undid other changes by accident
2025-05-13 10:07:38 -04:00
Bernd Schoolmann
67b0a19319 [PM-21001] Move tools usage of encrypt service (#14540)
* Add new encrypt service functions

* Undo changes

* Cleanup

* Fix build

* Fix comments

* Move tools usage of encrypt service
2025-04-30 15:36:48 +02:00
Thomas Avery
d43e4757df [PM-7604] Require target UserID for KdfConfigService (#14380)
* Require userId for KdfConfigService

* Update auth team callers

* Update tools team callers
2025-04-29 17:25:27 -05:00
Vijay Oommen
a829965262 [PM-20386] valuesChanges returns a string (#14338) 2025-04-18 13:05:58 -05:00
Daniel James Smith
170f97da8e [PM-20333] Remove "export-attachments" feature flag (#14310)
* Remove usage of export-attachments feature flag

* Remove export-attachments feature flag definition

* Update export.command documentation

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-04-17 08:58:16 -04:00
Bernd Schoolmann
5a1b0744f0 [PM-17665] Move cryptofunction service to km (#13285)
* Move cryptofunction service to km

* Fix formatting

* Fix import

* Fix build on desktop

* Fix build on browser and tests
2025-04-10 11:09:35 +02:00
Daniel James Smith
f13bc2766b Set selected format to json, when the zip format option is removed (#14092)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-04-02 15:28:40 +02:00
Daniel James Smith
7992e0247e Fix wrong file extension being set when exporting with attachments (#14067)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-03-31 15:06:27 +00:00
Daniel James Smith
0311681803 Fix filename not including "_encrypted_" when selecting encrypted vault exports (#14066)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-03-31 16:55:04 +02:00
Daniel James Smith
49924512b8 [PM-19656] Fix zip option not being set correctly after navigating to Admin Console (#14058)
* Simplify if to reduce nesting

* Start subscribing to changes of the vaultSelector as soon as possible during ngOnInit

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-03-31 15:55:20 +02:00
Daniel James Smith
7ed2145393 Set correct filename extensions on vault-export (#14018)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-03-28 16:20:36 +01:00
Brandon Treston
0fd01ed7ee [PM-18566] Wire up vNextPolicyService for Clients (#13678)
* wire up vNext impl

* wire up vNextPolicyService for browser

* wire up vNextPolicyService for desktop

* wire up vNextPolicyService for cli

* fix test

* fix missed caller

* cleanup

* fix missing property assignment

* fix QA bug for PM-19205

* fix QA bug for PM-19206

* fix QA bug for pm-19228

* cleanup
2025-03-25 11:30:47 -04:00
Bernd Schoolmann
27baa92fcf [PM-10749] [BEEEP] New export format: Zip with attachments (#10465)
* Add new export format: zip

* Restrict zip export to just individual vaults

* Add tests

* Remove unused import

* Fix build error

* Fix tests

* Fix test

* Fix retrieval of ciphers by passing in activeUserId

* Guard feature behind `export-attachments`-feature-flag

* Extend cipher filter to also filter out any ciphers that are assigned to an organization

* Added apiService to retrieve AttachmentData (metaData) and then download the attachment

- Added ApiService as a depdency within DI for VaultExportService/IndividualVaultExportService
- Added unit tests for filtering ciphers
- Added unit test for downloading attachment metadata and attachments

* Moved attachment decryption into a separate method and added unit tests

* Added null check for creating the base attachment folder

* Move format check for zip within Org export into an early return/throw

* Add feature flag guard on the CLI

* Extend ExportScopeCallout to display an individual export will contain attachment when zip-format is selected

* Fix adding/removing the zip-export option based on selected vault and state of `export-attachments` feature-flag

* Separate AAA visually using whitespace within tests

* Remove unused error var

* Write test that verifies different http request failures when retrieving attachment data

* Remove uneeded ignore lint rule

* Rewrite test to actually check that ciphers assigned to an org are filtered out

* Introduce ExportedVault return type (#13842)

* Define ExportedVault type unioned by 2 new types that describe a plain-text export vs a blob-based zip-export

* Extend static getFileName to handle formats and add unit-tests

* Introduce new export return type throughout the vault export module

- Update abstractions
- Update return types within implementations
- Update callers/consumers to handle the new return value
- Fix all unit tests

* Add support for new export return type and fix download of blobs via CLI

* Add documentation to public methods

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>

---------

Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-03-25 13:30:54 +01:00
Vijay Oommen
8ed8c9af6a [PM-18685] Disable MyVault when the Person Ownership policy is true (#13930) 2025-03-24 08:33:17 -05:00
✨ Audrey ✨
b4bfacf6e3 [PM-16792] [PM-16822] Encapsulate encryptor and state provision within UserStateSubject (#13195) 2025-02-21 17:00:51 -06:00
Oscar Hinton
5d04efad2a [PM-18363] Remove internal dependencies from package.json (#13448)
* Remove internal dependencies from package.json

* Update lockfile

* Change workspace to include nested libs
2025-02-20 15:04:39 +01:00
Daniel James Smith
f798760dc5 [PM-17948] Migrate export from generator legacy to generator core (#13238)
* Migrate export from generator-legacy to generator-core

* Remove unused platformUtilsService

* Wire up password generation within ngOnInit

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-02-18 20:21:42 +01:00
SmithThe4th
a2945203f4 [PM-12047] Remove usage of ActiveUserState from cipher.service (#12814)
* Cipher service web changes

* Updated browser client to pass user id to cipher service observable changes

* Cli changes

* desktop changes

* Fixed test

* Libs changes

* Fixed merge conflicts

* Fixed merge conflicts

* removed duplicate reference fixed conflict

* Fixed test

* Fixed test

* Fixed test

* Fixed desturcturing issue on failed to decrypt ciphers cipher service

* Updated abstraction to use method syntax

* Fixed conflicts

* Fixed test on add edit v2

Passed active userId to delete function

* Used getUserId utility function

* made vault changes

* made suggestion changes

* made suggestion changes

* made suggestion changes

* Replace getUserId function calls with pipe operator syntax for better consistency

* fixed merge conflicts

* revert mistake made of usinf account activity during merge conflict fix

* fixed conflicts

* fixed tests
2025-02-12 08:53:31 -05:00
Bernd Schoolmann
2f8a7a95bd [PM-15994] Move encrypt service to km ownership (#13220)
* Move encrypt service to km ownership

* Update imports for encrypt service abstraction and move bulk encrypt service abstraction

* Fix imports

* Fix further imports

* Fix imports

* Fix worker import
2025-02-05 17:39:11 +01:00
Brandon Treston
a949f793ed [PM-15506] Implement vNextOrganizationService (#12839)
* [PM-15506] Wire up vNextOrganizationService for libs/common and libs/angular (#12683)

* Wire up vNextOrganizationService in PolicyService

* Wire vNextOrganizationService in SyncService

* wire vNextOrganizationService for EventCollectionService

* wire vNextOrganizationService for KeyConnectorService

* wire up vNextOrganizationService for CipherAuthorizationService

* Wire up vNextOrganizationService in PolicyService

* Wire vNextOrganizationService in SyncService

* wire vNextOrganizationService for EventCollectionService

* wire vNextOrganizationService for KeyConnectorService

* wire up vNextOrganizationService for CipherAuthorizationService

* wire vNextOrganizationService for share.component

* wire vNextOrganizationService for collections.component

* wire vNextOrganizationServcie for add-account-credit-dialog

* wire vNextOrganizationService for vault-filter.service

* fix browser errors for vNextOrganizationService implementation in libs

* fix desktop errors for vNextOrganizationService implementation for libs

* fix linter errors

* fix CLI errors on vNextOrganizationServcie implementations for libs

* [PM-15506] Wire up vNextOrganizationService for web client (#12810)

PR to a feature branch, no need to review until this goes to main.

* implement vNextOrganization service for browser client (#12844)

PR to feature branch, no need for review yet.

* wire vNextOrganizationService for licence and some web router guards

* wire vNextOrganizationService in tests

* remove vNext notation for OrganizationService and related

* Merge branch 'main' into ac/pm-15506-vNextOrganizationService

* fix tsstrict error

* fix test, fix ts strict error
2025-01-22 15:20:25 -05:00
Oscar Hinton
e5f83ff086 [PM-17031] Create UI-common (#12831)
Extract core functionality from `libs/angular` to allow teams to depend on `libs/ui-common` instead.

Moves the following functionality to `ui-common`.
- `I18nPipe`. `libs/angular` still has an old copy but `components` depends on the new variant from `ui-common`.
- `safeProvider`, `SafeProvider` and `SafeInjectionToken`. `libs/angular`re-exports these to avoid needing to update all consumers.
2025-01-17 10:42:31 -05:00
Oscar Hinton
653b730969 [PM-16872] Update libs to use explicit dependencies (#12770)
Update all libs to use explicit dependencies rather than relying on tsconfig.libs.json. This allows us to more easily understand the dependencies between libs and prevent users from accidentally adding new dependencies.

We still use tsconfig.libs (now renamed tsconfig.spec) for tests.
2025-01-10 11:21:38 +01:00
SmithThe4th
10c8a2101a [PM-12049] Remove usage of ActiveUserState from folder service (#11880)
* Migrated folder service from using active user state to single user state

Added extra test cases for encrypted folder and decrypted folders

Updated derived state to use decrypt with key

* Update callers in the web

* Update callers in the browser

* Update callers in libs

* Update callers in cli

* Fixed test

* Fixed folder state test

* Fixed test

* removed duplicate activeUserId

* Added takewhile operator to only make calls when userId is present

* Simplified to accept a single user id instead of an observable

* Required userid to be passed from notification service

* [PM-15635] Folders not working on desktop (#12333)

* Added folders memory state definition

* added decrypted folders state

* Refactored service to remove derived state

* removed combinedstate and added clear decrypted folders to methods

* Fixed test

* Fixed issue with editing folder on the desktop app

* Fixed test

* Changed state name

* fixed ts strict issue

* fixed ts strict issue

* fixed ts strict issue

* removed unnecessasry null encrypteed folder check

* Handle null folderdata

* [PM-16197] "Items with No Folder" shows as a folder to edit name and delete (#12470)

* Force redcryption anytime encryption state changes

* Fixed text file

* revert changes

* create new object with nofolder instead of modifying exisiting object

* Fixed failing test

* switched to use memory-large-object

* Fixed ts sctrict issue

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
2025-01-02 17:16:33 -05:00
Matt Gibson
9c1e2ebd67 Typescript-strict-plugin (#12235)
* Use typescript-strict-plugin to iteratively turn on strict

* Add strict testing to pipeline

Can be executed locally through either `npm run test:types` for full type checking including spec files, or `npx tsc-strict` for only tsconfig.json included files.

* turn on strict for scripts directory

* Use plugin for all tsconfigs in monorepo

vscode is capable of executing tsc with plugins, but uses the most relevant tsconfig to do so. If the plugin is not a part of that config, it is skipped and developers get no feedback of strict compile time issues. These updates remedy that at the cost of slightly more complex removal of the plugin when the time comes.

* remove plugin from configs that extend one that already has it

* Update workspace settings to honor strict plugin

* Apply strict-plugin to native message test runner

* Update vscode workspace to use root tsc version

* `./node_modules/.bin/update-strict-comments` 🤖

This is a one-time operation. All future files should adhere to strict type checking.

* Add fixme to `ts-strict-ignore` comments

* `update-strict-comments` 🤖

repeated for new merge files
2024-12-09 20:58:50 +01:00
Bernd Schoolmann
38c4eeb27d [PM-14542] Move kdf to km ownership (#11877)
* Move kdf to km ownership

* Fix duplicate import

* Remove whitespace

* Fix double imports

* Fix desktop build

* Fix test error

* Fix imports

* Move ownership of kdftype to km

* Fix imports

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2024-11-21 13:45:28 +01:00
Bernd Schoolmann
b486fcc689 [Pm-13097] Rename cryptoservice to keyservice and move it to km ownership (#11358)
* Rename cryptoservice to keyservice

* Rename cryptoservice to keyservice

* Move key service to key management ownership

* Remove accidentally added file

* Fix cli build

* Fix browser build

* Run prettier

* Fix builds

* Fix cli build

* Fix tests

* Fix incorrect renames

* Rename webauthn-login-crypto-service

* Fix build errors due to merge conflicts

* Fix linting
2024-10-24 19:41:30 +02:00
Thomas Rittson
7c72795d1c [PM-12747] Move CollectionService and models to AC Team (#11278) 2024-10-08 10:14:39 -04:00
Bernd Schoolmann
d92b2cbea2 [PM-11477] Remove deprecated cryptoservice functions (#10854)
* Remove deprecated cryptoservice functions

* Use getUserkeyWithLegacySupport to get userkey

* Fix tests

* Fix tests

* Fix tests

* Remove unused cryptoservice instances

* Fix build

* Remove unused apiService in constructor

* Fix encryption

* Ensure passed in key is used if present

* Fix sends and folders

* Fix tests

* Remove logged key

* Fix import for account restricted keys
2024-09-24 11:28:33 +02:00
Daniel James Smith
f70b3df2d2 [PM-11949] Fix generating and copying export password (#10999)
* Use password field value instead of local variable for copy to clipboard

Use appCopyClick directive instead of manually copying and showing success toast

* Add missing "copySuccessful" message key to desktop and web

* Remove whitespace from web en/messages.json

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-09-12 20:04:39 +02:00
Jordan Aasen
140b76d021 [PM-8490] - Add generate password to password-protected export (#10539)
* WIP generate password in export vault

* finish generate password in export component

* use bitIconButton directive

* add copy link to file password input

* change copy password message
2024-08-20 17:16:54 -07:00
SmithThe4th
dedd7f1b5c [PM-10607] Require userId for getKeyForCipherKeyDecryption (#10509)
* updated cipher service to stop using the deprecated getUserKeyWithLegacySupport and use the version that requires a user id

* Added account service mock

* fixed cipher test

* Fixed test

* removed async from encryptCipher

* updated encryptSharedCipher to pass userId to the encrypt function

* Pass userId to getUserKeyWithLegacySupport on encryptSharedCipher

* pass in userid when setting masterKeyEncryptedUserKey

* Added activer usedId to new web refresh function
2024-08-20 11:00:48 -05:00
Oscar Hinton
c50a9063bc [PM-2340] Enable use-lifecycle-interface (#5488)
Enables one of the recommended rules of @angular-eslint. Since this rule was fairly trivial to fix and has no QA effects it seemed reasonable to migrate all code.
2024-08-02 13:59:38 -04:00
Daniel James Smith
92692388cb Move stranded enum into @bitwarden/vault-export-ui (#10247)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-07-25 11:17:35 -04:00
aj-rosado
94d6cc3ef1 [PM-8780] Added validation to only display organizations with managed collections (#10065)
* Added validation to only display organizations with managed collections on the export org selector

* using the decryptedCollection$ directly instead of creating a new observable from the encryptedCollections array
2024-07-19 10:45:35 +01:00
aj-rosado
ea76760782 [AC-2508][AC-2511] member access report view and export logic (#10011)
* Added new report card and FeatureFlag for MemberAccessReport

* Add new "isEnterpriseOrgGuard"

* Add member access icon

* Show upgrade organization dialog for enterprise on member access report click

* verify member access featureflag on enterprise org guard

* add comment with TODO information for follow up task

* Initial member access report component

* Improved readability, removed path to wrong component and refactored buildReports to use the productType

* finished MemberAccessReport layout and added temporary service to provide mock data

* Moved member-access-report files to bitwarden_license/
Removed unnecessary files

* Added new tools path on bitwarden_license to the CODEOWNERS file

* added member access description to the messages.json

* layout changes to member access report

* Created new reports-routing under bitwarden_license
Moved member-access-report files to corresponding subfolder

* Added search logic

* Removed routing from member-access-report BL component on OSS.
Added member-access-report navigation to organizations-routing on BL

* removed unnecessary ng-container

* Added OrganizationPermissionsGuard and canAccessReports validation to member-access-report navigation

* replaced deprecated search code with searchControl

* Address PR feedback

* removed unnecessary canAccessReports method

* Added report-utils class with generic functions to support report operations

* Added member access report mock

* Added member access report specific logic

* Splitted code into different classes that explained their objective.

* fixed member access report service test cases

* Addressed PR feedback

* Creating a service to return the data for the member access report

* added missing ExportHelper on index.ts

* Corrected property names on member access report component view

* removed duplicated service
2024-07-11 17:11:05 +01:00
Daniel James Smith
33de685b40 [PM-5165][PM-8645] Migrate password strength component (#9912)
* Create standalone password-strength-v2 component

* Add deprecation notice to old component

* PM-8645: Use new password-strength component on export

* Remove unneccessary variable

* Remove setPasswordScoreText method

* Rename passwordStrengthResult to passwordStrengthScore and assign proper type

* Add missing types

* Document component Inputs/Outputs

* Add unit tests

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-07-10 16:59:17 +02:00
Daniel James Smith
c35bbc522c [PM-9051][PM-8641] Use reusable export-component on web (#9741)
* Add export-web.component

Introduce new export-web component
Delete old component
export.module - With export-web being standalone there's no need for a importModule
Change routing to load new component

* Prepare export.component to receive a orgId via the hosting-component

* Remove unused onSaved as it's replaced by onSuccessfulExport

* Refactor org-vault-export.component

Introduce new org-vault-export.component.html as the old component relied on the markup from password manager
Refactor org-vault-export.component
Retrieve organizationId from Route and pass it into the shared export.component
Ensure when exporting from AC to include all data from the selected org
org-vault-export.module - With the new component being standalone there's no need for a importModule
Change routing to load new org-vault-export component

* PM-8641 - Add success toast to base-export component
This ensures a success toast is shown on all clients consistently
Add missing entries into clients messages.json

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-06-25 19:17:03 +02:00
Jake Fink
0add2949c0 [PM-8772] move ranges to static properties on class (#9567)
* move ranges to static properties on class

* rename static properties
2024-06-25 08:21:02 -04:00
Daniel James Smith
8d04731633 [PM-6568][PM-8820][Tech-Debt] Migrate all tools owned toasts to use CL ToastService instead of PlatformUtilsService (#9405)
* Migrate all tools owned toasts to use CL ToastService instead of PlatformUtilsService

* Fix test that was missing a mock

* Fix double checking file and file-content selection

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-06-19 18:28:47 +02:00
Vincent Salucci
b169207b74 [AC-2647] Remove Flexible Collections MVP code (#9518)
* chore: organization.ts, remove refs to flexibleCollections and isManager, refs AC-2647

* chore: clean up callers of removed methods from organization.ts, refs AC-2647

* chore: access-selector, remove fc input and update permissionList param, refs AC-2647

* chore: update permissionList caller, update group-add-edit fc refs, and remove accessAll, refs AC-2647

* chore: update member-dialog fc callers, refs AC-2647

* chore: update bulk-collections-dialog fc callers, refs AC-2647

* chore: update collection-dialog fc callers, refs AC-2647

* chore: update simple fc caller to misc files, refs AC-2647

* chore: update member-dialog fc callers, refs AC-2647

* chore: remove accessAll references and update callers, refs AC-2647

* chore: update comment to specify v1 usage, refs AC-2647

* chore: remove unused message keys and code calls to use those messages, refs AC-2647

* chore: remove readonly false from access-selector model map function, refs AC-2647
2024-06-10 11:59:20 -05:00
Daniel James Smith
c749447894 [PM-8254] Create shareable export component (#9246)
* Make export.component a standalone component

Fix lint issue with takeUntil

* Create shareable export.component.html

Copied existing export.component.html as that has already been migrated to use the component library components
Strip the markup from the dialog and the submit-button

* Add outputs to inform the hosting component about certain events (submit, loading, disabled)

Emit successful Export

Expose a form-id so the hosting component can bind to this form

Fix name of output

* Ensure that the file gets prefixed with `org`when exporting from an organization

* When exporting from an organization ensure Organization_ClientExportedVault is collected

* Add comments to the components outputs

* Better way of addressing the previously fixed lint issue

* Fix disabling the form not emitting the formDisabled state

* Add better comments to Outputs based on PR feedback

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-28 22:32:01 +02:00
Matt Gibson
37eef7731f Prefer prefetching keys (#9289)
magical black-box key retrieval is slow, due to needing to repeatedly resolve (and potentially decrypt) keys. Doing the work up front is both more explicit and much faster.

It would be preferable to move OrganizationId to an opaque type in the models, but that has rippling effects all over the place and ultimately is stopped by vault filtering on strings rather than ids, but still calling the property `organizationId`, we need to fix that first.
2024-05-22 09:56:24 -04:00
Daniel James Smith
a3d69047c7 [PM-8252] Use new user-verification for exports on all clients (#9244)
* Move/replace submit and userVerification logic from web into the BaseExportComponent

Add "@bitwarden/auth" as dependency to the vault-export-ui package
New submit logic also checks for password-encrypted exports which will be need for future UI updates on browser and desktop

* Remove import/passing of the unneeded UserVerificationService

* Remove app-user-verification from browser and desktop components as the new UI is opened as a self-contained dialog

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-21 13:02:16 +02:00
Matt Gibson
ee690cd1ef Use account service for getting account profile data. (#9133)
* Use account service for getting account profile data.

* desktop build fixes

* CLI build fixes

* Remove state service methods
2024-05-17 00:21:00 +02:00
rr-bw
a42de41587 [PM-5363] PinService State Providers (#8244)
* move pinKeyEncryptedUserKey

* move pinKeyEncryptedUserKeyEphemeral

* remove comments, move docs

* cleanup

* use UserKeyDefinition

* refactor methods

* add migration

* fix browser dependency

* add tests for migration

* rename to pinService

* move state to PinService

* add PinService dep to CryptoService

* move protectedPin to state provider

* update service deps

* renaming

* move decryptUserKeyWithPin to pinService

* update service injection

* move more methods our of crypto service

* remove CryptoService dep from PinService and update service injection

* remove cryptoService reference

* add method to FakeMasterPasswordService

* fix circular dependency

* fix desktop service injection

* update browser dependencies

* add protectedPin to migrations

* move storePinKey to pinService

* update and clarify documentation

* more jsdoc updates

* update import paths

* refactor isPinLockSet method

* update state definitions

* initialize service before injecting into other services

* initialize service before injecting into other services (bw.ts)

* update clearOn and do additional cleanup

* clarify docs and naming

* assign abstract & private methods, add clarity to decryptAndMigrateOldPinKeyEncryptedMasterKey() method

* derived state (attempt)

* fix typos

* use accountService to get active user email

* use constant userId

* add derived state

* add get and clear for oldPinKeyEncryptedMasterKey

* require userId

* move pinProtected

* add clear methods

* remove pinProtected from account.ts and replace methods

* add methods to create and store pinKeyEncryptedUserKey

* add pinProtected/oldPinKeyEncrypterMasterKey to migration

* update migration tests

* update migration rollback tests

* update to systemService and decryptAndMigrate... method

* remove old test

* increase length of state definition name to meet test requirements

* rename 'TRANSIENT' to 'EPHEMERAL' for consistency

* fix tests for login strategies, vault-export, and fake MP service

* more updates to login-strategy tests

* write new tests for core pinKeyEncrypterUserKey methods and isPinSet

* write new tests for pinProtected and oldPinKeyEncryptedMasterKey methods

* minor test reformatting

* update test for decryptUserKeyWithPin()

* fix bug with oldPinKeyEncryptedMasterKey

* fix tests for vault-timeout-settings.service

* fix bitwarden-password-protected-importer test

* fix login strategy tests and auth-request.service test

* update pinService tests

* fix crypto service tests

* add jsdoc

* fix test file import

* update jsdocs for decryptAndMigrateOldPinKeyEncryptedMasterKey()

* update error messages and jsdocs

* add null checks, move userId retrievals

* update migration tests

* update stateService calls to require userId

* update test for decryptUserKeyWithPin()

* update oldPinKeyEncryptedMasterKey migration tests

* more test updates

* fix factory import

* update tests for isPinSet() and createProtectedPin()

* add test for makePinKey()

* add test for createPinKeyEncryptedUserKey()

* add tests for getPinLockType()

* consolidate userId verification tests

* add tests for storePinKeyEncryptedUserKey()

* fix service dep

* get email based on userId

* use MasterPasswordService instead of internal

* rename protectedPin to userKeyEncryptedPin

* rename to pinKeyEncryptedUserKeyPersistent

* update method params

* fix CryptoService tests

* jsdoc update

* use EncString for userKeyEncryptedPin

* remove comment

* use cryptoFunctionService.compareFast()

* update tests

* cleanup, remove comments

* resolve merge conflict

* fix DI of MasterPasswordService

* more DI fixes
2024-05-08 11:34:47 -07:00
Ike
1e4158fd87 [PM-5735] Create kdf Service (#8715)
* key connector migration initial

* migrator complete

* fix dependencies

* finalized tests

* fix deps and sync main

* clean up definition file

* fixing tests

* fixed tests

* fixing CLI, Browser, Desktop builds

* fixed factory options

* reverting exports

* implemented UserKeyDefinition clearOn

* Initial Kdf Service Changes

* rename and account setting kdfconfig

* fixing tests and renaming migration

* fixed DI ordering for browser

* rename and fix DI

* Clean up Migrations

* fixing migrations

* begin data structure changes for kdf config

* Make KDF more type safe; co-author: jlf0dev

* fixing tests

* Fixed CLI login and comments

* set now accepts userId and test updates

---------

Co-authored-by: Jake Fink <jfink@bitwarden.com>
2024-04-25 11:26:01 -07:00