Commit Graph

363 Commits

Author SHA1 Message Date
Shane Melton 107c9052b8
[AC-1431] Add missing UserVerificationModule import (#5555) 2023-06-05 16:14:24 -07:00
Vincent Salucci ace1e309fa
refactor: remove unscoped file from core index and update references, refs PM-2491 (#5566) 2023-06-05 14:12:01 -05:00
Rui Tomé dea4c6858f
[AC-1077] Update "Master Password Reset" policy copy (#5463)
* [AC-1077] Renamed "Master password reset" policy to "Account recovery administration"

* [AC-1077] Updated copy in TDE SSO option in configuration page to “Account Recovery Administration policy”

* [AC-1077] Updated “Reset password” action and modal to “Recover account”

* [AC-1077] Changed event message for user updating temporary password issued through account recovery

* [AC-1077] Renamed 'password reset' enrollment to 'account recovery'

* [AC-1077] Updated key names for messages that were modified for Account Recovery policy copy
2023-06-01 08:57:30 +01:00
Shane Melton e092d42b72
[AC-1104] Fix access import/export with custom permission (#5014)
* [AC-1104] Allow importBlockedByPolicy to be overridden

Adjust the import component so that the importBlockedByPolicy flag can be overridden by the org import component to always return false.

* [AC-1104] Allow disabledByPolicy to be overridden in export component

Adjust the export component so that the disabledByPolicy flag can be overridden by the org export component to always return false.

* [AC-1104] Cleanup logic that disables export form

* [AC-1104] Use observable subscription for assigning importBlockedByPolicy flag

* [AC-1264] Add optional success callback for import component

Use the optional callback in org-import.component.ts to clear the file and file contents when the user does not have access to the vault page

* [AC-1264] Re-order properties

* [AC-1104] Refactor import component to only use onSuccess callback that can be overridden
2023-05-30 16:30:15 -07:00
Oscar Hinton f7b372a0b0
[PM-2276] Upgrade Storybook to v7 (#5258) 2023-05-26 15:58:06 +02:00
Jared Snider 0fcfe883b5
Feature/[PM-1378] - Trusted Device Encryption - Establish trust logic for all clients (#5339)
* PM1378 - (1) Create state service methods for securely storing a device symmetric key while following existing pattern of DuckDuckGoKey generation (2) Create makeDeviceKey method on crypto service which leverages the new state service methods for storing the device key.

* PM-1378 - Document CSPRNG types w/ comments explaining what they are and when they should be used.

* PM-1378 - TODO to add tests for makeDeviceKey method

* PM-1378 - Create Devices API service for creating and updating device encrypted master keys + move models according to latest code standards ( I think)

* PM-1378 - TODO clean up - DeviceResponse properly moved next to device api service abstraction per ADR 0013

* PM-1378 - CryptoService makeDeviceKey test written

* PM-1378 - Tweak crypto service makeDeviceKey test to leverage a describe for the function to better group related code.

* PM-1378 - Move known devices call out of API service and into new devices-api.service and update all references. All clients building.

* PM-1378 - Comment clean up

* PM-1378 - Refactor out master key naming as that is a reserved specific key generated from the MP key derivation process + use same property on request object as back end.

* PM-1378 - Missed a use of master key

* PM-1378 - More abstraction updates to remove master key.

* PM-1378 - Convert crypto service makeDeviceKey into getDeviceKey method to consolidate service logic based on PR feedback

* PM-1378- Updating makeDeviceKey --> getDeviceKey tests to match updated code

* PM-1378 - Current work on updating establish trusted device logic in light of new encryption mechanisms (introduction of a device asymmetric key pair in order to allow for key rotation while maintaining trusted devices)

* PM-1378 - (1) CryptoService.TrustDevice() naming refactors (2) Lots of test additions and tweaks for trustDevice()

* PM-1378 - Updated TrustedDeviceKeysRequest names to be consistent across the client side board.

* PM-1378 - Move trusted device crypto service methods out of crypto service into new DeviceCryptoService for better single responsibility design

* PM-1378 - (1) Add getDeviceByIdentifier endpoint to devices api as will need it later (2) Update TrustedDeviceKeysRequest and DeviceResponse models to match latest server side generic encrypted key names

* PM-1378 - PR feedback fix - use JSDOC comments and move from abstraction to implementation

* PM-1378 - Per PR feedback, makeDeviceKey should be private - updated tests with workaround.

* PM-1378- Per PR feedback, refactored deviceKey to use partialKey dict so we can associate userId with specific device keys.

* PM-1378 - Replace deviceId with deviceIdentifier per PR feedback

* PM-1378 - Remove unnecessary createTrustedDeviceKey methods

* PM-1378 - Update device crypto service to leverage updateTrustedDeviceKeys + update tests

* PM-1378 - Update trustDevice logic - (1) Use getEncKey to get user symmetric key as it's the correct method and (2) Attempt to retrieve the userSymKey earlier on and short circuit if it is not found.

* PM-1378 - Replace deviceId with deviceIdentifier because they are not the same thing

* PM-1378 - Per PR feedback, (1) on web/browser extension, store device key in local storage under account.keys existing structure (2) on desktop, store deviceKey in secure storage. (3) Exempt account.keys.deviceKey from being cleared on account reset

* PM-1378 - Desktop testing revealed that I forgot to add userId existence and options reconciliation checks back

* PM-1378 - Per discussion with Jake, create DeviceKey custom type which is really just an opaque<SymmetricCryptoKey> so we can more easily differentiate between key types.

* PM-1378 - Update symmetric-crypto-key.ts opaque DeviceKey to properly setup Opaque type.

* PM-1378 - Fix wrong return type for getDeviceKey on DeviceCryptoServiceAbstraction per PR feedback
2023-05-25 14:17:19 -04:00
Shane Melton 86471790ca
[AC-561] Refactor delete organization component (#5007)
* [AC-561] Rename DeleteOrganizationComponent to DeleteOrganizationDialogComponent

* [AC-561] Refactor delete organization dialog to use dialog service

- Use new bit-dialog
- Use reactive form and bitSubmit directives
- Add injected dialog params
- Switch to observable pattern
- Use dialog result instead of success event emitter
- Add helper method to open dialog using dialog service
- Update usage in families-for-enterprise-setup.component.ts and account.component.ts

* [AC-561] Create a UserVerification module

Move the user verification components into their own module that can be imported in multiple modules without conflict and allow tree shaking.

* [AC-561] Move delete-organization-dialog into its own folder

* [AC-561] Create delete organization dialog module

* [AC-561] Cleanup delete org dialog import statements

* [AC-561] Remove unused property

* [AC-561] Use organization observable from organizationService

* [AC-561] Use organization object instead of pull out storing the name individually

* [AC-561] Make the delete organization dialog a standalone component

- Remove the delete organization dialog module
- Move the dialog component up a directory
- Remove references to the deleted module

* [AC-561] Fix DialogServiceAbstraction references after merge

* [AC-561] Cleanup dialog loading spinner and cancel button

* [AC-561] Fix broken barrel file after merge
2023-05-25 07:49:30 -07:00
André Bispo b9fe78796a
[PM-1019] Environment selection clients (#5480)
* [PM-169][PM-142][PM-191] Add Environments to Web and Desktop (#5294)

* [PM-1351] Add property to server-config.response. Change config to be able to fetch without being authed.

* [PM-1351] fetch every hour.

* [PM-1351] fetch on vault sync.

* [PM-1351] browser desktop fetch configs on sync complete.

* [PM-1351] Add methods to retrieve feature flags

* [PM-1351] Add enum to use as key to get values feature flag values

* [PM-1351] Remove debug code

* [PM-1351] Get flags when unauthed. Add enums as params. Hourly always fetch.

* [PM-1351] add check for authed user using auth service

* [PM-169] Web: add drop down to select environment

* [PM-169] Fix pop up menu margins. Add DisplayEuEnvironmentFlag.

* [PM-169] Change menu name.

* [PM-169] Add environment selector ts and html. Add declaration and import on login.module

* [PM-169] Add environment selector to desktop.

* [PM-169] Ignore lint error.

* [PM-169] add takeUntil to subscribes

* [PM-191] PR Fixes, code format

* [PM-168] Add Environments to extension login/registration (#5434)
2023-05-19 17:35:42 +01:00
Shane Melton 3f7a63b2c6
[PM-2102] Implement logic to keep row control enable/disable status in sync with the access item properties whenever the parent control is enabled/disabled (#5433)
Angular 15 introduced a breaking change that calls setDisabledState() whenever a CVA is added. This was re-enabling all the internal form group rows (even those that should have remained disabled).
2023-05-18 10:32:18 -07:00
Oscar Hinton 3da7fc7cb3
Deprecated broadcaster (#5461) 2023-05-17 12:27:27 +02:00
Shane Melton 909d54e326
[AC-358] Update help doc link (#5455) 2023-05-15 12:18:06 -07:00
Shane Melton bcda04ee86
[AC-358] SelfHosted update subscription page (#5101)
* [AC-358] Add selfHostSubscriptionExpiration property to organization-subscription.response.ts

* [AC-358] Update selfHost org subscription template

- Replace "Subscription" with "SubscriptionExpiration"
- Add question mark help link
- Add helper text for grace period
- Add support for graceful fallback in case of missing grace period in subscription response

* Update libs/common/src/billing/models/response/organization-subscription.response.ts

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* [AC-358] Remove unnecessary hypen

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* [AC-358] Introduce SelfHostedOrganizationSubscription view
- Encapsulate expiration/grace period logic in the new view object.
- Remove API response getters from the angular component
- Replace the API response object with the new view

* [AC-358] Clarify name for new expiration without grace period field

* [AC-358] Update constructor parameter name

* [AC-358] Simplify new selfhost subscription view

- Make expiration date properties public
- Remove obsolete expiration date getters
- Update the component to use new properties
- Add helper to component for determining if the subscription should be rendered as expired (red text)

* [AC-358] Rename isExpired to isExpiredAndOutsideGracePeriod to be more explicit

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-05-15 07:38:53 -07:00
aj-rosado 44fd063dc1
[PM-2054] Updated Password Generator History to use Component Library on Web (#5414)
* [PM-2054] Updated Password Generator History to use Component Library

* [PM-2054] Corrected paddings

* [PM-2054] Added missing type to buttons

* [PM-2054] Removed unused imports and run prettier

* [PM-2054] Swap list by bit-table
2023-05-15 12:01:28 +01:00
Oscar Hinton f196928c20
[PM-2186] Change collection and group dialogs to large (#5403) 2023-05-10 13:35:09 +02:00
Jonathan Prusik 6eb032b697
[PM-1884] Address vault ui long name overflow and vertical letter cutoff (#5345)
* address vault ui long name overflow and vertical letter cutoff

* address vertical icon placement in item row
2023-05-09 19:45:35 -04:00
Robyn MacCallum 8dc7ead853
Add more descriptive titles for web vault rows (#5404)
* Add more descriptive titles for web vault rows

* Swap example strings
2023-05-09 14:03:31 -04:00
Robyn MacCallum 9bbaae6ef2
[PM-2089] Fix Collections not nesting properly in the Org Vault (#5369) 2023-05-08 13:22:06 -04:00
Robyn MacCallum 0b9ed77b8e
[PM-2088] Remove extra click handling from Collection row (#5353) 2023-05-08 13:21:45 -04:00
Oscar Hinton 20d40a0388
[PM-2087] Bump tailwind and prettier-plugin-tailwindcss (#5320) 2023-05-04 17:02:45 +02:00
SmithThe4th 50eea96ec5
[PM-1699] Updated low kdf iterations warning (#5170)
* updated low ksf iterations warning

* Removed test implementation

* Removed unused translation and updated key

* Enabled low kdf on this branch for testing

* Removed duplicate showKdf initialiazation

* [PM-1700] Put KDF warning behind a LaunchDarkly Feature Flag (#5308)

* Added feature flag for low kdf iteration

* Added feature flag implementation to component

* Renamed feature flag to align with what is setup on LaunchDarkly
2023-05-04 09:46:12 -04:00
Oscar Hinton c2278c082c
[PM-2104] Resolve dialog defects (#5357) 2023-05-04 13:52:08 +02:00
Jonathan Prusik d3efcd9279
add aria-label to account button (#5338) 2023-05-03 11:39:39 -04:00
SmithThe4th f655460fa7
[PM-1399] Resolve eslint errors for button type - vault (#5274)
* Added button type to each button element related to the vault team

* Removed disable statement comment

* [PM-1399] Resolve eslint errors for button type - admin-console  (#5275)

* Added button type to each button element related to the admin console team

* Added button type to each button element related to the billing team

* Removed disable statement comment

* [PM-1399] Resolve eslint errors for button type - tools (#5284)

* Added button type to each button element related to the tools team

* Added button type to each button element related to the tools team

* Added button type to each button element related to the auth team (#5295)
2023-05-03 10:55:22 -04:00
Jake Fink 2c51af192c
Move auth to app folder (#5336)
* move auth folder into app folder

* fix auth folder imports

* reorder imports in login component
2023-05-02 16:08:52 -04:00
Oscar Hinton 4e1867682f
[PM-1504] Migrate Dialogs to DialogService (#5013)
This PR introduces a generic `DialogService` which can be used by all the clients. This allows us to decouple dialogs from the `PlatformUtilsHelper`.

The `DialogService` provides a new method, `openSimpleDialog` which is the new interface for that type of dialogs.

This gives us 3 different implementations: 
- Web: DialogService modern dialogs
- Browser: SweetAlert
- Desktop: Native electron based
2023-05-02 18:46:03 +02:00
Oscar Hinton f37ff09e10
[PM-1915] Remove selector for all dialogs (#5257) 2023-05-01 17:59:47 +02:00
Oscar Hinton 7ed0a4bbf2
[PM-1914] Migrate all dialogs to use the new bitDialogFooter default styling (#5256) 2023-05-01 17:59:29 +02:00
Cesar Gonzalez de078c4bcd
[PM-1433] Creating Item Doesn't Auto-Select Current Organization/Collection in Individual Web Vault (#5302) 2023-05-01 10:07:57 -05:00
Robyn MacCallum 671a9115bb
[PM-1400] Update IconComponent to use OnPush ChangeDetection (#5181)
* Add disableFavicon$ to stateService

* Change IconComponent's ChangeDetectionStrategy and use disableFavicon$ observable

* Only get first result from disableFavicon observable

* Move disabledFavicon$ to SettingsService

* Update usage of disableFavicon to use SettingsService

* Remove getting and setting of disabledFavicon on login

* Settings service observable adjustments

* Fix for popup initially having a null value for the disableFavicon setting in settingsService

* Move disabledFavicon$ subscription to ngOnInit

* feat: experiment with observables

* Remove SettingsService from browser app component

* Fix storybook changes

* Update apps/web/src/app/vault/components/vault-items/vault-items.stories.ts

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

* Fix mock function signature

---------

Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
2023-04-28 15:07:26 -04:00
aj-rosado 525de3bfd2
[PM-730] Corrected EventType when copying password (#5229)
* [PM-730] Corrected EventType when copying password

* [PM-730] Corrected copy password and totp events
2023-04-27 16:46:48 +01:00
Will Martin 95b1ea318c
[SM-688] use dynamic-avatar in SM (#5203)
* make dynamic-avatar standalone; use in SM

* fix broken story
2023-04-26 12:25:09 -04:00
André Bispo cfc380c697
[PM-1349] Update client service to retrieve feature flags from API (#5064)
* [PM-1351] Add property to server-config.response. Change config to be able to fetch without being authed.

* [PM-1351] fetch every hour.

* [PM-1351] fetch on vault sync.

* [PM-1351] browser desktop fetch configs on sync complete.

* [PM-1351] Add methods to retrieve feature flags

* [PM-1351] Add enum to use as key to get values feature flag values

* [PM-1351] Remove debug code

* [PM-1351] Get flags when unauthed. Add enums as params. Hourly always fetch.

* [PM-1351] add check for authed user using auth service

* [PM-1351] remove unnecessary timer on account unlock
2023-04-26 15:30:39 +01:00
Jake Fink dfe69f77f5
[PM-687] emergency access invite lost during sso (#5199)
* [PM-687] refactor observable in base accept component

* [PM-687] add emergency access invitation to global state

* [PM-687] save invite to state and check on login

* [PM-687] move emergency access check above queryParams observable
2023-04-26 08:47:35 -04:00
Jim Hays 9f7bf1132b
[PM-1877] Spellcheck (#5237)
* Bug fix: "vaule" -> "value"

* Bug fix: "aria-descibedby" -> "aria-describedby"

* Bug fix: "chararacter" -> "character"

* Fix typos in comments

* Fix typos in documentation

* Fix typo in test description

* Fix typos in sample data: "childen" -> "children"

* Fix typos in sample data: "pargraphs" -> "paragraphs"

* Fixes to test data: "Additinoal", "Informaion" -> "Additional", "Information"

* Fix typo in test data: "dolhpin" -> "dolphin"

* Fix typo in local variable: "attachement" -> "attachment"

* Fix typo in method name: "detachOrganizastion" -> "detachOrganization"

* Fix typo in method name: "getNewlyAddedDomians" -> "getNewlyAddedDomains"

* Fix typo: "EncyptedMessageResponse" -> "EncryptedMessageResponse"

* Fix typo: "miliseconds" -> "milliseconds"

* Fix typo: "authResponsePushNotifiction" -> "authResponsePushNotification"

* Fix typo: "getPushNotifcationObs" -> "getPushNotificationObs"

* Fix typo: "ExpriationDate" -> "ExpirationDate"

* Fix typo: "OrganizationUserResetPasswordDetailsReponse" -> "OrganizationUserResetPasswordDetailsResponse"

* Fix typo: "DISPLAY_TITLE_ATTRIBUE" -> "DISPLAY_TITLE_ATTRIBUTE"

* Fix typo: "credentialretreivalCommandHandler" -> "credentialRetrievalCommandHandler"

* Fix typo: "buildLoginCredntials" -> "buildLoginCredentials"

* Fix typo: "_mappedCredentialsColums" -> "_mappedCredentialsColumns"

* Fix typo: "_mappedPersonalInfoAsIdentiyColumns" -> "_mappedPersonalInfoAsIdentityColumns"

* Fix typo in input name: "StroageGbAdjustment" -> "StorageGbAdjustment"

* Fix typo in const: "encryptionAlogrithm" -> "encryptionAlgorithm"

---------

Co-authored-by: Daniel James Smith <djsmith@web.de>
2023-04-26 12:16:07 +02:00
Oscar Hinton 76673ebe8b
[PM-1541] Adjust the dialogs max-width (#5036) 2023-04-25 16:45:35 +02:00
Rui Tomé 89c8c48cd4
[AC-1340] Fixed cipher restore for provider users by using the restore-admin endpoints (#5255) 2023-04-21 12:22:34 +01:00
Andreas Coroiu 315c4ffc76
[AC-1338] fix: filter out unassigned from cipher create/edit/clone (#5238) 2023-04-21 10:30:30 +02:00
Rui Tomé aacabf5bdf
[AC-1340] [Defect] Provider users unable to delete vault items for client organizations (#5242)
* [AC-1340] Calling Cipher DeleteAdmin endpoints when user has canEditAnyCollection permission

* [AC-1340] Fixed CLI and Desktop builds

* [AC-1340] Changed CipherService delete methods parameter 'orgAdmin' to 'asAdmin' and to nullable

* [AC-1340] Changed variable names from 'orgAdmin' to 'asAdmin'

* [AC-1340] Reverted change on DeleteCommand
2023-04-20 16:33:29 +01:00
Oscar Hinton 68b62e73f1
[SM-645] Use search component in secrets manager (#4991)
* Move search component into the component library

* Migrate search fields

* Reshuffle imports slightly

* Remove export input module

---------

Co-authored-by: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com>
2023-04-19 16:21:57 -04:00
Daniel James Smith 192bb5a7b3
[PM-328] Move exporter to tools (#5070)
* Create and register new libs/exporter

Create package.json
Create tsconfig
Create jest.config
Extend shared and root tsconfig and jest.configs
Register with eslint

* Migrate exportService to libs/exporter

Move exportService (abstraction and impl) into libs/exporter
Refactored exportService to be split into vault-export and event-export
Created barrel-files for both exports
Moved export.service.spec.ts into vault-export
Created an export-helper, which helps build the filename (extract method refactor from ExportService)

* Move components in libs/angular into tools-subfolder

Moved components
Updated imports in jslib-services.module and jslib.module

* Register libs/exporter with browser and fix imports

Move export.component into tools-subfolder

* Register libs/exporter with cli and fix imports

Move export.command into tools-subfolder

* Register libs/exporter with desktop and fix imports

Move export.component into tools-subfolder

* Move export models to libs/exporter

* Update web imports

* Update package-lock.json

* Move export models back as it would create circular dependency

Reponse models in common rely on export models which are in libs/exporter, which relies on common

* Fix up web for event-export

* Update CODEOWNERS

* Add export-models to team-tools-dev

* Simplify domain import

* Moving EventExport into web
2023-04-19 11:30:46 +02:00
Andreas Coroiu 4852992662
[AC-779] [Defect] Event log links for policies groups users and items not working (#5212)
* [AC-779] fix: policy link

* [AC-779] fix: search string set by url not showing in input field

* [AC-779] fix: navigation to cipher events

* [AC-779] fix: collection link

* [AC-779] chore: clean up old components

* [AC-779] chore: remove some copy pasta
2023-04-18 08:04:39 +02:00
Shane Melton 07c2c2af20
[AC-1070] Enforce master password policy on login (#4795)
* [EC-1070] Introduce flag for enforcing master password policy on login

* [EC-1070] Update master password policy form

Add the ability to toggle enforceOnLogin flag in web

* [EC-1070] Add API method to retrieve all policies for the current user

* [EC-1070] Refactor forcePasswordReset in state service to support more options

- Use an options class to provide a reason and optional organization id
- Use the OnDiskMemory storage location so the option persists between the same auth session

* [AC-1070] Retrieve single master password policy from identity token response

Additionally, store the policy in the login strategy for future use

* [EC-1070] Introduce master password evaluation in the password login strategy

- If a master password policy is returned from the identity result, evaluate the password.
- If the password does not meet the requirements, save the forcePasswordReset options
- Add support for 2FA by storing the results of the password evaluation on the login strategy instance
- Add unit tests to password login strategy

* [AC-1070] Modify admin password reset component to support update master password on login

- Modify the warning message to depend on the reason

- Use the forcePasswordResetOptions in the update temp password component

* [EC-1070] Require current master password when updating weak mp on login

- Inject user verification service to verify the user
- Conditionally show the current master password field only when updating a weak mp. Admin reset does not require the current master password.

* [EC-1070] Implement password policy check during vault unlock

Checking the master password during unlock is the only applicable place to enforce the master password policy check for SSO users.

* [EC-1070] CLI - Add ability to load MP policies on login

Inject policyApi and organization services into the login command

* [EC-1070] CLI - Refactor update temp password logic to support updating weak passwords

- Introduce new shared method for collecting a valid and confirmed master password from the CLI and generating a new encryption key
- Add separate methods for updating temp passwords and weak passwords.
- Utilize those methods during login flow if not using an API key

* [EC-1070] Add route guard to force password reset when required

* [AC-1070] Use master password policy from verify password response in lock component

* [EC-1070] Update labels in update password component

* [AC-1070] Fix policy service tests

* [AC-1070] CLI - Force sync before any password reset flow

Move up the call to sync the vault before attempting to collect a new master password. Ensures the master password policies are available.

* [AC-1070] Remove unused getAllPolicies method from policy api service

* [AC-1070] Fix missing enforceOnLogin copy in policy service

* [AC-1070] Include current master password on desktop/browser update password page templates

* [AC-1070] Check for forced password reset on account switch in Desktop

* [AC-1070] Rename WeakMasterPasswordOnLogin to WeakMasterPassword

* [AC-1070] Update AuthServiceInitOptions

* [AC-1070] Add None force reset password reason

* [AC-1070] Remove redundant ForcePasswordResetOptions class and replace with ForcePasswordResetReason enum

* [AC-1070] Rename ForceResetPasswordReason file

* [AC-1070] Simplify conditional

* [AC-1070] Refactor logic that saves password reset flag

* [AC-1070] Remove redundant constructors

* [AC-1070] Remove unnecessary state service call

* [AC-1070] Update master password policy component

- Use typed reactive form
- Use CL form components
- Remove bootstrap
- Update error component to support min/max
- Use Utils.minimumPasswordLength value for min value form validation

* [AC-1070] Cleanup leftover html comment

* [AC-1070] Remove overridden default values from MasterPasswordPolicyResponse

* [AC-1070] Hide current master password input in browser for admin password reset

* [AC-1070] Remove clientside user verification

* [AC-1070] Update temp password web component to use CL

- Use CL for form inputs in the Web component template
- Remove most of the bootstrap classes in the Web component template
- Use userVerificationService to build the password request
- Remove redundant current master password null check

* [AC-1070] Replace repeated user inputs email parsing helpers

- Update passwordStrength() method to accept an optional email argument that will be parsed into separate user inputs for use with zxcvbn
- Remove all other repeated getUserInput helper methods that parsed user emails and use the new passwordStrength signature

* [AC-1070] Fix broken login command after forcePasswordReset enum refactor

* [AC-1070] Reduce side effects in base login strategy

- Remove masterPasswordPolicy property from base login.strategy.ts
- Include an IdentityResponse in base startLogin() in addition to AuthResult
- Use the new IdentityResponse to parse the master password policy info only in the PasswordLoginStrategy

* [AC-1070] Cleanup password login strategy tests

* [AC-1070] Remove unused field

* [AC-1070] Strongly type postAccountVerifyPassword API service method

- Remove redundant verify master password response
- Use MasterPasswordPolicyResponse instead

* [AC-1070] Use ForceResetPassword.None during account switch check

* [AC-1070] Fix check for forcePasswordReset reason after addition of None

* [AC-1070] Redirect a user home if on the update temp password page without a reason

* [AC-1070] Use bit-select and bit-option

* [AC-1070] Reduce explicit form control definitions for readability

* [AC-1070] Import SelectModule in Shared web module

* [AC-1070] Add check for missing 'at' symbol

* [AC-1070] Remove redundant unpacking and null coalescing

* [AC-1070] Update passwordStrength signature and add jsdocs

* [AC-1070] Remove variable abbreviation

* [AC-1070] Restore Id attributes on form inputs

* [AC-1070] Clarify input value min/max error messages

* [AC-1070] Add input min/max value example to storybook

* [AC-1070] Add missing spinner to update temp password form

* [AC-1070] Add missing ids to form elements

* [AC-1070] Remove duplicate force sync and update comment

* [AC-1070] Switch backticks to quotation marks

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-04-17 07:35:37 -07:00
Thomas Rittson ad0c460687
[EC-850] ProviderUser permissions should prevail over member permissions (#5162)
* Apply provider permissions even if also member

* Add org.isMember

* Refactor: extract syncProfileOrganizations method

* Change isNotProvider logic to isMember

* Fix cascading org permissions

* Add memberOrganizations$ observable
2023-04-17 13:09:53 +10:00
Jake Fink fbbaf10488
[AC-1045] add action to vault timeout policy (#4782) 2023-04-15 00:11:33 +01:00
Rui Tomé e3f31ac741
[AC-1081] Merge feature/billing-obfuscation (#5172)
* [AC-431] Add new organization invite process (#4841)

* [AC-431] Added properties 'key' and 'keys' to OrganizationUserAcceptRequest

* [AC-431] On organization accept added check for 'initOrganization' flag and send encrypt keys if true

* [AC-431] Reverted changes on AcceptOrganizationComponent and OrganizationUserAcceptRequest

* [AC-431] Created OrganizationUserAcceptInitRequest

* [AC-431] Added method postOrganizationUserAcceptInit to OrganizationUserService

* [AC-431] Created AcceptInitOrganizationComponent and added routing config. Added 'inviteInitAcceptedDesc' to messages

* [AC-431] Remove blank line

* [AC-431] Remove requirement for logging in again

* [AC-431] Removed accept-init-organization.component.html

* Update libs/common/src/abstractions/organization-user/organization-user.service.ts

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* [AC-431] Sending collection name when initializing an org

* [AC-431] Deleted component accept-init-organization and incorporated logic into accept-organization

* Update libs/common/src/abstractions/organization-user/organization-user.service.ts

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* [AC-431] Returning promise chains

* [AC-431] Moved ReAuth check to org accept only

* [AC-431] Fixed import issues

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* [AC-434] Hide billing screen for reseller clients (#4955)

* [AC-434] Retrieving ProviderType for each Org

* [AC-434] Hide subscription details if user cannot manage billing

* [AC-434] Renamed providerType to provider-type

* [AC-434] Reverted change that showed Billing History and Payment Methods tabs

* [AC-434] Hiding Secrets Manager enroll

* [AC-434] Renamed Billing access variables to be more readable

* Apply suggestions from code review

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* [AC-434] Reduce duplication in permission code

* [AC-434] npm prettier

* [AC-434] Changed selfhost subscription permission

* [AC-434] Added canEditSubscription check for change plan buttons

* [AC-434] Removed message displaying provider name in subscription

* [AC-434] canEditSubscription logic depends on canViewSubscription

* [AC-434] Hiding next charge value for users without billing edit permission

* [AC-434] Changed canViewSubscription and canEditSubscription to be clearer

* [AC-434] Altered BillingSubscriptionItemResponse.amount and BillingSubscriptionUpcomingInvoiceResponse.amount to nullable

* [AC-434] Reverted change on BillingSubscriptionItemResponse.amount

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* Updated IsPaidOrgGuard reference from org.CanManageBilling to canEditSubscription

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-04-14 11:14:18 +01:00
Andreas Coroiu 0bc6add5c3
[AC-974] [Technical Dependency] Refactor Vault Tables (#4967)
* [EC-974] feat: scaffold new vault-items component

* [EC-974] feat: add basic mocked data to story

* [EC-974] feat: add initial table version

* [EC-974] chore: split rows into separate components

* [EC-974] chore: rename item row to cipher row

* [EC-974] feat: create common vault item interface

* [EC-974] feat: use cdk virtual scrolling

* [EC-974] fix: tweak `itemSize`

* [EC-974] chore: move vault-items component to app/vault folder

* [EC-974] feat: initial support for extra column

* [EC-974] feat: start adding org badge

Having issues with modules import

* [EC-974] feat: add working owner column on collections row

* [EC-974] feat: add owner to ciphers

* [EC-974] fix: org name badge bugs when reused

* [EC-974] feat: fix and translate columns

* [EC-974] feat: allow collections to be non-editable

* [EC-974] feat: use data source

* [EC-974] fix: remove profile name from vault items

* [EC-974] feat: add events

* [EC-974] feat: add support for copy event

* [EC-974] feat: add support for collections column

* [EC-974] feat: add support for group badges

* [EC-974] chore: rename for consistency

* [EC-974] feat: change story to use template

* [EC-974] feat: add support for launching

* [EC-974] feat: add support for attachements

* [EC-974] feat: add stories for all use-cases

* [EC-974] feat: add support for cloning

* [EC-974] feat: add support for moving to organization

* [EC-974] feat: add support for editing cipher collections

* [EC-974] feat: add support for event logs

* [EC-974] feat: add support for trash/delete/restore

* [EC-974] feat: add support for editing collections

* [EC-974] feat: add support for access and delete collections

* [EC-974] feat: don't show menu if it's empty

* [EC-974] feat: initial buggy implementation of selection

* [EC-974] feat: implement bulk move

* [EC-974] feat: add support for bulk moving to org

* [EC-974] feat: add support for bulk restore

* [EC-974] feat: add support for bulk delete

* [EC-974] feat: add ability to disable the table

* [EC-974] feat: create new filter function based on routed model

* [EC-974] wip: start replacing vault items component

* [EC-974] feat: add support for fetching ciphers

* [EC-974] feat: hide trash by default

* [EC-974] feat: add support for the rest of the data

* [EC-974] feat: implement organization filtering using org badge

* [EC-974] feat: fix navigation to "my vault"

* [EC-974] feat: don't show bulk move options when filtering on org items

* [EC-974] feat: prepare for disabling table

* [EC-974] fix: add missing router link to collections

* [EC-974] feat: connect all outputs

* [EC-974] fix: list not properly refreshing after delete

* [EC-974] feat: limit selection to top 500 items

* [EC-974] feat: implement refresh tracker

* [EC-974] feat: use refresh tracker to disable vault items

* [EC-974] feat: add empty list message

* [AC-974] feat: add initial load with spinner and fix empty -> show list bug

* [EC-974] feat: replace action promise with simple loading boolean

* [EC-974] feat: refactor individual vault header

* [EC-974] feat: cache and make observables long lived

* [EC-974] feat: implement searching

* [EC-974] feat: add support for showing collections

* [EC-974] feat: add ciphers to org vault list

* [EC-974] feat: show group column

* [EC-974] feat: tweak settings for org vault

* [EC-974] feat: implement search using query params

* [EC-974] feat: add support for events that are common with individual vault

* [EC-974] feat: add support for all events

* [EC-974] feat: add support for empty list message and no permission message

* [EC-974] feat: always show table

* [EC-974] feat: fix layout issues due to incorrect row height

* [EC-974] feat: disable list if empty

* [EC-974] feat: improve sync handling

* [EC-974] feat: improve initial loading sequence

* [EC-974] feat: improve initial load sequence in org vault

* [EC-974] refactor: simplify and optimize data fetching

* [EC-974] feat: use observables from org service

* [EC-974] feat: refactor org vault header

* [EC-974] fix: data not refreshing properly

* [EC-974] fix: avoid collection double fetching

* [EC-974] chore: clean up refresh tracker

* [EC-974] chore: clean up old vault-items components

* [EC-974] chore: clean up old code in vault component

* [EC-974] fix: reduce rows in story

The story ends up too big for chromatic.

* [EC-974] docs: tweak and typo fixes of asyncToObservable docs comment

* [EC-974] fix: `attachements` typo

* [EC-974] chore: remove review question comment

* [EC-974] chore: remove unused `securityCode` if statement

* [EC-974] fix: use `takeUntill` for legacy dialogs

* [EC-974] fix: use CollectionDialogTabType instead of custom strings

* [EC-974] fix: copy implementation

* [EC-974] fix: use `useTotp` to check for premium features

* [EC-974] fix: use `tw-sr-only`

* [EC-974] chore: remove unecessary eslint disable

* [EC-974] fix: clarify vault item event naming

* [EC-974] fix: remove `new` from `app-new-vault-items`

* [EC-974] fix: collection row not disabled during loading

* [EC-974] chore: simplify router links without path changes

* [EC-974] feat: invert filter function to get rid of `cipherPassesFilter`

* [EC-974] fix: move `NestingDelimiter` to collection view

Nesting is currently only a presentational construct, and the concept does not exist in our domain.

* [EC-974] fix: org vault header not updating when switching org

* [EC-974] fix: table sizing jumping around

* [EC-974] fix: list not refreshing after restoring item

* [EC-974] fix: re-add missing unassigned collection

* [EC-974] fix don't show new item button in unassigned collection

* [EC-974] fix: navigations always leading to individual vault

* [EC-974] fix: remove checkbox when collections are not editable

* [EC-974] fix: null reference blocking collections from refreshing after delete

* [EC-974] fix: don't show checbox for collections that user does not have permissions to delete

* [EC-974] fix: navigate away from deleted folder

* [EC-974] chore: clean up un-used output

* [EC-974] fix: org badge changing color randomly

* [EC-974] fix: lint issues after merge

* [EC-974] fix: lower amount of ciphers in story

chromatic doesn't like large snapshots

* [EC-974] fix: "all collections" not taking `organizationId` filter into account

* [EC-974] fix: make sure unassigned appears in table too

* [EC-974] feat: add unassigned to storybook

* [EC-974] fix: forced row height not being applied properly

* [EC-974] fix: hopefully fix table jumping once and for all

* [EC-974] fix: attachemnts getting hidden

* [EC-974] feat: extract collection editable logic to parent component

* [EC-974] feat: separately track editable items

* [EC-974] feat: optimize permission checks

* [EC-974] fix: bulk menu hidden on chrome

:lolcry:

* [EC-974] fix: don't show groups column if org doesnt use groups

* [EC-974] feat: make entire row clickable

* [EC-974] fix: typo resulting in non-editable collections
2023-04-13 14:48:29 -04:00
cd-bitwarden 3300a4cc15
[SM-612] Highlighting selected product properly (#5065)
* Highlighting selected product properly

* suggested changes by WIll
2023-04-11 14:59:20 -04:00
Justin Baur 7263579eaf
[PM-329] Detangle SearchService & CipherService (#4838)
* Remove Circular Dependency

* Fix Vault Searching

* Remove Unused cipherServiceOptions

* Add searchService Parameter to CipherService

* Fix instantiation of CipherService in test
2023-04-07 11:11:20 -04:00
Daniel James Smith cf2d8b266a
[PM-1071] Display import-details-dialog on successful import (#4817)
* Prefer callback over error-flow to prompt for password

Remove error-flow to request file password
Prefer callback, which has to be provided when retrieving/creating an instance.
Delete ImportError
Call BitwardenPasswordProtector for all Bitwarden json imports, as it extends BitwardenJsonImporter
Throw errors instead of returning
Return ImportResult
Fix and extend tests import.service
Replace "@fluffy-spoon/substitute" with "jest-mock-extended"

* Fix up test cases

Delete bitwarden-json-importer.spec.ts
Add test case to ensure bitwarden-json-importer.ts is called given unencrypted or account-protected files

* Move file-password-prompt into dialog-folder

* Add import success dialog

* Fix typo

* Only list the type when at least one got imported

* update copy based on design feedback

* Remove unnecessary /index import

* Remove promptForPassword_callback from interface

PR feedback from @MGibson1 that giving every importer the ability to request a password is unnecessary. Instead, we can pass the callback into the constructor for every importer that needs this functionality

* Remove unneeded import of BitwardenJsonImporter

* Fix spec constructor

* Fixed organizational import

Added an else statement, or else we'd import into an org and then also import into an individual vault
2023-04-06 22:41:09 +02:00
Robyn MacCallum 19626a7837
Sort organization filters alphabetically (#5117) 2023-04-06 10:31:36 -04:00