Commit Graph

1019 Commits

Author SHA1 Message Date
Kyle Spearrin 06c7c3fd18
[PM-5149] UI for unique SP entity id on organization sso configs (#7117)
* add ui for making sp entity id unique

* pretty

* updates
2024-01-18 21:54:31 +00:00
rr-bw c481d92948
[PM-5384] Create Duo Redirect Connector (#7594)
* create duo redirect connector

* update webpack and duo_code name

* add handoff message

* remove CSP, center handoff message

---------

Co-authored-by: Jake Fink <jfink@bitwarden.com>
2024-01-18 13:26:02 -08:00
Oscar Hinton 5810b0c7a2
[PM-5300] Use deep linking for premium (#6432)
Resolves the get premium links not working in the browser extension. Replaces them with the deep links instead.
2024-01-18 17:43:34 +01:00
Oscar Hinton 03c6037a9c
[CL-167] Replace title slot with title-suffix for web header (#7571) 2024-01-18 11:45:48 +01:00
Jonathan Prusik 8e9a104bd0
[deps] Autofill: Update prettier to v3.2.2 (#7565)
* [deps] Autofill: Update prettier to v3.2.2

* prettier fixes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-17 16:02:44 -05:00
Ike fe73709e59
[PM-5401] Rename Passkey "custom name" (#7578)
* Change to Name from CustomName

* Fixing messages

* Fix case

* component i18n key change
2024-01-17 12:44:56 -05:00
Thomas Rittson ee4aa31444
[AC-2027] Update Flexible Collections logic to use organization property (#7445)
* Remove unused feature flag

* Replace feature flag ref with org flag

* Remove deprecated feature flag to discourage use

* Add check to org.canCreateNewCollections

* Adjust init logic of components to avoid race conditions

* Make canCreateNewCollections logic more explicit

* Resolve merge conflicts with vault changes

* Update comments

* Remove uses of old feature flag

* Remove last of old feature flag

* Clean up feature flag

* Fix linting

* Fix linting
2024-01-17 12:33:39 +00:00
Matt Gibson 160a636fa0
Move key types to central location (#7531) 2024-01-17 07:27:44 -05:00
Jared Snider 756c02cec2
Auth/PM-4596 - Extract PIN and Biometrics unlock method logic into re-useable services for user verification (#7107)
* PM-4596 - PinCryptoService first draft

* PM-4596 - PinCryptoService - Refactor pinKeyEncryptedKey retrievals out into own method getPinKeyEncryptedKeys

* PM-4596 - npm ci + npm run prettier to fix lint issues

* PM-4596 - PinCryptoService - Add kdf types

* PM-4596 - PinCryptoService - Refactor pin validation into own helper method.

* PM-4596 - Rename pin-crypto.service.ts to pin-crypto.service.implementation.ts

* PM-4596 - PinCryptoService - add additional logging for error states.

* PM-4596 - JslibServicesModule - register new PinCryptoService and PinCryptoServiceAbstraction

* PM-4596 - PinCryptoService - modify decryptUserKeyWithPin signature to not require email to match MP verification process in user verification service.

* PM-4596 - Lock components - use new PinCryptoService.decryptUserKeyWithPin(...) to get user key + refactor base comp unlock with pin method to improve

* PM-4596 - Lock component - if too many invalid attempts, added toast explaining that we were logging the user out due to excess PIN entry attempts

* PM-4596 - UserVerificationService - (1) Refactor verifyUser(...) to use switch + separate methods for a cleaner parent method + better extensibility for PIN & biometrics which are TBD (2) Add PIN support to validateInput(...)

* PM-4596 - UserVerificationService - add PIN and biometrics functions to verifyUser(...)

* PM-4596 - PinCryptoService Spec - start test file - instantiates properly

* PM-4596 - PinCryptoService tests - WIP

* PM-4596 - PinCryptoService tests - WIP - got success cases working

* PM-4596 - pin-crypto.service.implementation.spec.ts renamed to pin-crypto.service.spec.ts

* PM-4596 - PinCryptoService.getPinKeyEncryptedKeys(...) - add comment + var name change for clarity

* PM-4596 - PinCryptoService tests - test invalid, null return scenarios

* PM-4596 - CLI - bw.ts - update UserVerificationService instantiation to include new pinCryptoService

* PM-4596 - PinCryptoService - import VaultTimeoutSettingsServiceAbstraction instead of implementation for factory creation to get browser building

* PM-4596 - (1) Create pinCryptoServiceFactory for browser background (2) Add it to the existing userVerificationServiceFactory

* PM-4596 - Browser - Main.background.ts - Add pinCryptoService and add to userVerificationService dependencies

* PM-4596 - UserVerificationService - per PR feedback simplify returns of verifyUserByPIN(...) and verifyUserByBiometrics(...)

* PM-4596 - Messages.json on desktop & browser - per PR feedback, adjust tooManyInvalidPinEntryAttemptsLoggingOut translation text to remove "you"

* PM-4596 - VerificationType enum - fix line copy mistake and give BIOMETRICS own, unique value.

* PM-4596 - VerificationType - rename BIOMETRICS to Biometrics to match existing MasterPassword value case.

* PM-4596  - Update verification type to consider whether or not a secret exists as we have added a new verification which doesn't have a type. Add new server and client side verification types.  Update all relevant code to pass compilation checks.

* PM-4596 - More verification type tweaking

* PM-4596 - Verification - verificationHasSecret - tweak logic to be more dynamic and flexible for future verification types

* PM-4596 - UpdateTempPasswordComp - use new MasterPasswordVerification

* PM-4596 - Desktop - DeleteAcctComp - use VerificationWithSecret to solve compile error w/ accessing secret

* PM-4596 - Per discussions with Andreas & Will, move new Pin Crypto services into libs/auth + added @bitwarden/auth path to CLI tsconfig + added new, required index.ts files for exporting service abstractions & implementations

* PM-4596 - Fixed missed import fixes for lock components across clients for pin crypto service after moving into @bitwarden/auth

* PM-4596 - More PinCryptoService import fixes to get browser & desktop building

* PM-4596 - Update desktop lock comp tests to pass by providing new pin crypto service.

* PM-4596 - User verification service -update todo

* PM-4596 - PinCryptoService - per PR feedback, fix auto import wrong paths.

* PM-4596 - PinCryptoService tests - fix imports per PR feedback

* PM-4596 - UserVerificationSvc - rename method to validateSecretInput per PR feedback

* Fix imports

* PM-4596 - PinCryptoService - Refactor naming for clarity and move test cases into describes per PR feedback

* reorg libs/auth; expose only libs/auth/core to cli app

* PM-4596 - UserVerification - Resolve import issue with importing from libs/auth. Can't use @bitwarden/auth for whatever reason.

* PM-4596 - Fix desktop build by fixing import

* PM-4596 - Provide PinCryptoService to UserVerificationService

* PM-4596 - PinCryptoServiceFactory - you cannot import services from @bitwarden/auth in the background b/c it brings along the libs/auth/components and introduces angular into the background context which doesn't have access to angular which causes random test failures. So, we must separate out the core services just like the CLI to only bring along the angular agnostic services from core.

* PM-4596 - Refactor libs/auth to have angular / common + update all imports per discussion with Matt & Will. Introduced circular dep between PinCryptoService + VaultTimeoutSettingsService + UserVerificationService

* PM-4596 - VaultTimeoutSettingsService - Refactor UserVerificationService out of the service and update all service instantiations and tests. The use of the UserVerificationService.hasMasterPassword method no longer needs to be used for backwards compatibility. This resolves the circular dependency between the PinCryptoService, the UserVerificationService, and the VaultTimeoutSettingsService. We will likely refactor the hasMasterPassword method out of the UserVerificationService in the future.

* PM-4596 - Update CL tsconfig.libs.json to add new auth/common and auth/angular paths for jslib-services.module imports of pin crypto service to work and for test code coverage to run successfully.

* PM-4596 - Address PR feedback

* PM-4596 - Update root tsconfig (only used by storybook) to add new libs/auth paths to fix chromatic build pipeline.

* PM-4596 - Actually update tsconfig with proper routes to fix storybook

* PM-4596 - UserVerificationService - verifyUserByBiometrics - add error handling logic to convert failed or cancelled biometrics verification to a usable boolean

* PM-4596 - Add missing await

* PM-4596 - (1) Add log service and log to user verification service biometric flow to ensure errors are at least revealed to the console (2) Fix factory missing PinCryptoServiceInitOptions

* PM-4596 - Use the correct log service abstraction

* PM-4596 - Remove unused types per PR review

---------

Co-authored-by: William Martin <contact@willmartian.com>
2024-01-16 14:52:06 -05:00
Bitwarden DevOps b06d5b2143
Bumped web version to 2024.1.2 (#7568) 2024-01-16 17:03:30 +00:00
Bitwarden DevOps 091121f120
Bumped web version to 2024.1.1 (#7566) 2024-01-16 14:52:46 +00:00
Justin Baur b98af7f05d
Listen to Window Load (#7506) 2024-01-16 14:39:52 +00:00
Oscar Hinton 36b2d8b6b2
[PM-5345] Update vault-search to use bit-search (#7273)
Migrate vault search to use the bit-search component.
2024-01-15 12:10:31 +01:00
Jason Ng 2347b96dba
AC-2057 3dot menu missing in individual vault (#7529)
* update individual vault so 3dot menu shows in cipher row
2024-01-12 15:00:11 -05:00
github-actions[bot] 809c5c46f7
Autosync the updated translations (#7535)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-01-12 06:51:38 +01:00
Rui Tomé 48643e45ea
[AC-1893] Removed logic to downgrade Manager roles and remove Edit/Delete any collection permissions for Flexible Collections (#7365) 2024-01-12 07:54:11 +10:00
Matt Bishop 6baad76088
[PM-5548] Eliminate in-app purchase logic (#7433)
* Eliminate in-app purchase logic

* Remove more in-app logic found, for payment and subscription management

---------

Co-authored-by: Lotus Scott <148992878+lscottbw@users.noreply.github.com>
2024-01-11 15:24:43 -05:00
Shane Melton 88b18249da
[PM-5680] Exclude provider orgs when opening the add collection dialog (#7519) 2024-01-11 09:24:43 -08:00
aj-rosado 99022e2baa
Added dashed line as separator and label for common formats on format selector for import (#7432) 2024-01-11 16:24:40 +00:00
Tom 7112f44375
Returning the loop checking a cipher's uris to prevent dupes (#7488) 2024-01-11 10:17:51 -05:00
Oscar Hinton 48d4c88770
[PM-4975] Migrate change email to CL (#7223) 2024-01-11 15:23:57 +01:00
Todd Martin 7bd8b00fbf
[PM-2260] Remove TDE feature flag and all conditional logic based on it (#7352) 2024-01-10 12:33:11 -05:00
Jason Ng 48d161009d
AC-1115 Modify AC Vault/Collections (#6789)
* Permissions Column added to Org Vault. Other updates to filter section and Can Manage Permission added and put behind feature flag

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
2024-01-10 09:56:23 -05:00
Jake Fink 0fba5810d9
sync before migrating legacy user (#7435) 2024-01-08 12:00:28 -05:00
github-actions[bot] 40f4fde7bf
Autosync the updated translations (#7453)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-01-05 10:38:22 +00:00
Will Martin 1a38bec901
[AC-1389] update collection dialog copy based on admin access setting (#7137)
* update collection dialog access copy based on allowAdminAccessToAllCollectionItems setting

* remove requirement to have a Can Manage user if v1 flag is off or admins have access to all collections

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2024-01-05 13:26:23 +10:00
Jason Ng 312197b8c7
PM-5589 add-edit defect fix (#7450) 2024-01-04 15:34:37 -05:00
Jake Fink 8e46ef1ae5
default use for encryption on (#7447) 2024-01-04 12:34:39 -05:00
Bernd Schoolmann 1b4717a78f
[PM-3343] Capture TOTP QR codes from websites in the browser extension (#5985)
* Implement totp capture for browser extensions
2024-01-03 13:20:17 -05:00
Bitwarden DevOps 4784ab12e5
Bumped browser,cli,desktop,web version to 2024.1.0 (#7428) 2024-01-02 22:07:38 +00:00
Thomas Rittson fb0e8fc2ff
[AC-1921] Fix undefined property errors when bulk deleting collections (#7336)
* Fix bulk delete collections in individual vault

* Fix deleting collections in org vault
2024-01-02 21:00:37 +00:00
Mark Youssef eebb9794cb
[PM-5367] Update the content of the enterprise vault page (#7291)
* Update the content of the enterprise vault page

* Update other enterprise layouts

* Apply feedback for best practices
2024-01-02 10:48:08 -08:00
github-actions[bot] 9694939c4c
Autosync the updated translations (#7410)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-01-02 11:51:01 +01:00
Daniel James Smith 4f310b6b69
Update all instances of copyright with 2023 to 2024 (#7396)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-12-29 15:28:14 +00:00
github-actions[bot] f429756f68
Autosync the updated translations (#7391)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-12-29 01:57:22 +01:00
Thomas Rittson 63384bead9
Fix Delete button not showing in collection modal (#7304) 2023-12-29 09:54:00 +10:00
Conner Turnbull 163aab202b
[AC-1359] Setting plan and product to Teams if adding an org from a provider (#7269)
* wip

* Running prettier after npm ci

* Defects AC-1929 AC-1955 AC-1956

* Setting plan and product to Teams if adding an org from a provider

* Updated logic to correctly set seat count depending on how you approach the upgrade flow

* Moved logic setting seat count to changedProduct

* Setting sm seats when upgrading to the current count

* Setting max storage if the organization's current plan has it set above the base

* Refactored logic in changedProduct to be a bit more concise. Added logic for handling sm service accounts and storage increases

* Decomposed the logic in changedProduct

* Resolved defects introduced in the merge conflict

* Changes after executing `npm run prettier`

---------

Co-authored-by: Alex Morask <amorask@bitwarden.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-12-28 15:19:11 -05:00
github-actions[bot] cb67ae8f1e
Autosync the updated translations (#7378)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-12-28 13:26:11 +00:00
aj-rosado b783d99d02
Moved reports files into tools ownership and updated the imports (#7222) 2023-12-28 10:06:23 +00:00
Alex Morask 3d30823d2a
[AC-1754] Provide upgrade flow for paid organizations (#6948)
* wip

* Running prettier after npm ci

* Defects AC-1929 AC-1955 AC-1956

* Updated logic to correctly set seat count depending on how you approach the upgrade flow

* Setting sm seats when upgrading to the current count

* Setting max storage if the organization's current plan has it set above the base

* Refactored logic in changedProduct to be a bit more concise. Added logic for handling sm service accounts and storage increases

* Decomposed the logic in changedProduct

* Resolved defects introduced in the merge conflict

---------

Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
2023-12-27 10:52:40 -05:00
Jake Fink a62f8cd652
[PM-3797] Client changes to use new key rotation process (#6881)
## Type of change

<!-- (mark with an `X`) -->

```
- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
```

## Objective

<!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding-->
Final Client changes for Key Rotation Improvements. 

- Introduces a new `KeyRotationService` that is responsible for owning rotation process.
- Moves `Send` re-encryption to the `SendService` (`KeyRotationService` shouldn't have knowledge about how domains are encrypted).
- Moves `EmergencyAccess` re-encryption to the `EmergencyAccessService`.
- Renames `AccountRecoveryService` to `OrganizationUserResetPasswordService` after feedback from Admin Console


## Code changes

<!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes-->
<!--Also refer to any related changes or PRs in other repositories-->

Auth
- **emergency-access-update.request.ts:** New request model for domain updates that includes Id
- **emergency-access.service.ts:** Moved `EmergencyAccess` re-encryption to the `EmergencyAccessService`. Add deprecated method for legacy key rotations if feature flag is off
- **key-rotation.service/api/spec/module:** New key rotation service for owning the rotation process. Added api service, module, and spec file.
- **update-key.request.ts:** Moved to Auth ownership. Also added new properties for including other domains.
- **migrate-legacy-encryption.component.ts:** Use new key rotation service instead of old component specific service. Delete old service.
- **change-password.component.ts:** Use new key rotation service.
- **settings.module.ts:** Import key rotation module.

Admin Console
- **organization-user-reset-password.service.ts/spec:** Responsible for re-encryption of reset password keys during key rotation. Added tests.
- **organization-user-reset-password-enrollment.request.ts:** New request model for key rotations
- **reset-password.component.ts:** Update `AccountRecoveryService` to `OrganizationUserResetPasswordService`
- **enroll-master-password-reset.component.ts:** Update `AccountRecoveryService` to `OrganizationUserResetPasswordService`

Tools
- **send.service/spec.ts:** Responsible only for re-encryption of sends during key rotation. Added tests.

Other
- **api.service.ts:** Move `postAccountKey` to `KeyRotationApiService`
- **feature-flag.enum.ts:** add new feature flag

## Screenshots

<!--Required for any UI changes. Delete if not applicable-->

## Before you submit

- Please add **unit tests** where it makes sense to do so (encouraged but not required)
- If this change requires a **documentation update** - notify the documentation team
- If this change has particular **deployment requirements** - notify the DevOps team
- Ensure that all UI additions follow [WCAG AA requirements](https://contributing.bitwarden.com/contributing/accessibility/)
2023-12-22 10:31:24 -05:00
github-actions[bot] 6ed073bf80
Autosync the updated translations (#7333)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-12-22 11:26:18 +01:00
Shane Melton a19a4ffdf7
[AC-1879] Add null check for collection view helpers (#7073)
* [AC-1879] Add null check for collection view helpers

* [AC-1879] Add additional null check to organization-options.component.ts
2023-12-21 15:51:48 -08:00
Michał Chęciński 53e4127ab8
[DEVOPS-1501] Build and Deploy Web Vault for USDEV (DevTest) (#7309)
* Add usdev config

* add command to build usdev to package

* Add usdev to build

* Add usdev to web deploy workflow

* Fix

* Fix

* Fix
2023-12-21 17:10:31 +01:00
SmithThe4th 07d224d6bc
[PM-4239] When viewing an item with a passkey, passkey is not announced by screenreader (#7154)
* Made passkey field focusable

* Made passkey field focusableand accessibilty possible for screenreaders in announcing the field
2023-12-21 10:54:54 -05:00
Thomas Rittson 061b15ba6d
Clone manage property when cloning collection (#7300) 2023-12-21 13:44:12 +10:00
cyprain-okeke de04bc4410
[AC-1753] Automatically assign provider's pricing to new organizations (#7228)
* changes for the msp task

* fix an issues

* resolve pr comment
2023-12-20 22:55:30 +01:00
aj-rosado 7dff870c93
looking to routeOrgId instead orgId to redirect the user (#7216) 2023-12-19 18:35:03 +00:00
Oscar Hinton 017da06f9a
[CL-160] Rename BadgeType to BadgeVariant (#7244)
We're establishing a common language for the Component Library. As part of this work we're renaming componentType to variant. Starting with badges.
2023-12-19 19:22:37 +01:00
Oscar Hinton 21539e6e95
[PM-5299] Extract a danger-zone component (#7220)
Extract a re-useable danger-zone component instead of needing to duplicate the code.
2023-12-18 18:34:44 +01:00
Jared Snider 7ffa983469
Auth/PM-1658 - Dynamic Org Invite Link to accelerate users through org invite accept process (#6702)
* PM-1658 - Update Accept Organization component to take new org invite qParams into acct for accelerating the user through the org invite accept process.

* PM-1658 - Update trial initiation and register form comps to respect fromOrgInvite when email is populated to make the populated email read only so users in the org invite process dont change it.

* PM-1658 - Per PR feedback, we could simplify the logic by only sending the org sso identifier if it was required to be used.

* PM-1658 - Accept Comp - should send existing user email as qParam to get it to autofill properly. Previous "autofill" was due to using remember email when creating an account before testing the existing user inv flow.
2023-12-18 11:28:15 -05:00
github-actions[bot] 74a70e420a
Autosync the updated translations (#7234)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-12-15 15:31:01 +01:00
Will Martin e102919c2f
[CL-133] add skip links to bit-layout (#7213)
* Add light LinkType to link directive

* add skip link to bit-layout; update i18n for all apps

* install storybook interaction testing packages

* update storybook config

* add skiplink story to bit-layout

* update route and focus logic

* remove focus ring
2023-12-15 09:06:05 -05:00
Will Martin b73d73b508
create team owned libs for billing, admin-console, platform (#7233)
* add admin-console lib files

* add billing lib files

* add platform lib files

* update lib references in config files

* update package-lock
2023-12-15 09:02:21 -05:00
Daniel James Smith 60d9f3d150
[PM-1925][PM-2741][AC-1334] flexible collections export page (#5759)
* Use bitTypography for page title

* Replaced app-callout with bit-callout

* Replace button with bit-button

* Update radio buttons to use CL

* Use searchable select for fileFormat dropdown

* Remove unneeded divs (old styling)

* pm-1826 remove eslint-disable tailwindcss/no-custom-classname

* Removed for-attribute from bit-labels

* Removed bitInput from bit-selects

* Removed name-attribute from bit-selects

* Make format a required field

* Removed unused dependency on cryptoService

* Remove unused dependency on BroadcasterService

* Removed dependency on window

* Moved organizationId into BaseExportComponent

* Add vaultSelector

Add organizationService as new dependency
Retrieve organizations a user has access to
Add vaultSelector dropdown
Add `export from` label
Add exportFromHint

* Removed hint as discussed by product&design

* Add function to check for import/export permission

* Export callout should listen to changes

Even though the organizationId was changed, the Input did not trigger changing the scope

* Reading FlexibleCollections feature flag to show the vault-selector on export (#7196)

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>
2023-12-14 13:55:54 +01:00
Ike 7051f255ed
[PM-4168] Enable encryption for registered passkeys (#7074)
* Added enable encryption

* various updates and tests added.

* fixing linter errors

* updated spec file
2023-12-13 07:02:35 -08:00
✨ Audrey ✨ df406a9862
[PM-252] fix inconsistent generator configuration behavior (#6755)
* decompose password generator policy enforcement
* integrate new logic with UI
* improve UX of minimum password length
* improve password generator policy options documentation
* initialize min length to default minimum length boundary
* reset form value on input to prevent UI desync from model

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-12-12 19:17:20 -05:00
Todd Martin bfa76885ac
[PM-4107] Only call config on successful sync (#7149) 2023-12-12 18:14:34 -05:00
Will Martin 02ba26e53c
[AC-1786] deprecate manager role (#6931)
* add deprecation message

* hide manager option

* deprecate manager enum
2023-12-12 09:43:47 -05:00
Will Martin 79dbe051c8
[AC-1747] deprecate access control indicator (#6796)
---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-12-11 22:40:11 -05:00
Oscar Hinton a40643d9d6
Move SM header into web (#6976) 2023-12-11 18:22:37 +01:00
Alex Morask 4f9120576d
[AC-1797] Prevent billing email/business name update for resellers (#7042)
* Prevent billing email/business name updates for reseller

* Enable business name based on CS feedback

* Fixed prettier issue
2023-12-11 10:26:43 -05:00
Oscar Hinton cf0c6e8896
[PM-4349] Migrate hasPremium and debounceNavigation to be functional (#6591)
Class based router guards are deprecated as of Angular 15.2, per angular.io/guide/deprecations#router-class-and-injection-token-guards. To simplify future angular upgrades we need to resolve these deprecations.

This PR migrates the HasPremium and DebounceNavigationService guards to use the new functional pattern.
2023-12-11 14:22:34 +00:00
Rui Tomé 483a197e4d
[AC-1139] Flexible collections: deprecate Manage/Edit/Delete Assigned Collections custom permissions (#6906)
* [AC-1139] Add new layout for MemberDialogComponent when FC feature flag is enabled

* [AC-1139] Deprecated Organization canEditAssignedCollections, canDeleteAssignedCollections, canViewAssignedCollections

* [AC-1139] Checking if FC feature flag is enabled when using canDeleteAssignedCollections or canViewAssignedCollections

* [AC-1139] Added missing parameter to customRedirect

* [AC-1139] Fixed canEdit permission

* [AC-1139] Fixed CanDelete logic

* [AC-1139] Changed canAccessVaultTab function to receive configService

* Override deprecated values on sync

* [AC-1139] Reverted change that introduced ConfigService as a parameter to canAccessVaultTab

* [AC-1139] Fixed circular dependency

* [AC-1139] Moved overriding of deprecated values to syncService

* Revert "[AC-1139] Fixed circular dependency"

This reverts commit 6484420976.

* Revert "Override deprecated values on sync"

This reverts commit f0c25a6996.

* [AC-1139] Added back the deprecation of methods canEditAssignedCollections, canDeleteAssignedCollections, canViewAssignedCollections

* [AC-1139] Reverted change on syncService

* [AC-1139] Override deprecated values on sync

* [AC-1139] Fix canDelete logic in
collection-dialog.component.ts and
bulk-delete-dialog.component.ts

* [AC-1139] Moved override logic from syncService to organizationService

* [AC-1139] Add ability to have titlecase titles on nested-checkbox.component checkboxes; use on member-dialog.component

* Revert "[AC-1139] Add ability to have titlecase titles on nested-checkbox.component checkboxes; use on member-dialog.component"

This reverts commit 9ede0fc5ac.

* [AC-1139] Fix bulk delete functionality

* [AC-1139] Refactor canEdit and canDelete to use ternary operator

* [AC-1139] Fix canDelete condition in VaultComponent

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-12-08 18:07:52 +00:00
github-actions[bot] c8c52957a0
Autosync the updated translations (#7140)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-12-08 12:02:15 +01:00
Thomas Avery 51c5e053f7
[SM-909] Migrate service account people tab to new selector (#6534)
* migrate sa -> people tab to new selector

* remove unused code

* Add access token still available warning
2023-12-07 15:33:45 -06:00
Todd Martin 2b3faca86b
Move PasswordStrengthComponent to Tools (#7125)
* Moved password-strength component to Tools

* Move zxcvbn into Tools ownership

zxcvbn is the library currently used to calculate the password-strength

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-12-07 14:11:05 -05:00
Oscar Hinton 7bbdee9daa
[PM-3565] Enforce higher minimum KDF (#6440)
Changes minimum iterations for PBKDF2 to 600 000. Also converts the constants into ranges to ensure there is only a single place for all checks.
2023-12-05 10:55:12 -05:00
github-actions[bot] 56860482b1
Bumped web version to 2023.12.0 (#7105)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-12-05 10:54:08 -05:00
Will Martin 4b7ab41132
[AC-1726] Create restricted access view for collections (#6949) 2023-12-04 16:12:55 -05:00
Conner Turnbull c1963f1bc3
Cleaned up feature flag logic now that it's released (#7030) 2023-12-04 08:16:43 -05:00
Jake Fink 641ae844fb
[PM-3797 Part 2] Create Account Recovery Service (#6667)
* create account recovery service

* update legacy migration tests

* declare account recovery service in migrate component

* create account recovery module

* remove changes to core organization module

* use viewContainerRef to allow dependency injection on modal

* fix imports
2023-12-01 17:21:04 -05:00
Thomas Rittson 0d035c5a09
[AC-1873] Only assign user in the front-end if using Flexible Collections (#7051)
* Only assign user in the front-end if using Flexible Collections

* Fix prettier
2023-12-01 09:45:52 -06:00
github-actions[bot] 8a19328af2
Autosync the updated translations (#7054)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-12-01 12:18:23 +01:00
Jake Fink 8a0fa574c7
move web settings to auth (#7022) 2023-11-30 17:15:06 -05:00
Daniel James Smith 1c43f77d51
Make linter happy (#7043)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-11-30 16:20:23 +00:00
Daniel James Smith a79b4e182f
Fix hide text toggle on send access (#7028)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-11-30 16:07:25 +00:00
renovate[bot] 28de9439be
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3

* prettier formatting updates

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
2023-11-29 16:15:20 -05:00
ttalty ed865a6747
[PM-3560] Adding the password complexity component to the password protected va… (#6936)
* Adding the password complexity component to the password protected valut export

* Removing the zxcvbn import as the component handles the strength check
2023-11-28 14:44:06 -05:00
Shane Melton 9f81f66e2c
Move purge-vault.component.ts to Vault code ownership (#6992) 2023-11-28 12:03:45 -05:00
Oscar Hinton a5e3432f85
Assign ownership to many libs files (#6928)
Assign ownership to many of the remaining libs/common files.

Criteria for ownership:
* Files used by a single team, is now owned by that team.
* Files related to a domain owned by a team is now owned by that team.
* Where ownership is unclear the "lowest level" service takes ownership.
2023-11-27 20:59:44 +00:00
Shane Melton f82f9ba0d0
[AC-1122] Add new admin access to all collections and items settings (#6703)
* [AC-1117] Add manage permission (#5910)

* Add 'manage' option to collection access permissions

* Add 'manage' to collection permissions

* remove service accidentally committed from another branch

* Update CLI commands

* update message casing to be consistent

* access selector model updates

* [AC-1374] Limit collection create/delete (#5963)

* feat: udate request/response/data/domain models for new column, refs AC-1374

* feat: create collection management ui, refs AC-1374

* fix: remove limitCollectionCdOwnerAdmin boolean from org update request, refs AC-1374

* fix: moved collection management UI, removed comments, refs AC-1374

* fix: observable chaining now properly calls API when local org updated, refs AC-1374

* fix: remove unused form template variables, refs AC-1374

* fix: clean up observable chain, refs AC-1374

* fix: remove parent.parent route, refs AC-1374

* fix: add cd explaination, refs AC-1374

* [AC-1649] Remove organizationId from collection-bulk-delete.request (#6343)

* refactor: remove organizationId from collection-bulk-delete-request, refs AC-1649

* refactor: remove request model from dialog component, refs AC-1649

* [AC-1174] Bulk collection management (#6133)

* [AC-1174] Add bulk edit collection access event type

* [AC-1174] Add bulk edit collection access menu option

* [AC-1174] Add initial bulk collections access dialog

* [AC-1174] Add logic to open bulk edit collections dialog

* [AC-1174] Move AccessItemView helper methods to access selector model to be shared

* [AC-1174] Add access selector to bulk collections dialog

* [AC-1174] Add bulk assign access method to collection-admin service

* [AC-1174] Introduce strongly typed BulkCollectionAccessRequest model

* [AC-1174] Update vault item event type name

* Update DialogService dependency

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>

* Rename LimitCollectionCdOwnerAdmin -> LimitCollectionCreationDeletion (#6409)

* Add manage property to synced Collection data

* Revert "Add manage property to synced Collection data"

Pushed to feature branch instead of a new one

This reverts commit 65cd39589c.

* Add manage property to synced Collection data

* Revert "Add manage property to synced Collection data"

This reverts commit f7fa30b79a.

* [AC-1680] Add manage property to collection view and response models (#6417)

* Add manage property to synced Collection data

* Update tests

* feat: add LimitCollectionCreationDeletion conditional to canCreateNewCollections logic, refs AC-1659 (#6429)

* [AC-1669] Enforce Can Manage permission on Collection dialog (#6493)

* [AC-1669] Cleanup unhandled promise warnings

* [AC-1669] Force change detection to ensure AccessSelector has the most recent items

* [AC-1669] Initially select acting member when creating a new collection

* [AC-1669] Add validator to ensure manage permission is selected

* [AC-1669] Update error toast logic to support access tab errors

* [AC-1669] Add error icon

* [AC-1713] [Flexible collections] Add feature flags to clients (#6486)

* Add FlexibleCollections and BulkCollectionAccess flags

* Flag Collection Management settings

* Flag bulk collection access dialog

* Flag collection access modal changes

* [AC-1662] Add LimitCollecitonCreationDeletion conditional to CanDelete logic (#6526)

* feat: implement limitCollectionCreationDeletion into canDelete logic, refs AC-1662

* feat: make canDelete functions backwards compatible with feature flag, refs AC-1662

* feat: update vault-items.component for async getter, refs AC-1662

* feat: update configService injection, refs AC-1662

* feat: add config service to canDelete reference, refs AC-1662

* fix: remove configservice dependency from views, refs AC-1757 (#6686)

* Add missing provider to vault-items.stories (#6690)

* [AC-1730] Add new AllowAdminAccessToAllCollectionItems setting to org response models

* [AC-1730] Add new AllowAdminAccessToAllCollectionItems setting to org request model

* [AC-1730] Add new collection setting to UI and include it when submitting

* [AC-1122] Add V1 feature flag

* [AC-1122] Hide new setting behind V1 feature flag

* [AC-1122] Add support for disabled form control

---------

Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2023-11-27 11:44:15 -08:00
Vincent Salucci aac4177a6c
[AC-1179][AC-1738] Event log for collection management setting (#6699)
* [AC-1117] Add manage permission (#5910)

* Add 'manage' option to collection access permissions

* Add 'manage' to collection permissions

* remove service accidentally committed from another branch

* Update CLI commands

* update message casing to be consistent

* access selector model updates

* [AC-1374] Limit collection create/delete (#5963)

* feat: udate request/response/data/domain models for new column, refs AC-1374

* feat: create collection management ui, refs AC-1374

* fix: remove limitCollectionCdOwnerAdmin boolean from org update request, refs AC-1374

* fix: moved collection management UI, removed comments, refs AC-1374

* fix: observable chaining now properly calls API when local org updated, refs AC-1374

* fix: remove unused form template variables, refs AC-1374

* fix: clean up observable chain, refs AC-1374

* fix: remove parent.parent route, refs AC-1374

* fix: add cd explaination, refs AC-1374

* [AC-1649] Remove organizationId from collection-bulk-delete.request (#6343)

* refactor: remove organizationId from collection-bulk-delete-request, refs AC-1649

* refactor: remove request model from dialog component, refs AC-1649

* [AC-1174] Bulk collection management (#6133)

* [AC-1174] Add bulk edit collection access event type

* [AC-1174] Add bulk edit collection access menu option

* [AC-1174] Add initial bulk collections access dialog

* [AC-1174] Add logic to open bulk edit collections dialog

* [AC-1174] Move AccessItemView helper methods to access selector model to be shared

* [AC-1174] Add access selector to bulk collections dialog

* [AC-1174] Add bulk assign access method to collection-admin service

* [AC-1174] Introduce strongly typed BulkCollectionAccessRequest model

* [AC-1174] Update vault item event type name

* Update DialogService dependency

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>

* Rename LimitCollectionCdOwnerAdmin -> LimitCollectionCreationDeletion (#6409)

* Add manage property to synced Collection data

* Revert "Add manage property to synced Collection data"

Pushed to feature branch instead of a new one

This reverts commit 65cd39589c.

* Add manage property to synced Collection data

* Revert "Add manage property to synced Collection data"

This reverts commit f7fa30b79a.

* [AC-1680] Add manage property to collection view and response models (#6417)

* Add manage property to synced Collection data

* Update tests

* feat: add LimitCollectionCreationDeletion conditional to canCreateNewCollections logic, refs AC-1659 (#6429)

* [AC-1669] Enforce Can Manage permission on Collection dialog (#6493)

* [AC-1669] Cleanup unhandled promise warnings

* [AC-1669] Force change detection to ensure AccessSelector has the most recent items

* [AC-1669] Initially select acting member when creating a new collection

* [AC-1669] Add validator to ensure manage permission is selected

* [AC-1669] Update error toast logic to support access tab errors

* [AC-1669] Add error icon

* [AC-1713] [Flexible collections] Add feature flags to clients (#6486)

* Add FlexibleCollections and BulkCollectionAccess flags

* Flag Collection Management settings

* Flag bulk collection access dialog

* Flag collection access modal changes

* feat: update event type with new collection management event, refs AC-1179

* [AC-1662] Add LimitCollecitonCreationDeletion conditional to CanDelete logic (#6526)

* feat: implement limitCollectionCreationDeletion into canDelete logic, refs AC-1662

* feat: make canDelete functions backwards compatible with feature flag, refs AC-1662

* feat: update vault-items.component for async getter, refs AC-1662

* feat: update configService injection, refs AC-1662

* feat: add config service to canDelete reference, refs AC-1662

* fix: remove configservice dependency from views, refs AC-1757 (#6686)

* feat: add new event type and update event service, refs AC-1179

* Add missing provider to vault-items.stories (#6690)

* fix: enum typo and name scheme, refs AC-1179

* fix: update message example, refs AC-1179

* fix: modifiedCollectionManagement message example, refs AC-1179

---------

Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Shane Melton <smelton@bitwarden.com>
2023-11-27 12:08:25 -06:00
Vincent Salucci 162c669177
[AC-1721] Disable Collection Management settings on self-hosted (#6921)
* feat: disable collection management setting when self-hosted and hide save button, refs AC-1721

* fix: remove debug code, refs AC-1721
2023-11-27 10:28:31 -06:00
github-actions[bot] 4c8193060d
Autosync the updated translations (#6973)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-11-27 12:51:09 +01:00
Todd Martin 640700e4f0
Add missing translations on WebAuthn login (#6965) 2023-11-27 09:10:49 +01:00
Todd Martin 802fb29120
Fix on-premise vs. on-premises in org plan verbiage (#6966) 2023-11-25 16:58:38 -05:00
github-actions[bot] b71a547d8f
Autosync the updated translations (#6961)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-11-24 12:25:47 +01:00
Jake Fink e60d557f85
I guess we won't break master before going on 4 day weekend (#6952) 2023-11-22 21:29:10 +00:00
Jared Snider 3a0603a837
Auth/PM-2041 - Finish adding FIDO2 Authentication + Decryption to Web Client (#6798)
* PM-2041 - (1) Bring over WebauthnApiService + required models from existing #5493 PR (2) Per discussion with Andreas, remove unnecessary methods from WebauthnApiService

* PM-2041 - Rename responses folder to response to match rest of codebase

* PM-2041 - Recreate  BaseLoginViaWebAuthnComponent and then web implementation of it.

* PM-2041 - Web routing module - add LoginViaWebAuthnComponent and associated route "login-with-passkey"

* PM-2041 - InjectionTokens - add new navigator credentials injection token which provides the CredentialsContainer interface of the Credential Management API and exposes methods to request credentials and notify the user agent when events such as successful sign in or sign out happen

* PM-2041 - Rename WebauthnApiService & abstraction to WebAuthnLoginApiService

* PM-2041 - Rename WebauthnLoginApiService to WebAuthnAdminApiService

* PM-2041 - Bring over first draft of webauthn-login.service + abstraction; register on jslib-services.module.

* PM-2041 - Bring over web & base login component changes to add login with passkey button if feature flag enabled.

* PM-2041 - WebAuthnAdminApi - update list of TODOs based on conversation with Andreas

* PM-2041 - Login.module - cleanup todo after conversation w/ Andreas

* PM-2041 - Move utils out of web and into common auth/utils and renamed to webauthn-utils

* PM-2041 - Update userDecryptionOptions to support new webauthn prf decryption option

* PM-2041 - (1) Recreate webauthn-login service with updated logic (2) Move files from webauthn to webauthn-login (3) Recreate webauthn-login.strategy with updated logic

* PM-2041 - Remove completed TODO

* PM-2041 - Fix login-via-webauthn component imports + fix name (missing n)

* PM-2041 - Missed this change when renaming LoginViaWebAuthComponent to LoginViaWebAuthnComponent

* PM-2041 - Add WebAuthnLoginApiService to jslib-services.module

* PM-2041 - Remove unused param from WebAuthnLoginApiServiceAbstraction as we aren't supporting non-discoverable passkeys for MVP

* PM-2041 - WebAuthnLoginApiService - remove email and target correct endpoint for getCredentialAssertionOptions(...) call

* PM-2041 - WebAuthnLoginStrategy - (1) Remove unused dep (2) Add safeguard checks to setUserKey(...) logic similar to SSO login strategy

* PM-2041 - BaseLoginViaWebAuthnComponent - Rewrite authenticate logic to use new methods on webAuthnLoginService

* PM-2041 - UserDecryptionOptionsResponse - update naming of webAuthn options object to match server response

* PM-2041 - WebAuthnLoginAssertionResponseRequest - (1) clean up TODO (2) Fix response property name to match server

* PM-2041 - WebAuthnTokenRequest - must stringify device response b/c sending as form data

* PM-2041 - AuthService - Add WebAuthnLoginCredentials and WebAuthnLoginStrategy support to auth service

* PM-2041 - WIP tests for WebAuthnLoginService

* PM-2041 - UserDecryptionOptions - Rename WebAuthnPrfOptions to singular WebAuthnPrfOption to match server

* PM-2041 - Add TODO in login comp

* PM-2041 - (1) Update WebAuthnLoginService.assertCredential(...) to add a check to ensure we cannot leak PRF credentials to the BW server by mistake (2) Add credential to view names for clarity (3) Add JS doc style comments to WebAuthnLoginServiceAbstraction

* PM-2041 - Login.component.html - (1) Center passkey login button (2) Use correct user passkey icon

* PM-2041 - Utils + tests - (1) Add new hexStringToArrayBuffer(...) method (2) Add tests for existing fromBufferToHex(...) (3) Add tests for new hexStringToArrayBuffer(...) method

* PM-2041 - Fix broken import

* PM-2041 - WebAuthnLoginResponseRequest - Adjust warning to be correct

* PM-2041 - Webauthn-utils - createSymmetricKeyFromPrf(...) - add return type

* PM-2041 - WebAuthnLoginService spec file - good progress on figuring out how to test passkey assertion process. Tests are passing, but need to add more setup logic around the MockAuthenticatorAssertionResponse in order to be able to confirm the output is correct.

* PM-2041 - Utils + Utils Spec file changes - (1) Add new fromB64ToArrayBuffer(...) method (2) Add tests for existing fromBufferToB64(...) (3) Add tests for new fromB64ToArrayBuffer(...) method (4) Add round trip conversion tests in both directions

* PM-2041 - Utils.spec - update round trip conversion tests between hex string and array buffer.

* PM-2041 - WebAuthnLoginService.spec - assertCredential(...) happy path test passing

* PM-2041 - WebAuthnLoginAssertionResponseRequest - Add interface

* PM-2041 - WebAuthnLoginAssertionResponseRequest data should be UrlB64 strings per discussion w/ Andreas

* PM-2041 - WebAuthnLoginService Spec file - Per feedback, reverse approaches to generating test data (go from array buffer to b64 strings vs the reverse) to avoid using math.random which can introduce test inconsistency

* PM-2041 - Finish testing assertCredential(...)

* PM-2041 - WebAuthnLoginService tests completed - tested logIn method

* PM-2041 - Login html - add "or" between standard email login and passkey login

* PM-2041 - WebAuthnLoginStrategy test start

* PM-2041 - After rebase - BaseLoginViaWebAuthnComponent - Must rename ForceResetPasswordReason to ForceSetPasswordReason + refactor post login routing logic to match other auth owned flows.

* PM-2401 - Desktop - login comp - fix desktop build

* PM-2041 - Browser - login comp - fix build issue

* PM-2401 - WIP on webauthn-login.strategy testing

* PM-2401 - Finish testing webauthn login strategy

* PM-2041 - WebAuthnAdminApiService renamed to WebAuthnLoginAdminApiService

* PM-2041 - Remove unnecessary comment

* PM-2041 - Per PR feedback, remove noMargin and just add mb-3

* PM-2041 - Per PR feedback, remove unused 2FA and remember email logic (2FA isn't supported right now and we aren't using non-discoverable credentials so we aren't using a user entered email)

* PM-2401 - BaseLoginViaWebAuthnComponent - improve error handling to allow users to retry w/ another passkey

* PM-2401 - Per PR feedback, provide translated message to cover all invalid passkey scenarios.

* PM-2401 - WebAuthnLoginService - per PR feedback, remove unnecessary from

* PM-2041 - WebAuthnLoginCredentialAssertionView - per PR feedback, use actual key type

* PM-2401 - Per PR feedback, remove WebAuthnLoginStrategy constructor as it is identical to its super class constructor

* PM-2041 - WebAuthnLoginService tests - use first value from to improve tests

* PM-2401 - Fix WebAuthnLoginService build issue after changing SymmetricCryptoKey to PrfKey

* PM-2041 - WebAuthnLoginServiceAbstraction remove incorrect undefined from getCredentialAssertionOptions() abstraction

* PM-2041 - Refacor WebAuthn login service tests based on PR feedback

* PM-2041 - Per PR feedback, remove NAVIGATOR_CREDENTIALS injection token and just use WINDOW directly for WebAuthnLoginService

* PM-2041 - WebAuthnLoginServiceAbstraction - per PR feedback, improve assertCredential jsdocs with return info

* PM-2041 - Per PR feedback, update WebAuthnLoginStrategy logInTwoFactor(...) to return an exception if attempted to be called.

* PM-2041 - WebAuthnLoginResponseRequest - per PR feedback, replace fromBufferToB64(...) with fromBufferToUrlB64(...)

* PM-2041 - AssertionOptionsResponse - use doc comment per PR feedback

* PM-2041 - Per PR feedback, adjust location of helpers and mocks in WebAuthnLoginStrategy test file

* PM-2041 - Adjust WebAuthnLoginService tests to take the WebAuthnLoginResponseRequest change to use fromBufferToUrlB64(...) into account to get tests to pass again

* PM-2041 - WebAuthnLoginStrategy - adjust test name to match convention per PR feedback

* PM-2041 - More test tweaks - (1) Rename method (2) Support strict

* PM-2041 - Per PR feedback, AssertionOptionsResponse constructor should null check allowCredentials b/c it is optional

* PM-2041 - Per PR Feedback, remove duplicated fromB64ToArrayBuffer(...) from utils and update tests.

* PM-2041 - Per PR feedback, rename WebAuthnTokenRequest to WebAuthnLoginTokenRequest

* PM-2041 - Per discussion with product and Andreas, add 2FA transition handling just in case we add server support in the future.

* feat: stretch PRF key (#6927)

* feat: stretch PRF key

includes necessary utils -> service refactors

* feat: add tests

* [PM-2041] feat: assertion-options `POST` -> `GET`

* [PM-2041] chore: remove unused properties

* [PM-2041] fix: set private key

* [PM-2041] feat: remove all 2FA related fields

* [PM-2041] chore: clean up 2FA comments

* [PM-2041] chore: document `webauthn-login-prf-crypto.service.abstraction.ts`

* [PM-2041] chore: document webauthn login services

---------

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
2023-11-22 13:24:33 -05:00
Jason Ng 2be9273e5f
PM-4828 Align disable and menu icon in vault filter (#6947) 2023-11-22 12:04:10 -05:00
Ike f1691a5ef1
PM-1391-Added previous-url to global-state (#5733)
* added previous-url to global-state

* updated storage of previousUrl for SSO/MFA flows

* revert file changes

* added post login routing

* Clear PreviousUrl from storage on new Login

* Components do not call StateService anymore

* removed needed query params

* refactored components to use RouterService

* fixed build error

* fixed mfa component

* updated logic for previous Url

* removed unneeded base implementation

* Added state call for Redirect Guard

* Fixed test cases

* Remove routing service calls

* renamed global field, changed routing to guard

* reverting constructor changes and git lint issue

* fixing constructor ordering

* fixing diffs to be clearer on actual cahnges.

* addressing accepting emergency access case

* refactor and add locked state logic

* refactor name of guard to be more clear

* Added comments and tests

* comments + support lock page deep linking + code ownership

* readability updates

* Combined guards and specs updated routing

* Update oss-routing.module.ts

* fixed stroybook build
2023-11-22 08:54:12 -08:00
Matt Gibson 24c240d0d4
Ps/pm 2910/add browser storage services (#6849)
* Allow for update logic in state update callbacks

* Prefer reading updates to sending in stream

* Inform state providers when they must deserialize

* Update DefaultGlobalState to act more like DefaultUserState

* Fully Implement AbstractStorageService

* Add KeyDefinitionOptions

* Address PR feedback

* Prefer testing interactions for ports

* Synced memory storage for browser

* Fix port handling

* Do not stringify port message data

* Use messaging storage

* Initialize new foreground memory storage services

This will need to be rethought for short-lived background pages, but for
now the background is the source of truth for memory storage

* Use global state for account service

* Use BrowserApi listener to avoid safari memory leaks

* Fix build errors: debugging and missed impls

* Prefer bound arrow functions

* JSON Stringify Messages

* Prefer `useClass`

* Use noop services

* extract storage observable to new interface

This also reverts changes for the existing services to use
foreground/background services. Those are now used only in state
providers

* Fix web DI

* Prefer initializing observable in constructor

* Do not use jsonify as equality operator

* Remove port listener to avoid memory leaks

* Fix logic and type issues

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2023-11-21 16:35:37 -05:00
Jason Ng 5e9856fa03
AC-1694 update inactive 2fa reports, remove can edit except pw ciphers (#6907) 2023-11-20 15:02:14 -05:00
Todd Martin a4b961aa0a
Remove EU environment feature flag from clients (#6619) 2023-11-20 11:55:35 -05:00
Alex Morask 6f9c6d07af
[PM-4395] Block reseller org invites if they outnumber available seats (#6698)
* Add Toast when reseller org invites over seat limit

* Set validation error when reseller org invited members outnumber seats

* Thomas' feedback
2023-11-20 10:10:47 -05:00
github-actions[bot] 621e0fb980
Autosync the updated translations (#6901)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-11-19 08:42:06 +00:00
Jason Ng a141890b09
AC-1333 vault report org ciphers (#5998)
* updated report components to only show can edit ciphers, added badges, spec files
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-11-17 11:58:37 -05:00
aj-rosado 3952af058c
[PM-2806] Migrate send access to Component Library (#6139)
* Remove unneeded ApiService

* Extract SendAccess for sends of type text

* Migrate form and card-body

* Migrate callout

* Extract SendAccess for sends of type file

* Converted SendAccess component to standalone

* Migrated bottom message to CL

* Added Send Access Password Component

* Added No item component, password component and changed bootstrap classes

* Updated send texts and added layout for unexpected error

* Changed SendAccessTextComponent to standalone

* Moved AccessComponent to oss.module.ts and removed unnecessary components from app.module

* Properly set access modifiers

* Using async action on download button

* Updated links

* Using tailwind classes

* Using ng-template and ng-container

* Added validation to check if status code is from a wrong password

* Using Component Library Forms

* using subscriber to update password on send access

* Using reactive forms to show the text on send access

* Updated message.json keys for changed values

* Removed unnecessary components and changed classes to tailwind ones

* added margin bottom on send-access-password to keep consistent with other send-access layouts

* removed duplicated message key

* Added error toast message on wrong password

---------

Co-authored-by: Daniel James Smith <djsmith@web.de>
2023-11-17 16:06:59 +00:00
Jared Snider e84e02c441
[PM-3659] - Disable Passkey registration if Require SSO Policy Enabled (#6729)
* PM-3659 - Passkey registration - if the require SSO policy applies to the user, disable user's ability to enable passkey registration and the ability to create new credentials if they already have some + display message indicating why the feature is off.  We still must allow users to remove existing credentials.

* PM-3659 - Replace policyService.get$ with policyService.policyAppliesToActiveUser$

* PM-3659 - CreateCredentialDialogComp - remove error handling as async actions has better handling built in already.
2023-11-16 21:20:31 +00:00
Matt Gibson 29aabeb4f5
Ps/pm 2910/state framework improvements (#6860)
* Allow for update logic in state update callbacks

* Prefer reading updates to sending in stream

* Inform state providers when they must deserialize

* Update DefaultGlobalState to act more like DefaultUserState

* Fully Implement AbstractStorageService

* Add KeyDefinitionOptions

* Address PR feedback

* More Descriptive Error

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2023-11-16 14:15:34 -05:00
github-actions[bot] 49ba8384e5
Bumped web version to 2023.10.2 (#6879)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-11-13 13:51:01 -05:00
stoler f40f88a497
[PM-3164] Fix change KDF dialog cancel button (#5883)
* added bitDialog close to button element

* remove deprecated data-dismiss attribute

---------

Co-authored-by: stoler <stoler@Internet>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-11-13 07:25:46 -08:00
Alex Morask b528675cf9
[AC-1812] Add link to Teams Starter trial, pricing to Teams trial pages (#6844)
* Add link to teams starter, pricing to teams

* Jared's feedback

* QA: Make link on teams starter subtext
2023-11-10 11:10:29 -05:00
Andreas Coroiu 49103cdda4
[PM-4737] feat: add Beta badge (#6859) 2023-11-10 15:50:50 +01:00
Alex Morask 356e3fc7fc
[AC-1806] Hide Teams Starter for MSP creating client org (#6835)
* Hide Teams Starter plan for provider creating new client org

* QA: Disallow addition of existing Teams Starter orgs
2023-11-10 09:31:48 -05:00
github-actions[bot] ade9e9adfe
Autosync the updated translations (#6853)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-11-10 10:29:47 +00:00
Justin Baur e1b5b83723
Add State Provider Framework (#6640)
* Add StateDefinition

Add a class for encapsulation information about state
this will often be for a domain but creations of this will
exist outside of a specific domain, hence just the name State.

* Add KeyDefinition

This adds a type that extends state definition into another sub-key
and forces creators to define the data that will be stored and how
to read the data that they expect to be stored.

* Add key-builders helper functions

Adds to function to help building keys for both keys scoped
to a specific user and for keys scoped to global storage.

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Add updates$ stream to existing storageServices

Original commit by Matt: 823d9546fe
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Add fromChromeEvent helper

Create a helper that creats an Observable from a chrome event
and removes the listener when the subscription is completed.

* Implement `updates$` property for chrome storage

Use fromChromeEvent to create an observable from chrome
event and map that into our expected shape.

* Add GlobalState Abstractions

* Add UserState Abstractions

* Add Default Implementations of User/Global state

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Add Barrel File for state

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Fix ChromeStorageServices

* Rework fromChromeEvent

Rework fromChromeEvent so we have to lie to TS less and
remove unneeded generics. I did this by caring less about
the function and more about the parameters only.

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* Fix UserStateProvider Test

* Add Inner Mock & Assert Calls

* Update Tests to use new keys

Use different key format

* Prefer returns over mutations in update

* Update Tests

* Address PR Feedback

* Be stricter with userId parameter

* Add Better Way To Determine if it was a remove

* Fix Web & Browser Storage Services

* Fix Desktop & CLI Storage Services

* Fix Test Storage Service

* Use createKey Helper

* Prefer implement to extending

* Determine storage location in providers

* Export default providers publicly

* Fix user state tests

* Name tests

* Fix CLI

* Prefer Implement In Chrome Storage

* Remove Secure Storage Option

Also throw an exception for subscribes to the secure storage observable.

* Update apps/browser/src/platform/browser/from-chrome-event.ts

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

* Enforce state module barrel file

* Fix Linting Error

* Allow state module import from other modules

* Globally Unregister fromChromeEvent Listeners

Changed fromChromeEvent to add its listeners through the BrowserApi, so that
they will be unregistered when safari closes.

* Test default global state

* Use Proper Casing in Parameter

* Address Feedback

* Update libs/common/src/platform/state/key-definition.ts

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

* Add `buildCacheKey` Method

* Fix lint errors

* Add Comment

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

* Use Generic in callback parameter

* Refactor Out DerivedStateDefinition

* Persist Listener Return Type

* Add Ticket Link

---------

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
2023-11-09 17:06:42 -05:00
ttalty 801141f90e
[PM-166] [PM-198] - Add Event Logs for CLI Actions (#6527)
* Added the DeviceType changes for windows CLI

* Event logging for CLI commands

* Changing the icons to cli icons
2023-11-09 15:17:25 -05:00
Shane Melton 4446c09fd2
[PM-1337] Hide Organization options for users without master password (#6650)
* [PM-1337] Remove unused ModalService

* [PM-1337] Use memberOrganization$ instead of deprecated isMember filter

* [PM-1337] Move bitMenu into organization-options.component.html and update show/hide logic for various options

* [PM-1337] Use observables for injected data in dynamic vault filter option

Dynamic components do not currently support input data binding (available in Angular 16) so an observable must be passed into and subscribed by the dynamic component to receive updates.

* [PM-1337] Cleanup organization-options.component.ts

* [PM-1337] Use bitMenu directives instead of explicit TW classes

* [PM-1337] Refactor app-link-sso into a directive to remove redundant template

* [PM-1337] Fix failing tests
2023-11-09 10:12:00 -08:00
Jake Fink 929a08339f
[PM-3797 Part 1] Add Emergency Access Service (#6612)
* lazy load and move accept emergency component

* create emergency access services
- move api calls to specific api service and refactor

* remove any from emergency api service

* move emergency access logic to service

* create emergency access view

* move view ciphers logic to service

* move models to web folder

* move takeover logic to service

* remove emergency api service dependency from other files

* write tests for emergency access service

* import shared module into component

* fix imports

* Revert "fix imports"

This reverts commit d21cb02bd8.

* create emergency access module for service

* move emergency access out of core folder
- add more organization to components under settings

* change EA views to domain models

* move EA enums to folder

* resolve PR feedback
2023-11-08 16:03:10 -05:00
Thomas Avery ec205d4224
[SM-919] Migrate Project people tab to access-policy-selector (#6431)
* Add access-policy-selector

* Update to access-policy service and models

* Add access-policy service tests

* Use new selector in project-people

* Fix access removal dialog bug (#6653)
2023-11-08 11:41:41 -05:00
Andreas Coroiu 65d2d74348
[PM-2241] Add PRF attestation flow during passkey registration (#6525)
* [PM-2241] chore: refactor into new "pending" view type

* [PM-2241] feat: record PRF support

* [PM-2241] feat: add prf checkbox to dialog

* [PM-2241] chore: remove `disableMargin` instead

Will expressed his concern that these things aren't sustainable, and that we should try using `!important` statements instead, which is a good point!

* [PM-2241] feat: add prf registration

* [PM-2241] feat: add support for `prfStatus`

* [PM-2241] feat: add rotateable key set

* [PM-2241] feat: add PRF creation error handling

* [PM-2241] chore: improve rotateable key docs

* [PM-2241] feat: add basic test

* [PM-2241] chore: update `SaveCredentialRequest` docs

* [PM-2241] chore: rename to `WebauthnLoginAdminService`

* [PM-2241] fix: typo in `save-credential.request.ts`

* [PM-2241] fix: typo in more places
2023-11-08 14:35:36 +01:00
Alex Morask c7b448cdc8
[AC-1230] Show payment component during free org upgrade (#6716)
* Show payment method for upgrading free org

* Add payment method for upgrade if missing
2023-11-08 07:35:10 -05:00
github-actions[bot] 166fa60194
Bumped web version to 2023.10.1 (#6815)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-11-06 20:25:47 -05:00
Conner Turnbull e6a09082c4
[PM-4716] [PM-4717] [AC-1799] UI Bugs around Paid Plans (#6810)
* [PM-4717] Fixed teams starter typo in trial initiation

* [PM-4716] Fixed duplicated information in enterprise plan details

* [AC-1799] Resolved unresponsive "invite members" button when adding users to org
2023-11-06 19:42:08 +00:00
github-actions[bot] ffab1e31e2
Autosync the updated translations (#6780)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-11-06 15:15:50 +00:00
Conner Turnbull 9f5226f8a6
[AC-1708] Teams Starter Plan (#6740)
* Added support for the teams starter plan

* Plans now respect display sort order. Updated teams starter to be in its own product

* Remove upgrade button and show new copy instead -- wip copy

* Added upgrade dialog for teams starter plan when adding an 11th user

* Updated the add user validator to check if plan is teams starter. Updated to not count duplicated emails in the overall count

* Renamed validator to be more descriptive and added additional unit tests

* Added validator for org types that require customer support to upgrade

* Updated small localization for teams plan to account for new starter plan

* Removed invalid tests

* Resolved issues around free trial flow for teams starter

* Added new layout for teams starter free trial flow

* Updated copy following demo. Resolved display issues discovered during demo

* Removed temporary copy for testing

* Updated the second step of free trial flow to use org display name

* Updated invite user modal to display 10 instead of 20 as the invite limit for Teams Starter

---------

Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
2023-11-03 17:32:44 -05:00
Jared Snider 161c1c63ff
Auth/PM-3275 - Changes to support TDE User without MP being able to Set a Password (#6281)
* PM-3275 - Policy.service - Refactor existing mapPoliciesFromToken internal logic to provide public mapPolicyFromResponse method

* PM-3275 - Add new PolicyApiService.getMasterPasswordPolicyOptsForOrgUser method for use in the set password comp

* PM-3275 - Update set-password.comp to use new policyApiService.getMasterPasswordPoliciesForInvitedUsers method

* PM-3275 - (1) Remove post TDE AuthN set password routing logic from SSO/2FA comps as we cannot set an initial user password until after decryption in order to avoid losing the ability to decrypt existing vault items (a new user key would be created if one didn't exist in memory) (2) Add set password routing logic post TDE decryption in LoginWithDevice/Lock components (3) Add new ForceResetPasswordReason to capture this case so that we can guard against users manually navigating away from the set password screen

* PM-3275 - SyncSvc - Add logic for setting forcePasswordReset reason if TDE user w/out MP went from not having MP reset permission to having it.

* PM-3275 - Rename ForceResetPasswordReason enum to ForceSetPasswordReason + update all references.

* PM-3275 - Removing client deprecated calls to getPoliciesByInvitedUser and helper call getMasterPasswordPoliciesForInvitedUsers

* PM-3275 - PolicyAPI service - remove no longer necessary getPoliciesByInvitedUser method

* PM-3275 - LockComp - TODO cleanup

* PM-3275 - SSO & 2FA comp - cleanup of incorrect routing path

* PM-3275 - (1) State service refactor - change getForcePasswordResetReason / setForcePasswordResetReason to be getForceSetPasswordReason / setForceSetPasswordReason (2) Sync Service - encapsulate setForceSetPasswordReasonIfNeeded logic into own method

* PM-3275 - SetPassword Comp - Rename "identifier" to be "orgSsoIdentifier" for clarity

* PM-3275 - SetPasswordComp - Moving routing from SSO / 2FA comps to Lock / LoginWithDevice comps results in a loss of the the OrgSsoId.  However, as part of the TDE work, we added the OrgSsoId to state so use that as a fallback so we can accurately evaluate if the user needs to be auto enrolled in admin account recovery.

* PM-3275 - SetPasswordComp - add a bit more context to why/when we are reading the user org sso id out of state

* PM-3275 - SetPassword Comp - (1) Add forceSetPasswordReason and ForceSetPasswordReason enum as public props on the class so we can change copy text based on which is set + set  forceSetPasswordReason on ngOnInit (2) Refactor ngOnInit to use a single RxJs observable chain for primary logic as the auto enroll check was occurring before the async getUserSsoOrganizationIdentifier could finish.

* PM-3275 - Desktop - App comp - missed replacing getForcePasswordResetReason with getForceSetPasswordReason

* PM-3275 - TDE Decryption Option Comps - must set ForceSetPasswordReason so that we can properly enforce keeping the user on the component + display the correct copy explaining the scenario to the user.

* PM-3275 - All Clients - SetPasswordComp html - Update page description per product + remove no longer used ssoCompleteRegistration translation.

* PM-3275 - SetPasswordComp - hopefully the final puzzle piece - must clear ForceSetPasswordReason in order to let user navigate back to vault.

* PM-3275 - SyncService - Remove check for previous value of account decryption options hasManageResetPasswordPermission as when a user logged in on a trusted device after having their permissions updated, the initial setting would be true and it would cause the flag to NOT be set when it should have.

* PM-3275 - TDE User Context - (1) Remove explicit navigation to set password screen from post decryption success scenarios on lock & login w/ device comps (2) Move TdeUserWithoutPasswordHasPasswordResetPermission flag setting to SSO / 2FA components to support both trusted and untrusted device scenarios (both of which are now caught by the auth guard).

* PM-3275 - (1) SetPassword comp - adjust set password logic for TDE users to avoid creating a new user asymmetric key pair and setting a new private key in memory. (2) Adjust SetPasswordRequest to allow null keys

* PM-3275 - Remove unused route from login with device comp

* PM-3275 - Sso & 2FA comp tests - Update tests to reflect new routing logic when TDE user needs to set a password

* PM-3275 - Lock comp - per PR feedback, remove unused setPasswordRoute property.

* PM-3275 - SetPasswordComp - Per PR feedback, use explicit null check

* PM-3275 - Per PR Feedback, rename missed forcePasswordResetReason to be forceSetPasswordReason on account model

* PM-3275 - Auth guard - rename forcePasswordResetReason to forceSetPasswordReason

* PM-3275 - SSO / 2FA comps - Per PR feedback, refactor Admin Force Password reset handling to be in one place above the TDE user flows and standard user flows as it applies to both.

* PM-3275 - Per PR feedback, clarify 2FA routing comment

* PM-3275 - Per PR feedback, update set-password comp ngOnInit switchMaps to just return promises as switchMap converts promises to observables internally.

* PM-3275 - Per PR feedback, refactor set password ngOnInit observable chain to avoid using async subscribe and instead simply sequence the calls via switchMap and tap for side effects.

* PM-3275 - Per PR feedback, move tap after filter so we can remove if check

* PM-3275 - Per PR feedback, update policy service mapping methods to use shorthand null checking.

* PM-3275 - SetPassword comp - (1) Move force set password reason logic into onSetPasswordSuccess(...) (2) On onSetPasswordSuccess, must set hasMasterPassword to true for user verification scenarios.

* PM-3275 - Per PR feedback, remove new hasManageResetPasswordPermission flag from profile response and instead simply read the information off the existing profile.organizations data as the information I needed was already present.

* PM-4633 - PolicyService - mapPolicyFromResponse(...) - remove incorrect null check for data.  Policies with internal null data property should still be evaluated and turned into Policy objects or the policy array ends up having null values in it and it causes errors down the line on login after acct creation.
2023-11-03 11:33:10 -04:00
Alex Morask 5c7121d881
[AC-1593] Update Toast/refresh token when User adds SM to org (#6610)
* Update toast message for SM addition

* Refresh identity token after SM sub

* Thomas' feedback
2023-11-01 10:50:31 -04:00
Thomas Rittson 0c3b569d0e
[AC-1373] Flexible Collections (#6336)
* [AC-1117] Add manage permission (#5910)

* Add 'manage' option to collection access permissions

* Add 'manage' to collection permissions

* remove service accidentally committed from another branch

* Update CLI commands

* update message casing to be consistent

* access selector model updates

* [AC-1374] Limit collection create/delete (#5963)

* feat: udate request/response/data/domain models for new column, refs AC-1374

* feat: create collection management ui, refs AC-1374

* fix: remove limitCollectionCdOwnerAdmin boolean from org update request, refs AC-1374

* fix: moved collection management UI, removed comments, refs AC-1374

* fix: observable chaining now properly calls API when local org updated, refs AC-1374

* fix: remove unused form template variables, refs AC-1374

* fix: clean up observable chain, refs AC-1374

* fix: remove parent.parent route, refs AC-1374

* fix: add cd explaination, refs AC-1374

* [AC-1649] Remove organizationId from collection-bulk-delete.request (#6343)

* refactor: remove organizationId from collection-bulk-delete-request, refs AC-1649

* refactor: remove request model from dialog component, refs AC-1649

* [AC-1174] Bulk collection management (#6133)

* [AC-1174] Add bulk edit collection access event type

* [AC-1174] Add bulk edit collection access menu option

* [AC-1174] Add initial bulk collections access dialog

* [AC-1174] Add logic to open bulk edit collections dialog

* [AC-1174] Move AccessItemView helper methods to access selector model to be shared

* [AC-1174] Add access selector to bulk collections dialog

* [AC-1174] Add bulk assign access method to collection-admin service

* [AC-1174] Introduce strongly typed BulkCollectionAccessRequest model

* [AC-1174] Update vault item event type name

* Update DialogService dependency

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>

* Rename LimitCollectionCdOwnerAdmin -> LimitCollectionCreationDeletion (#6409)

* Add manage property to synced Collection data

* Revert "Add manage property to synced Collection data"

Pushed to feature branch instead of a new one

This reverts commit 65cd39589c.

* Add manage property to synced Collection data

* Revert "Add manage property to synced Collection data"

This reverts commit f7fa30b79a.

* [AC-1680] Add manage property to collection view and response models (#6417)

* Add manage property to synced Collection data

* Update tests

* feat: add LimitCollectionCreationDeletion conditional to canCreateNewCollections logic, refs AC-1659 (#6429)

* [AC-1669] Enforce Can Manage permission on Collection dialog (#6493)

* [AC-1669] Cleanup unhandled promise warnings

* [AC-1669] Force change detection to ensure AccessSelector has the most recent items

* [AC-1669] Initially select acting member when creating a new collection

* [AC-1669] Add validator to ensure manage permission is selected

* [AC-1669] Update error toast logic to support access tab errors

* [AC-1669] Add error icon

* [AC-1713] [Flexible collections] Add feature flags to clients (#6486)

* Add FlexibleCollections and BulkCollectionAccess flags

* Flag Collection Management settings

* Flag bulk collection access dialog

* Flag collection access modal changes

* [AC-1662] Add LimitCollecitonCreationDeletion conditional to CanDelete logic (#6526)

* feat: implement limitCollectionCreationDeletion into canDelete logic, refs AC-1662

* feat: make canDelete functions backwards compatible with feature flag, refs AC-1662

* feat: update vault-items.component for async getter, refs AC-1662

* feat: update configService injection, refs AC-1662

* feat: add config service to canDelete reference, refs AC-1662

* fix: remove configservice dependency from views, refs AC-1757 (#6686)

* Add missing provider to vault-items.stories (#6690)

* Fix imports after update from master

---------

Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com>
Co-authored-by: Shane Melton <smelton@bitwarden.com>
2023-11-01 09:30:59 +00:00
Andreas Coroiu 317d652088
[PM-3722] Use `UserVerificationPrompt` in passkey registration dialog (#6422)
* [PM-3722] fix: wrong translation bug

* [PM-3722] feat: use user verification component during creation

* [PM-3722] feat: use user verification component during deletion

* [PM-3722] feat: improve error handling
2023-11-01 09:26:41 +01:00
ttalty 43edc1a893
[PM-105] Premium Badge Send File (#6684)
* adding the premium badge for the send item file option

* Removing the unnecessary margin after seeing design spec
2023-10-31 13:52:24 -04:00
Oscar Hinton 485be21826
[PM-4360] Move organization-domain and organization-user to admin console (#6630)
* Move organization-domain and organization-user to admin console
2023-10-30 22:32:57 +01:00
github-actions[bot] 169a9bed4c
Autosync the updated translations (#6720)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-10-30 08:31:57 +00:00
rr-bw 5868d76b91
[PM-3198][PM-3199] Rename PasswordlessLoginStrategy (#6425)
* rename to LoginWithDeviceLoginStrategy

* rename LoginWithDeviceComponent

* update translation for web route

* rename strategy to AuthRequestLoginStrategy

* rename PasswordlessLogInCredentials and PasswordlessCreateAuthRequest

* rename setPasswordlessAccessCode

* rename startPasswordlessLogin() in template files

* rename startPasswordlessLogin() for browser template file

* rename AuthenticationType.Passwordless

* standardize LogInStrategy to LoginStrategy

* standardize PasswordLogInStrategy to PasswordLoginStrategy

* standardize SsoLogInStrategy to SsoLoginStrategy

* standardize UserApiLogInStrategy to UserApiLoginStrategy

* standardize naming of login credentials

* rename log-in-credentials.ts to login-credentials.ts
2023-10-25 11:15:05 -07:00
Kyle Spearrin afc9128653
[PM-4419] Add lastpass direct importer to browser (#6638)
* Split up import/export into separate modules

* Fix routing and apply PR feedback

* Renamed OrganizationExport exports to OrganizationVaultExport

* Make import dialogs standalone and move them to libs/importer

* Make import.component re-usable

- Move functionality which was previously present on the org-import.component into import.component
- Move import.component into libs/importer
Make import.component standalone
Create import-web.component to represent Web UI
Fix module imports and routing
Remove unused org-import-files

* Enable importing on deskop

Create import-dialog
Create file-menu entry to open import-dialog
Extend messages.json to include all the necessary messages from shared components

* Renamed filenames according to export rename

* Make ImportWebComponent standalone, simplify routing

* Pass organizationId as Input to ImportComponent

* use formLoading and formDisabled outputs

* use formLoading & formDisabled in desktop

* Emit an event when the import succeeds

Remove Angular router from base-component as other clients might not have routing (i.e. desktop)
Move logic that happened on web successful import into the import-web.component

* Enable importing on deskop

Create import-dialog
Create file-menu entry to open import-dialog
Extend messages.json to include all the necessary messages from shared components

* use formLoading & formDisabled in desktop

* Add missing message for importBlockedByPolicy callout

* Remove commented code for submit button

* Implement onSuccessfulImport to close dialog on success

* fix table themes on desktop & browser

* fix fileSelector button styles

* update selectors to use tools prefix; remove unused selectors

* update selectors

* Wall off UI components in libs/importer

Create barrel-file for libs/importer/components
Remove components and dialog exports from libs/importer/index.ts
Extend libs/shared/tsconfig.libs.json to include @bitwarden/importer/ui -> libs/importer/components
Extend apps/web/tsconfig.ts to include @bitwarden/importer/ui
Update all usages

* Rename @bitwarden/importer to @bitwarden/importer/core

Create more barrel files in libs/importer/*
Update imports within libs/importer
Extend tsconfig files
Update imports in web, desktop, browser and cli

* import-lastpass wip

* Lazy-load the ImportWebComponent via both routes

* Fix import path for ImportComponent

* add validation; add shared folders field

* clean up logic

* fill fileContent on account change

* Use SharedModule as import in import-web.component

* show spinner on pending validation; properly debounce; refactor to loadCSVData func

* fix pending submit guard

* hide on web, show on desktop & browser

* reset user agent fieldset styles

* fix validation

* File selector should be displayed as secondary

* update validation

* Fix setUserTypeContext always throwing

* refactor to password dialog approach

* remove control on destroy; dont submit on enter keydown

* helper to serialize vault accounts (#6556)

* helper to serialize vault accounts

* prettier

* add prompts

* Add missing messages for file-password-prompt

* Add missing messages for import-error-dialog

* Add missing message for import-success-dialog

* Create client-info

* Separate submit and handling import, add error-handling

* Move catch and error handling into submit

* Remove AsyncValidator logic from handleImport

* Add support for filtering shared accounts

* add sso flow to lp import (#6574)

* stub out some sso flow

* use computer props

* lastpass callback

* baseOpenIDConnectAuthority

* openIDConnectAuthorityBase

* comments

* camelCase user type context model

* processSigninResponse

* Refactor handleImport

* use large dialogSize

* remove extra setUserTypeContext

* fix passwordGenerationService provider; pass all errors to ValidationErrors

* add await SSO dialog & logic

* Move lastpass related files into separate folder

* Use bitSubmit to override submit preventDefault (#6607)

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

* Use large dialogSize

* revert jslib changes

* PM-4398 - Add missing importWarning

* make ui class methods async

* add LastPassDirectImportService

* update error handling

* add OOB methods (manual passcode only)

* fix typo

* respond to SSO callback

* localize error messages

* remove uneeded comment

* update i18n

* add await sso i18n

* add not implemented error to service

* fix getting k2

* fix k1 bugs

* null checks should not be strict

* update awaiting sso dialog

* update approveDuoWebSdk

* add browser lastpass oidc/sso connector

* add getRedirectUrlWithParams

* params

* rename to getOidcRedirectUrlWithParams

* refactor oob login flow

* Add messages needed for Lastpass import flow

Taken from https://github.com/bitwarden/clients/pull/6541/files#diff-47e9af6d0d7d691a507534f7955edaa9fb37be8cf1c1981fd2ba898e99b6130d

* Update apps/browser/src/connectors/sso.ts

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* Update libs/importer/src/components/lastpass/import-lastpass.component.ts

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* fix error

* Removing fieldset due to merge of https://github.com/bitwarden/clients/pull/6626

* Add sso-connector to manifest.v3

* Make linter happy

* Refactoring to push logic into the service vs the component

Move all methods related to MFA-UI into a LastPassDirectImportUIService
Move all logic around the import into a LastPassDirectImportService
The component now only has the necessary flows but no knowledge on how to use the lastpass import lib or the need for a OIDC client

* Remove unneeded passwordGenerationService

* move all import logic to service

* apply code review: remove name attributes; use protected fields; use formGroup.value

* rename submit method and add comment

* update textarea id

* update i18n

* remove rogue todo comment

* Add missing messages forLastpass import

* extract helper asyncValidatorsFinished

* Remove files related to DuoUI we didn't need to differentiate for MFA via Duo

* Add missing import

* use clientType

* triple =

* lastpassAuthResult for web sso connector

* remove browser sso connector

* use web vault for oidc redirect url

* revert formGroup.value access

* process lastpassAuthResult

* simplify message handler logic

* consolidate logic for lastpass auth result

* swap lastpass logic in sso connector

* add email to signInRequest

* add try again error message

* add try again i18n

* consistent clientinfo id (#6654)



---------

Co-authored-by: William Martin <contact@willmartian.com>

* hide on browser

* show LP importer on browser client

* add missing i18n to browser

* add lastpass prefix

* add shared i18n copy to web and browser

* rename deeplink

* use protected field

* rename el ids

* refactor: remove nested conditional

* update form ids in consuming client components

* remove unnecessary return statement

* fix file id

* use ngIf

* use hidden because of getElementById

* Remove OIDC lib logging

* Forward LP sso callback message to LP direct import service

* Add missing collection label

* Add missing `invalidFilePassword` to messages.json

---------

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: William Martin <contact@willmartian.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
2023-10-24 18:37:48 +00:00
Matt Gibson c798c92c84
Ps/fix dev flags not defined (#6683)
* Handle devFlags not defined

* Default dev flags to false
2023-10-24 17:48:01 +02:00
Matt Gibson 1d2757e42b
Noop notifications for dev (#6671)
* Noop notifications for dev

We rarely have notifications set up for development environments, this
removes the error messages related to missing server notification
services

* Log actions in noop service

* Add line breaks

* Improve log messages

* Ignore local config at all levels
2023-10-24 15:18:23 +02:00
github-actions[bot] 7ff4a157f9
Bumped browser,cli,desktop,web version to 2023.10.0 (#6674)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-10-23 13:12:03 -07:00
Will Martin ec866c744e
[PM-4195] LastPass importer flow (#6541)
* Split up import/export into separate modules

* Fix routing and apply PR feedback

* Renamed OrganizationExport exports to OrganizationVaultExport

* Make import dialogs standalone and move them to libs/importer

* Make import.component re-usable

- Move functionality which was previously present on the org-import.component into import.component
- Move import.component into libs/importer
Make import.component standalone
Create import-web.component to represent Web UI
Fix module imports and routing
Remove unused org-import-files

* Enable importing on deskop

Create import-dialog
Create file-menu entry to open import-dialog
Extend messages.json to include all the necessary messages from shared components

* Renamed filenames according to export rename

* Make ImportWebComponent standalone, simplify routing

* Pass organizationId as Input to ImportComponent

* use formLoading and formDisabled outputs

* use formLoading & formDisabled in desktop

* Emit an event when the import succeeds

Remove Angular router from base-component as other clients might not have routing (i.e. desktop)
Move logic that happened on web successful import into the import-web.component

* Enable importing on deskop

Create import-dialog
Create file-menu entry to open import-dialog
Extend messages.json to include all the necessary messages from shared components

* use formLoading & formDisabled in desktop

* Add missing message for importBlockedByPolicy callout

* Remove commented code for submit button

* Implement onSuccessfulImport to close dialog on success

* fix table themes on desktop & browser

* fix fileSelector button styles

* update selectors to use tools prefix; remove unused selectors

* update selectors

* Wall off UI components in libs/importer

Create barrel-file for libs/importer/components
Remove components and dialog exports from libs/importer/index.ts
Extend libs/shared/tsconfig.libs.json to include @bitwarden/importer/ui -> libs/importer/components
Extend apps/web/tsconfig.ts to include @bitwarden/importer/ui
Update all usages

* Rename @bitwarden/importer to @bitwarden/importer/core

Create more barrel files in libs/importer/*
Update imports within libs/importer
Extend tsconfig files
Update imports in web, desktop, browser and cli

* import-lastpass wip

* Lazy-load the ImportWebComponent via both routes

* Fix import path for ImportComponent

* add validation; add shared folders field

* clean up logic

* fill fileContent on account change

* Use SharedModule as import in import-web.component

* show spinner on pending validation; properly debounce; refactor to loadCSVData func

* fix pending submit guard

* hide on web, show on desktop & browser

* reset user agent fieldset styles

* fix validation

* File selector should be displayed as secondary

* update validation

* Fix setUserTypeContext always throwing

* refactor to password dialog approach

* remove control on destroy; dont submit on enter keydown

* helper to serialize vault accounts (#6556)

* helper to serialize vault accounts

* prettier

* add prompts

* Add missing messages for file-password-prompt

* Add missing messages for import-error-dialog

* Add missing message for import-success-dialog

* Create client-info

* Separate submit and handling import, add error-handling

* Move catch and error handling into submit

* Remove AsyncValidator logic from handleImport

* Add support for filtering shared accounts

* add sso flow to lp import (#6574)

* stub out some sso flow

* use computer props

* lastpass callback

* baseOpenIDConnectAuthority

* openIDConnectAuthorityBase

* comments

* camelCase user type context model

* processSigninResponse

* Refactor handleImport

* use large dialogSize

* remove extra setUserTypeContext

* fix passwordGenerationService provider; pass all errors to ValidationErrors

* add await SSO dialog & logic

* Move lastpass related files into separate folder

* Use bitSubmit to override submit preventDefault (#6607)

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

* Use large dialogSize

* revert jslib changes

* PM-4398 - Add missing importWarning

* make ui class methods async

* add LastPassDirectImportService

* update error handling

* add OOB methods (manual passcode only)

* fix typo

* respond to SSO callback

* localize error messages

* remove uneeded comment

* update i18n

* add await sso i18n

* add not implemented error to service

* fix getting k2

* fix k1 bugs

* null checks should not be strict

* update awaiting sso dialog

* update approveDuoWebSdk

* refactor oob login flow

* Removing fieldset due to merge of https://github.com/bitwarden/clients/pull/6626

* Refactoring to push logic into the service vs the component

Move all methods related to MFA-UI into a LastPassDirectImportUIService
Move all logic around the import into a LastPassDirectImportService
The component now only has the necessary flows but no knowledge on how to use the lastpass import lib or the need for a OIDC client

* Remove unneeded passwordGenerationService

* move all import logic to service

* apply code review: remove name attributes; use protected fields; use formGroup.value

* rename submit method and add comment

* update textarea id

* update i18n

* remove rogue todo comment

* extract helper asyncValidatorsFinished

* Remove files related to DuoUI we didn't need to differentiate for MFA via Duo

* Add missing import

* revert formGroup.value access

* add email to signInRequest

* add try again error message

* add try again i18n

* consistent clientinfo id (#6654)



---------

Co-authored-by: William Martin <contact@willmartian.com>

* hide on browser

* add lastpass prefix

* add shared i18n copy to web and browser

* rename deeplink

* use protected field

* rename el ids

* refactor: remove nested conditional

* update form ids in consuming client components

* remove unnecessary return statement

* fix file id

* use ngIf

* use hidden because of getElementById

* Remove OIDC lib logging

---------

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: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com>
2023-10-23 17:46:49 +00:00
Oscar Hinton c2e03d2cdc
[PM-2052] Migrate bulk restore component (#6604) 2023-10-23 17:22:07 +02:00
Alex Morask 95d4d281cb
[AC-1706] Show Discounted Prices (#6668)
* Removed subscription copy from org and individual

* Discount all prices in subscription components
2023-10-23 11:01:59 -04:00
Daniel James Smith 8067b26dc6
[PM-3554] Add support for alias creation via self-hosted SimpleLogin (#6077)
* Add support for alias creation via self-hosted SimpleLogin

* Add forwardedSimpleLoginBaseUrl to username-gen-options type

* Only show Server Url on web if on selfhosted bitwarden

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-10-23 13:48:15 +02:00
github-actions[bot] 4994b61397
Autosync the updated translations (#6662)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-10-23 09:53:19 +00:00
github-actions[bot] ce30caa770
Autosync the updated translations (#6644)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-10-20 08:53:37 +00:00
Matt Gibson cdcd1809f0
Expand account service (#6622)
* Define account service observable responsibilities

* Establish account service observables and update methods

* Update Account Service observables from state service

This is a temporary stop-gap to avoid needing to reroute all account
activity and status changes through the account service. That can be
done as part of the breakup of state service.

* Add matchers for Observable emissions

* Fix null active account

* Test account service

* Transition account status to account info

* Remove unused matchers

* Remove duplicate class

* Replay active account for late subscriptions

* Add factories for background services

* Fix state service for web

* Allow for optional messaging

This is a temporary hack until the flow of account status can be
reversed from state -> account to account -> state. The foreground
account service will still logout, it's just the background one cannot
send messages

* Fix add account logic

* Do not throw on recoverable errors

It's possible that duplicate entries exist in `activeAccounts` exist
in the wild. If we throw on adding a duplicate account this will cause
applications to be unusable until duplicates are removed it is not
necessary to throw since this is recoverable. with some potential loss
in current account status

* Add documentation to abstraction

* Update libs/common/spec/utils.ts

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

* Fix justin's comment :fist-shake:

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2023-10-19 15:41:01 -04:00
Daniel James Smith 9e290a3fed
[PM-4222] Make importer UI reusable (#6504)
* Split up import/export into separate modules

* Fix routing and apply PR feedback

* Renamed OrganizationExport exports to OrganizationVaultExport

* Make import dialogs standalone and move them to libs/importer

* Make import.component re-usable

- Move functionality which was previously present on the org-import.component into import.component
- Move import.component into libs/importer
Make import.component standalone
Create import-web.component to represent Web UI
Fix module imports and routing
Remove unused org-import-files

* Renamed filenames according to export rename

* Make ImportWebComponent standalone, simplify routing

* Pass organizationId as Input to ImportComponent

* use formLoading and formDisabled outputs

* Emit an event when the import succeeds

Remove Angular router from base-component as other clients might not have routing (i.e. desktop)
Move logic that happened on web successful import into the import-web.component

* fix table themes on desktop & browser

* fix fileSelector button styles

* update selectors to use tools prefix; remove unused selectors

* Wall off UI components in libs/importer

Create barrel-file for libs/importer/components
Remove components and dialog exports from libs/importer/index.ts
Extend libs/shared/tsconfig.libs.json to include @bitwarden/importer/ui -> libs/importer/components
Extend apps/web/tsconfig.ts to include @bitwarden/importer/ui
Update all usages

* Rename @bitwarden/importer to @bitwarden/importer/core

Create more barrel files in libs/importer/*
Update imports within libs/importer
Extend tsconfig files
Update imports in web, desktop, browser and cli

* Lazy-load the ImportWebComponent via both routes

* Use SharedModule as import in import-web.component

* File selector should be displayed as secondary

* Use bitSubmit to override submit preventDefault (#6607)

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

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: William Martin <contact@willmartian.com>
2023-10-19 11:17:23 +02:00
Oscar Hinton d0e72f5554
[PM-4360] Move auth owned code into auth (#6595) 2023-10-19 08:03:32 +00:00
Shane Melton eabdbe3d19
[AC-1595] Update SSO identifier hint (#6608) 2023-10-18 10:18:51 -07:00
Andreas Coroiu ba7a211f0d
[PM-1222] Store passkeys in Bitwarden vault (#4715)
* [EC-598] feat: scaffold content scripting

* [EC-598] feat: load page script from content script

* [EC-598] feat: succesfully intercept methods

* [EC-598] feat: add better support for messaging

* [EC-598] feat: implement calls to new service

* [EC-598] feat: add ability to return responses

* [EC-598] feat: half-implemented params mapping

* [EC-598] feat: add b64 conversion

* [EC-598] feat: half-implemented user interfacing

* [EC-598] feat: initial working user verification

* [EC-598] feat: center popup

* [EC-598] feat: add basic cancel button

* [EC-598] feat: confirm new credentials

* [EC-598] feat: add cbor-redux npm package

* [EC-598] feat: initial version of credential creation

* [EC-598] feat: fully working credential creation

* [EC-598] feat: fully working register and assert flow

* [EC-598] feat: properly check for presence

* [EC-598] feat: rudimentar error handling

* [EC-598] feat: transparent passthrough of platform authenticators

* [EC-598] feat: improve error handling

* [EC-598] feat: use browser as fallback when vault does not contain requested credential

* [EC-598] feat: add fido2Key to cipher

* [EC-598] feat: successfully store passkeys in vault

* [EC-598] feat: implement passwordless vault auth

* [EC-598] feat: add basic support for managing passkeys

* [EC-598] feat: show new cipher being added

* [EC-598] feat: allow user to pick which credential to use

* [EC-598] feat: differntiate between resident auth and 2fa

* [EC-598] feat: add some padding to popout

* [EC-598] feat: allow storage of more information

* [EC-598] feat: show user name as sub title

* [EC-598] feat: show all available data

* [EC-598] chore: clean up console logs

* [EC-598] feat: fix google issues

Google does not like self-signed packed format. I've removed the attestation statement all-together untill further notice. We're don't really have any statements so

* [EC-598] fix: temporarily remove origin check

* [EC-598] fix: user interaction not being awaited sometimes

Only one handler can return a response. That handler needs to return true to indicated it's intention to eventually do so.
Our issue was that multiple handlers were returning truthy values, causing a race condition.

* [EC-598] fix: messenger crashing

The messenger is listening to all DOM communcation, most of which is formatted differently. We were not handling these cases properly which resulted in attempts to access undefined fields.

* [EC-598] feat: add basic test-case for messenger

* [EC-598] feat: add test for request/response

* [EC-598] feat: add initial one-way support for aborting

* [EC-598] feat: add ability to throw errors across messenger

* [EC-598] feat: transition to using exceptions

* [EC-598] feat: add abort controller all the way to service

* [EC-598] feat: ability to abort from page script

* [EC-598] feat: add automatic default timeouts

* [EC-598] chore: move component from generic popup fodler

* [EC-598] chore: collect all passkeys stuff under common folder

* [EC-598] fix: filter messages from other sources

* [EC-598] chore: add small todo comment

* [EC-598] feat: add timeout and UV to params

* [EC-598] feat: implement full support for timeouts

* [EC-598] feat: start creating separate authenticator service

* [EC-598] feat: first tested rule in new authentitcator

* [EC-598] feat: allow user to confirm duplication

* [EC-598] feat: add check for unsupported algorithms

* [EC-598] feat: add check for invalid option values

* [EC-598] feat: handle unsupported pinAuth

* [EC-598] feat: confirm new credentials

* [EC-598] feat: rearrange order of execution

* [EC-598] chore: rearrange tests

* [EC-598] feat: add support for saving discoverable credential

* [EC-598] feat: remove ability to duplicate excluded credentials

* [EC-598] chore: rearrange tests

* [EC-598] feat: add support for non-discoverable credentials

* [EC-598] chore: use webauthn authenticator model as base instead of CTAP

* [EC-598] feat: don't leak internal errors during creation

* [EC-598] feat: tweak key data to contain separate type and algorithm

* [EC-598] feat: add counter to fido2key

* [EC-598] feat: complete implementation of `makeCredential`

* [EC-598] feat: add ignored enterpriseAttestation param

* [EC-598] feat: start implementing `getAssertion`

* [EC-598] feat: add separate `nonDiscoverableId` to keys

* [EC-598] fix: properly convert credentials to guid raw format

* [EC-598] chore: add todo tests about deleted items

* [EC-598] feat: implement missing credential checks

* [EC-598] feat: add user confirmation test to assertion

also rewrite to use cipher views in tests

* [EC-598] feat: increment counter during assertion

* [EC-598] feat: implement assertion

* [EC-598] feat: add signatures to attestation

* [EC-598] feat: add general error handling for attestation

* [EC-598] feat: start working on new `Fido2ClientService`

* [EC-598] feat: check user id length

* [EC-598] feat: check origin and rp.id effective domains

* [EC-598] feat: check for supported key algorithms

* [EC-598] feat: hash client data and throw if aborted

* [EC-598] feat: extend return from authenticator

* [EC-598] feat: fully implement createCredential

* [EC-598] feat: implement assertCredential

* [EC-598] feat: make everything compile again

* [EC-598] feat: remove orgigin

* [EC-598] fix: rpId validation logic

* [EC-598] fix: some smaller bugs

* [EC-598] fix: flag saying authData doesnt contain attestation

* [EC-598] fix: wrong flags in tests

* [EC-598] fix: data not getting saved properly

* [EC-598] fix: invalid signature due to double hashing

* [EC-598] chore: clean up unusued function

* [EC-598] feat: fully wokring non-discoverable implementation

* [EC-598] feat: add initial implementation of UI sessions

* [EC-598] feat: fully refactored user interface

Now uses sessions instead of single request-response style communcation

* [EC-598] feat: make fallback working again

* [EC-598] feat: add rudimentary support for excluded credentials

* [EC-598] fix: send correct excluded cipher ids

* [EC-598] feat: wait for session close before closing window

* [EC-598] feat: test unique signatures

* [EC-598] chore: clean up old commented code

* [EC-598] feat: do not exclude organization credentials

* [EC-598] chore: remove unused clas

* [EC-598] fix: remove platform attachment check

* [EC-598] chore: rename webauthn folder to fido2

* [EC-598] chore: continue rename webauthn to fido2

* [EC-598] feat: interpret rk preferred as required

Fixes GoDaddy issues

* [EC-598] fix: bug preventing fallback on assertion

* [EC-598] feat: inform user when no credentials are found

* [EC-598] chore: add some more console logs for debugging

* [EC-598] feat: very basic scroll when picking credentials

* [EC-598] chore: tweak unique signature test

* [EC-598] chore: tweak how unassigned rpId gets calcuated

* [EC-598] fix: response prototype chains

* [EC-598] feat: allow discoverable credentials to be used for non-discoverable assertions

* [EC-598] fix: counter not being saved correctly

* [EC-598] fix: bug in result mapping

* [EC-598] feat: add support for user verifiction using MP during attestation

* [EC-598] feat: add support for user verifiction using MP during assertion

* [EC-598] feat: quick fix noop service

* [EC-598] chore: refactor observables a little bit

* [EC-598] feat: show unsupported user verification error

* [EC-598] feat: add logging to fido2 authenticator

* [EC-598] feat: add logging to fido2 client

* [EC-598] feat: close popout directly from bg script

* [EC-598] chore: clean up page-script

* [EC-598] feat: add webauthn polyfill

* [EC-598] feat: polyfill platform authenticator support

* [EC-598] feat: only show fallback options if supported

* [EC-598] fix: reponse not correctly polyfilled

* [EC-598] chore: add name to polyfill classes

* [EC-598] chore: update unsupported UV copy

* [EC-598] fix: race condition when opening new popout

* Fixed lint issues

* [PM-1500] Add feature flag to enable passkeys (#5406)

* Added launch darkly feature flag to passkeys implementation

* fixed linter

* Updated fido2 client service test to accomodate feature flag

* Updated fido2client service to include unit test for feature flag

* Renamed enable pass keys to fido2 vault credentials, added unit test when feature flag is not enabled

* fixed failing Login domain test case

* [EC-598] chore: remove unecessary return statement

* [EC-598] chore: remove unnecessary eslint disable

* [PM-1975] Move FIDO2 files into vault folder (#5496)

* Moved fido2 models to vault in libs

* Moved fido2 models to vault in libs

* Moved fido2 services and abstractions to vault folder in libs

* Moved fido2 popup to vault folder on the browser

* Updated import path after moving files to the vault folder

* Moved authenticator abstraction and service to the vault folder

* Updated content and page script path

* Added content script, page script and background messaging to vault

* fixed lint issue

* Updated reference paths

* Added missing fallbacksupported property in test files

* Added missing fallbacksupported to the newSession method

* [PM-2560] Fix Firefox default passkeys handling (#5690)

* Return callback response in addListener

* Add clarifying comment

* Isolate returning the callback to fido2 commands

* Update apps/browser/src/platform/browser/browser-api.ts

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* Fix formatting

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>

* [PM-1976] Display passkeys properly on the browser (#5616)

* Removed passkeys from the vault types filter and added fucntion to get the count of Fido2keys and Login types

* Updated build filter to take Fido2key type as a Login type

* Updated icon font files

* Updated vault items and view to handle changes with fido2keys

* Updated add edit view for fido2keys

* Prevent moving passkeys to an organization where it exists

* Prevent moving passkeys to an organization where it exists

* Added view for non-discoverable passkeys

* Added diaglog to inform user that passkey won't be copied when cloning a non discoverable key

* Muted text that shows cipher item is available for 2fa

* Changed conditional to check if an organization already has the same passkey item

* Muted text to align with figma designs and used rpId for the application input value

* Modified checkFido2KeyExistsInOrg function to workk with discoverable and non discoverable keys

* Differentiate between non-discoverable and discoverable keys when moving to an organization

* Added suggested changes from PR review

* Updated font files css changes

* Fixed bug preventing launch bitton from working for Login types (#5639)

* [PM-1574] Display passkeys on web (#5651)

* Allowed discoverable Fido2key type to be displayed alongside Login type

* Added view during edit for discoverable and non-discoverable passkeys

* Fixed PR comments, added relvant tests to domain changes

* Fixed imports and updated the launch function to use the Launchable interface

* Added launch on vault filter for fido2key types

* Added missing passkey text field in edit view (#5800)

* [PM-1977] Display passkeys properly on the desktop (#5763)

* Allowed discoverable Fido2key type to be displayed alongside Login type

* Added view during edit for discoverable and non-discoverable passkeys

* Fixed PR comments, added relvant tests to domain changes

* Fixed imports and updated the launch function to use the Launchable interface

* Added fido2key to login filter and added view display for fido2key

* Added passkeys view for non discoverable passkeys and edit view for passkeys

* Fixed PR comments

* switched date format to short

* [PM-3046] [PM-3047] Defects for discoverable and non-discoverable passkeys on desktop and web (#5847)

* Added missing passkey text field in edit view (#5800)

* Added dialog to clone no discoverable passkeys on web and desktop.Also, removed clone on the desktop for discoverable passkeys and added passkey view to non- discoverable passkeys on desktop during edit

* Prevent cloning dialog on non fido2key ciphers

* Made fido2key use website favicon if avaialble instead of the passkey icon

* Do not display passkey view on clone edit for dekstop

* Do not display passkey view on clone edit for browser

* Prevented movement of passkeys ND or D to an organization once one exists and also made it possible for org memebers with user roles to move passkeys to an organization. (#5868)

* two step passkey view was outside the conditional (#5872)

* fixed merge conflict

* [PM-2907] Shopify Passkey Broken on Firefox When Extension is Installed (#6003)

* [PM-2907] Shopify Passkey Broken on Firefox When Extension is Installed

* [PM-2907] Shopify Passkey Broken on Firefox When Extension is Installed

* [PM-2907] Shopify Passkey Broken on Firefox When Extension is Installed

* Added passkey fallback imaged and added extension to image name on the icons component

* [PM-3155] CLI: Editing a cipher with a non-discoverable passkey causes the passkey to be removed (#6055)

* Added fido2keyexport for the CLI and added the fido2key field to the login response for the CLI

* Added fido2keyexport for the CLI and added the fido2key field to the login response for the CLI

* Removed unneccesary code

* Added non discoverable passkey to template

* [PM-2270] Renamed Fido2Key.userName to Fido2Key.userDisplayName (#6005)

* Renamed fido2key property username to userDisplayName

* Renamed username property on fido2key object to userdisplayname

* updated username to userDisplayName in fido2 export

* Update libs/angular/src/vault/vault-filter/models/vault-filter.model.ts

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

* [PM-3775] feat: import v0.4.0 (#6183)

* [PM-3660] Address PR feedback (#6157)

* [PM-3660] chore: simplify object assignment

* [PM-3660] fix: remove unused origin field

* [PM-3660] feat: add Fido2Key tests

* [PM-3660] chore: convert popOut to async func

* [PM-3660] chore: refactor if-statements

* [PM-3660] chore: simplify closePopOut

* [PM-3660] fix: remove confusing comment

* [PM-3660] chore: move guid utils away from platform utils

* [PM-3660] chore: use null instead of undefined

* [PM-3660] chore: use `switch` instead of `if`

* [EC-598] fix: popup not closing bug

* [PM-1859] Refactor to credentialId (#6034)

* PM-1859 Refactor to credentialId

* PM-1859 Minor changes

* PM-1859 Fix credentialId initialization logic

* PM-1859 Added missing logic

* PM-1859 Fixed logic to use credentialID instead of cipher.id

* [PM-1859] fix: missing renames

---------

Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>

* [PM-1722] gracefully fail if site prompts user for passkey on load (#6089)

* added error logic to look for options.mediation in page-script

* moved the options mediation logic into the try catch. changed error to FallbackRequestedError

* [PM-1224] Ensure Passkeys Not Requested From Iframes (#6057)

* added isNotIFrame method to page-script

* added NotAllowedError to assertCredential in fido2

* remove excess comments

* refactor fido2-client.service. created new errorhandling method for similar code between create and assert

* update types and naming convention for new method in fido2-client.service

* Did a reset to previous commit withiout the refactoring to reduce code duplication, Renamed isNotIframeCheck function and fixed other commits

* Revert "update types and naming convention for new method in fido2-client.service"

This reverts commit 1f5499b9bb.

* Revert "refactor fido2-client.service. created new errorhandling method for similar code between create and assert"

This reverts commit 3115c0d2a1.

* updated test cases

* removed forward slashes

---------

Co-authored-by: gbubemismith <gsmithwalter@gmail.com>

* [EC-598] Window Messaging Fix; (#6223)

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

* updated test cases and services using the config service

* [PM-3807] All passkeys as login ciphers - Minimal implementation to minimize blockers (#6233)

* [PM-3807] feat: remove non-discoverable from fido2 user interface class

* [PM-3807] feat: merge fido2 component ui

* [PM-3807] feat: return `cipherId` from user interface

* [PM-3807] feat: merge credential creation logic in authenticator

* [PM-3807] feat: merge credential assertion logic in authenticator

---------

Co-authored-by: gbubemismith <gsmithwalter@gmail.com>

* [PM-3807] Store all passkeys as login cipher type (#6255)

* [PM-3807] feat: add `discoverable` property to fido2keys

* [PM-3807] feat: assign discoverable property during creation

* [PM-3807] feat: save discoverable field to server

* [PM-3807] feat: filter credentials by rpId AND discoverable

* [PM-3807] chore: remove discoverable tests which are no longer needed

* [PM-3807] chore: remove all logic for handling standalone Fido2Key

View and components will be cleaned up as part of UI tickets

* [PM-3807] fix: add missing discoverable property handling to tests

* [PM-3862] chore: move browser fido2 user interface to vault folder (#6265)

* [PM-2207], [PM-1245], [PM-3302] Make browser login, lock, and 2fa components handle configurable redirect routes (#5989)

* Initial work

* Added lock and login redirect and added functionality to abort when in login or locked state

* uncommented cipher row

* added query params to logi component

* Proof of concept for change detection fix

* Remove leftover comment

* Refactored message listener observable to handle angular change detection

* cleanup and removed unused references

* Refactored the connect method be seperating to the pop out logic to a seperate method

* Added comment to explain code change on the message listener

* Removed unused types

* Initial work

* Added lock and login redirect and added functionality to abort when in login or locked state

* uncommented cipher row

* added query params to logi component

* Proof of concept for change detection fix

* Remove leftover comment

* Refactored message listener observable to handle angular change detection

* cleanup and removed unused references

* Refactored the connect method be seperating to the pop out logic to a seperate method

* Added comment to explain code change on the message listener

* Removed unused types

* Added full synce service to the fido2 authenticator to ensure the full sync is completed before getting all decrypted ciphers

* Added full synce service to the fido2 authenticator to ensure the full sync is completed before getting all decrypted ciphers

* Code cleanup to remove sessionId from login component

* Refactored components to make the redirectUrl more generic, fixed code review comments

* Commented out ensureUnlockedVault for this PR

* Fixed destroy subject inheritance issue on the login componenet

* Fixed lock component error

* Added function to run inside angular zone

* Merged branch with master and fixed conflicts

* Changed redirect logic on login and 2fa to use callbacks

* fixed pr comments

* Updated the messageListener observable version to use same logic from the callback version and added comment on the callback version

* Refactored fido2 popup to use auth guard when routing to component, added BrowserRouterService to track previous page and route using that

* Updated components to use browserRouterService for routing to previous page

* Removed auth status reference from browser-fido2-user-interface service

* Removed activated route from lock component

* Removed route in base class constructor

* removed unused comments and method

* refactored router service to not store on the disk

* [PM-3783] feat: patch `chrome.runtime.onMessage` event listeners

(cherry picked from commit 2ca241a0d4)

* Fixed PR comments

* Fixed PR comments

* Revert "[PM-3783] feat: patch `chrome.runtime.onMessage` event listeners"

This reverts commit ed6a713688.

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>

* [PM-3807] Store passkeys as array (#6288)

* [PM-3807] feat: store passkeys as array

* [PM-3807] fix: issues in views

* [PM-3807] fix: additional view bugs

* [PM-3807] fix: check array length

* [PM-3807] fix: I secretly like build errors

* [PM-3970] Empty list of ciphers when logging in via fido 2 popout (#6321)

* fix: sync not being properly called

* fix: don't call sync everywhere

* [PM-3905] Address PR feedback v2 (#6322)

* [PM-3905] chore: move webauthn utils to vault

* [PM-3905] chore: make static function private

* [PM-3905] chore: add documentation to user interface classes

* [PM-3905] chore: clean up unused abort controllers

* [PM-3905] chore: add documentation to fido2 client and authenticatio

* [PM-3905] chore: extract create credential params mapping to separate function

* [PM-3905] chore: extract get assertion params mapping to separate function

* [PM-3905] chore: assign requireResidentKey as separate variable

* [PM-3905] feat: started rewrite of messenger

Basic message sending implemented, now using message channels instead of rxjs

* [PM-3905] feat: complete rewrite of messenger

* [PM-3905] chore: clarify why we're assigning to window

* [PM-3905] feat: clean up tests

* [PM-3905] docs: document messenger class

* [PM-3905] feat: remove `requestId` which is no longer needed

* [PM-3905] feat: simplify message structure

* [PM-3905] chore: typo

* [PM-3905] chore: clean up old file

* [PM-3905] chore: tweak doc comment

* [PM-3905] feat: create separate class for managing aborts

* [PM-3905] chore: move abort manager to vault

* [PM-3980] Add a creationDate field to the Fido2Key object (#6334)

* Added creationDate field to be used on the passkeys view instead of the cipher.creationDate

* Fixed comments from PR

* added to the constructor and sorted out other comments

* Exported Fido2KeyExport through index.ts

* Fixed iso string issue where the date wasn't converted back to Date (#6364)

* [PM-4045] Get error returned when editing an item with a passkey in the CLI (#6379)

* Creationdate doesn't get converted to a date

* Creationdate doesn't get converted to a date

* removed null assignment

* [PM-3810] Unify Passkeys view (#6335)

* Removed standalone fido2key view, update login view to show created date when a fido2key is present, reverted icon component to previous state without fido2key type, removed filters to handle standalone fido2key as login type

* Allow duplication

* Removed launchable behaviours from fido2 key view

* Reworked desktop views from standalone fido2keys to unified fido2keys in the login

* Reworked web views from standalone fido2keys to unified fido2keys in the login

* Fixed test case to not create standalone fido2keys

* Updated views to use fido2key creation date

* removed unused locale

* moved logic from template to class

* Removed fido2key ciphertype

* Removed fido2key ciphertype references

* PM-2559 Messaging Rework for Passkey Bug (#6282)

* [PM-2559] Messaging Rework - Update browser-api messageListener removing promises to fix Firefox bug

Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>

* Resolved merge conflicts from vault item encryption.

* moved passkeys ontop totp code to align with the add edit view (#6466)

* Bug during reafactoring where the hostname is not used if the rpId is undefined (#6484)

* [PM-4054] Rename Fido2Key to Fido2Credential (#6442)

* Rename Fido2Key to Fido2Credential

* Fix export

* Remove unnecessary alis in export

* Make test less wordly

---------

Co-authored-by: gbubemismith <gsmithwalter@gmail.com>

* [PM-3812][PM-3809] Unify Create and Login Passkeys UI (#6403)

* PM-1235 Added component to display passkey on auth flow

* PM-1235 Implement basic structure and behaviour of UI

* PM-1235 Added localised strings

* PM-1235 Improved button UI

* Implemented view passkey button

* Implemented multiple matching passkeys

* Refactored fido2 popup to use browser popout windows service

* [PM-3807] feat: remove non-discoverable from fido2 user interface class

* [PM-3807] feat: merge fido2 component ui

* [PM-3807] feat: return `cipherId` from user interface

* [PM-3807] feat: merge credential creation logic in authenticator

* [PM-3807] feat: merge credential assertion logic in authenticator

* updated test cases and services using the config service

* [PM-3807] feat: add `discoverable` property to fido2keys

* [PM-3807] feat: assign discoverable property during creation

* [PM-3807] feat: save discoverable field to server

* [PM-3807] feat: filter credentials by rpId AND discoverable

* [PM-3807] chore: remove discoverable tests which are no longer needed

* [PM-3807] chore: remove all logic for handling standalone Fido2Key

View and components will be cleaned up as part of UI tickets

* [PM-3807] fix: add missing discoverable property handling to tests

* updated locales with new text

* Updated popout windows service to use defined type for custom width and height

* Update on unifying auth flow ui to align with architecture changes

* Moved click event

* Throw dom exception error if tab is null

* updated fido2key object to array

* removed discoverable key in client inerface service for now

* Get senderTabId from the query params and send to the view cipher component to allow the pop out close when the close button is clicked on the view cipher component

* Refactored view item if passkeys exists and the cipher row views by having an extra ng-conatiner for each case

* Allow fido2 pop out close wehn cancle is clicked on add edit component

* Removed makshift run in angular zone

* created focus directive to target first element in ngFor for displayed ciphers in fido2

* Refactored to use switch statement and added condtional on search and add div

* Adjusted footer link and added more features to the login flow

* Added host listener to abort when window is closed

* remove custom focus directive. instead stuck focus logic into fido2-cipher-row component

* Fixed bug where close and cancel on view and add component does not abort the fido2 request

* show info dialog when user account does not have master password

* Removed PopupUtilsService

* show info dialog when user account does not have master password

* Added comments

* Added comments

* made row height consistent

* update logo to be dynamic with theme selection

* added new translation key

* Dis some styling to align cipher items

* Changed passkey icon fill color

* updated flow of focus and selected items in the passkey popup

* Fixed bug when picking a credential

* Added text to lock popout screen

* Added passkeys test to home view

* changed class name

* Added uilocation as a query paramter to know if the user is in the popout window

* update fido2 component for dynamic subtitleText as well as additional appA11yTitle attrs

* moved another method out of html

* Added window id return to single action popout and used the window id to close and abort the popout

* removed duplicate activatedroute

* added a doNotSaveUrl true to 2fa options, so the previousUrl can remain as the fido2 url

* Added a div to restrict the use browser link ot the buttom left

* reverted view change which is handled by the view pr

* Updated locales text and removed unused variable

* Fixed issue where new cipher is not created for non discoverable keys

* switched from using svg for the logo to CL

* removed svg files

* default to browser implmentation if user is logged out of the browser exetension

* removed passkeys knowledge from login, 2fa

* Added fido2 use browser link component and a state service to reduce passkeys knowledge on the lock component

* removed function and removed unnecessary comment

* reverted to former

* [PM-4148] Added descriptive error messages (#6475)

* Added descriptive error messages

* Added descriptive error messages

* replaced fido2 state service with higher order inject functions

* removed null check for tab

* refactor fido2 cipher row component

* added a static abort function to the browser interface service

* removed width from content

* uncommented code

* removed sessionId from query params and redudant styles

* Put back removed sessionId

* Added fallbackRequested parameter to abortPopout and added comments to the standalone function

* minor styling update to fix padding and color on selected ciphers

* update padding again to address vertical pushdown of cipher selection

---------

Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
Co-authored-by: jng <jng@bitwarden.com>

* padding update for focused cipher row in popup

* Updated fido2Credentials to initialize as null instead of empty array (#6548)

* Updated fido2Credentials to be null instead of empty string

* Updated cipher tests.

* Fixed tests.

* Updated view and clone logic.

* Updated templates to handle null value.

* Further null checks.

* [PM-4226] Create login item on the fly and add passkey item to it (#6552)

* Use the + button to ad an item and then save a passkey on the added item

* switch if to tenary

* [PM-4284] Passkey popout is not pulling correct URI for website opened (#6549)

* Used url from sender window in getting matching logins

* Rough draft to combine user verification required and master password required prompts

* Revert "Rough draft to combine user verification required and master password required prompts"

This reverts commit f72d6f877f.

* Remove array initialization that is not necessary. (#6563)

* removed unused code from login, 2fa components (#6565)

* Moved clearing of passkey from submit to load when cloning. (#6567)

* [PM-4280] MP reprompt not respected on passkey creation and retrieval (#6550)

* Rough draft to combine user verification required and master password required prompts

* Updated the handle user verification logic

* allow same behaviour for master password reprompt and user verification

* added test cases and merged conditions

* [PM-4226] Add Cipher With Passkey Flow Change (#6569)

* changed the add login item with passkey to require master password repompt first before creating the cipher item

* removed userVerified variable

* combined conditionals

* added passkey not copied alert when cloning for organizations (#6579)

* [PM-4296] Cannot login to Bitwarden with FIDO2 WebAuthn if extension is installed and logged in (#6576)

* removed sameOriginWithAncestors check on fido2 assertions

* removed sameOriginWithAncestors check on fido2 assertions

* [PM-4333] fix: change transport to `internal` (#6594)

* Address PR feedback (#6572)

* remove listeners for safari

* removed unused i18n tokens

* changed link to button for accessibilty purposes

* Fix potential reference error by restoring the typeof check for chrome

* added fromNullable to reduces repetitive logic

* Revert "added fromNullable to reduces repetitive logic"

This reverts commit ce5fc9c278.

* Added js docs to fido2credential export

* refined jsdocs comments

* added documentation to fido2 auth guard

* Removed unused i18n tokens, uneccesary whitespaces and comments

---------

Co-authored-by: gbubemismith <gsmithwalter@gmail.com>
Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
Co-authored-by: Jason Ng <jng@bitwarden.com>
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Todd Martin <tmartin@bitwarden.com>
2023-10-17 15:34:44 -04:00
Oscar Hinton ffb67be0a2
[ADR-0006][AC-319] Migrate all tests to use jest mock instead of substitute (#6520)
Standardize on using jest mock instead of having two mocking frameworks which can be confusing.
2023-10-17 17:02:33 +00:00
cyprain-okeke 5cacd79d8c
Refactor StaticStore Plans and consuming logic (#6136)
* staticstore factoring changes

* Refactoring code changes

* fix the free org issue

* remove a depreciated endpoint

* Resolve the issue of secrets manager sub

* Fix the ui product sorting
2023-10-17 15:56:59 +01:00
Thomas Avery d79ef473c6
[SM-891] Set SM flag to true for self-hosted (#6088)
* Set SM flag to true for selfhosted

* [SM-890] Add Secrets Manager self-hosted indicator (#6163)

* Add SM self-hosted indicator
2023-10-16 15:46:59 -05:00
Alex Morask c39ffe1991
Update billing-sync-key to use Dialog (#6596) 2023-10-16 15:14:29 -04:00
Alex Morask b1a92ba04b
[PM-2411] Update `billing-sync-api-key` to use Dialog (#6537)
* Update billing-sync-api-key dialog

* Oscar's feedback
2023-10-16 12:10:04 -04:00
cd-bitwarden c3856ce821
[SM-896] When org is disabled disable the logic and show warning symbols (#6225)
* When org is disabled disable the logic and show warning symbols

* fixing org enabled logic

* removing unused code

* Adding route gaurd logic and new org suspended page

* fixing lint issue

* fixing issues

* Requested changes

* adding back code that was accidentally removed from organization-switcher

* Update bitwarden_license/bit-web/src/app/secrets-manager/shared/org-suspended.component.ts

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>

* Removing unused code and updating storybook to set enabled:true

* removing onDestroy

* Will's suggestions

* will's suggested change

* fix nav-item color in story

* Thomas Rittson's suggested changes

* adding back removed spaces

* Adding back white space

* updating guard

* Update bitwarden_license/bit-web/src/app/secrets-manager/guards/sm-org-enabled.guard.ts

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* removing ununsed data

* Updating incorrect messages

---------

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
Co-authored-by: William Martin <contact@willmartian.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-10-16 14:29:03 +00:00
Oscar Hinton 95d4406a7e
Update duo and add allow-popups and allow-popups-to-escape-sandbox (#6561) 2023-10-13 12:22:59 -04:00
github-actions[bot] b592b71df1
Autosync the updated translations (#6570)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-10-13 08:24:02 +00:00
Thomas Rittson a6b725d08a
[AC-1638] Disallow Secrets Manager for MSP-managed organizations (#6392)
* Hide Add SM component on sub page for MSPs

* Hide Add SM component on create org page for MSPs

* Use hasProvider instead of providerType
2023-10-12 15:56:42 +01:00
Will Martin 84bafe5e73
[CL-104] fix overlay + virtual scroll view recycling bug (#6179)
* close menu overlay when no longer visible

* prevent infinite loop in fallback-src directive

* block scrolling when menu is open

* disable view recycling; use reposition strategy
2023-10-12 10:34:53 -04:00
Andreas Coroiu 56a1229803
[PM-4016] Address feedback on [PM-2014] (#6532)
* [PM-4016] feat: use dialog `loading` attribute

* [PM-4016] chore: move constant to service

* [PM-4016] chore: simplify paddings

* [PM-4016] chore: rename to `AuthSettingsModule`

* [PM-4016] fix: move request creation to service

* [PM-4016] feat: simplify module structure

Remove core.module and use `@Injectable({ providedIn: "root" })` instead.
2023-10-11 16:09:01 +02:00
Daniel James Smith 3e720c05f2
[PM-4198][TechDebt] Split up import and export modules (#6483)
* Split up import/export into separate modules

* Fix routing and apply PR feedback

* Renamed OrganizationExport exports to OrganizationVaultExport

* Renamed filenames according to export rename

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-10-10 19:12:13 +02:00
Andreas Coroiu 725ee08640
[PM-2014] Passkey registration (#5396)
* [PM-2014] feat: scaffold new fido2 login component and module

* [PM-1024] feat: add content to login settings component

* [PM-1024] feat: add badge and button aria label

* [PM-2014] feat: create new dialog

* feat: add ability to remove form field bottom margin

(cherry picked from commit 05925ff77ed47f3865c2aecade8271390d9e2fa6)

* [PM-2014] feat: disable dialog close button

* [PM-2014] feat: implement mocked failing wizard flow

* [PM-2014] feat: add icons and other content

* [PM-2014] feat: change wording to "creating" password

* [PM-2014] feat: add new auth and auth core modules

* [PM-2014] chore: move fido2-login-settings to auth module

* [PM-2014] chore: expose using barrel files

* [PM-2014] feat: fetch webauthn challenge

* [PM-2014] chore: refactor api logic into new api service and move ui logic into existing service

* [PM-2014] feat: add tests for new credential options

* [PM-2014] feat: return undefined when credential creation fails

* [PM-2014] feat: implement credential creation

* [PM-2014] feat: add passkey naming ui

* [PM-2014] feat: add support for creation token

* [PM-2014] feat: implement credential saving

* [PM-2014] feat: Basic list of credentials

* [PM-2014] feat: improve async data loading

* [PM-2014] feat: finish up list UI

* [PM-2014] fix: loading state not being set properly

* [PM-2014] feat: improve aria labels

* [PM-2014] feat: show toast on passkey saved

* [PM-2014] feat: add delete dialog

* [PM-2014] feat: implement deletion without user verification

* [PM-2014] feat: add user verification to delete

* [PM-2014] feat: change to danger button

* [PM-2014] feat: show `save` if passkeys already exist

* [PM-2014] feat: add passkey limit

* [PM-2014] feat: improve error on delete

* [PM-2014] feat: add support for feature flag

* [PM-2014] feat: update copy

* [PM-2014] feat: reduce remove button margin

* [PM-2014] feat: refactor submit method

* [PM-2014] feat: autofocus fields

* [PM-2014] fix: move error handling to components

After discussing it with Jake we decided that following convention was best.

* [PM-2014] feat: change toast depending on existing passkeys

* [PM-2014] chore: rename everything from `fido2` to `webauthn`

* [PM-2014] fix: `CoreAuthModule` duplicate import

* [PM-2014] feat: change to new figma design `Encryption not supported`

* [PM-2014] fix: add missing href

* [PM-2014] fix: misaligned badge

* [PM-2014] chore: remove whitespace

* [PM-2014] fix: dialog close bug

* [PM-2014] fix: badge alignment not applying properly

* [PM-2014] fix: remove redundant align class

* [PM-2014] chore: move CoreAuthModule to AuthModule

* [PM-2014] feat: create new settings module

* [PM-2014] feat: move change password component to settings module

* [PM-2014] chore: tweak loose components recommendation

* [PM-2014] fix: remove deprecated pattern

* [PM-2014] chore: rename everything to `WebauthnLogin` to follow new naming scheme

* [PM-2014] chore: document requests and responses

* [PM-2014] fix: remove `undefined`

* [PM-2014] fix: clarify webauthn login service

* [PM-2014] fix: use `getCredentials$()`

* [PM-2014] fix: badge alignment using important statement

* [PM-2014] fix: remove sm billing flag

* [PM-2014] fix: `CoreAuthModule` double import

* [PM-2014] fix: unimported component (issue due to conflict with master)

* [PM-2014] fix: unawaited promise bug
2023-10-10 15:10:26 +02:00
Thomas Rittson 21fef9d38d
[AC-1453] Update TrialInitiationModule with new standalone component (#6448)
* import new standalone components directly into TrialInitiationModule instead of
  importing and re-exporting through LooseComponentsModule
2023-10-08 23:06:40 -04:00
Robyn MacCallum ceea6ef985
Update text for SM billing section checkbox (#6463) 2023-10-06 09:32:29 -04:00
github-actions[bot] a8d0ca7aaf
Autosync the updated translations (#6523)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-10-06 07:31:50 +00:00
SmithThe4th 922de469f4
[PM-2169] Update Password Reprompt Modal to use Component Library (#5720)
* update password reprompt to use the dialog CL

* Override showPasswordPrompt and submit method on web child classes from base classes to allow dialog work on web and modal on other clients

* Override showPasswordPrompt and submit method on web child classes from base classes to allow dialog work on web and modal on other clients

* Fixed lint issues

* Corrected comments

* Refactored passwored reprompt to use dialog service after changes to make the dialog service work on the desktop and browser

* Changed access modifier from protected to protected

* Refactored passwprd reprompt component to a stand alone component and fixed all references

* fix merge changes

* fix import aliases in password-reprompt.component.ts

* fix alias typo in browser tsconfig

* import from root vault alias

* revert tsconfig changes

* remove service abstraction and update imports

* remove component from imports

* Removed unneccesary show password toggle

* renamed selector to use vault prefix

* removed unnecessary data dismiss

* merged and fixed conflicts

* remove reintroduced file

* Added appAutoFocus to reprompt dialog

* delayed validation until submit happens

---------

Co-authored-by: William Martin <contact@willmartian.com>
2023-10-04 22:56:27 -04:00
Robyn MacCallum d40f996e71
[AC-1347] Allow editing of collections in individual vault (#6081)
* Rename Collection events to be more explicit

* Implement edit collection for individual vault row

* Implement edit and delete collection from individual vault header

* Implement bulk delete for collections in individual vault

* Clean up CollectionDialogResult properties

* Centralize canEdit and canDelete logic to Collection models

* Check orgId in canEdit and canDelete and add clarifying comments

---------

Co-authored-by: Shane Melton <smelton@bitwarden.com>
2023-10-04 14:15:20 -07:00
Conner Turnbull c411e1f03b
[AC-1404] incorrect pricing shows for 2019 teams customers (#6462)
* Refactor seat count calculation in subscription adjust component

* Defaulting additionalSeatCount to 0 when falsy
2023-10-04 12:29:20 +00:00
Thomas Rittson 0a953b444a
[AC-1453] Move OrganizationPlansComponent and related components out of LooseComponentsModule (#6230)
* restructure billing folders into individual, organization, and shared
* move components from `LooseComponentsModule`
2023-10-03 15:36:45 -04:00
Thomas Rittson 32121dabe4
Move PremiumComponent to billing ownership (#6450) 2023-10-02 11:43:31 -07:00
Alex Morask 6aed74d241
Hide additional tax inputs when country doesn't support Stripe Tax [AC-1665] (#6363)
* Revert "Removed countries that Stripe doesn't support (#6035)"

This reverts commit a81c70360a.

* Hide additional tax options when selected country doesn't support Stripe tax

* Conner's feedback
2023-10-02 09:42:50 -04:00
Alex Morask 1233a081e4
Conditionally display new copy under subscriptions table [AC-1657] (#6332)
* Add copy to translations

* Add copy to premium user subscription page

* Add copy to organization user subscription page

* Conditionally display copy on premium user subscription page

* Conditionally display copy on organization user subscription page

* Update translations to approved copy
2023-09-29 12:58:19 -04:00
Thomas Rittson c7afbab217
[AC-1453] Move SecretsManagerLogo into OSS code (#6447)
* Add failing eslint rule

* Move SecretsManagerLogo into OSS code
2023-09-29 16:58:06 +01:00
github-actions[bot] 4f6222a84d
Bumped browser,web version to 2023.9.2 (#6459)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-29 15:40:08 +00:00
Oscar Hinton ab0807072d
[PM-2157] Migrate EnrollMasterPasswordReset to CL (#6277) 2023-09-29 09:54:07 -04:00
github-actions[bot] 57bdb0a258
Autosync the updated translations (#6446)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-29 06:19:33 +00:00
Oscar Hinton 80314f51a1
[BEEEP] [PM-3838] Refactor password callout (#6234) 2023-09-28 14:52:05 +00:00
Todd Martin 8bef0883f5
Individual Vault Item Encryption Feature (#6241)
* PM-1049 - TODO: replace base component with business service

* updated server version

* disabled cipher key encryption

* add new storage to replace MasterKey with UserSymKey

* add storage for master key encrypted user symmetric key

* Begin refactor of crypto service to support new key structure

* remove provided key from getKeyForUserEncryption

* add decryption with MasterKey method to crypto service

* update makeKeyPair on crypto service to be generic

* add type to parameter of setUserKey in abstraction of crypto service

* add setUserSymKeyMasterKey so we can set the encrypted user sym key from server

* update cli with new crypto service methods
- decrypt user sym key and set when unlocking

* separate the user key in memory from user keys in storage

* add new memory concept to crypto service calls in cli

* update auth service to use new crypto service

* update register component in lib to use new crypto service

* update register component again with more crypto service

* update sync service to use new crypto service methods

* update send service to use new crypto service methods

* update folder service to use new crypto service methods

* update cipher service to use new crypto service

* update password generation service to use new crypto service

* update vault timeout service with new crypto service

* update collection service to use new crypto service

* update emergency access components to use new crypto service methods

* migrate login strategies to new key model
- decrypt and set user symmetric key if Master Key is available
- rename keys where applicable
- update unit tests

* migrate pin to use user's symmetric key instead of master key
- set up new state
- migrate on lock component
- use new crypto service methods

* update pin key when the user symmetric key is set
- always set the protected pin so we can recreate pin key from user symmetric key
- stop using EncryptionPair in account
- use EncString for both pin key storage
- update migration from old strategy on lock component

* set user symmetric key on lock component
- add missed key suffix types to crypto service methods

* migrate auto key
- add helper to internal crypto service method to migrate

* remove additional keys in state service clean

* clean up the old pin keys in more flows
- in the case that the app is updated while logged in and the user changes their pin, this will clear the old pin keys

* finish migrate auto key if needed
- migrate whenever retrieved from storage
- add back the user symmetric key toggle

* migrate biometrics key
- migrate only on retrieval

* fix crypto calls for key connector and vault timeout settings

* update change password components with new crypto service

* update assortment of leftover old crypto service calls

* update device-crypto service with new crypto service

* remove old EncKey methods from crypto service

* remove clearEncKey from crypto service

* move crypto service jsdoc to abstraction

* add org key type and new method to build a data enc key for orgs

* fix typing of bulk confirm component

* fix EncString serialization issues & various fixes

Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>

* update account model with new keys serialization

* migrate native messaging for biometrics to use new key model
- support backwards compatibility
- update safari web extension to send user key
- add error handling

* add early exit to native messaging flow for errors

* improve error strings in crypto service

* disable disk cache for browser due to bg script/popup race conditions

* clear bio key when pin is migrated as bio is refreshed

* share disk cache to fix syncing issues between contexts

* check for ephemeral pin before process reload

* remove state no longer needed and add JSDOC

* fix linter

* add new types to tests

* remove cryptoMasterKeyB64 from account

* fix tests imports

* use master key for device approvals still

* cleanup old TODOs, add missing crypto service parameters

* fix cli crypto service calls

* share disk cache between contexts on browser

* Revert "share disk cache between contexts on browser"

This reverts commit 56a590c491.

* use user sym key for account changing unlock verification

* PM-1565 Added item key property to cipher export domain (#5580)

* PM-1565 Added item key property to cipher export domain

* enabled cipher key encryption

* Updated getCipherKeyEncryptionEnabled validation to also return true if the serverVersion matches the minVersion

* Using async/await when getting decrypted ciphers on getOrganizationDecryptedExport

* Disabling CipherKey

* add tests to crypto service

* rename 'user symmetric key' with 'user key'

* remove userId from browser crypto service

* updated EncKey to UserKey where applicable

* jsdoc deprecate account properties

* use encrypt service in crypto service

* use encrypt service in crypto service

* require key in validateUserKey

* check storage for user key if missing in memory

* change isPinLockSet to union type

* move biometric check to electron crypto service

* add secondary fallback name for bio key for safari

* migrate master key if found

* pass key to encrypt service

* rename pinLock to pinEnabled

* use org key or user key for encrypting attachments

* refactor makeShareKey to be more clear its for orgs

* rename retrieveUserKeyFromStorage

* clear deprecated keys when setting new user key

* fix cipher service test

* options is nullable while setting user key

* Reordering Service creation on cli's bw.ts to fix ConfigApiService (#5684)

* more crypto service refactors
- check for auto key when getting user key
- consolidate getUserKeyFromMemory and FromStorage methods
- move bio key references out of base crypto service
- update either pin key when setting user key instead of lock component
- group deprecated methods
- rename key legacy method

* Feature/PM-1049 - TDEFflow 3 login decryption options - PR feedback changes (#5642)

* PM-1049 - PR Feedback change - Browser - replace incorrect use of routerlink with manual attribute styling to keep anchor styling + tab focus while not having a router action race condition for the log out action to complete.

* PM-1049 - PR Feedback - State Service changes - rename get/setAcctDecryptionOptions to  get/setAccountDecryptionOptions

* PM-1049 - PR Feedback changes - LoginDecryptionOptionsComp - Remove unncessary appA11yTitle directives as title / aria text would be identical to the displayed inner button text.

* DeviceType - Create sets of device types which other components can reference to avoid having to manually define groups of device types.

* PM-1049 - PR Feedback Changes - Update base-login-decryption-options component to leverage async piped observables per best practices. Updated all client templates to leverage new data streams.

* PM-1049 - BaseLoginDecryptionOptionsComp - Add validation service for generic error handling

* PM-1049 - DeviceResponse mistakenly had name as a number instead of a string

* PM-1049 - First draft of creating observable based data store service for Devices so that the base login comp can leverage it instead of calling the devices API service directly (as it will be moved into the SDK in the future).

* PM-1049 - Register new DevicesService on jslib-services module for use in components.

* PM-1049 - Add new hasDevicesOfTypes call to devices data store svc + devices API service.

* PM-1049 - BaseLoginDecryptionOptionsComp - wire up call to devicesService.hasDevicesOfTypes to replace getDevices() to avoid bringing down all trusted device information unnecessarily.

* PM-1049 - LoginDecryptionOptionsComp - Web HTML - clean up loading state so it displays spinner centered properly.

* PM-1049 - LoginDecryptionOptionsComp - Desktop HTML - Don't show login initiated title while page is loading to match other clients behavior.

* PM-1049 - Devices Services - Update naming of hasDevicesOfTypes to match new name on back end + route change to getDevicesExistenseByTypes

* PM-1049 - Device Response & View models - remove keys which are going to be deprecated on the base model

* PM-1049 - DevicesService - devicesBSubject --> devicesSubject rename per PR feedback

* PM-1049 - Devices Services - correct spelling of existence (*facepalm*)

* PM-1049 - Update comment for clarity per PR feedback

* PM-1049 - DevicesSvc - UserSymKey --> UserKey rename

* PM-1049 - BaseLoginDecryptionOptions - replace user email source - get from stateService vs tokenService.

* PM-1049 - BaseLoginDecryptionOptions - Remove uncessary check for userEmail as we will always have it here otherwise everything in the app is broken.

* PM-1049 - BaseLoginDecryptionOptions - Finish cleaning up removal of user email from showReqAdminApprovalBtn$ stream

* PM-1049 - LoginDecryptionOptionsComp - HTML revisions in web & browser to better space out buttons using tailwind or top margin to avoid need for multiple async pipes and shareReplay.

* PM-1049 - DevicesService - of course all observables should have $ suffix. Facepalm.

* PM-1049 - BaseLoginDecryptionOptionsComp - Update verbiage and style of destroy observable used for hooking into ngOnDestroy lifecycle to clean up all observables

* PM-1049 - BaseLoginDecryptionOptions - PR feedback changes - refactor user email to have an underlying bSubject stream to ensure subscription/promise execution separately from the template async pipe subscribing to the stream.

* PM-1049 - DevicesApiService - getDevicesExistenceByTypes - PR feedback - explicitly convert result to boolean instead of casting.

* PM-1049 - BaseLoginDecryptionOptionsComp - Add ShareReplay for getAccountDecryptionOptions + context per PR feedback

* PM-1049 - LoginDecryptionOptionsComp - Completely back away from template async pipe reactive approach as it caused massively increased complexity for little gain. Instead, just focus on reactively pulling asynchronously retrieved data and setting page loading state simply. This just works and is so much less overhead. + Add comments re flows of the component to be done later

* PM-1049- Revert DevicesService implementation from smart data store cache service giant mess into simple, clean data passthrough service to avoid complexity and keep moving forward. YAGNI

Co-authored-by: Andreas Coroiu <andreas@andreascoroiu.com>

* PM-1049 -  DeviceCryptoService - Add decryptUserKey method (WIP)

* PM-1049 - AccountDecryptionOptions - add get helpers for checking for trusted device / key connector decryption option existence.

* PM-1049 - SSO Login Strategy - added comments in setUserKey method for where we will probably be consuming device keys and determining if the device is trusted or not (i.e., if we can get a decrypted user sym key in memory)

* PM-1049 - DeviceCryptoSvc.decryptUserKey - Update method to properly use state service device key retrieval + add TODO to figure out what to do if user has previously had a device key and has cleared their local cache (which will result in the device being untrusted now)

* PM-1049 - SSO Login Strategy - add comment re future passkey login strategy support

* PM-2759 - SSO & 2FA components updated with v0 of navigation logic to send users to LoginDecryptionOptions

* PM-1049 - Account > AccountDecryptionOptions - can't create getter helper methods for determining if user has decryption options b/c of issues w/ account deserialization. Moving past b/c I can just easily check if the given options are not undefined.

* PM-2759 - Add TODOs for deprecation of id token response resetMasterPassword logic and replacement with use of accountDecryptionOptions

---------

Co-authored-by: Andreas Coroiu <andreas@andreascoroiu.com>

* PM-2582 Fix adding attachments (#5692)

* revert sharing disk cache between contexts

* fix tests

* PM-2791 Reordered service creation (#5701)

* Turned off flag in production.json

* add better tests to crypto service

* add hack to get around duplicate instances of disk cache on browser

* prevent duplicate cache deletes in browser

* fix browser state service tests

* Feature/PM-1212 - TDE - Approve with master password flow (#5706)

* PM-1212 - StateSvc - Add getUserDeviceTrustChoice && setUserDeviceTrustChoice to persist user's choice in local storage in case of refresh on login approval screens (ex: lock)

* PM-1212 - DeviceCryptoSvc - Add getUserDeviceTrustChoice && setUserDeviceTrustChoice as state service is lower level service for caching

* PM-1212 - LoginDecryptionOptionsComp - Save result of rememberEmail checkbox into local storage via deviceCryptoService.setUserDeviceTrustChoice

* PM-1212 - Lock component - after user key is set, check if user chose to establish trust, and if they did, then establish trust and reset choice.

* PM-1212 - Update naming of methods per discussion with Jake + add comment explaining intended single use retrieval and need for resetting the value.

* DeviceCryptoService - Refactor - decryptUserKey --> decryptUserKeyWithDeviceKey to match crypto service refactor naming convention

* PM-1212 - Refactor State Service per PR feedback to store trustDeviceChoiceForDecryption on Account.settings b/c the temp setting is scoped to a user.

* PM-2759 - SSO & 2FA Navigation to TDE Comp - Needs more work - Found scenarios on web with 2FA in which the expected navigation doesn't work. Adding TODO to assist in fixing

* (1) Add Trust to DeviceCryptoService name
(2) Move DeviceTrustCryptoService under auth folder

* PM-1212 - Add tests for new getUserTrustDeviceChoiceForDecryption and setUserTrustDeviceChoiceForDecryption methods + TODOs for future tests.

* PM-1212- Renaming / moving DeviceTrustCryptoService broke all the things - fixed all the client builds.

* PM-1212- Copy doc comment to abstraction per PR feedback

* PM-1212 - BaseLoginDecryptionOptions comp - remove unncessary cast to form control as apparently reactive forms now properly derives types.

* [PM-1203] Replace MP confirmation with verification code (#5656)

* [PM-1203] feat: ask for OTP if user does not have MP

* [PM-1203] feat: add backwards compatibility for accounts/servers without decryption options

* [PM-1203] feat: move hasMasterPassword to user-verification.service

* [PM-1203] fix: remove duplicate implementation from crypto service

* [PM-1203] fix: cli build

* Tweak device trust crypto service implementation to match mobile late… (#5744)

* Tweak device trust crypto service implementation to match mobile latest which results in more single responsibility methods

* Update tests to match device trust crypto service implementation changes

* update comment about state service

* update pinLockType states and add jsdocs

* add missed pinLockType changes

* [PM-1033] Org invite user creation flow 1 (#5611)

* [PM-1033] feat: basic redirection to login initiated

* [PM-1033] feat: add ui for TDE enrollment

* [PM-1033] feat: implement auto-enroll

* [PM-1033] chore: add todo

* [PM-1033] feat: add support in browser

* [PM-1033] feat: add support for desktop

* [PM-1033] feat: improve key check hack to allow regular accounts

* [PM-1033] feat: init asymmetric account keys

* [PM-1033] chore: temporary fix bug from merge

* [PM-1033] feat: properly check if user can go ahead an auto-enroll

* [PM-1033] feat: simplify approval required

* [PM-1033] feat: rewrite using discrete states

* [PM-1033] fix: clean-up and fix merge artifacts

* [PM-1033] chore: clean up empty ng-container

* [PM-1033] fix: new user identification logic

* [PM-1033] feat: optimize data fetching

* [PM-1033] feat: split user creating and reset enrollment

* [PM-1033] fix: add missing loading false statement

* [PM-1033] fix: navigation logic in sso component

* [PM-1033] fix: add missing query param

* [PM-1033] chore: rename to `ExistingUserUntrustedDevice`

* PM-1033 - fix component templates to reference `ExistingUserUntrustedDevice` so clients can build

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>

* remove extra partial key

* set master key on lock component

* rename key hash to password hash on crypto service

* fix cli

* rename enc user key setter in crypto service

* Adds Events & Human Readable Messages (#5746)

* [PM-1202] Hide the Master Password tab on Settings / Security (#5649)

* [PM-1203] feat: ask for OTP if user does not have MP

* [PM-1203] feat: get master password status from decryption options

* [PM-1203] feat: add backwards compatibility for accounts/servers without decryption options

* [PM-1203] feat: move hasMasterPassword to user-verification.service

* fix merge issues

* Change getUserTrustDeviceChoiceForDecryption / setUserTrustDeviceChoiceForDecryption to getShouldTrustDevice / setShouldTrustDevice (#5795)

* Auth/[PM-1260] - Existing User - Login with Trusted Device (Flow 2) (#5775)

* PM-1378 - Refactor - StateSvc.getDeviceKey() must actually convert JSON obj into instance of SymmetricCryptoKey

* TODO: BaseLoginDecryptionOptionsComponent - verify new user check doesn't improperly pick up key connector users

* PM-1260 - Add new encrypted keys to TrustedDeviceUserDecryptionOptionResponse

* PM-1260 - DeviceTrustCryptoSvc - decryptUserKeyWithDeviceKey: (1) update method to optionally accept deviceKey (2) Return null user key when no device key exists (3) decryption of user key now works in the happy path

* PM-1260 - LoginStrategy - SaveAcctInfo - Must persist device key on new account entity created from IdTokenResponse for TDE to work

* PM-1260 - SSO Login Strategy - setUserKey refactor - (1) Refactor existing logic into trySetUserKeyForKeyConnector + setUserKeyMasterKey call and (2) new trySetUserKeyWithDeviceKey method for TDE

* PM-1260 - Refactor DeviceTrustCryptoService.decryptUserKeyWithDeviceKey(...) - Add try catch around decryption attempts which removes device key (and trust) on decryption failure + warn.

* PM-1260 - Account - Add deviceKey to fromJSON

* TODO: add device key tests to account keys

* TODO: figure out state service issues with getDeviceKey or if they are an issue w/ the account deserialization as a whole

* PM-1260 - Add test suite for decryptUserKeyWithDeviceKey

* PM-1260 - Add interfaces for server responses for UserDecryptionOptions to make testing easier without having to use the dreaded any type.

* PM-1260 - SSOLoginStrategy - SetUserKey - Add check looking for key connector url on user decryption options + comment about future deprecation of tokenResponse.keyConnectorUrl

* PM-1260 - SSO Login Strategy Spec file - Add test suite for TDE set user key logic

* PM-1260 - BaseLoginStrategy - add test to verify device key persists on login

* PM-1260 - StateService - verified that settings persist properly post SSO and it's just device keys we must manually instantiate into SymmetricCryptoKeys

* PM-1260 - Remove comment about being unable to feature flag auth service / login strategy code due to circ deps as we don't need to worry about it b/c of the way we've written the new logic to be additive.

* PM-1260 - DevicesApiServiceImplementation - Update constructor to properly use abstraction for API service

* PM-1260 - Browser - AuthService - (1) Add new, required service factories for auth svc and (2) Update auth svc creation in main.background with new deps

* PM-1260 - CLI - Update AuthSvc deps

* PM-1260 - Address PR feedback to add clarity / match conventions

* PM-1260 - Resolving more minor PR feedback

* PM-1260 - DeviceTrustCryptoService - remove debug warn

* PM-1378 - DeviceTrustCryptoSvc - TrustDevice - Fix bug where we only partially encrypted the user key with the device public key b/c I incorrectly passed userKey.encKey (32 bytes) instead of userKey.key (64 bytes) to the rsaEncrypt function which lead to an encryption type mismatch when decrypting the user's private key with the 32 byte decrypted user key obtained after TDE login.  (Updated happy path test to prevent this from happening again)

* PM-1260 - AccountKeys tests - add tests for deviceKey persistence and deserialization

* PM-1260 - DeviceTrustCryptoSvc Test - tweak verbiage per feedback

* PM-1260 - DeviceTrustCryptoSvc - Test verbiage tweak part 2

* Update apps/browser/src/background/service-factories/devices-api-service.factory.ts

per PR feedback

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

---------

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

* Defect - LockComp - After setting user key, must AWAIT retrieval of user's previous choice to have trusted the device or not. (#5804)

* [PM-2928] [PM-2929] [PM-2930] Fixes for: [PM-1203] Replace MP confirmation with verification code (#5798)

* [PM-2928] feat: hide change email if user doen't have MP

* [PM-2929] feat: hide KDF settings if user doesn't have MP

* [PM-2930] feat: remove MP copy

* Removed self-hosted check from TDE SSO config. (#5837)

* [PM-2998] Move Approving Device Check (#5822)

* Switch to retrieving approving device from token response

- Remove exist-by-types API call
- Define `HasApprovingDevices` on TDE options

* Update Naming

* Update Test

* Update Missing Names

* [PM-2908] feat: show account created toast (#5810)

* fix bug where we weren't passing MP on Restart to migrate method in lock

* fix: buffer null error (#5856)

* Auth/[pm-2759] - TDE - SSO and 2FA routing logic (#5829)

* PM-2759 - SsoComp - (1) Temp remove all TDE routing logic (2) Refactor existing navigation logic via new component utility function navigateViaCallbackOrRoute

* PM-2759 - SSO Component - Create test suite for logIn logic

* PM-2759 - SsoComp Tests - add disclaimer regarding testing private methods and props

* PM-1259 - SSO Comp - Refactor LogIn method to use functions for each navigation case for improved readability

* PM-1259 - SSO Comp Tests - Add tests for error case during login + test for new handleLoginError logic

* PM-2759 - SsoComp - Deprecate resetMasterPassword and replace with AccountDecryptionOptions logic + update tests

* PM-2759 - SsoComp + tests - Add trusted device encryption first draft handling which has login success and force password reset handling

* PM-2759 - Minor SsoComp comment and method name tweaks

* PM-2759 - BaseTwoFactorComp - (1) Comment out TDE stuff for now (2) Add test suite (3) Replace global window in base comp constructor with angular injection token for window which follows best practices and allows for mocking so the comp can be unit tested

* PM-2759 - Update child 2FA components to use angular injection token for window like base comp

* PM-2759 - TwoFactorComp - Finish testing all logic in doSubmit

* PM-2759 - TwoFactorComponent - Refactor DoSubmit method logic into multiple simple functions to make logic easier to follow

* PM-2759 - Add newtrustedDeviceOption.hasManageResetPasswordPermission property to match server changes

* PM-2759 - Flag AuthResult.resetMasterPassword property as deprecated

* PM-2759 - SSO comp - TDE routing logic - User without MP and ResetPassword permission must set a MP

* PM-2759 - Update Sso Comp tests to reflect additionally added TDE > MP set required logic (when user has no MP but they can reset other user passwords)

* PM-2759 - SsoComp - Add comment explaining the happy paths better for TDE success navigation

* PM-2759 - SsoComp - Refactor isTrustedDeviceEncEnabled logic into own method

* PM-2759 - SsoComp - As the 2FA comp passes the org id through to each route, going to standardize on doing so across the board for now to avoid any tricky scenarios down the line where it is needed and it's not present

* PM-2759 - SsoComp - Finish renaming orgIdFromState to orgIdentifier

* PM-2759 - SsoComp - update tests for forcePasswordReset flows now passing orgIdentifier as query param

* PM-2759 - SsoComp Tests - Export mockAcctDecryptionOpts permutations so we can share them across SsoComp and TwoFactorComp tests

* PM-2759 - Refactor 2FA comp post login redirect logic to match SSO component + add TDE logic

* PM-2759 - SsoComp - Refactor tests a bit for improved re-use

* PM-2759 - Sso Comp tests - can't export consts from a spec file or the other spec files that import them will re-execute the whole test suite as a nested test suite. TIL.

* PM-2759 - TwoFactorComp tests - All existing navigation scenarios + new TDE scenarios should now be tested.

* PM-2759 - Web - 2FA comp - Fix build error b/c of renamed base comp prop (identifier --> orgIdentifier)

* PM-2759 - Fix SsoLogin strategy tests b/c they were broken w/ the addition of the HasManageResetPasswordPermission prop to the TrustedDeviceOption interface

* PM-2759 - Web TwoFactorComp - goAfterLogIn method must be an arrow function to inherit the parent base component scope so that important things like angular services can be defined. Web 2FA flow does not work without this being an arrow func.

* PM-2759 - Fix typo

* PM-2759 - SsoComp and TwoFactorComp tests -  move service and other mocks into the top level before each to better ensure no crossover between test states per PR feedback

* PM-2759 - SsoComp - add clarity by refactoring unclear comment

* PM-2759 - SsoComp - Per excellent PR feedback, refactor if else statements to  guard statements for better readability / design

* PM-2759 - TwoFactorComp - Replace ifs with guard statements

* PM-2759 - TwoFactorComp - add clarity to comment per PR feedback

* PM-2759 - Replace use of jest.Mocked with MockProxy per PR feedback

* PM-2759 - Use unknown over any per PR feedback

* Bypass Master Password Reprompt if a user does not have a MP set (#5600)

* Add a check for a master password in PasswordRepromptService.enabled()

* Add tests for enabled()

* Update state service method call

* Use UserVerificationService to determine if a user has a master password

* rename password hash to master key hash

* fix cli build from key hash renaming

* [PM-1339] Allow Rotating Device Keys (#5806)

* Merge remote-tracking branch 'origin/feature/trusted-device-encryption' into Auth/pm-1339/rotate-device-keys

* Implement Rotation of Current Device Keys

- Detects if you are on a trusted device
- Will rotate your keys of only this device
- Allows you to still log in through SSO and decrypt your vault because the device is still trusted

* Address PR Feedback

* Move Files to Auth Ownership

* fix: getOrgKeys returning null

* [PM-3143] Trusted device encryption: Refactor reset enroll service (#5869)

* create new reset enrollment service

* refactor: login decryption options according to TODO

* feat: add tests

* PM-3143 - Add override to overriden methods

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>

* generate a master key from master password if needed (#5870)

* [PM-3120] fix: device key not being saved properly (#5882)

* pm-2582 Moved code to cipher service (#5818)

* Auth/pm 1050/pm 1051/remaining tde approval flows (#5864)

* fix: remove `Unauth guard` from `/login-with-device`

* Turned encryption on (#5908)

* [PM-3101] Fix autofill items not working for users without a master password (#5885)

* Add service factories for user verification services

* Update autofill service to check for existence of master password for autofill

* Update the context menu to check for existence of master password for autofill

* context menu test fixes

* [PM-3210] fix: use back navigation (#5907)

* Removed buttons (#5935)

* PM-2759 - Fix broken backwards compatibility for authResult.resetMast… (#5940)

* PM-2759 - Fix broken backwards compatibility for authResult.resetMasterPassword

* PM-2759 - Update TODO with specific tech debt task + target release date

* TDE - State Svc - setDeviceKey should support setting null for future support of clearing device key. (#5942)

* Check if a user has a mp before showing kdf warning (#5929)

* [PM-1200] Unlock settings changes for accounts without master password - clients (#5894)

* [PM-1200] chore: add comment for jake

* [PM-1200] chore: rename to `vault-timeout`

* [PM-1200] feat: initial version of `getAvailableVaultTimeoutActions`

* [PM-1200] feat: implement `getAvailableVaultTimeoutActions`

* [PM-1200] feat: change helper text if only logout is available

* [PM-1200] feat: only show available timeout actions

* [PM-1200] fix: add new service factories and dependencies

* [PM-1200] fix: order of dependencies

`UserVerificationService` is needed by `VaultTimeoutSettingsService`

* [PM-1200] feat: add helper text if no lock method added

* [PM-1200] refactor: simplify prev/new values when changing timeout and action

* [PM-1200] feat: fetch timeout action from new observable

* [PM-1200] refactor: make `getAvailableVaultTimeoutActions` private

* [PM-1200] feat: add test cases for `vaultTimeoutAction$`

* [PM-1200] feat: implement new timeout action logic

* [PM-1200] feat: add dynamic lock options to browser

* [PM-1200] feat: enable/disable action select

* [PM-1200] feat: add support for biometrics

* [PM-1200] feat: add helper text and disable unavailable options

* [PM-1200] feat: update action on unlock method changes

* [PM-1200] feat: update browser to use async pipe

* [PM-1200] fix: element not updating

* [PM-1200] feat: hide masterPassOnRestart pin option

* [PM-1200] feat: hide change master password from browser settins

* [PM-1200] feat: hide change master password from app menu

* [PM-1200] feat: logout if lock is not supported

* [PM-1200] feat: auto logout from lock screen if unlocking is not supported

* [PM-1200] feat: remove lock button from web menus

* Revert "[PM-1200] fix: element not updating"

This reverts commit b27f425f48570d0d5dbc9dedb9797023fef64d8b.

* Revert "[PM-1200] feat: update browser to use async pipe"

This reverts commit 766c15bc3dbadcf7dcef3053b148e7874f8939ce.

* [PM-1200] chore: add comment regarding detectorRef

* [PM-1200] feat: remove lock now button from browser settings

* [PM-1200] feat: add `userId` to unlock settings related methods

* [PM-1200] feat: remove non-lockable accounts from menu

* [PM-1200] fix: cli not building

---------

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>

* [PM-3215][PM-3289] Create MasterKey from Password If Needed (#5931)

* Create MasterKey from Password

- Check if the MasterKey is stored or not
- Create it if it's not

* Add getOrDeriveKey Helper

* Use Helper In More Places

* Changed settings menu to be enabled whenever the account is not locked. (#5965)

* [PM-3169] Login decryption options in extension popup (#5909)

* [PM-3169] refactor: lock guard and add new redirect guard

* [PM-3169] feat: implement fully rewritten routing

* [PM-3169] feat: close SSO window

* [PM-3169] feat: store sso org identifier in state

* [PM-3169] fix: tests

* [PM-3169] feat: get rid of unconventional patch method

* PM-3169 - SSO & 2FA Comps - Update naming of new callback to match existing pattern + add tests for callback logic execution.

* PM-3169 - Update LockGuard to have a special exception for allowing the TDE Login with MP flow

* PM-3169 - Per discussion w/ Jake and Justin, rename login-initiated guard to be tde decryption required guard (more named for functionality vs specific route)

* PM-3169 - Add some additional context to new redirect guard scenario

* PM-3169 - Per PR feedback, replace all callback types with Promise<void> as the return values are not being used.

* PM-3169 - StateSvc - Per PR feedback, update setUserSsoOrganizationIdentifier signature to explicitly use null instead of partial<string> which doesn't do anything

* PM-3169 - Replace onSuccessfulLogin type to compile

* PM-3169 - Add clarification comment for why we are not using a query param for persisting the org identifier

* PM-3169 - Per discussion with Justin, only use memory for SsoOrgId as we don't need to persist it beyond that; tested and it worked on all 3 clients for new user TDE creation

* PM-3169 - Add missing ssoIdentifierRequired translation to desktop and browser

* PM-3169 - After discussing with Justin again, we realized that memory doesn't work on desktop if user refreshes app or closes and re-opens it so must use disk.

* PM-3169 - Per PR feedback, remove hasEverHadUserKey logic as we can just leverage existing getUserKey method to check if we have a user key or not; tested all guards in browser and web with no issues

* PM-3169 - Per design discussion with Danielle, move account created toast after successful account creation vs on load of page.

---------

Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: Jared Snider <jsnider@bitwarden.com>

* [PM-3314] Fixed missing MP prompt on lock component (#5966)

* Updated lock component to handle no master password.

* Added a comment.

* Add Missing Slash (#5967)

* Fix AdminAuthRequest Serialization on Desktop (#5970)

- toJSON isn't being called by ElectronStorageService
- Force it's conversion to JSON earlier so it happens for all storage methods

* Fix issue where we were incorrectly calling setRememberEmailValues in the AdminAuthRequest state - no need to do this as the email is already saved to state. By calling this method, we would actually overwrite the already saved email with null as the user's choice to remember email wasn't persisted through SSO on the login service. (#5972)

* PM-3329 - Restore everHadUserKey logic from PM-3169 which I incorrectly removed in order to fix routing logic so that user can lock and land on the lock screen properly (#5979)

* PM-3210 - TDE - LoginWithDevice routing fix - Mirror PR #5950 in just simply providing a back action on click which works for all app generated scenarios (#5982)

* PM-3332 - TDE - SsoLoginStrategy - For existing admin auth reqs, must… (#5980)

* PM-3332 - TDE - SsoLoginStrategy - For existing admin auth reqs, must manually handle 404 error case to prevent app from hanging and clear the local state if the admin auth req in the DB has been purged; i.e., it should fail silently.

* Add TODO for SSO Login Strategy tests

* PM-3331 - TDE - Firefox - Browser extension - fix access denied error… (#5984)

* PM-3331 - TDE - Firefox - Browser extension - fix access denied error on popup load which was caused by the canAccessFeature guard failing to lookup the TDE feature flag as the server config was returning null even after a successful server call as only returned the value if the user was unauthenticated for some reason

* PM-3331 - After discussion with Andre, further refactor ConfigService logic to always return the latest information from the server so that requests for feature flag data will always get the most up to date information.

* PM-3345 - TDE - Desktop - Biometrics setting submenu tweak - do not s… (#5988)

* PM-3345 - TDE - Desktop - Biometrics setting submenu tweak - do not show require MP or PIN entry on restart if user doesn't have at least one of those options b/c otherwise user can get into a bad state where they cannot unlock

* PM-3345 - TDE - Desktop - Settings comp - if user turns off PIN and Biometric is on + require PIN on restart is enabled then must turn that setting off to prevent bad user state

* PM-3345 - Final tweak to logic

* [PM-2852] Final merge from Key Migration branch to TDE Feature Branch (#5977)

* [PM-3121] Added new copy with exclamation mark

* [PM 3219] Fix key migration locking up the Desktop app (#5990)

* Only check to migrate key on VaultTimeout startup

* Remove desktop specific check

* PM-3332 - LoginWithDevice - Add error handling logic around admin auth request retrieval similar to sso login strategy to prevent error state and allow re-creation of an admin auth request if it has been purged from the server for whatever reason. (#5991)

* PM-3355 - TDE - Browser JIT Account Creation - Browser create user logic still had logic for simply closing the extension tab but as we no longer open the login decryption options in a tab we needed to update the logic here to navigate the user directly onto the vault. (#5993)

* Add distinctUntilChanged to fix multiple value changes for biometrics firing (#5999)

* Add optional chaining to master key (#6007)

* PM-3369 - TDE - Persist user's choice to trust device to state when user ma… (#6000)

* PM-3369 - Persist user's choice to trust device to state when user makes choice + persist previous choices out of state

* PM-3369 - Must set trust device in state on load if it's never been set before

* PM-3369 - Refactor BaseLoginDecOptions to properly set trust device choice in state on load

* Update libs/angular/src/auth/components/base-login-decryption-options.component.ts

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

---------

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

* Updated email change component to getOrDeriveMasterKey (#6009)

* [PM-3330] Force Update to Lockable Accounts on PIN/Biometric Update (#6006)

* Add Listener For Events that Need To Redraw the Menu

* Send redrawMenu Message When Pin/Biometrics Updated

* DeviceTrustCryptoService - don't worry about checking if a device should establish trust or not if the user doesn't have trusted device encryption on (#6010)

* Auth / pm 3351 / TDE Login - Browser & Desktop vault sync issue fix (#6002)

* PM-3351 - TDE Login on desktop and browser via SSO comp with no 2FA should trigger sync like standard onSuccessfulLogin process used to so user lands on vault with data.

* PM-3351 - 2FA Comp - Refactor onSuccessfulLogin logic to only execute in the success path just like the SSO component + adding specific onSuccessfulLoginTde flow just like SSO comp. + removed unnecessary calls to loginService.clearValues(). Added browser & desktop definitions for onSuccessfulLoginTde which is just a fullSync kick off.

* TODO

* PM-3351 - remove await to restore code back to previous state without hang.

* PM-3351 - 2FA Comp - Don't await onSuccessfulLoginTde b/c it causes a hang

* PM-3351 - remove sso comp incorrect todo

* PM-3351 - SsoComp - don't await onSuccessfulLoginTde for browsers sake

* PM-3351 - SsoComp - remove awaits from  onSuccessfulLoginTde and onSuccessfulLogin to avoid any hangs on desktop and browser

* PM-3351 - Convert onSuccessfulLoginTde to promise<void> as its return is not used + refactor all to be consistent and clearly communciate that the sync won't be awaited.

* PM-3351 - Convert onSuccessfulLogin to promise<void> and update all methods accordingly to more clearly indicate that the syncs and any other logic won't be awaited.

* [PM-3356] Fallback to OTP When MasterPassword Hasn't Been Used (#6017)

* Fallback to OTP When MasterPassword Hasn't Been Used

* Update Test and Rename Method

* Revert "DeviceTrustCryptoService - don't worry about checking if a device should establish trust or not if the user doesn't have trusted device encryption on (#6010)" (#6020)

This reverts commit 6ec22f9570.

* PM-3390 - TDE - Redraw desktop after user creation to update isLocked checks and get menu to be enabled properly (#6018)

* [PM-3383] Hide Change Password menu option for user with no MP (#6022)

* Hide Change Master Password menu item on desktop when a user doesn't have a master password.

* Renamed variable for consistency.

* Updated to base logic on account.

* Fixed menubar

* Resolve merge errors in crypto service spec

* Fixed autofill to use new method on userVerificationService (#6029)

* conflict resolution

* missing file

* PM-3456 - TDE Admin Auth Req Flow - FF dead object issue - The foreground popup must retrieve the long lived background services for the new TDE services (the AuthRequestCryptoService service fixes this issue, but the DeviceTrustCryptoService should have been added to services.module as well) (#6037)

* skip auto key check when using biometrics on browser (#6041)

* Added comments for backward compatibility removal. (#6039)

* Updated warning message. (#6059)

* Tde pr feedback (#6051)

* move pin migration to the crypto service

* refactor config service logic

* refactor lock component load logic

* rename key connector methods

* add date to backwards compat todo

* update backwards compat todo

* don't specify defaults in redirectGuard

* nit

* add null & undefined check for userid before using the account

* fix ui tests

* add todo for tech debt

* add todo comment

* Fix storybook per PR feedback

* Desktop & Browser - lock comp - add optional chaining check for focusable input - user can just have biometric and not have a MP or a PIN so must support that.

* Main.background.ts - remove duplicate instantiations of the userVerificationApiService and userVerificationService which were added in two separate PRs

* Per PR feedback - (1) Browser app routing module - fix incorrect import for redirect guard (2) Created index.ts file for auth guards to simplify imports and updated imports

* Per PR feedback, (1) Update jslib-services.module to provide actual instance of VaultTimeoutService (2) Update init service to use concrete VaultTimeoutService vs abstraction.

Co-authored-by: Matt Gibson <git@mgibson.dev>

* Per PR feedback - update services module AuthRequestCryptoService and DeviceTrustCryptoService to use shorthand format.

* Per PR feedback, add devicesService to main background and update services module to ensure the popup leverages the background devicesService

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>
Co-authored-by: Matt Gibson <git@mgibson.dev>

* Updated message keys for CrowdIn to pick them up. (#6066)

* TDE PR Feedback resolutions round 2 (#6068)

* Per PR feedback - main.background.ts - move userVerificationService and userVerificationApiService to correct location

* Per PR feedback - JS lib services + vault timeout service updates - (1) Correctly type callbacks based on injection tokens (2) Update vault timeout service to have proper types based on injection tokens

* Per PR Feedback - update web init service to inject actual VaultTimeoutService vs abstraction similar to what we did for desktop here: 55a797d4ff

* Per more feedback - revert incorrect changes to VaultTimeoutService based on existing injection token types for LOGOUT_CALLBACK and LOCKED_CALLBACK.. and instead update the injection token types themselves to match how they are being used.

* Per PR feedback - in browser main.background.ts, inject concrete VaultTimeoutService instead of abstraction so we don't have to cast it anymore (matching web & desktop)

* Conflict resolution

* PM-2669 Added missing changes from conflict resolution

* Turn cipher encryption on for testing purposes

* Bumped up minimum version

* Turn off cipher key encryption

* Converted to jest-mock-extended and removed dependency

* Remove key from cipher view

* Added comment to Cipher for future refactoring (#6175)

* Remove ConfigApiServiceAbstraction from popup services (#6174)

* Replaced null orgId. (#6208)

* Added reference to new aesGenerateKey function. (#6222)

* Updated server version and feature flag for QA smoke tests.

* [PM-2814] Add ConfigService to CipherService (#6239)

* Updated CipherService to use ConfigService

Updated version check.

* Added missing DI for CLI.

* Updated parameter name for consistency.

* Addressed use of options pattern in config-service.factory.ts.

* Added CLI initialization. (#6266)

* Updated checkServerMeetsVersionRequirement to use observable (#6270)

* [PM-2814] Handle key rotation missing key (#6267)

* Fixed issue with key rotation

* Updates to CipherService to handle not having key on the model.

* More refactoring.

* Updated abstraction to remove private method.

* Fixed test.

* Updated test to reflect the fact that we set key to null.

* Resolved merge conflicte with logService added in master.

* Updated Mv3 factory include log service from merge in ConfigService initialization.

* Fixed another merge conflict with ConfigService to add logService dependency.

* Disable configService timer for cli (#6319)

The rxjs timer() function keeps the node process alive and stops it from exiting.
CLI should not run long enough to actually use the timer, so just remove it.

* [PM-3978] Handle sharing with org with cipher key encryption (#6370)

* Added explicit parameters to encrypt to handle org sharing.

* Updated add-edit to handle new parameter to encrypt

* Updated minimum server version for QA testing.

* Updated minimum version to `2023.8.0` and turned off cipher encryption for QA.

* Updated minimum server version in preparation for release.

* [PM-2669] PR review changes (#6415)

* Addressed PR feedback.

* Added comments and renamed parameters for clarity.

* Updated vault export to keep immediate invocation and reformat for clarity.

Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>

* Updated comment.

* Removed async that was left on saveCipherAttachment accidentally.

---------

Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>

---------

Co-authored-by: Jared Snider <jsnider@bitwarden.com>
Co-authored-by: gbubemismith <gsmithwalter@gmail.com>
Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: Jacob Fink <jfink@bitwarden.com>
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
Co-authored-by: aj-rosado <109146700+aj-rosado@users.noreply.github.com>
Co-authored-by: Andreas Coroiu <andreas@andreascoroiu.com>
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: André Bispo <abispo@bitwarden.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com>
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
Co-authored-by: Matt Gibson <git@mgibson.dev>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-09-28 08:44:57 -04:00
Alex Morask fe0ef5aad7
Clear VAT/GST info when box is unchecked (#6338) 2023-09-27 10:57:50 -04:00
Oscar Hinton c5475f78ea
Forbid promise misuse (#6360) 2023-09-26 22:07:22 +01:00
David Claybourne abd3e66e20
[PS-1878] Feature/selfhost anonaddy (#4056)
* Add selfhosted anonaddy url

* Remove newlines

* Add serverurl field to web

* Show anonaddy api errors

* Add forwardedAnonAddyBaseUrl prop to UsernameGeneratorOptions type

* Use Alias Domain instead of just Domain name

This is easier to distinguish between domain and server url

* Only show Server Url on web if on selfhosted bitwarden

---------

Co-authored-by: Daniel James Smith <djsmith@web.de>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-09-26 15:34:34 +02:00
Daniel James Smith 5616e69e10
Removed unused references to ModalService (#6371)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-09-25 22:09:12 +02:00
Conner Turnbull d0037bb257
Add Braintree sandbox to permitted sources in CSP (#6381) 2023-09-25 09:53:50 -04:00
Oscar Hinton a9c25e8310
[BEEEP] [PM-4043] Remove date-input-polyfill (#6372) 2023-09-22 10:33:46 +00:00
github-actions[bot] e7a05e115b
Autosync the updated translations (#6369)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-22 07:55:31 +00:00
github-actions[bot] c2877523c8
Bumped web version to 2023.9.1 (#6365)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-21 18:14:18 -04:00
Jake Fink 8c06508435
[PM-3726] Force migration of legacy user's encryption key (#6195)
* [PM-3726] migrate legacy user's encryption key

* [PM-3726] add 2fa support and pr feedback

* [PM-3726] revert launch.json & webpack.config changes

* [PM-3726] remove update key component
- also remove card in vault since legacy users can't login

* [PM-3726] Fix i18n & PR feedback

* [PM-3726] make standalone component

* [PM-3726] linter

* [PM-3726] missing await

* [PM-3726] logout legacy users with vault timeout to never

* [PM-3726] add await

* [PM-3726] skip auto key migration for legacy users

* [PM-3726] pr feedback

* [PM-3726] move check for web into migrate method

---------

Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
2023-09-20 15:57:01 -04:00
Thomas Rittson 284eda6cd3
Remove sm-ga-billing feature flag (#6213) 2023-09-20 09:35:20 +10:00
Oscar Hinton e68e449aff
[BEEEP] [PM-3865] Remove button groups (#6253) 2023-09-19 21:10:00 +00:00
github-actions[bot] 71452833aa
Bumped browser,cli,desktop,web version to 2023.9.0 (#6339)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-19 11:31:18 -04:00
github-actions[bot] 075baf219b
Autosync the updated translations (#6326)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-19 09:38:18 +00:00
Daniel James Smith 98cfe1b806
1password1pux importer can import json (#6049)
The .1pux-format is technically just a ziup-file that contain a file named `export.data`which is a json file.
These changes add support to upload either a 1pux or the export.data file directly.
The thought to change this came through the recent addtion of the ProtonPass importer.

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-09-19 09:05:05 +00:00
github-actions[bot] f606dfbc96
Autosync the updated translations (#6305)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-15 07:24:34 +00:00
github-actions[bot] 5f7eb9dc40
Autosync the updated translations (#6291)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-14 14:12:22 +00:00
Oscar Hinton 86c5bd111c
Add a warning to not modify this file (#6235) 2023-09-14 08:28:41 -04:00
Oscar Hinton a6e4ad4e7e
[PM-3818] Remove unused css (#6218) 2023-09-14 11:50:06 +02:00
Felipe Santos 0a004d695a
[PM-3881] Fix ENV=cloud npm run build:oss:watch (#6262) 2023-09-12 15:10:08 +02:00
Will Martin 373569833f
[PS-2841] remove SweetAlert2 dependency (#6191)
* remove swal from app.component

* remove dep

* remove unused swal css
2023-09-11 17:15:27 -04:00
Will Martin f999e2cea9
[PM-3763] remove Sweet Alert from desktop and browser (#6138)
* update desktop and browser swal references to use CL

* rename bit-dialog-close

* share fingerprint dialog between desktop and browser

* apply code review

* format fingerprint in template

* apply code review

* fix button color

* fix button types

* update var names

* close awaitDesktop dialog on success AND error

* add DialogService to NativeMessageHandlerService deps

* wrap browser message dialogs in ngZone.run

* wrap native messaging handler in ngzone.run

* apply code review

* fix async ngzone

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2023-09-11 14:54:23 -04:00
Daniel James Smith 2323509dee
[PM-147] Import error states usability improvements (#6245)
* Add import error dialog

(cherry picked from commit 518211dae0)

* Rename ErrorList to ErrorListItem

(cherry picked from commit a7dd643710)
2023-09-11 14:41:34 +00:00
Thomas Rittson 61e1bc1a1c
[AC-1479][BEEEP] Refactor ConfigService to improve observable usage (#5602)
* refactor ConfigService to use observables

* make environmentService.urls a ReplaySubject

---------

Co-authored-by: Hinton <hinton@users.noreply.github.com>
2023-09-08 10:05:37 -04:00
github-actions[bot] fe354f9063
Autosync the updated translations (#6227)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-09-08 10:29:11 +00:00
rr-bw 5440e372f6
[PM-3804] Remove Server Flag Icons (#6207)
* remove flags from web component

* remove selectedRegionImageName from web component

* remove input

* delete image files and update browser translation

* update translation and popup width for destkop/browser

* remove translations

* revert width on dialog
2023-09-07 14:44:55 -07:00
Conner Turnbull a81c70360a
Removed countries that Stripe doesn't support (#6035) 2023-09-07 16:55:10 +00:00
Oscar Hinton 0e04f35b04
[PM-3577] Refactor Electron iframes (#6221) 2023-09-07 18:32:45 +02:00
Shane Melton 615248e04f
[AC-1012] Hide link to 2FA policy for Teams orgs (#6154)
- Also cleanup eslint warnings
2023-09-07 08:06:22 -07:00
Rui Tomé 2d73f754bf
[AC-244] Refreshing identity token after accepting org invite to get updated email verified status (#6094) 2023-09-07 14:36:45 +01:00
aj-rosado 5f78aeaef2
[PM-2805] Migrate add edit send to Component Library (#6004)
* Converted add-edit send component dialog into a bit-dialog

* Updated Send AddEdit text fields to Component Library

* Migrated Share and Options fields to ComponentLibrary on SendAddEdit

* Migrated footer buttons to ComponentLibrary on SendAddEdit

* Updated web's SendAddEdit component file fields

* Replaced file upload with component library

* Changed SendAddEdit to use Reactive Forms on web

* Changed browser SendAddEdit to use ReactiveForms

* Update SendAddEdit on desktop to use ReactiveForms

* Added AppA11yTitle to button on web SendAddEdit

* Initial efflux-dates web change to ComponentLibrary

* Corrected delete button to check if it is in EditMode on SendAddEdit

* Using BitLink on options button

* Corrected typo on send add edit desktop

* Replaced efflux-dates with datetime-local input on SendAddEdit web, browser and desktop

* Removed efflux dates

* Added firefox custom date popout message on DeletionDate to SendAddEdit browser component

* moved desktop's new send data reload from send to SendAddEdit component

* removing unnecessary attributes and spans from Send AddEdit web

* removed redundant try catch from add edit and unnecessary parameter from close

* Added type for date select options

* Removed unnecessary classes and swapped bootstrap classes by corresponding tailwind classes

* Removed unnecessary code

* Added file as required field
Submit only closes popup on success

* Added pre validations at start of submit

* PM-3668 removed expiration date from required

* PM-3671 not defaulting maximum access count to 0

* PM-3669 Copying the link from link method

* Removed required tag from html and added to formgroup

* PM-3679 Checking if is not EditMode before validating if FormGroup file value is set

* PM-3691 Moved error validation to web component as browser and desktop need to show popup error

* PM-3696 - Disabling hide email when it is unset and has policy to not allow hiding

* PM-3694 - Properly setting default value for dates on Desktop when changing from an existing send

* Disabling hidden required fields

* [PM-3800] Clearing password on new send
2023-09-07 13:49:13 +01:00