* Prevent collection nesting on import into a my items collection
My Items collections do not support nested collections. The import source hierarchy needs to be flattened into the My Items collection
* Introduce new types for folder and collection relationship
Makes it easier to identify which position is for the cipherIndex and which is for the folder-/collection-index
* Fix assignment of ciphers to My items collection
* Remove unneeded type cast or assertions
* Add clarifying comment
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Fix feature flag check for "pm-25855-chromium-importer-abe"
The old lofgic actually removed all chromium support when the flag was disabled. It should only remove those browser if the flag is disabled and when on Windows.
* Extend tests
* Update comment
* Remove duplicate test
* Add test for when device cannot be detected and throws and error
* Add descriptive comment to feature flag test case assertions
* Better test assertion
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Add missing browser to SUPPORTED_BROWSERS in windows.rs
These were previously removed due to needing ABE support
* Add feature flag for chromium importer with ABE
* Fix tests for windows
* Run cargo fmt
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Verify route and input to be a valid organizationId
* Optimize canImport check
Instead of loading the user and organization again, used the previously loaded organization and check the permission directly
* Reset organization in case organizationId is set to undefined
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Add importer metadata to native code
* Impl napi code in ts
* Impl napi code in ts
* Fix clippy
* Fix clippy
* remove ts util tests
* Check for installed browsers
* PR fixes
* test fix
* fix clippy
* fix tests
* Bug fix
* clippy fix
* Correct tests
* fix clippy
* fix clippy
* Correct tests
* Correct tests
* [PM-25521] Wire up loading metadata on desktop (#16813)
* Initial commit
* Fix issues regarding now unused feature flag
* Fixed ts-strict issues
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: adudek-bw <adudek@bitwarden.com>
* Remove logic to skip Brave as that now happens via the native code
* Define default capabilities which can be overwritten by specifc client/platform
* Fix DI issues
* Do not overwrite existing importers, just add new ones or update existing ones
* feat: [PM-25521] return metadata directly (not as JSON) (#16882)
* feat: return metadata directly (not as JSON)
* Fix broken builds
Move getMetaData into chromium_importer
Remove chromium_importer_metadata and any related service
Parse object from native instead of json
* Run cargo fmt
* Fix cargo dependency sort order
* Use exposed type from NAPI instead of redefining it.
* Run cargo fmt
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Only enable chromium loader for installed and supported browsers
---------
Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
• prefer undefined over null
• obtain required UserId once per method, before branching
• guards moved to beginning of methods
* lift UserId retrieval to occur once during import
* remove redundant userId retrieval
* [PM-25682] Remove ts-strict-ignore from Vault view models and update types to be strict
* [PM-25682] Ignore ViewEncryptableKeys error for old decrypt methods
* [PM-25682] Add null/undefined as possible types for isNull* and other helpers that include null checks internally
* [PM-25682] Use patchValue instead of setValue which does not support undefined values
* [PM-25682] Add type assertions and other misc. null checks where necessary
* [PM-25682] Fix importers specs
* [PM-25682] Cleanup card view/details
* [PM-25682] Fix cipher view hasAttachment helper
* [PM-25682] Cleanup unecessary null assignments in notification.background.spec.ts
* [PM-25682] Ensure linkedId is undefined instead of null
* [PM-25682] Cleanup misc typing errors
* [PM-25682] Make the CipherId required
* [PM-25682] Undo CipherId assertions
* [PM-25682] Undo brand initial value change
* [PM-25682] Update SshKeyView
* [PM-25682] Add constructor to Fido2CredentialView
* [PM-25682] Prettier
* [PM-25682] Fix strict type warnings after merge with main
* [PM-25682] Cleanup cipher view spec
* [PM-25682] Cleanup new type warnings after merge
* [PM-25682] Undo removed eslint-disable-next-line comment
* [PM-25682] Fix flaky test
* [PM-25682] Use satisfies instead of as for Fido2CredentialAutofillView
* Disable chrome loader on MAS
* Remove direct dependency on platform utils service in favour of the system
* Move check above brave condition
* Invert condition
* replace deprecated getOrgKey() method
• obtain account using `accountService.activeAccount$` and then use id property to guarentee validity of UserId
* hide chromium importer for Brave/Windows only
* run cargo fmt
* address items found during review
• revert unnecessary changes to windows.rs
• handle exceptions by disabling chromium importer
* refactor filter logic
* wrap sdk callsite in try/catch to handle error appropriately
`encryptService.decryptString()` calls code in the internal SDK which when provided an invalid
key returns `CryptoError::InvalidMac`. The originating callsite has been wrapped in a try/catch
in order to intercept the error and return false so that logic in parse() may return
a more appropriate error message in the UI.
* add unit test and explanatory comment
* remove misleading comment
* remove null comparison and unused variable
Addresses an issue when selecting an import format when the use-chromium-importer feature flag is enabled
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Add importer dummy lib, add cargo deps for win/mac
* Add Chromium importer source from bitwarden/password-access
* Mod crypto is no more
* Expose some Chromium importer functions via NAPI, replace home with home_dir crate
* Add Chromium importer to the main <-> renderer IPC, export all functions from Rust
* Add password and notes fields to the imported logins
* Fix windows to use homedir instead of home
* Return success/failure results
* Import from account logins and join
* Linux v10 support
* Use mod util on Windows
* Use mod util on macOS
* Refactor to move shared code into chromium.rs
* Fix windows
* Fix Linux as well
* Linux v11 support for Chrome/Gnome, everything is async now
* Support multiple browsers on Linux v11
* Move oo7 to Linux
* Fix Windows
* Fix macOS
* Add support for Brave browser in Linux configuration
* Add support for Opera browser in Linux configuration
* Fix Edge and add Arc on macOS
* Add Opera on macOS
* Add support for Vivaldi browser in macOS configuration
* Add support for Chromium browser in macOS configuration
* Fix Edge on Windows
* Add Opera on Windows
* Add Vivaldi on windows
* Add Chromium to supported browsers on Windows
* stub out UI options for chromium direct import
* call IPC funcs from import-desktop
* add notes to chrome csv importer
* remove (csv) from import tool names and format item names as hostnames
* Add ABE/v20 encryption support
* ABE/v20 architecture description
* Add a build step to produce admin.exe and service.exe
* Add Windows v20/ABE configuration functionality to specify the full path to the admin.exe and service.exe. Use ipc.platform.chromiumImporter.configureWindowsCryptoService to configure the Chromium importer on Windows.
* rename ARCHITECTURE.md to README.md
* aligns with guidance from architecture re: in-repository documentation.
* also fixes a failing lint.
* cargo fmt
* cargo clippy fix
* Declare feature flag for using chromium importer
* Linter fix after executing npm run prettier
* Use feature flag to guard the use of the chromium importer
* Added temporary logging to further debug, why the Angular change detection isn't working as expected
* introduce importer metadata; host metadata from service; includes tests
* fix cli build
* Register autotype module in lib.rs
introduce by a bad merge
* Fix web build
* Fix issue with loaders being undefined and the feature flag turned off
* Add missing Chromium support when selecting chromecsv
* debugging
* remove chromium support from chromecsv metadata
* fix default loader selection
* [PM-24753] cargo lib file (#16090)
* Add new modules
* Fix chromium importer
* Fix compile bugs for toolchain
* remove importer folder
* remove IPC code
* undo setting change
* clippy fixes
* cargo fmt
* clippy fixes
* clippy fixes
* clippy fixes
* clippy fixes
* lint fix
* fix release build
* Add files in CODEOWNERS
* Create tools owned preload.ts
* Move chromium-importer.service under tools-ownership
* Fix typeError
When accessing the Chromium direct import options the file button is hidden, so trying to access it's values will fail
* Fix tools owned preload
* Remove dead code and redundant truncation
* Remove configureWindowsCryptoService function/methods
* Clean up cargo files
* Fix unused async
* Update apps/desktop/desktop_native/bitwarden_chromium_importer/Cargo.toml
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
* Fix napi deps
* fix lints
* format
* fix linux lint
* fix windows lints
* format
* fix missing `?`
* fix a different missing `?`
---------
Co-authored-by: Dmitry Yakimenko <detunized@gmail.com>
Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: ✨ Audrey ✨ <ajensen@bitwarden.com>
Co-authored-by: ✨ Audrey ✨ <audrey@audreyality.com>
Co-authored-by: adudek-bw <adudek@bitwarden.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
* Move pin service to km ownership
* Run format
* Eslint
* Fix tsconfig
* Fix imports and test
* Clean up imports
* Remove unused dependency on PinService
* Fix comments
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* [PM-22136] Update sdk cipher view map to support uknown uuid type
* [PM-22136] Add key to CipherView for copying to SdkCipherView for encryption
* [PM-22136] Add fromSdk* helpers to Cipher domain objects
* [PM-22136] Add toSdk* helpers to Cipher View objects
* [PM-22136] Add encrypt() to cipher encryption service
* [PM-22136] Add feature flag
* [PM-22136] Use new SDK encrypt method when feature flag is enabled
* [PM-22136] Filter out null/empty URIs
* [PM-22136] Change default value for cipher view arrays to []. See ADR-0014.
* [PM-22136] Keep encrypted key value on attachment so that it is passed to the SDK
* [PM-22136] Keep encrypted key value on CipherView so that it is passed to the SDK during encryption
* [PM-22136] Update failing attachment test
* [PM-22136] Update failing importer tests due to new default value for arrays
* [PM-22136] Update CipherView.fromJson to handle the prototype of EncString for the cipher key
* [PM-22136] Add tickets for followup work
* [PM-22136] Use new set_fido2_credentials SDK method instead
* [PM-22136] Fix missing prototype when decrypting Fido2Credentials
* [PM-22136] Fix test after sdk change
* [PM-22136] Update @bitwarden/sdk-internal version
* [PM-22136] Fix some strict typing errors
* [PM-23348] Migrate move cipher to org to SDK (#15567)
* [PM-23348] Add moveToOrganization method to cipher-encryption.service.ts
* [PM-23348] Use cipherEncryptionService.moveToOrganization in cipherService shareWithServer and shareManyWithServer methods
* [PM-23348] Update cipherFormService to use the shareWithServer() method instead of encrypt()
* [PM-23348] Fix typo
* [PM-23348] Add missing docs
* [PM-22136] Fix EncString import after merge with main
* add support for RfFieldsV2
* add unit tests for totp and custom fields
* update empty-folders data for new unit tests
* ignore User ID$, Password$ and Script$
* refactor: extract parsing logic for Rf_fields and RfFieldsV2 into separate methods and don't ignore User ID$, Password$ or Script$
* Fixed linting issue by executing npm run prettier
---------
Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Create importer for xml file from Password Depot 17
- Create importer
- Create test data
- Create unit tests
* Add support for parsing credit cards
* Update comment on importer class
* Wire up the importer to be selectable in the UI
* Import and set favorites based on export file
* Refactor: Extract method for parsing login fields
* Parse comment on credit cards
* Add support for parsing identity records
* Add support for parsing rdp records
* Remove html decoding of password field
* Include setting credit card brand
* Create type to describe the different source item types
* Add support for SoftwareLicense item type
* Add support for teamviewer item type
* Add support for Putty item type
* Skip processing historical entries
* Add support for banking item type
* Add support for information item type
* Add support for certificate into login type
* Rename encrypted-file.xml to noop-encrypted-file due to a source type with the same name
* Add support for encrypted file item type
* Add support for document type
* Add mapping of source field types to bitwarden custom field types
* Remove duplicate code (copy-pasta mistake)
* Added missing docs
* Adding fallback to support MacOS Password Depot 17 xml files
Instead of a version node they have a dataformat node which contains the file format version
* Add support to parse export files from the MacOS client
* Skip creating a folder if it has no name
* Fix recognition and assignment to folders/collections
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* add generic `union-of-values` helper
* migrate `GeneratorDialogAction` to a constant
* migrate `VaultState` to a constant
* migrate `AtRiskCarouselDialogResult` to a constant
* migrate `CredentialGeneratorDialogAction` to a constant
* migrate `FolderAddEditDialogResult` to a constant
* migrate `ViewCipherDialogResult` to a constant
* migrate `VisibleVaultBanner` to a constant
* migrate `VaultFilterLabel` to a constant
* migrate `WebVaultGeneratorDialogResult` to a constant
* migrate `BulkDeleteDialogResult` to a constant
* migrate `BulkMoveDialogResult` to a constant
* migrate `AddEditCipherDialogResult` to a constant
* migrate `VaultItemDialogResult` to a constant
* migrate `BrowserPromptState` to a constant
* migrate `NudgeType` to a constant
* migrate `SecurityTaskStatus` to a constant
* migrate `CipherRepromptType` to a constant
* migrate `SecureNoteType` to a constant
* migrate `FieldType` to a constant
* migrate `LinkedIdType` to a constant
* migrate `CollectionAssignmentResult` to a constant
* migrate `AddEditFolderDialogResult` to a constant
* migrate `AttachmentDialogResult` to a constant
* fix CipherType in delete organization dialog
* fix `in` statement in VaultFilter
* Fix build errors across enum updates
* fix two more CipherType castings
* update CipherResponse `CipherType`
* define type for `fieldType` parameter
* refine how `cipherTypeNames` is generated and add utility function for grabbing cipher type name
* use `CipherType` rather than `number`
* add stricter typing for `FieldType`
* add fixme for `CipherType` to be ADR-0025 compliant
* remove error throw for `toCipherTypeName` and instead update typing to have `| undefined`
* add helpers for CipherType conversions
* prefer `undefined`
Upgrade Angular to v19 using the update guide.
- Add `standalone: false` to any missed component in stories or tests.
- Update jest.config to follow the new best practices.