Commit Graph

1177 Commits

Author SHA1 Message Date
✨ Audrey ✨ 2eeb1bbc45
specify generator algorithm during TDE (#9519) 2024-06-05 14:59:08 -04:00
Jared Snider 9d35a8895e
Auth/PM-8367 - Email Verification - Integrate Registration Self Hosted Env Selector + new Self Hosted Env Settings Dialog into Registration Start (#9361)
* PM-8367 - WIP - initial comp creation

* PM-8367 - Majority of new registration self hosted env config dialog working

* PM-8367 - RegistrationEnvSelectorComponent - add method handleSelfHostedEnvConfigDialogResult and add toast for happy path.

* PM-8367 - Add validation TODO

* PM-8367 - RegistrationSelfHostedEnvConfigDialogComponent - Add validator

* PM-8367 - RegEnvSelector - Only show self hosted if the client is browser or desktop since we will be using the selector on web as well.

* PM-8367 - Registration start comp - add env selector

* PM-8367 - Registration start - add proper import for standalone comps.

* PM-8367 - Registration Start - get storybook fixed with registration env selector

* PM-8367 - Add self hosted server to web translations only for storybook

* PM-8367 - Add more storybook examples and update docs (WIP - need to test self hosted selection)

* PM-8367 - Registration Start - update stories

* PM-8367 - Env Selector now emits selected region so that parent comps can listen to it if needed.

* PM-8367 - Registration Start - wire up handler for selectedRegionChange so that the parent comp can successfully track isSelfHost and hide / show the terms / privacy policy checkbox

* PM-8367 - TODO cleanup

* PM-8367 - Registration start docs - stage gate is two words.

* PM-8367 - Per working session with Will, move top level provided services to app level instead of module level to solve dialog null injector errors.

* PM-8367 - Storybook working for self hosted env dialog

* PM-8367 - Add dialog scroll feature to bitDialog and implement in self hosted env dialog.

* PM-8367 - Revert bit dialog changes and scroll implementation.

* PM-8367 - Tweak registration start docs

* PM-8367 - Remove unused changeDetectorRef

* PM-8367 - Add docs per PR feedback
2024-06-03 13:05:27 -04:00
Jared Snider f691854387
Auth - PM-7392 & PM-7436 - Token Service - Desktop - Add disk fallback for secure storage failures (#8913)
* PM-7392 - EncryptSvc - add new method for detecting if a simple string is an enc string.

* PM-7392 - TokenSvc - add checks when setting and retrieving the access token to improve handling around the access token encryption.

* PM-7392 - (1) Clean up token svc (2) export access token key type for use in tests.

* PM-7392 - Get token svc tests passing; WIP more tests to come for new scenarios.

* PM-7392 - Access token secure storage to disk fallback WIP but mostly functional besides weird logout behavior.

* PM-7392 - Clean up unnecessary comment

* PM-7392 - TokenSvc - refresh token disk storage fallback

* PM-7392 - Fix token service tests in prep for adding tests for new scenarios.

* PM-7392 - TokenSvc tests - Test new setRefreshToken scenarios

* PM-7392 - TokenSvc - getRefreshToken should return null or a value - not undefined.

* PM-7392 - Fix test name.

* PM-7392 - TokenSvc tests - clean up test names that reference removed refresh token migrated flag.

* PM-7392 - getRefreshToken tests done.

* PM-7392 - Fix error quote

* PM-7392 - TokenSvc tests - setAccessToken new scenarios tested.

* PM-7392 - TokenSvc - getAccessToken - if secure storage errors add error to log.

* PM-7392 - TokenSvc tests - getAccessToken - all new scenarios tested

* PM-7392 - EncryptSvc - test new stringIsEncString method

* PM-7392 - Main.ts - fix circ dep issue.

* PM-7392 - Main.ts - remove comment.

* PM-7392 - Don't re-invent the wheel and simply use existing isSerializedEncString static method.

* PM-7392 - Enc String - (1) Add handling for Nan in parseEncryptedString (2) Added null handling to isSerializedEncString. (3) Plan to remove encrypt service implementation

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

* PM-7392 - Remove encrypt service method

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

* PM-7392 - Actually fix circ dep issues with Justin. Ty!

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

* PM-7392 - TokenSvc - update to use EncString instead of EncryptSvc + fix tests.

* PM-7392 - TokenSvc - (1) Remove test code (2) Refactor decryptAccessToken method to accept access token key and error on failure to pass required decryption key to method.

* PM-7392 - Per PR feedback and discussion, do not log the user out if hte refresh token cannot be found. This will allow users to continue to use the app until their access token expires and we will error on trying to refresh it. The app will then still work on a fresh login for 55 min.

* PM-7392 - API service - update doAuthRefresh error to clarify which token cannot be refreshed.

* PM-7392 - Fix SetRefreshToken case where a null input would incorrectly trigger a fallback to disk.

* PM-7392 - If the access token cannot be refreshed due to a missing refresh token or API keys, then surface an error to the user and log it so it isn't a silent failure + we get a log.

* PM-7392  - Fix CLI build errors

* PM-7392 - Per PR feedback, add missing tests (thank you Jake for writing these!)

Co-authored-by: Jake Fink <jfink@bitwarden.com>

* PM-7392 - Per PR feedback, update incorrect comment from 3 releases to 3 months.

* PM-7392 - Per PR feedback, remove links.

* PM-7392 - Per PR feedback, move tests to existing describe.

* PM-7392 - Per PR feedback, adjust all test names to match naming convention.

* PM-7392 - ApiService - refreshIdentityToken - log error before swallowing it so we have a record of it.

* PM-7392 - Fix copy for errorRefreshingAccessToken

* PM-7392 - Per PR feedback, move error handling toast responsibility to client specific app component logic reached via messaging.

* PM-7392 - Swap logout reason from enum to type.

* PM-7392 - ApiService - Stop using messaging to trigger toast to let user know about refresh access token errors; replace with client specific callback logic.

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* PM-7392 - Per PR feedback, adjust enc string changes and tests.

* PM-7392 - Rename file to be type from enum

* PM-7392 - ToastService - we need to await the activeToast.onHidden observable so return the activeToast from the showToast.

* PM-7392 - Desktop AppComp - cleanup messaging

* PM-7392 - Move Logout reason custom type to auth/common

* PM-7392 - WIP - Enhancing logout callback to consider the logout reason + move show toast logic into logout callback

* PM-7392 - Logout callback should simply pass along the LogoutReason instead of handling it - let each client's message listener handle it.

* PM-7392 - More replacements of expired with logoutReason

* PM-7392 - More expired to logoutReason replacements

* PM-7392 - Build new handlers for displaying the logout reason for desktop & web.

* PM-7392 - Revert ToastService changes

* PM-7392 - TokenSvc - Replace messageSender with logout callback per PR feedback.

* PM-7392 - Desktop App comp - replace toast usage with simple dialog to guarantee users will see the reason for them being logged out.

* PM-7392 - Web app comp - fix issue

* PM-7392 - Desktop App comp - don't show cancel btn on simple dialogs.

* PM-7392 - Desktop App comp - Don't open n simple dialogs.

* PM-7392 - Fix browser build

* PM-7392 - Remove logout reason from CLI as each logout call handles messaging on its own.

* PM-7392 - Previously, if a security stamp was invalid, the session was marked as expired. Restore that functionality.

* PM-7392 - Update sync service logoutCallback to include optional user id.

* PM-7392 - Clean up web app comp

* PM-7392 - Web - app comp - only handle actually possible web logout scenarios.

* PM-7392 - Browser Popup app comp - restore done logging out message functionality + add new default logout message

* PM-7392 - Add optional user id to logout callbacks.

* PM-7392 - Main.background.ts - add clarifying comment.

* PM-7392 - Per feedback, use danger simple dialog type for error.

* PM-7392 - Browser Popup - add comment clarifying expectation of seeing toasts.

* PM-7392 - Consolidate invalidSecurityStamp error handling

* PM-7392 - Per PR feedback, REFRESH_ACCESS_TOKEN_ERROR_CALLBACK can be completely sync. + Refactor to method in main.background.

* PM-7392 - Per PR feedback, use a named callback for refreshAccessTokenErrorCallback in CLI

* PM-7392 - Add TODO

* PM-7392 - Re-apply bw.ts changes to new service-container.

* PM-7392 - TokenSvc - tweak error message.

* PM-7392 - Fix test

* PM-7392 - Clean up merge conflict where I duplicated dependencies.

* PM-7392 - Per discussion with product, change default logout toast to be info

* PM-7392 - After merge, add new logout reason to sync service.

* PM-7392 - Remove default logout message per discussion with product since it isn't really visible on desktop or browser.

* PM-7392 - address PR feedback.

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2024-06-03 12:36:45 -04:00
Alex Morask 28de91888a
[AC-1939] Manage provider payment information (#9415)
* Added select-payment-method.component in shared lib

Because we're going to be implementing the same functionality for providers and orgs/users, I wanted to start moving some of this shared functionality into libs so it can be accessed in both web and bit-web. Additionally, the Stripe and Braintree functionality has been moved into their own services for more central management.

* Added generalized manage-tax-information component to shared lib

* Added generalized add-account-credit-dialog component to shared libs

* Added generalized verify-bank-account component to shared libs

* Added dialog for selection of provider payment method

* Added provider-payment-method component

* Added provider-payment-method component to provider layout
2024-06-03 11:01:14 -04:00
Nick Krantz 748eb00223
[PM-6826] Vault filter refresh (#9365)
* add initial type filter

- use `bit-select` while the chip component is being developed

* get cipherTypes$ from service

- integrate with user settings

* initial add of folder selection

* initial add of vault selection

* initial add of collections filter

* update `VaultPopupListFilterService` to `VaultPopupListFiltersService`

* integrate hasFilterApplied$

* intermediate commit of integration to the filters component

* do not return the tree when the value is null

* return null when the updated option is null

* update vault-popup-list to conform to the chip select structure

* integration of bit-chip-select

* move "no folder" option to the end of the list

* show danger icon for deactivated organizations

* show deactivated warning when the filtered org is disabled

* update documentation

* use pascal case for constants

* store filter values as full objects rather than just id

- This allows secondary logic to be applied when filters are selected

* move filter form into service to be the source of truth

* fix tests after adding "jest-preset-angular/setup-jest"

* remove logic to have dynamic cipher type filters

* use ProductType enum

* invert conditional for less nesting

* prefer `decryptedCollections$` over getAllDecrypted

* update comments

* use a `filterFunction$` observable rather than having to pass filters back to the service

* fix children testing

* remove check for no folder

* reset filter form when filter component is destroyed

* add takeUntilDestroyed for organization valueChanges

* allow takeUntilDestroyed to use internal destroy ref

- The associated unit tests needed to be configured with TestBed rather than just `new Service()` for this to work

* use controls object for type safety
2024-06-03 09:20:14 -05:00
Jared Snider 01648e2cc3
Auth/PM-8358 - User Verification dialog & form input fix for empty submit displaying wrong error (#9363)
* PM-8358 - UserVerificatonFormInput - fix incorrect init logic. We needed to execute the processSecretChanges logic to convert null into { type: 0, secret: null }  (VerificationWithSecret) for all non-biometric verification flows. .

* PM-8358 - UserVerificationService - verifyUser(...) - throw error if called with null. It should only happen if a dev makes a mistake in theory.
2024-06-03 10:15:11 -04:00
Justin Baur 0e7ed8dd7f
[PM-8210] Discourage Active User in `CryptoService` (#9364)
* Add Helper For Preparing a Record For Use in `forkJoin`

* Update & Test CryptoService Changes

* Delete Unused Code

* Update DeviceTrustService

* Update CipherService

* Make `userPublicKey$` Public

* Rename convertValues File

* Update libs/common/src/platform/abstractions/crypto.service.ts

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

* Add `convertValues` Tests

* Add Doc Comments

* Convert to `function`'s

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

* Fix Test Typos

* Add param doc

* Update Test Name

* Add `@throws` Docs

---------

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
2024-05-31 12:10:23 -04:00
Justin Baur 93e7a6ae87
[PM-8436] [PM-8483] Support Asymmetric Mac Encryption Types in EncString (#9441)
* Support Asymmetric Mac Encryption Types in EncString

* Add EncString Tests
2024-05-30 16:01:24 -04:00
Daniel James Smith de92720d7e
[PM-7289] Create generator libraries (#9432)
* Create and register @bitwarden/generator-core

- Create libs/tools/generator/core
- Register new library within tsconfigs
- Register new library within eslint.configs

* Create and register @bitwarden/generator-extensions

- Create libs/tools/generator/extensions
- Register new library within tsconfigs
- Register new library within eslint.configs

* Create and register @bitwarden/generator-components

- Create libs/tools/generator/components
- Register new library within tsconfigs
- Register new library within eslint.configs

* Update libs/tools/generator/components/package.json

Co-authored-by:  Audrey  <ajensen@bitwarden.com>

* Update libs/tools/generator/extensions/package.json

Co-authored-by:  Audrey  <ajensen@bitwarden.com>

* Add empty barrel files for new libs

* Fix extension of test.environment

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by:  Audrey  <ajensen@bitwarden.com>
2024-05-30 15:38:31 -04:00
✨ Audrey ✨ 90e7e16df6
move state provider extensions to tools folder (#9436) 2024-05-30 15:37:40 -04:00
✨ Audrey ✨ bb277565df
fix lint failure (#9440) 2024-05-30 14:34:36 -04:00
✨ Audrey ✨ 0ef5ab79c6
Revert "Revert "Change website default value to empty string. (#9127)" (#9437)" (#9438)
This reverts commit d0914ac81f.
2024-05-30 18:20:07 +00:00
✨ Audrey ✨ d0914ac81f
Revert "Change website default value to empty string. (#9127)" (#9437)
This reverts commit c37006c564.
2024-05-30 20:16:32 +02:00
pixls c37006c564
Change website default value to empty string. (#9127)
Fastmail API returns and error when passed a null value in forDomain.
Empty string is the preferred blank option.

Co-authored-by: yara <ybeadenkopf@fastmailteam.com>
2024-05-30 13:32:25 -04:00
Jake Fink e29025df28
[PM-5951] Migrate org invite state (#9014)
* use deep linked url for org invite instead of separate state

* remove organization invite state & fix tests

* clear login redirect for SSO JIT users since they are accepted when setting MP

* create accept org invite service and consolidate components in module

* finish switch to accept org invite service

* move logic to accept org service

* the rest of the owl

* clear org invite along with deep linked route

* pr feedback

* fix test and add error to catch null invite

* pr feedback

* clear stored invite if it doesn't match provided one
2024-05-30 12:03:17 -04:00
Bernd Schoolmann f6942dde74
[PM-3050] Add sync on unlock, logout when account is deleted (#9288)
* Add sync on unlock, logout when account is deleted

* Update libs/common/src/vault/services/sync/sync.service.ts

Co-authored-by: SmithThe4th <gsmith@bitwarden.com>

* Fix failing unit tests

* Fix incorrect merge

---------

Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
2024-05-30 11:10:03 +02:00
rr-bw 828e26f93c
[PM-8368] AnonLayout Footer Updates (#9397)
* add hostname to footer via env service

* add logic for showing/hiding environment

* add docs

* add web env-selector

* refactor to use one slot for env-selector

* add storybook docs

* add env hostname to stories

* remove sample route
2024-05-29 13:31:04 -07:00
aj-rosado 2098f42400
[PM-7875] Add log to which step parse failed on LastPass import (#9264)
* Added step info regarding where the parse accounts throw the error

* standardized the step to be always set
2024-05-29 17:39:55 +01:00
Justin Baur a6df923416
[PM-8292] Fixup `ForegroundSyncService` (#9292)
* Change `object` to `Record<string, unknown>`

* Change `object` to `Record<string, unknown>` Pt. 2

* Update ForegroundSyncService

- Manage finish message in the listener to more gaurantee a message back
- Make the timeout much longer
- Allow it to throw if the background sync service threw

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2024-05-29 12:12:58 -04:00
Daniel James Smith 86d6be3187
[PM-8448] Create BItwarden Send UI library package (#9402)
* Create the send-ui library package

Create folder
Create package.json
Create jest config
Create tsconfig and tsconfig.spec.json
Create README
Add empty barrel file for exporting future members

* Register @bitwarden/send-ui with all clients and libs

* Register with eslint

* Fix linting issue with README

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-05-29 11:26:40 +01: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 93b9eba769
Separate browser foreground and background memory space (#9315)
* Separate browser foreground and background memory space

* Prefer inherited DI providers
2024-05-27 08:54:24 -04:00
Matt Gibson c61ba41b97
Use User Key Definitions for user-scoped data (#9348) 2024-05-27 08:12:28 -04:00
Thomas Rittson c0bb7b9edf
[AC-2631] Add device-approval command scaffolding (#9351)
* Add device-approval scaffolding

* Refactor: move helpers to BaseProgram

* Update CODEOWNERS
2024-05-27 11:03:23 +10:00
Jared Snider 89d7e96b25
Auth/PM-5086 - Email Verification - Registration Start + Environment Selector components (#9342)
* PM-5086 - WIP start on registration start component

* PM-5086 - more WIP progress on registration start comp

* PM-5086 - Setup secondary component

* PM-5086 - (1) Validation working (2) States implemented (3) 2nd state for check email mostly completed except for correct icon

* PM-5086 - Registration Start - check email state - update icon to be correct from figma.

* PM-5086 - Refactor self hosted conditional + actually hide the checkbox if it is self hosted.

* PM-5086 - WIP good progress on getting browser & desktop creating account on logic working.

* PM-5086 - Accessibility pass + WIP on region selector

* PM-5086 - Accessibility pass with Danielle

* PM-5086 - Migrate env selector logic to own component.

* PM-5086 - Update AnonLayoutWrapperComp import

* PM-5086 - Remove unncessary focus.

* PM-5086 - WIP first draft of registration env selector; name might change to differentiate it from existing env selector.

* PM-5086 - Rename env selector to be more clear and use registration-env-selector instead.

* PM-5086 - (1) Export registration env selector (2) Change comp name not just file name.

* PM-5086 - Create new registration page stub

* PM-5086 - Fix build issue where select module was missing from new registration env selector.

* PM-5086 - Registration --> registration start.

* PM-5086 - Add missing translation from registration-start-secondary-component to desktop & browser.

* PM-5086 - Add missing translations

* PM-5086 - Registration Env Selector - forms require form groups. duh.

* PM-5086 - Registration Env Selector - working now.

* PM-5086 - Registration Start desktop mostly working with env selector issues.

* PM-5086 - Registration start - get self hosted env dialog to close on close click. Backdrop click doesn't work but escape does still.

* PM-5086 - TODO: figure out if there is a better way to get the dialog to close.

* PM-5086 - Registration start - get goBack working to properly re-show env selector

* PM-5086 - Self Hosted Env Comp - re-emit current env on close so that select based env selectors can reset

* PM-5086 - RegistrationEnvSelector - Refactor init logic to also listen for env updates so that the user's choices on the self hosted settings dialog get communicated to this comp

* PM-5086 - Registration Start Desktop - Don't allow users to close dialog via escape as we need them to either close or save to get the env service to set the env correctly.

* PM-5086 - Browser Registration Start Page stub

* PM-5086 - Registration Start comp - storybook added

* PM-5086 - Remove links to start-registration as we aren't ready to implement that yet.

* PM-5086 - Revert environment comp changes.

* PM-5086 - Delete registration start pages.

* PM-5086 - Test removing PreloadedEnglishI18nModule to see if it fixes test failures

* PM-5086 - Try to resolve issues w/ importing PreloadedEnglishI18nModule into RegistrationStartComponent storybook stories file.

* PM-5086 - Allow translations to be imported for all libs.

* PM-5086 - Remove comment from JSON

* PM-5086 - TODO cleanup

* PM-5086 - Per PR feedback, fix display issues by using correct classes.

* PM-5086 - Fix SVG per PR feedback

* PM-5086 - Remove unnecessary methods

* PM-5086 - RegistrationEnvSelectorComponent - per PR feedback, properly type null in form group
2024-05-24 15:43:29 -04:00
Merissa Weinstein 15ba7040e5
[PM-6606] remove onboarding feature flag (#9178)
* remove feature flag value from enum

* remove feature flag from onboarding component

* remove ConfigService mock from spec

* fix format
2024-05-24 09:02:17 -05:00
Rui Tomé 5dd7224143
[AC-2328] Add a Bulk OrganizationUsersController.GetResetPasswordDetails endpoint (#9140)
* [AC-2302] Move organization-auth-request.service to bit-common folder

* [AC-2302] Rename organization-auth-request.service to organization-auth-request-api.service

* [AC-2302] Move logic from component to organization-auth-request.service

* [AC-2302] Fix import path in OrganizationAuthRequestService

* [AC-2302] Move imports to OrganizationsModule and delete unused CoreOrganizationModule

* [AC-2302] Move the call to get userResetPasswordDetails into OrganizationAuthRequestService

* [AC-2302] Remove @Injectable() and manually configure dependencies

* [AC-2302] Add OrganizationAuthRequestService unit tests first draft

* [AC-2302] Refactor device-approvals.component.ts to remove unused imports

* [AC-2302] Set up jest on bit-common and add unit tests for OrganizationAuthRequestService

* [AC-2302] Add bit-common to jest.config.js

* [AC-2302] Update organizations.module.ts to include safeProviders declared in variable

* [AC-2302] Remove services and views folders from bit-common

* [AC-2302] Define path mapping

* Adjust an import path

The import path of `PendingAuthRequestView` in
`OrganizationAuthRequestApiService` was pointing to the wrong place. I
think this file was just recently moved, and the import didn't get
updated.

* Get paths working

* Fix import

* Update jest config to use ts-jest adn jsdom

* Copy-paste path mappings from bit-web

* Remove unnecessary test setup file

* Undo unnecessary change

* Fix remaining path mappings

* Remove Bitwarden License mapping from OSS code

* Fix bit-web so it uses its own tsconfig

* Fix import path

* Remove web-bit entrypoint from OSS tsconfig

* Make DeviceApprovalsComponent standalone

* Remove organization-auth-request-api.service export

* Remove OrganizationsRoutingModule from DeviceApprovalsComponent imports

* Remove CoreOrganizationModule from OrganizationsModule imports

* Remove NoItemsModule from OrganizationsModule imports

* Use ApiService from JslibServicesModule

* Update providers in device-approvals.component.ts

* Add method to retrieve reset password details for multiple organization users

* Add organizationUserId property to OrganizationUserResetPasswordDetailsResponse class

* Rename ResetPasswordDetails to AccountRecoveryDetails

---------

Co-authored-by: Addison Beck <hello@addisonbeck.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2024-05-24 11:20:51 +01:00
Thomas Rittson f2fcf5ce2e
[AC-2522] Remove collection enhancements opt-in (#9283)
* Remove FlexibleCollectionsMigration feature flag and code

* Remove api method
2024-05-24 09:00:40 +10:00
Victoria League 08a6f91411
[CL-221] Add chip-select component (#9021)
---------

Co-authored-by: William Martin <contact@willmartian.com>
2024-05-23 16:30:55 -04:00
Cesar Gonzalez bbf1473022
[PM-5295] Improve autofill collection of page details performance (#9063)
* [PM-5295] Improve autofill collection of page details performance

* [PM-5295] Reworking implementation to leverage requestIdleCallback instead of requestAnimationFrame

* [PM-5295] Reworking implementation to leverage requestIdleCallback instead of requestAnimationFrame

* [PM-5295] Incorporating documentation for added methods

* [PM-5295] Reworking how we handle collection of shadowRoot elements

* [PM-5295] Fixing jest tests relating to the defined pseudo selector

* [PM-5295] Fixing jest tests relating to the defined pseudo selector

* [PM-5295] Refactoring

* [PM-5295] Refactoring

* [PM-5295] Refactoring

* [PM-5295] Starting the work to set up the tree walker strategy under a feature flag

* [PM-5295] Incorporating methodology for triggering a fallback to the TreeWalker API if issues arise with the deepQuery approach

* [PM-5295] Fixing jest test
2024-05-23 18:30:37 +00:00
Will Martin 4b3e63f7b7
[CL-289] fix text decoration in CL button and item-content (#9219) 2024-05-23 11:53:51 -04:00
Shane Melton 0b950080ca
[PM-8004] [AC-2603] [AC-2616] [AC-2621] [AC-2622] Unmanaged collection fixes (#9301)
* [AC-2603] Add unmanaged property to CollectionAdminView and response models

* [AC-2603] Cleanup CollectionViews

- Remove getters that have been replaced with Unmanaged property
- Remove AddAccess that is also being replaced
- Add canEditUnmanagedCollections() helper to organization

* [AC-2603] Replace old AddAccess logic with Unmanaged flag

* [AC-2603] Fix failing test

* [AC-2603] Ensure Add Access badge/toggle only shows when V1 flag is enabled

* [AC-2603] Undo change to canEditUserAccess and canEditGroupAccess

Custom users should not get access to an unmanaged collection with only Manage Groups and Manage User permissions. That is still reserved for admin/owners and EditAnyCollection custom users.
2024-05-22 11:58:04 -07:00
Kyle Spearrin 5a29fee7e6
[PM-7004] Verify org delete from emailed link (#8445)
* add verify org delete page

* PR feedback from thomas

* use abstraction

* Apply suggestions from code review

Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>

* delete org copy

* Move verify-recover-delete-org component to admin-console/organizations/manage folder and update routing

* [PM-7004] Add async/await to ngOnInit in verify-recover-delete-org.component.ts

* [PM-7004] Update deleteRecoverOrgConfirmDesc message in messages.json

* [PM-7004] Add warning message for deleting organization's active user accounts

* [PM-7004] Update to standalone component

* [PM-7004] Update delete organization warning message

* [PM-7004] Refactor delete organization form

* [PM-7004] Delete unused selector in verify-recover-delete-org.component.ts

* [PM-7004] Rename recoverDeleteToken method in verify-recover-delete-org.component.ts to deleteUsingToken

* [PM-7004] Update formGroup initialization in verify-recover-delete-org.component.ts

* [PM-7004] Delete formGroup initialization in verify-recover-delete-org.component.ts

* [PM-7004] Remove try/catch from submit method in verify-recover-delete-org.component.ts

* [PM-7004] Update submit button type in verify-recover-delete-org.component.html

* [PM-7004] Remove manual loading state in verify-recover-delete-org.component

* [PM-7004] Remove unnecessary span in verify-recover-delete-org.component.html

* [PM-7004] Update button styles in verify-recover-delete-org.component.html

* [PM-7004] Add back in the manual loading state in verify-recover-delete-org.component

* [PM-7004] Update button type and class in verify-recover-delete-org.component.html

* [PM-7004] Replace bootstrap classes with equivalent tailwind classes

* [PM-7004] Replace bootstrap classes with Tailwind in verify-recover-delete-org.component.html

---------

Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>
Co-authored-by: Rui Tome <rtome@bitwarden.com>
2024-05-22 18:00:02 +01:00
rr-bw 623cda8b64
fix DI (#9294) 2024-05-22 07:48:05 -07:00
✨ Audrey ✨ 6ca836f31d
fix clear when account unavailable error (#9299)
* fix clear when account unavailable error
* remove explicit password history clear on logout
2024-05-22 10:03:17 -04: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
Shane Melton 3d0e0d261e
[PM-6825] Browser Refresh - Initial List Items (#9199)
* [PM-6825] Add temporary vault page header

* [PM-6825] Expose cipherViews$ observable

* [PM-6825] Refactor getAllDecryptedForUrl to expose filter functionality for reuse

* [PM-6825] Introduce VaultPopupItemsService

* [PM-6825] Introduce initial VaultListItem and VaultListItemsContainer components

* [PM-6825] Add VaultListItems to VaultV2 component

* [PM-6825] Introduce autofill-vault-list-items.component to encapsulate autofill logic

* [PM-6825] Add temporary Vault icon

* [PM-6825] Add empty and no results states to Vault tab

* [PM-6825] Add unit tests for vault popup items service

* [PM-6825] Negate noFilteredResults placeholder

* [PM-6825] Cleanup new Vault components

* [PM-6825] Move new components into its own module

* [PM-6825] Fix missing button type

* [PM-6825] Add booleanAttribute to showAutofill input

* [PM-6825] Replace empty refresh BehaviorSubject with Subject

* [PM-6825] Combine *ngIfs for vault list items container

* [PM-6825] Use popup-section-header component

* [PM-6825] Use small variant for icon buttons

* [PM-6825] Use anchor tag for vault items

* [PM-6825] Consolidate vault-list-items-container to include list item component functionality directly

* [PM-6825] Add Tailwind classes to new Vault icon

* [PM-6825] Remove temporary header comment

* [PM-6825] Fix auto fill suggestion font size and padding

* [PM-6825] Use tailwind for vault icon styling

* [PM-6825] Add libs/angular to tailwind.config content

* [PM-6825] Cleanup missing i18n

* [PM-6825] Make VaultV2 standalone and cleanup Browser App module

* [PM-6825] Use explicit type annotation

* [PM-6825] Use property binding instead of interpolation
2024-05-21 17:05:02 -04:00
Jason Ng 5075d0865e
[AC-2447] Allow the UI to save and close dialog when user removes final Can Manage Collection of an item (#9136)
* update saveCollectionsWithServer to accept a new value if user can no longer manage cipher after requested update
2024-05-21 12:32:27 -04:00
Jason Ng b7463d551c
[AC- 2493] Restore and Delete Unassigned Items (#8983)
* updates added for single and bulk delete and restore items including unassigned and permissions for owners and custom users
2024-05-21 12:32:02 -04:00
Jared Snider 00db087cee
Auth/PM-5501 - VaultTimeoutSettingsSvc State Provider Migration - Cleanup desktop orphaned data (#9277)
* PM-5501 - Remove global vault timeout data on desktop to avoid orphaning the data.

* PM-5501 - Test new migration logic.
2024-05-21 09:53:40 -04:00
Jake Fink 56c4be4f1a
consolidate login strategy deps (#8859) 2024-05-21 09:34:03 -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
Nick Krantz 6c61cd4f63
[AC-217] Migrate to Banner Component (#8899)
* convert premium card to banner component

- create VaultBanners component that will handle all banner logic

* move upgrade browser notice to banner component

* refactor verify email component to use the banner component

* add email banner to VaultBanners component

* move low KDF message to banner component

* remove unused KDF component

* allow multiple banners to be displayed at once

* use vault service to consolidate premium banner logic
- Implement prompt thresholds for premium banner
- Update dismiss logic to re-run visibility logic

* update variable name

* move all dismiss/show logic to vault banner service

* rename tense of methods for readability

* apply underline to send email button to match other banner actions

* fix dark mode styling across banners

* remove unused variable

* use bitLink directive for styling rather than tailwind

* move premium banner to a standalone observable

* update bootstrap styles to tailwind

* use new KDF service for vault banners

* move the VerifyEmailComponent to a standalone component

* convert premium banner to a singular observable

* remove unneeded import

* AC-2589 add unique id for each vault banner

* AC-2588 poll sync service to only show premium banner after a sync

* close subscription to syncCompleted$ after one emit

* remove unneeded ReplaySubject
2024-05-20 16:06:35 -05:00
Matt Gibson f2d24e036b
Ps/pm-8197/clean-up-desktop-biometric-ipc (#9275)
* Do not process reload on account switch

* Validate specified key against specified user

* Grab userId immediately for user key retrieval
2024-05-20 16:19:58 -04:00
rr-bw ac47cca944
make data properties optional (#9276) 2024-05-20 13:06:22 -07:00
rr-bw 6fd81fa4d0
[PM-8236] Move AnonLayoutWrapperComponent to Libs (#9272)
* move to libs/auth

* add tw-max-w-md to anonlayout
2024-05-20 11:12:01 -07:00
✨ Audrey ✨ a16dc84a0a
[PM-6819] Credential generator MV3 integration (#8998)
* replace `PasswordGeneratorService` with `legacyPasswordGenerationServiceFactory`
* replace `UsernameGeneratorService` with `legacyUsernameGenerationServiceFactory`
* migrate generator options and history
* apply policy immediately once available
* suppress duplicate policy emissions
* run password generation response code in `ngZone`
2024-05-20 18:08:49 +01:00
aj-rosado 4e1173d5cf
Add info on the item failing the parse when importing from LastPass (#9068)
* Added more error log info into methods called on openVault from LastPass Direct importer

* Adding error messages to help identify errors on the ParseAccounts and ParseShar methods from the lastpass importer parser.ts

* removed unintended throw

* Revert "Added more error log info into methods called on openVault from LastPass Direct importer"

This reverts commit dc83722c2f.

* Cleaned up error messages on LastPass's parser.ts

* throwing the error message if it exists on the Error object

* Using const on name instead let on parseShar
2024-05-20 11:46:20 +01: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
Matt Gibson 4afe5de87b
Revert "[PM-7810] Handle Multithread Decryption Through Offscreen API (#8978)" (#9221)
This reverts commit f51042f813.
2024-05-16 15:48:03 -04:00