* [AC-2603] Add unmanaged property to CollectionAdminView and response models
* [AC-2603] Cleanup CollectionViews
- Remove getters that have been replaced with Unmanaged property
- Remove AddAccess that is also being replaced
- Add canEditUnmanagedCollections() helper to organization
* [AC-2603] Replace old AddAccess logic with Unmanaged flag
* [AC-2603] Fix failing test
* [AC-2603] Ensure Add Access badge/toggle only shows when V1 flag is enabled
* [AC-2603] Undo change to canEditUserAccess and canEditGroupAccess
Custom users should not get access to an unmanaged collection with only Manage Groups and Manage User permissions. That is still reserved for admin/owners and EditAnyCollection custom users.
* add verify org delete page
* PR feedback from thomas
* use abstraction
* Apply suggestions from code review
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>
* delete org copy
* Move verify-recover-delete-org component to admin-console/organizations/manage folder and update routing
* [PM-7004] Add async/await to ngOnInit in verify-recover-delete-org.component.ts
* [PM-7004] Update deleteRecoverOrgConfirmDesc message in messages.json
* [PM-7004] Add warning message for deleting organization's active user accounts
* [PM-7004] Update to standalone component
* [PM-7004] Update delete organization warning message
* [PM-7004] Refactor delete organization form
* [PM-7004] Delete unused selector in verify-recover-delete-org.component.ts
* [PM-7004] Rename recoverDeleteToken method in verify-recover-delete-org.component.ts to deleteUsingToken
* [PM-7004] Update formGroup initialization in verify-recover-delete-org.component.ts
* [PM-7004] Delete formGroup initialization in verify-recover-delete-org.component.ts
* [PM-7004] Remove try/catch from submit method in verify-recover-delete-org.component.ts
* [PM-7004] Update submit button type in verify-recover-delete-org.component.html
* [PM-7004] Remove manual loading state in verify-recover-delete-org.component
* [PM-7004] Remove unnecessary span in verify-recover-delete-org.component.html
* [PM-7004] Update button styles in verify-recover-delete-org.component.html
* [PM-7004] Add back in the manual loading state in verify-recover-delete-org.component
* [PM-7004] Update button type and class in verify-recover-delete-org.component.html
* [PM-7004] Replace bootstrap classes with equivalent tailwind classes
* [PM-7004] Replace bootstrap classes with Tailwind in verify-recover-delete-org.component.html
---------
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>
Co-authored-by: Rui Tome <rtome@bitwarden.com>
* [PM-6825] Add temporary vault page header
* [PM-6825] Expose cipherViews$ observable
* [PM-6825] Refactor getAllDecryptedForUrl to expose filter functionality for reuse
* [PM-6825] Introduce VaultPopupItemsService
* [PM-6825] Introduce initial VaultListItem and VaultListItemsContainer components
* [PM-6825] Add VaultListItems to VaultV2 component
* [PM-6825] Introduce autofill-vault-list-items.component to encapsulate autofill logic
* [PM-6825] Add temporary Vault icon
* [PM-6825] Add empty and no results states to Vault tab
* [PM-6825] Add unit tests for vault popup items service
* [PM-6825] Negate noFilteredResults placeholder
* [PM-6825] Cleanup new Vault components
* [PM-6825] Move new components into its own module
* [PM-6825] Fix missing button type
* [PM-6825] Add booleanAttribute to showAutofill input
* [PM-6825] Replace empty refresh BehaviorSubject with Subject
* [PM-6825] Combine *ngIfs for vault list items container
* [PM-6825] Use popup-section-header component
* [PM-6825] Use small variant for icon buttons
* [PM-6825] Use anchor tag for vault items
* [PM-6825] Consolidate vault-list-items-container to include list item component functionality directly
* [PM-6825] Add Tailwind classes to new Vault icon
* [PM-6825] Remove temporary header comment
* [PM-6825] Fix auto fill suggestion font size and padding
* [PM-6825] Use tailwind for vault icon styling
* [PM-6825] Add libs/angular to tailwind.config content
* [PM-6825] Cleanup missing i18n
* [PM-6825] Make VaultV2 standalone and cleanup Browser App module
* [PM-6825] Use explicit type annotation
* [PM-6825] Use property binding instead of interpolation
* Move/replace submit and userVerification logic from web into the BaseExportComponent
Add "@bitwarden/auth" as dependency to the vault-export-ui package
New submit logic also checks for password-encrypted exports which will be need for future UI updates on browser and desktop
* Remove import/passing of the unneeded UserVerificationService
* Remove app-user-verification from browser and desktop components as the new UI is opened as a self-contained dialog
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* convert premium card to banner component
- create VaultBanners component that will handle all banner logic
* move upgrade browser notice to banner component
* refactor verify email component to use the banner component
* add email banner to VaultBanners component
* move low KDF message to banner component
* remove unused KDF component
* allow multiple banners to be displayed at once
* use vault service to consolidate premium banner logic
- Implement prompt thresholds for premium banner
- Update dismiss logic to re-run visibility logic
* update variable name
* move all dismiss/show logic to vault banner service
* rename tense of methods for readability
* apply underline to send email button to match other banner actions
* fix dark mode styling across banners
* remove unused variable
* use bitLink directive for styling rather than tailwind
* move premium banner to a standalone observable
* update bootstrap styles to tailwind
* use new KDF service for vault banners
* move the VerifyEmailComponent to a standalone component
* convert premium banner to a singular observable
* remove unneeded import
* AC-2589 add unique id for each vault banner
* AC-2588 poll sync service to only show premium banner after a sync
* close subscription to syncCompleted$ after one emit
* remove unneeded ReplaySubject
* replace `PasswordGeneratorService` with `legacyPasswordGenerationServiceFactory`
* replace `UsernameGeneratorService` with `legacyUsernameGenerationServiceFactory`
* migrate generator options and history
* apply policy immediately once available
* suppress duplicate policy emissions
* run password generation response code in `ngZone`
* [AC-2302] Move organization-auth-request.service to bit-common folder
* [AC-2302] Rename organization-auth-request.service to organization-auth-request-api.service
* [AC-2302] Move logic from component to organization-auth-request.service
* [AC-2302] Fix import path in OrganizationAuthRequestService
* [AC-2302] Move imports to OrganizationsModule and delete unused CoreOrganizationModule
* [AC-2302] Move the call to get userResetPasswordDetails into OrganizationAuthRequestService
* [AC-2302] Remove @Injectable() and manually configure dependencies
* [AC-2302] Add OrganizationAuthRequestService unit tests first draft
* [AC-2302] Refactor device-approvals.component.ts to remove unused imports
* [AC-2302] Set up jest on bit-common and add unit tests for OrganizationAuthRequestService
* [AC-2302] Add bit-common to jest.config.js
* [AC-2302] Update organizations.module.ts to include safeProviders declared in variable
* [AC-2302] Remove services and views folders from bit-common
* [AC-2302] Define path mapping
* Adjust an import path
The import path of `PendingAuthRequestView` in
`OrganizationAuthRequestApiService` was pointing to the wrong place. I
think this file was just recently moved, and the import didn't get
updated.
* Get paths working
* Fix import
* Update jest config to use ts-jest adn jsdom
* Copy-paste path mappings from bit-web
* Remove unnecessary test setup file
* Undo unnecessary change
* Fix remaining path mappings
* Remove Bitwarden License mapping from OSS code
* Fix bit-web so it uses its own tsconfig
* Fix import path
* Remove web-bit entrypoint from OSS tsconfig
* Make DeviceApprovalsComponent standalone
* Remove organization-auth-request-api.service export
* Remove OrganizationsRoutingModule from DeviceApprovalsComponent imports
* Remove CoreOrganizationModule from OrganizationsModule imports
* Remove NoItemsModule from OrganizationsModule imports
* Use ApiService from JslibServicesModule
* Update providers in device-approvals.component.ts
---------
Co-authored-by: Addison Beck <hello@addisonbeck.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
* refactor: move logic for products into a service
- This is in preparation for having having the navigation menu show products based off of the same logic.
* add extra small font size to tailwind config
* remove absolute positioning from toggle width component
- it now sits beneath the product switcher
* update product switcher to have UI details that are only shown in the navigation pane
* add navigation oriented product switcher
* integrate navigation product switcher into secrets manager
* integrate navigation product switcher into provider console
* integrate navigation product switcher into user layout
* integrate navigation product switcher into organizations
* add translation for "switch"
* hide active styles from navigation product switcher
* update storybook for product switcher stories
* remove unneeded full width style
* use protected readonly variable instead of getter
* migrate stories to CSF3
* remove double subscription to `moreProducts$`
* only use wrapping div in navigation switcher story
- less vertical space is taken up
* update to satisfies
* refactor `navigationUI` to `otherProductOverrides`
* move observables to protected readonly
* apply margin-top via class on the host component
* remove switch text from the navigation product switcher
* Allow for the active navigation switcher to be shown
* remove xxs font style
* remove unneeded module
* remove switch from stories
* remove defensive nullish coalescing
* remove merge leftovers
* Defect PM-7899 - show organizations product at the top of the other products list
* Defect PM-7951 use attr.icon to keep the icon as an attribute after prod mode is enabled
* Defect PM-7948 update path based on the current org
* force active styles for navigation items (#9128)
* add horizontal margin to icon
---------
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
* Add permission checks for org vault bulk actions
* Show checkboxes for all collections except Unassigned
* Separate individual and admin logic between CollectionView
and CollectionAdminView
* Remove heading for error toasts per design feedback
* [PM-7883] Cleanup/refactor collection-dialog.component
- Add new limitNestedCollections option
- Remove redundant calls to collectionService and collectionAdminService
- Adjust deleted parent logic to account for users that cannot ViewAllCollections
* [PM-7883] Ensure collection management setting is considered when limiting nested collections in the org vault
* initial commit
* Make changes for provider billing details
* replace the hardcoded values with real data
* Apply discount on the displayed amount
* Fix the design issues base on the new design changes
* Fix the design space issue
* Remove unnecessary If statements
* Revert the change
* Remove unnecessary If statements
* Refactoring the discount calculation for easy understanding
* Fix the subscription page issue for existing providers
* Merge branch 'main' into ac-2570-existing-providers-see-new-cb-experience-on-admin-console-org-billing-subscription-page
* Fix pr comment on error if the user isn't a provider user
* Resolve the pr comment on error for non provider user
* Remove unused property
* PM-5501 - VaultTimeoutSettingsSvc - refactor var names in getVaultTimeoutAction
* PM-5501 - Add state definitions and key definitions + test deserialization of key defs.
* PM-5501 - Add state provider dep to VaultTimeoutSettingsSvc
* PM-5501 - Refactor getVaultTimeout
* PM-5501 - VaultTimeoutSettingsService - Build getMaxVaultTimeoutPolicyByUserId helper
* PM-5501 - (1) Update state definitions (2) convert KeyDefs to UserKeyDefs (2) Remove everBeenUnlocked as we won't need it
* PM-5501 - VaultTimeoutSettingsSvc - POC for getVaultTimeoutActionByUserId$ method + new private determineVaultTimeoutAction helper.
* PM-5501 - VaultTimeoutSettingsSvc - build set and observable get methods for vault timeout settings
* PM-5501 - Update web references to use new vault timeout setting service methods
* PM-5501 - VaultTimeoutSettingsSvc - write up abstraction js docs
* PM-5501 - VaultTimeoutSettingsSvc abstraction - finish tweaks
* PM-5501 - VaultTimeoutSettingsSvc - add catchError blocks to observables to protect outer observables and prevent cancellation in case of error.
* PM-5501 - Remove vault timeout settings from state service implementation.
* PM-5501 - VaultTimeoutSettingsServiceStateProviderMigrator first draft
* PM-5501 - WIP - replace some state service calls with calls to vault timeout settings svc.
* PM-5501 - Replace state service calls in login strategies to get vault timeout settings data with VaultTimeoutSettingsService calls.
* PM-5501 - Fix login strategy tests
* PM-5501 - Update login strategy tests to pass
* PM-5501 - CryptoSvc - share VaultTimeout user key def to allow crypto svc access to the vault timeout without creating a circular dep.
* PM-5501 - Fix dependency injections.
* PM-5501 - ApiSvc - replace state svc with vault timeout settings svc.
* PM-5501 - VaultTimeoutSettingsServiceStateProviderMigrator more cleanup
* PM-5501 - Test VaultTimeoutSettingsServiceStateProviderMigrator
* PM-5501 - VaultTimeoutSettingsSvc tests updated
* PM-5501 - Update all setVaultTimeoutOptions references
* PM-5501 - VaultTimeoutSettingsSvc - Update setVaultTimeoutOptions to remove unnecessary logic and clean up clearTokens condition.
* PM-5501 - Fix vault timeout service tests
* PM-5501 - Update VaultTimeoutSettings state tests to pass
* PM-5501 - Desktop - system svc - fix build by replacing use of removed method.
* PM-5501 - Fix CLI by properly configuring super class deps in NodeApiService
* PM-5501 - Actually finish getitng deps fixed to get CLI to build
* PM-5501 - VaultTimeoutSettingsSvc.determineVaultTimeoutAction - pass userId to getAvailableVaultTimeoutActions to prevent hang waiting for an active user.
* PM-5501 - VaultTimeoutSettingSvc test - enhance getVaultTimeoutActionByUserId$ to also test PIN scenarios as an unlock method
* PM-5501 - bump migration version
* PM-5501 - Refactor migration to ensure the migration persists null vault timeout values.
* PM-5501 - Bump migration version
* PM-5501 - Fix web build issues introduced by merging main.
* PM-5501 - Bump migration version
* PM-5501 - PreferencesComponent - revert dep change from InternalPolicyService to standard PolicyService abstraction
* PM-5501 - Address all PR feedback from Jake
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* PM-5501 - VaultTimeoutSettingsSvc tests - add tests for setVaultTimeoutOptions
* PM-5501 - VaultTimeoutSettingsSvc - setVaultTimeoutOptions - Update tests to use platform's desired syntax.
* PM-5501 - Fix tests
* PM-5501 - Create new VaultTimeout type
* PM-5501 - Create new DEFAULT_VAULT_TIMEOUT to allow each client to inject their default timeout into the VaultTimeoutSettingService
* PM-5501 - Migrate client default vault timeout to new injection token
* PM-5501 - Update VaultTimeoutSettingsSvc to use VaultTimeout type and apply default vault timeout if it is null.
* PM-5501 - Update vaultTimeout: number to be vaultTimeout: VaultTimeout everywhere I could find it.
* PM-5501 - More changes based on changing vaultTimeout from number to VaultTimeout type.
* PM-5501 - VaultTimeoutSvc - Update shouldLock logic which previously checked for null (never) or any negative values (any strings except never) with a simple string type check.
* PM-5501 - More cleanup of vaultTimeout type change - replacing null checks with "never" checks
* PM-5501 - VaultTimeoutSettingsSvc - refactor determineVaultTimeout to properly treat string and numeric vault timeouts.
* PM-5501 - Update vault timeout settings service tests to reflect new VaultTimeout type.
* PM-5501 - VaultTimeoutSettingsService - add more test cases for getVaultTimeoutByUserId
* PM-5501 - (1) Remove "immediately" as 0 is numerically meaningful and can be used with Math.min (2) Add VaultTimeoutOption interface for use in all places we show the user a list of vault timeout options.
* PM-5501 - VaultTimeoutSettingSvc - update tests to use 0 as immediately.
* PM-5501 - VaultTimeoutInputComp - Add new types and update applyVaultTimeoutPolicy logic appropriately.
* PM-5501 - Add new types to all preferences and setting components across clients.
* PM-5501 - Fix bug on web where navigating to the preferences page throws an error b/c the validatorChange function isn't defined.
* PM-5501 - WIP on updating vault timeout setting migration and rollback + testing it.
* PM-5501 - Update VaultTimeoutSettingsSvc state provider migration and tests to map existing possible values into new VaultTImeout type.
* PM-5501 - Fix vault timeout settings state tests by changing number to new VaultTimeout type.
* PM-5501 - Fix crypto svc auto key refresh test to use "never" instead of null.
* PM-5501 - Add clarifying comment to vaulttimeout type
* PM-5501 - Desktop app comp - replace systemTimeoutOptions with vault timeout type.
* PM-5501 - Update vault timeout service tests to use VaultTimeout type.
* PM-5501 - VaultTimeoutSettingsSvc - (1) Fix bug where vault timeout action didn't have a default like it did before (2) Fix bug in userHasMasterPassword where it would incorrectly return the active user stream for a given user id as a fallback. There is no guarantee the given user would match the active user so the paths are mutually exclusive.
* PM-5501 - Login Strategy fix - Move retrieval of vault timeout settings and setting of the tokens until after account init and user decryption options set as those opts are needed to properly determine the user's available vault timeout actions.
* PM-5501 - Fix vault timeout settings svc tests
* PM-5501 - VaultTimeoutSettingSvc - move default logic to determine methods + refactor default vault timeout action to properly default to lock in scenarios the user has lock available.
* Update libs/angular/src/components/settings/vault-timeout-input.component.ts
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
* PM-5501 - Per PR feedback, cleanup commented out vault timeout options
* PM-5501 - Fix vault timeout input comp lint issues
* PM-5501 - Per PR feedback from Cesar, update VaultTimeout type to use const so we can avoid any magic string usage. Awesome.
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
* PM-5501 - CLI - use "never" as default vault timeout instead of null.
* PM-5501 - Fix broken tests
* PM-5501 - Bump migration version
* PM-5501 - Fix build errors after merging main.
* PM-5501 - Update mockMigrationHelper to pass along client type so tests will respect it.
* PM-5501 - Update VaultTimeoutSettingsServiceStateProviderMigrator and tests to use new CLI client type to convert undefined values to never so that CLI users don't lose their session upon running this migration.
* PM-5501 - Bump migration version
* PM-5501 - Fix migration tests to use new authenticated user format
* PM-5501 Update rollback tests
* PM-5501 - Adjust migration based on feedback.
* PM-5501 - Per Jake's find, fix missed -2
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* PM-5501 - Add user id to needsStorageReseed.
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* PM-5501 - Per PR feedback, setVaultTimeoutOptions shouldn't accept null for vault timeout anymore.
* PM-5501 - Per PR feedback, add null checks for set methods for setting vault timeout or vault timeout action.
* PM-5501 - Per PR feedback, add more context as to why we need vault timeout settings to persist after logout.
* PM-5501 - Per PR feedback, fix userHasMasterPassword
* PM-5501 - VaultTimeoutSettingsService - fix userHasMasterPassword check by checking for null decryption options.
* PM-5501 - Remove state service from vault timeout settings service (WOOO)
* PM-5501 - Bump migration version
* PM-5501 - Account Security comp - refactor to consider ease of debugging.
* PM-5501 - (1) Add checks for null vault timeout and vault timeout actions (2) Add tests for new scenarios.
* PM-5501 - VaultTimeoutSettingsSvc - setVaultTimeoutOptions - fix bug where nullish check would throw incorrectly if immediately (0) was picked as the timeout.
* PM-5501 - Per PR feedback, clean up remaining token service methods which accept null for timeout and add tests. .
* PM-5501 - Fix nit
---------
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
* [AC-2484] Fix bug where Custom Users with "Delete any collection" permission incorrectly see "Can Edit" permission for Unassigned Collection
* [AC-2484] Undo change on permission tooltip permission check
* [AC-2484] Fix permission text for unassigned collection
* move pinKeyEncryptedUserKey
* move pinKeyEncryptedUserKeyEphemeral
* remove comments, move docs
* cleanup
* use UserKeyDefinition
* refactor methods
* add migration
* fix browser dependency
* add tests for migration
* rename to pinService
* move state to PinService
* add PinService dep to CryptoService
* move protectedPin to state provider
* update service deps
* renaming
* move decryptUserKeyWithPin to pinService
* update service injection
* move more methods our of crypto service
* remove CryptoService dep from PinService and update service injection
* remove cryptoService reference
* add method to FakeMasterPasswordService
* fix circular dependency
* fix desktop service injection
* update browser dependencies
* add protectedPin to migrations
* move storePinKey to pinService
* update and clarify documentation
* more jsdoc updates
* update import paths
* refactor isPinLockSet method
* update state definitions
* initialize service before injecting into other services
* initialize service before injecting into other services (bw.ts)
* update clearOn and do additional cleanup
* clarify docs and naming
* assign abstract & private methods, add clarity to decryptAndMigrateOldPinKeyEncryptedMasterKey() method
* derived state (attempt)
* fix typos
* use accountService to get active user email
* use constant userId
* add derived state
* add get and clear for oldPinKeyEncryptedMasterKey
* require userId
* move pinProtected
* add clear methods
* remove pinProtected from account.ts and replace methods
* add methods to create and store pinKeyEncryptedUserKey
* add pinProtected/oldPinKeyEncrypterMasterKey to migration
* update migration tests
* update migration rollback tests
* update to systemService and decryptAndMigrate... method
* remove old test
* increase length of state definition name to meet test requirements
* rename 'TRANSIENT' to 'EPHEMERAL' for consistency
* fix tests for login strategies, vault-export, and fake MP service
* more updates to login-strategy tests
* write new tests for core pinKeyEncrypterUserKey methods and isPinSet
* write new tests for pinProtected and oldPinKeyEncryptedMasterKey methods
* minor test reformatting
* update test for decryptUserKeyWithPin()
* fix bug with oldPinKeyEncryptedMasterKey
* fix tests for vault-timeout-settings.service
* fix bitwarden-password-protected-importer test
* fix login strategy tests and auth-request.service test
* update pinService tests
* fix crypto service tests
* add jsdoc
* fix test file import
* update jsdocs for decryptAndMigrateOldPinKeyEncryptedMasterKey()
* update error messages and jsdocs
* add null checks, move userId retrievals
* update migration tests
* update stateService calls to require userId
* update test for decryptUserKeyWithPin()
* update oldPinKeyEncryptedMasterKey migration tests
* more test updates
* fix factory import
* update tests for isPinSet() and createProtectedPin()
* add test for makePinKey()
* add test for createPinKeyEncryptedUserKey()
* add tests for getPinLockType()
* consolidate userId verification tests
* add tests for storePinKeyEncryptedUserKey()
* fix service dep
* get email based on userId
* use MasterPasswordService instead of internal
* rename protectedPin to userKeyEncryptedPin
* rename to pinKeyEncryptedUserKeyPersistent
* update method params
* fix CryptoService tests
* jsdoc update
* use EncString for userKeyEncryptedPin
* remove comment
* use cryptoFunctionService.compareFast()
* update tests
* cleanup, remove comments
* resolve merge conflict
* fix DI of MasterPasswordService
* more DI fixes
* [AC-1707] Add feature flag
* [AC-1707] Prevent loading ciphers for provider users in the org vault when the feature flag is enabled
* [AC-1707] Ensure new canEditAllCiphers logic only applies to organizations that have FC enabled
* [AC-1707] Update editAllCiphers helper to check for restrictProviderAccess feature flag
* [AC-1707] Remove un-used vaultFilterComponent reference
* [AC-1707] Hide vault filter for providers
* [AC-1707] Add search to vault header for provider users
* [AC-1707] Hide New Item button for Providers when restrict provider access feature flag is enabled
* [AC-1707] Remove leftover debug statement
* [AC-1707] Update canEditAllCiphers references to consider the restrictProviderAccessFlag
* [AC-1707] Fix collections component changes from main
* [AC-1707] Fix some feature flag issues from merge with main
* [AC-1707] Avoid 'readonly' collection dialog for providers
* [AC-1707] Fix broken Browser component
* [AC-1707] Fix broken Desktop component
* [AC-1707] Add restrict provider flag to add access badge logic
* [AC-2555] Fix missing feature flags in CollectionsComponent
* [AC-2555] Do not filter collections when opening the cipher collections dialog in the org vault
* Ensure AuthStatus Changes Before Exiting
* Do Not Display Account Without Name Or Email
* Fix Environment Selectors
* Add AccountService.clean to Web
* Update Emergency Access To Get Their Own Key
* Migrate Organization Keys To Get Their Own Key
* Remove Optional Parameters
* Update Abstraction Parameter Name to Match Implementation
* Add @throws Doc
* Update Group modal -> Collections tab to respect collection management settings,
e.g. only allow admins to assign access to collections they can manage
* Update collectionAdminView getters for custom permissions
* [AC-1623] Remove cloneableOrganizationCiphers property
and update canClone to reflect new clone permission logic
* [AC-1623] Remove allowOwnershipAssignment override in orgVault as the same restrictions apply to both vaults
* [AC-1623] Ensure ownershipOptions are restricted for non-admins when cloning an org cipher item
* Use account service to track accounts and active account
* Remove state service active account Observables.
* Add email verified to account service
* Do not store account info on logged out accounts
* Add account activity tracking to account service
* Use last account activity from account service
* migrate or replicate account service data
* Add `AccountActivityService` that handles storing account last active data
* Move active and next active user to account service
* Remove authenticated accounts from state object
* Fold account activity into account service
* Fix builds
* Fix desktop app switch
* Fix logging out non active user
* Expand helper to handle new authenticated accounts location
* Prefer view observable to tons of async pipes
* Fix `npm run test:types`
* Correct user activity sorting test
* Be more precise about log out messaging
* Fix dev compare errors
All stored values are serializable, the next step wasn't necessary and was erroring on some types that lack `toString`.
* If the account in unlocked on load of lock component, navigate away from lock screen
* Handle no users case for auth service statuses
* Specify account to switch to
* Filter active account out of inactive accounts
* Prefer constructor init
* Improve comparator
* Use helper methods internally
* Fixup component tests
* Clarify name
* Ensure accounts object has only valid userIds
* Capitalize const values
* Prefer descriptive, single-responsibility guards
* Update libs/common/src/state-migrations/migrate.ts
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Fix merge
* Add user Id validation
activity for undefined was being set, which was resulting in requests for the auth status of `"undefined"` (string) userId, due to key enumeration. These changes stop that at both locations, as well as account add for good measure.
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* PM-7811 - Refactor UserKeyInitService to UserAutoUnlockKeyService - remove active account listening logic as it introduced race conditions with user key memory retrieval happening before the user auto unlock key was set into memory.
* PM-7811 - CLI - (1) Fix deps (2) On CLI init (pre command execution), if there is an active account, then set the user key in memory from the user auto unlock key.
* PM-7811 - Browser Extension / desktop - (1) Update deps (2) Sets user key in memory if the auto unlock key is set on account switch and background init (must act on all accounts so that account switcher displays unlock status properly).
* PM-7811 - Web - (1) Update deps (2) Sets user key in memory if the auto unlock key is set on init
* PM-7811 - Fix account switcher service changes not being necessary.
Refactors the feature flags in ConfigService to be type safe. It also moves the default value to a centralized location rather than the caller defining it. This ensures consistency across the various places they are used.
* [AC-1999] Fix null check
this.collection can be both null or unassigned and `!= null` will handle both cases.
* [AC-1999] Navigate away when selected collection is deleted
---------
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
* PM-7235 - AuthSvc - Refactor getAuthStatus to simply use the cryptoService.hasUserKey check to determine the user's auth status.
* PM-7235 - CryptoSvc - getUserKey - remove setUserKey side effect if auto key is stored. Will move to app init
* PM-7235 - For each client init service, add setUserKeyInMemoryIfAutoUserKeySet logic
* PM-7235 - CryptoSvc tests - remove uncessary test.
* PM-7235 - Create UserKeyInitService and inject into all init services with new listening logic to support acct switching.
* PM-7235 - UserKeyInitSvc - minor refactor of setUserKeyInMemoryIfAutoUserKeySet
* PM-7235 - Add test suite for UserKeyInitService
* PM-7235 - Remove everBeenUnlocked as it is no longer needed
* PM-7235 - Fix tests
* PM-7235 - UserKeyInitSvc - per PR feedback, add error handling to protect observable stream from being cancelled in case of an error
* PM-7235 - Fix tests
* Update libs/common/src/platform/services/user-key-init.service.ts
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* Update libs/common/src/platform/services/user-key-init.service.ts
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* PM-7235 - AuthSvc - Per PR review, for getAuthStatus, only check user key existence in memory.
* PM-7235 - remove not useful test per PR feedback.
* PM-7235 - Per PR feedback, update cryptoService.hasUserKey to only check memory for the user key.
* PM-7235 - Per PR feedback, move user key init service listener to main.background instead of init service
* PM-7235 - UserKeyInitSvc tests - fix tests to plass
---------
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* add navigation item for integrations and SDKs page
* Initial routing to Integrations & SDKs page
* Initial add of integrations component
* Initial add of SDKs component
* add secret manage integration images
* remove integration & sdk components in favor of a single component
* add integration & integration grid components
* add integrations & sdks
* rename page & components to integration after design discussion
* add external rel attribute for SDK links
* remove ts extension
* refactor: use pseudo element to cover as a link
* refactor: change secondaryText to linkText to align with usage
* update icon for integrations
* add new badge option for integration cards
* hardcode integration/sdk names
* add dark mode images for integrations and sdks
* update integration/sdk card with dark mode image when applicable
* refactor integration types to be an enum
* fix enum typings in integration grid test
---------
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com>
* Refactoring
* Hide SM toggle on member invite and default to true for SM standalone org
* changed from hide sm checkbox to default and disable
* Removed errant addition from conflict resolution
* [AC-2209] Update permission text to display "No access" when collection is not assigned
* [AC-2209] Add permission tooltip for unassigned collections
* initial commit
* add changes from running prettier
* resolve the linx issue
* resolve the lint issue
* resolving lint error
* correct the redirect issue
* resolve pr commit
* Add a feature flag
* move the new component to adminconsole
* resolve some pr comments
* move the endpoint from ApiService to providerApiService
* move provider endpoints to the provider-api class
* change the header
* resolve some pr comments
* billing history component migration
* billing history component migration
* billing history component migration
* billing history component migration
* billing history component migration
---------
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
* change plan component migration
* change plan component migration
---------
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
* Removed business name from organization create/upgrade flows, and org info page
* Prefilling the logged in user's email to the billing email when creating an organization
* Boostrap basic banner, show for all admins
* Remove UI banner, fix method calls
* Invert showBanner -> hideBanner
* Add api call
* Minor tweaks and wording
* Change to active user state
* Add tests
* Fix mixed up names
* Simplify logic
* Add feature flag
* Do not clear on logout
* Update apps/web/src/locales/en/messages.json
---------
Co-authored-by: Addison Beck <github@addisonbeck.com>
* refactored injector of services on the browser service module
* refactored the search and popup serach service to use state provider
* renamed back to default
* removed token service that was readded during merge conflict
* Updated search service construction on the cli
* updated to use user key definition
* Reafctored all components that refernce issearchable
* removed commented variable
* added uncommited code to remove dependencies not needed anymore
* added uncommited code to remove dependencies not needed anymore
* create mp and kdf service
* update mp service interface to not rely on active user
* rename observable methods
* update crypto service with new MP service
* add master password service to login strategies
- make fake service for easier testing
- fix crypto service tests
* update auth service and finish strategies
* auth request refactors
* more service refactors and constructor updates
* setMasterKey refactors
* remove master key methods from crypto service
* remove master key and hash from state service
* missed fixes
* create migrations and fix references
* fix master key imports
* default force set password reason to none
* add password reset reason observable factory to service
* remove kdf changes and migrate only disk data
* update migration number
* fix sync service deps
* use disk for force set password state
* fix desktop migration
* fix sso test
* fix tests
* fix more tests
* fix even more tests
* fix even more tests
* fix cli
* remove kdf service abstraction
* add missing deps for browser
* fix merge conflicts
* clear reset password reason on lock or logout
* fix tests
* fix other tests
* add jsdocs to abstraction
* use state provider in crypto service
* inverse master password service factory
* add clearOn to master password service
* add parameter validation to master password service
* add component level userId
* add missed userId
* migrate key hash
* fix login strategy service
* delete crypto master key from account
* migrate master key encrypted user key
* rename key hash to master key hash
* use mp service for getMasterKeyEncryptedUserKey
* fix tests
* fix user key decryption logic
* add clear methods to mp service
* fix circular dep and encryption issue
* fix test
* remove extra account service call
* use EncString in state provider
* fix tests
* return to using encrypted string for serialization
Remove old compile flags which should no longer be required, and may even cause issues. secretsManager: false hides the app switcher which is now used for more than just secrets manager.
* SM-1159: Rename service accounts to machine accounts. Visible text only.
* SM-1159: Second round of adding service to machine account renames
* SM-1159: Change title
* SM-1159: Fix typo
* SM-1159: Add more keys
* SM-1159: Reordered keys
* SM-1159: Keys update
Add a dev tool for toggling the web vault width. This allows developers and designers to experiment with how the vault currently behaves with responsiveness and ensure new functionality looks good.
* create mp and kdf service
* update mp service interface to not rely on active user
* rename observable methods
* update crypto service with new MP service
* add master password service to login strategies
- make fake service for easier testing
- fix crypto service tests
* update auth service and finish strategies
* auth request refactors
* more service refactors and constructor updates
* setMasterKey refactors
* remove master key methods from crypto service
* remove master key and hash from state service
* missed fixes
* create migrations and fix references
* fix master key imports
* default force set password reason to none
* add password reset reason observable factory to service
* remove kdf changes and migrate only disk data
* update migration number
* fix sync service deps
* use disk for force set password state
* fix desktop migration
* fix sso test
* fix tests
* fix more tests
* fix even more tests
* fix even more tests
* fix cli
* remove kdf service abstraction
* add missing deps for browser
* fix merge conflicts
* clear reset password reason on lock or logout
* fix tests
* fix other tests
* add jsdocs to abstraction
* use state provider in crypto service
* inverse master password service factory
* add clearOn to master password service
* add parameter validation to master password service
* add component level userId
* add missed userId
* migrate key hash
* fix login strategy service
* delete crypto master key from account
* migrate master key encrypted user key
* rename key hash to master key hash
* use mp service for getMasterKeyEncryptedUserKey
* fix tests
In https://github.com/bitwarden/clients/pull/8133 the premium state changed to
be derived from observables, which means we can get rid of the `purchasePremium`
messages that are sent and instead rely directly on the observable to distribute
the state.
* Adding the key definitions and tests and initial send state service
* Adding the abstraction and implementing
* Planning comments
* Everything but fixing the send tests
* Moving send tests over to the state provider
* jslib needed name refactor
* removing get/set encrypted sends from web vault state service
* browser send state service factory
* Fixing conflicts
* Removing send service from services module and fixing send service observable
* Commenting the migrator to be clear on why only encrypted
* No need for service factories in browser
* browser send service is no longer needed
* Key def test cases to use toStrictEqual
* Running prettier
* Creating send test data to avoid code duplication
* Adding state provider and account service to send in cli
* Fixing the send service test cases
* Fixing state definition keys
* Moving to observables and implementing encryption service
* Fixing key def tests
* The cli was using the deprecated get method
* The observables init doesn't need to happen in constructor
* Missed commented out code
* If enc key is null get user key
* Service factory fix
* implementing the clients changes
* resolve pr comments on message.json
* moved the method to billing-api.service
* move the request and response files to billing folder
* remove the adding existing orgs
* resolve the routing issue
* resolving the pr comments
* code owner changes
* fix the assignedseat
* resolve the warning message
* resolve the error on update
* passing the right id
* resolve the unassign value
* removed unused logservice
* Adding the loader on submit button
* PM-5268 - Add DEVICE_TRUST_DISK to state definitions
* PM-5268 - DeviceTrustCryptoService - Get most of state provider refactor done - WIP - commented out stuff for now.
* PM-5268 - DeviceTrustCryptoServiceStateProviderMigrator - WIP - got first draft of migrator in place and working on tests. Rollback tests are failing for some reason TBD.
* PM-5268 - more WIP on device trust crypto service migrator tests
* PM-5268 - DeviceTrustCryptoServiceStateProviderMigrator - Refactor based on call with platform
* PM-5268 - DeviceTrustCryptoServiceStateProviderMigrator - tests passing
* PM-5268 - Update DeviceTrustCryptoService to convert over to state providers + update all service instantiations / dependencies to ensure state provider is passed in or injected.
* PM-5268 - Register new migration
* PM-5268 - Temporarily remove device trust crypto service from migrator to ease merge conflicts as there are 6 more migrators before I can apply mine in main.
* PM-5268 - Update migration numbers of DeviceTrustCryptoServiceStateProviderMigrator based on latest migrations from main.
* PM-5268 - (1) Export new KeyDefinitions from DeviceTrustCryptoService for use in test suite (2) Update DeviceTrustCryptoService test file to use state provider.
* PM-5268 - Fix DeviceTrustCryptoServiceStateProviderMigrator tests to use proper versions
* PM-5268 - Actually fix all instances of DeviceTrustCryptoServiceStateProviderMigrator test failures
* PM-5268 - Clean up state service, account, and login strategy of all migrated references
* PM-5268 - Account - finish cleaning up device key
* PM-5268 - StateService - clean up last reference to device key
* PM-5268 - Remove even more device key refs. *facepalm*
* PM-5268 - Finish resolving merge conflicts by incrementing migration version from 22 to 23
* PM-5268 - bump migration versions
* PM-5268 - DeviceTrustCryptoService - Implement secure storage functionality for getDeviceKey and setDeviceKey (to achieve feature parity with the ElectronStateService implementation prior to the state provider migration). Tests to follow shortly.
* PM-5268 - DeviceTrustCryptoService tests - getDeviceKey now tested with all new secure storage scenarios. SetDeviceKey tests to follow.
* PM-5268 - DeviceTrustCryptoService tests - test all setDeviceKey scenarios with state provider & secure storage
* PM-5268 - Update DeviceTrustCryptoService deps to actually use secure storage svc on platforms that support it.
* PM-5268 - Bump migration version due to merge conflicts.
* PM-5268 - Bump migration version
* PM-5268 - tweak jsdocs to be single line per PR feedback
* PM-5268 - DeviceTrustCryptoSvc - improve debuggability.
* PM-5268 - Remove state service as a dependency on the device trust crypto service (woo!)
* PM-5268 - Update migration test json to correctly reflect reality.
* PM-5268 - DeviceTrustCryptoSvc - getDeviceKey - add throw error for active user id missing.
* PM-5268 - Fix tests
* PM-5268 - WIP start on adding user id to every method on device trust crypto service.
* PM-5268 - Update lock comp dependencies across clients
* PM-5268 - Update login via auth request deps across clients to add acct service.
* PM-5268 - UserKeyRotationSvc - add acct service to get active acct id for call to rotateDevicesTrust and then update tests.
* PM-5268 - WIP on trying to fix device trust crypto svc tests.
* PM-5268 - More WIP device trust crypto svc tests passing
* PM-5268 - Device Trust crypto service - get all tests passing
* PM-5268 - DeviceTrustCryptoService.getDeviceKey - fix secure storage b64 to symmetric crypto key conversion
* PM-5268 - Add more tests and update test names
* PM-5268 - rename state to indicate it was disk local
* PM-5268 - DeviceTrustCryptoService - save symmetric key in JSON format
* PM-5268 - Fix lock comp tests by adding acct service dep
* PM-5268 - Update set device key tests to pass
* PM-5268 - Bump migration versions again
* PM-5268 - Fix user key rotation svc tests
* PM-5268 - Update web jest config to allow use of common spec in user-key-rotation-svc tests
* PM-5268 - Bump migration version
* PM-5268 - Per PR feedback, save off user id
* PM-5268 - bump migration version
* PM-5268 - Per PR feedback, remove unnecessary await.
* PM-5268 - Bump migration verson
* add remove button for passkeys during edit
* added live region to announce when a passkey is removed
* removed announce passkey removed by SR
* removed unused variable
* Create tracker that can await until expected observables are received.
* Test dates are almost equal
* Remove unused class method
* Allow for updating active account in accout service fake
* Correct observable tracker behavior
Clarify documentation
* Transition config service to state provider
Updates the config fetching behavior to be lazy and ensure that any emitted value has been updated if older than a configurable value (statically compiled).
If desired, config fetching can be ensured fresh through an async.
* Update calls to config service in DI and bootstrapping
* Migrate account server configs
* Fix global config fetching
* Test migration rollback
* Adhere to implementation naming convention
* Adhere to abstract class naming convention
* Complete config abstraction rename
* Remove unnecessary cli config service
* Fix builds
* Validate observable does not complete
* Use token service to determine authed or unauthed config pull
* Remove superfluous factory config
* Name describe blocks after the thing they test
* Remove implementation documentation
Unfortunately the experience when linking to external documentation is quite poor. Instead of following the link and retrieving docs, you get a link that can be clicked to take you out of context to the docs. No link _does_ retrieve docs, but lacks indication in the implementation that documentation exists at all.
On the balance, removing the link is the better experience.
* Fix storybook
Move export.component
Export from @bitwarden/vault-export-ui
Fix imports on browser, desktop and web
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* updated vault filter service to make use of collection service
* removed fix me
* reverted to use reload collections on org vault as collection admin service does not support state management yet
* fixed statement
Refactor environment service to emit a single observable. This required significant changes to how the environment service behaves and tackles much of the tech debt planned for it.
* collections component shows disable readOnly collections in the org vault edit collections modal, and will check if org allows Owners up manage all collections in ciphers
* create new user decryption options service
* rename new service to user decryption options
* add hasMasterPassword to user decryption options service
* migrate device trust service to new user decryption options service
* add migration for user-decryption-options
* migrate sync service and calls to trust-device-service
* rename abstraction file
* migrate two factor component
* migrate two factor spec
* migrate sso component
* migrate set-password component
* migrate base login decryption component
* migrate organization options component
* fix component imports
* add missing imports
- remove state service calls
- add update user decryption options method
* remove acct decryption options from account
* lint
* fix tests and linting
* fix browser
* fix desktop
* add user decryption options service to cli
* remove default value from migration
* bump migration number
* fix merge conflict
* fix vault timeout settings
* fix cli
* more fixes
* add user decryption options service to deps of vault timeout settings service
* update login strategy service with user decryption options
* remove early return from sync bandaid for user decryption options
* move user decryption options service to lib/auth
* move user decryption options to libs/auth
* fix reference
* fix browser
* check user decryption options after 2fa check
* update migration and revert tsconfig changes
* add more documentation
* clear user decryption options on logout
* fix tests by creating helper for user decryption options
* fix tests
* pr feedback
* fix factory
* update migration
* add tests
* update missed migration num in test
* PM-6780 - Create vault-export-ui package
* Migrate export-scope-callout to CL
- Move export-scope-callout.component to vault-export-UI
- Use bit-callout instead of app-callout
- Make component standalone
- Remove from jslib.module
- Prefix selector with team-name
- Export it from vault-export-ui
* Update usage of tools-export-scope-callout for desktop
* Update usage of tools-export-scope-callout for web
* Update usage of tools-export-scope-callout for browser
* Change package description
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Fix a typo in the `StateDefinition` description
* Introduce `OrganizationManagementPreferencesService`
* Declare `OrganizationManagementPreferencesService` in DI
* Update `autoConfirmFingerPrints` logic in emergency access files
* Update `autoConfirmFingerPrints` logic in `people` files
* Remove `autoConfirmFingerPrints` from `StateService` and `Account`
* Migrate existing client data for `autoConfirmFingerPrints`
* Update apps/web/src/app/admin-console/organizations/manage/user-confirm.component.ts
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* Update apps/web/src/app/admin-console/organizations/manage/user-confirm.component.ts
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* Use `set` instead of `update` for function names
---------
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* Remove formPromise and use bitSubmit
* Use formGroup.invalid instead of !valid
* Move variables related to encrypted exports into base component.
* Migrate to use new userVerificationDialogComponent
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* add showFavicons to domain settings
* replace usages of disableFavicon with showFavicons via the domain settings service and remove/replace settings service
* create migration for disableFavicon
* cleanup
* Added billing account profile state service
* Update usages after removing state service functions
* Added migrator
* Updated bw.ts and main.background.ts
* Removed comment
* Updated state service dependencies to include billing service
* Added missing mv3 factory and updated MainContextMenuHandler
* updated autofill service and tests
* Updated the remaining extensions usages
* Updated desktop
* Removed subjects where they weren't needed
* Refactored billing service to have a single setter to avoid unecessary emissions
* Refactored has premium guard to return an observable
* Renamed services to match ADR
f633f2cdd8/docs/architecture/clients/presentation/angular.md (abstract--default-implementations)
* Updated property names to be a smidgen more descriptive and added jsdocs
* Updated setting of canAccessPremium to automatically update when the underlying observable emits
* Fixed build error after merge conflicts
* Another build error from conflict
* Removed autofill unit test changes from conflict
* Updated login strategy to not set premium field using state service
* Updated CLI to use billing state provider
* Shortened names a bit
* Fixed build
* PM-5263 - Token Service state migration - (1) Got key and state definitions setup (2) Ported over core state service getTimeoutBasedStorageOptions method logic into local determineStorageLocation method (3) Updated majority of methods to use state provider state
* PM-5263 - StateSvc - add TODO to remove timeoutBasedStorageOptions + other state methods after migration code complete.
* PM-5263 - TokenSvc - ClearToken method - (1) Update signature to remove user id as it wasn't used and it simplifies the new state provider implementation (2) Convert away from state svc to state provider state.
* PM-5263 - TokenService - update deps - WIP on circular dep issues.
* PM-5263 - To resolve circular dep issues between VaultTimeoutSettingsSvc and TokenService: (1) For writes, require callers to pass in vault timeout data (2) For reads, we can just check both locations. This approach has 1 less state call than the previous implementation and is safe as long as the clear logic properly works and is executed anytime a user changes their vault timeout action (lock or log out) & vault timeout (numeric value)
* PM-5263 - VaultTimeoutSettingsSvc - Set token calls now updated to include vault timeout info.
* PM-5263 - Update API Service - add state service and look up vault timeout details and pass to token service when setting token info.
* PM-5263 - TokenService - update service dependencies.
* PM-5263 - TokenService - Add new getAccessTokenByUserId method for state service use case.
* PM-5263 - StateSvc - remove migrated methods and try to replace all usages of getAccessToken. WIP
* PM-5263 - TokenSvc Migration - start on migrator
* PM-5263 - (1) TokenSvc - Build new clearAccessTokenByUserId which is required by state service (2) TokenSvc - Update getToken to take an optional userId to handle another state service case (3) Add some documentation to TokenSvc abstraction.
* PM-5263 - StateService - finish updating all calls within the state service which accessed token service state directly with calls to the new token service methods instead.
* PM-5263 - TokenSvc Abstraction - Add more docs
* PM-5263 - TokenSvc abstraction - more doc tweaks
* PM-5263 - Web state service - add new token service dependency.
* PM-5263 - User API Key Login Strategy - Update to pull vault timeout action and vault timeout from state service in order to pass to new token service endpoints for setting API key client id and secret.
* PM-5263 - (1) Remove TokenSvc owned state from account (2) StateSvc - remove account scaffold logic for clearing removed account data. The same functionality will exist in the state provider framework via lifecycle hooks cleaning up this data and users getting initialized with null data by default.
* PM-5263 - Add token service dependency to state service (WIP - desktop deps not working)
* PM-5263 - Update services module on desktop and browser to add token svc dependency
* PM-5263 - API service factory - add state service factory dependency that I missed initially to get browser building.
* PM-5263 - TokenSvc - getToken/setToken/decodeToken --> getAccessToken/setAccessToken/decodeAccessToken
* PM-5263 - TokenSvc State Provider Migrator - WIP - update expected acct type to match actual account
* PM-5263 - TokenService - clearToken renamed to clearTokens
* PM-5263 - CLI - NodeApiService - add state service dep to get CLI building.
* PM-5263 - StateDefinitions - use unique state definition names
* PM-5263 - StateSvc - remove getTimeoutBasedStorageOptions as no longer used.
* PM-5263 - TokenSvc - Add TODO for figuring out how to store tokens in secure storage.
* PM-5263 - StateSvc - remove get/set 2FA token - references migrated later.
* PM-5263 - TODO: figure out if using same key definition names is an issue
* PM-5263 - TokenServiceStateProviderMigrator written
* PM-5263 - TokenServiceStateProviderMigrator - (1) Don't update legacy account if we only added a new state in state provider for 2FA token (2) Use for loop for easier debugging
* PM-5263 - TokenServiceStateProviderMigrator test - WIP - migration testing mostly complete and passing. Rollback logic TODO.
* PM-5263 - TokenServiceStateProviderMigrator - Add rollback logic to restore 2FA token from users to global.
* PM-5263 - TokenServiceStateProviderMigrator - Refactor rollback to only set account once as not necessary to set it every time.
* PM-5263 - TokenServiceStateProviderMigrator tests - test all rollback scenarios
* PM-5263 - Remove TODO as don't need unique key def names as long as state def keys are unique.
* PM-5263 - TokenSvc - update clearAccessTokenByUserId to use proper state provider helper method to set state.
* PM-5263 - Revert accidentally committing settings.json changes.
* PM-5263 - TokenSvc - update all 2FA token methods to require email so we can user specifically scope 2FA tokens while still storing them in global storage.
* PM-5263 - Update all token service 2FA set / get / clear methods to pass in email.
* PM-5263 - JslibServices module - add missed login service to login strategy svc deps.
* PM-5263 - VaultTimeoutSettingsService - setVaultTimeoutOptions - rename token to accesToken for clarity.
* PM-5263 - (1) TokenSvc - remove getAccessTokenByUserId and force consumers to use getAccessToken w/ optional user id to keep interface small (2) TokenSvc - attempt to implement secure storage on platforms that support it for access & refresh token storage (3) StateSvc - replace usage of getAccessTokenByUserId with getAccessToken
* PM-5263 - TokenSvc - add platform utils and secure storage svc deps
* PM-5263 - TODO: figure out what to do with broken migration
* PM-5263 - TODO: update tests in light of latest 2FA token changes.
* PM-5263 - TokenSvc - clean up TODO
* PM-5263 - We should have tests for the token service.
* PM-5263 - TokenSvc - setAccessToken - If platform supports secure storage and we are saving an access token, remove the access token from memory and disk to fully migrate to secure storage.
* PM-5263 - TokenSvc - getAccessToken - Update logic to look at memory and disk first always and secure storage last to support the secure storage migration
* PM-5263 - TokenSvc - setAccesToken - if user id null on a secure storage supporting platform, throw error.
* PM-5263 - TokenService - (1) Refresh token now stored in secure storage (2) Refresh token set now private as we require a user id to store it in secure storage and we can use the setTokens method to enforce always setting the access token and refresh token together in order to extract a user id from the refresh token. (3) setTokens clientIdClientSecret param now optional
* PM-5263 - TokenServiceStateProviderMigrator - update migration to take global but user scoped 2FA token storage changes into account.
* PM-5263 - Remove old migration as it references state we are removing. Bump min version.
Co-authored-by: Matt Gibson <git@mgibson.dev>
* PM-5263 - TokenService - 2FA token methods now backed by global state record which maps email to individual tokens.
* PM-5263 - WIP on Token Svc migrator and test updates based on new 2FA token storage changes.
* PM-5263 - TokenSvc - (1) Add jira tickets to clean up state migration (2) Add state to track secure storage migration to improve # of reads to get data
* PM-5263 - StateDef - consolidate name of token domain state defs per feedback from Justin + update migration tests
* PM-5263 - TokenSvc - fix error message and add TODO
* PM-5263 - Update token service migration + tests to pass after all 2FA token changes.
* PM-5263 - Fix all login strategy tests which were failing due to token state provider changes + the addition of the loginService as a dependency in the base login strategy.
* PM-5263 - Register TokenService state provider migration with migrator
* PM-5263 - TokenSvc state migration - set tokens after initializing account
* PM-5263 - TokenService changes - WIP - convert from ActiveUserStateProvider to just SingleUserStateProvider to avoid future circ dependency issues.
Co-authored-by: Jake Fink <jlf0dev@users.noreply.github.com>
* PM-5263 - TokenSvc - create getSecureStorageOptions for centralizing all logic for getting data out of SecureStorage.
* PM-5263 - TokenSvc - (1) Refactor determineStorageLocation to also determine secure storage - created a TokenStorageLocation string enum to remove magic strings (2) Refactor setAccessToken to use switch (3) Refactor clearAccessTokenByUserId to clear all locations and not early return on secure storage b/c we only use secure storage if disk is the location but I don't want to require vault timeout data for this method.
* PM-5263 - TokenSvc - getDataFromSecureStorage - Refactor to be more generic for easier re-use
* PM-5263 - TokenSvc - Convert refresh token methods to use single user state and require user ids
* PM-5263 - VaultTimeoutSettingsSvc - get user id and pass to access and refresh token methods.
* PM-5263 - TokenSvc - refactor save secure storage logic into private helper.
* PM-5263 - Base Login Strategy - per discussion with Justin, move save of tokens to before account initialization as we can always derive the user id from the access token. This will ensure that the account is initialized with the proper authN status.
* PM-5263 - TokenSvc - latest refactor - update all methods to accept optional userId now as we can read active user id from global state provider without using activeUserStateProvider (thus, avoiding a circular dep and having to have every method accept in a mandatory user id).
* PM-5263 - VaultTimeoutSettingsService - remove user id from token calls
* PM-5263 - TokenSvc - update all places we instantiate token service to properly pass in new deps.
* PM-5263 - TokenSvc migration is now 27th instead of 23rd.
* PM-5263 - Browser - MainContextMenuHandler - Update service options to include PlatformUtilsServiceInitOptions as the TokenService requires that and the TokenService is now injected on the StateService
* PM-5263 - TokenSvc migration test - update rollback tests to start with correct current version
* PM-5263 - Create token service test file - WIP
* PM-5263 - TokenSvc - tests WIP - instantiates working.
* PM-5263 - TokenSvc - set2FAToken - use null coalesce to ensure record is instantiated for new users before setting data on it.
* PM-5263 - TokenService tests - WIP - 2FA token tests.
* PM-5263 - Worked with Justin to resolve desktop circular dependency issue by adding SUPPORTS_SECURE_STORAGE injection token instead of injecting PlatformUtilsService directly into TokenService.
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* PM-5263 - TokenSvc tests - WIP - (1) Update TokenSvc instantiation to use new supportsSecureStorage (2) Test TwoFactorToken methods
* PM-5263 - Fix SUPPORTS_SECURE_STORAGE injection token to properly call supportsSecureStorage message
* PM-5263 - Token state testing
* PM-5263 - TokenState fix name of describe
* PM-5263 - TokenService - export TokenStorageLocation for use in tests.
* PM-5263 - TokenSvc Tests WIP
* PM-5263 - TokenSvc tests - access token logic mostly completed.
* PM-5263 - TokenSvc Tests - more WIP - finish testing access token methods.
* PM-5263 - TokenSvc WIP - another clear access token test.
* PM-5263 - TokenSvc tests - WIP - SetTokens tested.
* PM-5263 - Tweak test name
* PM-5263 - TokenSvc tests - remove unnecessary describe around 2FA token methods.
* PM-5263 - TokenSvc.clearAccessTokenByUserId renamed to just clearAccessToken
* PM-5263 - TokenSvc - refactor clearTokens logic and implement individual clear logic which doesn't require vault timeout setting information.
* PM-5263 - TokenSvc - Replace all places we have vaultTimeout: number with vaultTimeout: number | null to be accurate.
* PM-5263 - TokenSvc.clearTokens - add check for user id; throw if not found
* PM-5263 - TokenService - test clearTokens
* PM-5263 - TokenSvc Tests - setRefreshToken tested
* PM-5263 - TokenSvc tests - getRefreshToken tested + added a new getAccessToken test
* PM-5263 - TokenSvc - ClearRefreshToken scenarios tested.
* PM-5263 - TokenSvc.clearRefreshToken tests - fix copy pasta
* PM-5263 - TokenSvc tests - (1) Fix mistakes in refresh token testing (2) Test setClientId for all scenarios
* PM-5263 - TokenSvc tests - (1) Add some getClientId tests (2) clarify lack of awaits
* PM-5263 - TokenSvc Tests - WIP - getClientId && clearClientId
* PM-5263 - TokenService - getClientSecret - fix error message
* PM-5263 - TokenService tests - test all client secret methods
* PM-5263 - Update TokenSvc migration to 30th migration
* PM-5263 - TokenService - update all tests to initialize data to undefined now that fake state provider supports faking data based on specific key definitions.
* PM-5263 - (1) TokenSvc.decodeAccessToken - update static method's error handling (2) TokenSvc tests - test all decodeAccessToken scenarios
* PM-5263 - TokenSvc - (1) Add DecodedAccessToken type (2) Refactor getTokenExpirationDate logic to use new type and make proper type checks for numbers for exp claim values.
* PM-5263 - TokenSvc tests - test getTokenExpirationDate method.
* PM-5263 - TokenSvc - (1) Update DecodedAccessToken docs (2) Tweak naming in tokenSecondsRemaining
* PM-5263 - TokenSvc abstraction - add jsdoc for tokenSecondsRemaining
* PM-5263 - TokenSvc tests - test tokenSecondsRemaining
* PM-5263 - TokenSvc - DecodedAccessToken type - update sstamp info
* PM-5263 - TokenService - fix flaky tokenSecondsRemaining tests by locking time
* PM-5263 - TokenSvc Tests - Test tokenNeedsRefresh
* PM-5263 - (1) TokenSvc - Refactor getUserId to add extra safety (2) TokenSvc tests - test getUserId
* PM-5263 - (1) TokenSvc - refactor getUserIdFromAccessToken to handle decoding errors (2) TokenSvc tests - test getUserIdFromAccessToken
* PM-5263 - (1) TokenSvc - Refactor getEmail to handle decoding errors + check for specific, expected type (2) TokenSvc tests - test getEmail
* PM-5263 - TokenSvc tests - clean up comment
* PM-5263 - (1) TokenSvc - getEmailVerified - refactor (2) TokenSvc tests - add getEmailVerified tests
* PM-5263 - (1) TokenSvc - refactor getName (2) TokenSvc tests - test getName
* PM-5263 - (1) TokenSvc - refactor getIssuer (2) TokenSvc tests - test getIssuer
* PM-5263 - TokenSvc - remove unnecessary "as type" statements now that we have a decoded access token type
* PM-5263 - (1) TokenSvc - refactor getIsExternal (2) TokenSvc Tests - test getIsExternal
* PM-5263 - TokenSvc abstraction - tune up rest of docs.
* PM-5263 - TokenSvc - clean up promise<any> and replace with promise<void>
* PM-5263 - TokenSvc abstraction - more docs.
* PM-5263 - Clean up TODO as I've tested every method in token svc.
* PM-5263 - (1) Extract JWT decode logic into auth owned utility function out of the token service (2) Update TokenService decode logic to use new utility function (3) Update LastPassDirectImportService + vault.ts to use new utility function and remove token service dependency. (4) Update tests + migrate tests to new utility test file.
* PM-5263 - Rename decodeJwtTokenToJson to decode-jwt-token-to-json to meet lint rules excluding capitals
* PM-5263 - TokenSvc + tests - fix all get methods to return undefined like they did before instead of throwing an error if a user id isn't provided.
* PM-5263 - Services.module - add missing token service dep
* PM-5263 - Update token svc migrations to be 32nd migration
* PM-5263 - Popup - Services.module - Remove token service as it no longer requires a background service due to the migration to state provider. The service definition in jslib-services module is enough.
* PM-5263 - BaseLoginStrategy - Extract email out of getTwoFactorToken method call for easier debugging.
* PM-5263 - Login Comp - Set email into memory on login service so that base login strategy can access user email for looking up 2FA token stored in global state.
* PM-5263 - (1) LoginComp - remove loginSvc.setEmail call as no longer necessary + introduced issues w/ popup and background in browser extension (2) AuthReq & Password login strategies now just pass in email to buildTwoFactor method.
* PM-5263 - SsoLoginSvc + abstraction - Add key definition and get/set methods for saving user email in session storage so it persists across the SSO redirect.
* PM-5263 - Base Login Strategy - BuildTwoFactor - only try to get 2FA token if we have an email to look up their token
* PM-5263 - Remove LoginService dependency from LoginStrategyService
* PM-5263 - (1) Save off user email when they click enterprise SSO on all clients in login comp (2) Retrieve it and pass it into login strategy in SSO comp
* PM-5263 - (1) TokenSvc - update 2FA token methods to be more safe in case user removes record from local storage (2) Add test cases + missing clearTwoFactorToken tests
* PM-5263 - Browser SSO login - save user email for browser SSO process
* PM-5263 - Finish removing login service from login strategy tests.
* PM-5263 - More removals of the login service from the login strategy tests.
* PM-5263 - Main.ts - platformUtilsSvc no longer used in TokenSvc so remove it from desktop main.ts
* PM-5263 - Fix failing login strategy service tests
* PM-5263 - Bump token svc migration values to migration 35 after merging in main
* PM-5263 - Bump token svc migration version
* PM-5263 - TokenService.clearTwoFactorToken - use delete instead of setting values to null per discussion with Justin
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* PM-5263 - TokenSvc + decode JWT token tests - anonymize my information
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* PM-5263 - TokenSvc tests - update clear token tests based on actual deletion
* PM-5263 - Add docs per PR feedback
* PM-5263 - (1) Move ownership of clearing two factor token on rejection from server to base login strategy (2) Each login strategy that supports remember 2FA logic now persists user entered email in its data (3) Base login strategy processTwoFactorResponse now clears 2FA token (4) Updated base login strategy tests to affirm the clearing of the 2FA token
* Update libs/auth/src/common/login-strategies/login.strategy.ts
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* Update libs/auth/src/common/login-strategies/password-login.strategy.ts
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* PM-5263 - Login Strategy - per PR feedback, add jsdoc comments to each method I've touched for this PR.
* PM-5263 - (1) TokenSvc - adjust setTokens, setAccessToken, setRefreshToken, and clearRefreshToken based on PR feedback to remove optional user ids where possible and improve public interface (2) TokenSvc Abstraction - update docs and abstractions based on removed user ids and changed logic (3) TokenSvc tests - update tests to add new test cases, remove no longer relevant ones, and update test names.
* PM-5263 - Bump migrations again
---------
Co-authored-by: Matt Gibson <git@mgibson.dev>
Co-authored-by: Jake Fink <jlf0dev@users.noreply.github.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
* If editing your own member modal, you cannot add new collections or groups
* Update forms to prevent this
* Add helper text
* Delete unused api method
* Require init in i18n service.
this is needed to load translations and set translation locale
* No longer need to cast i18n
* Expose user preferred locale in i18nService
This is for correctly displaying `default` when no locale has been set in preferences components. The `locale$` observable should always resolve to the currently locale currently being translated to.
* create domain settings state provider
* replace callsites for defaultUriMatch and neverDomains with DomainSettingsService equivalents
* replace callsites for equivalentDomains with DomainSettingsService equivalents and clean up unused AccountSettingsSettings
* add migrations for domain settings state
* do not use enum for URI match strategy constants and types
* add getUrlEquivalentDomains test
* PR suggestions/cleanup
* refactor getUrlEquivalentDomains to return an observable
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: ✨ Audrey ✨ <ajensen@bitwarden.com>
* update tests
* add UriMatchStrategy docs notes
* service class renames
* use service abstraction at callsites previously using service class directly
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: ✨ Audrey ✨ <ajensen@bitwarden.com>
* Use state provider to store preferred language
* migrate preferred language
* Use new i18n provider to get LOCAL_ID
* Fix preloaded english i18n
This is a mock service that forces english translations, it doesn't need the i18n interface that allows changing of locales.
* PR improvements
* Fixup merge
* Fix invite member dialog not submitting on enter
updateOn: onBlur is unnecessary with component library forms
and was preventing the form from being submitted without deselecting
the email field
* Simplify name for validator
* Revert "[PM-5277] Migrate Sync Service to State Provider (#7680)"
This reverts commit 78008a9e1e.
Includes a noop migration builder that allows us to bridge over the deleted migration
* Prefer revert migrations to noop
this revert avoids the need to change behavior between released vs unreleased migrations and keeps some dangerous code out of the repo :success:
* Update ordering of badge settings migrator to be consistent with `rc`, which was cut with only up to version 25
* Fix missing type import
* Sent initiation path for organization and user signups
* Rename organizationQueryParameter > organizationTypeQueryParameter
* Jared's feedback
* Split PM & SM initiation path
* create auth request service
* copy methods from auth crypto service
* register new auth request service
* remove refs to auth request crypto service
* remove auth request crypto service
* remove passwordless login method from login strategy service
* add docs to auth request service
* [AC-2195] Update canEditAnyCipher permission to make an exception for Custom users with editAnyCollection permission
* [AC-2195] Update V1 FC flag check to include check for an organization's FC status
* [AC-2195] Remove redundant collection management setting check that was hiding the restricted access message for custom users with deleteAnyCollection
* [AC-2195] Ensure users with canEditAnyCollections can edit all collections
* WIP admin console layout
* Update icons
* Migrate more things
* Migrate the last pages
* Move header to web
* Fix story not working
* Convert header component to standalone
* Migrate org layout to standalone
* Enable org switcher
* Add AC to product switcher
* Migrate provider portal to vertical nav
* Migrate PM
* Prettier fixes
* Change AC and PP to use secondary variant layout & update logos
* Remove full width setting
* Remove commented code
* Add header to report pages
* Add provider portal banner
* Fix banner for billing pages
* Move vault title to header
* Prevent scrollbar jumping
* Move send button to header
* Replace search input with bit-search
* Remove unused files and css
* Add banner
* Tweak storage option
* Fix duplicate nav item after merge
* Migrate banner state to state provider framework
* [AC-2078] Fix device approvals header
* [PM-5861] Hide AC from product switcher for users that do not have access
* [PM-5860] Fix Vault and Send page headers
* [AC-2075] Fix missing link on reporting nav group
* [AC-2079] Hide Payment Method and Billing History pages for self-hosted instances
* [AC-2090] Hide reports/event log nav items for users that do not have permission
* [AC-2092] Fix missing provider portal option in product switcher on page load
* Add null check for organization in org layout component
* [AC-2094] Fix missing page header for new client orgs page
* [AC-2093] Update New client button styling
* Fix failing test after merge
* [PM-2087] Use disk-local for web layout banner
* [PM-6041] Update banner copy to read "web app"
* [PM-6094] Update banner link to marketing URL
* [PM-6114] add CL container component to VVR pages (#7802)
* create bit-container component
* add container to all page components
* Fix linting errors after merge with main
* Fix product switcher stories
* Fix web-header stories
* mock org state properly in product switcher stories (#7956)
* refactor: move web layout migration banner logic into a service (#7958)
* make CL codeowner of web header files
* move migration banner logic to service; update stories
* [PM-5862] Ensure a sync has run before hiding navigation links
* Remove leftover banner global state
* Re-add dropped selfHosted ngIf
* Add rel noreferrer
* Remove comment
---------
Co-authored-by: Shane Melton <smelton@bitwarden.com>
Co-authored-by: Will Martin <contact@willmartian.com>
* Fix nextMock arguments
* Add state for biometric prompts
* Use biometric state for prompts
* Migrate biometric prompt data
* wire up biometric state to logouts
* Add migrator to migrate list
* Remove usages of prompt automatically
Explicitly list non-nulled state as intentional
* `npm run prettier` 🤖
* Fix web lock component
* [AC-2193] Hide collection access restricted state when there are visible sub-collections
* [AC-2193] Undo change to showCollectionAccessRestricted
* [AC-2193] Update not items and access restricted views to only show if there are both no collections or items available
* update collection service to use new state provider framework, remove stateservice from collection service, update collections state provider with migrate file and unit test
* enable duo for desktop
* added missing return path in main.ts
* updated logic in component
* removed switch added await; updated logic in main.
* addressed subscription concerns in main; updated formatting in 2fa component
* Update Duo case in locales
* Create MigrationRunner
- Create MigrationRunner Service for running migrations in StateService
- Create web override so that migrations also run against `localStorage`
* Fix Web StateService
* Fix WebMigrationRunner
* Fix CLI
* Fix ElectronStateService
* Update Comment
* More Common Scenarios
* Move libs/exporter into libs/tools/*
Migrating all files from libs/exporter over to libs/tools/export/vault-export/vault-export-core
Rename package to vault-export-core
Fix all file paths
* Update libs and tsconfig imports
* Fix client imports
* Fix eslint, jest and package-lock.json
* Update CODEOWNERS
* Add README.md to whitelist-capital-letters
* Fix vault-export-service tests not running
* Update libs/tools/export/vault-export/README.md
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
* Fix types imports
* Export types from vault-export-core
* Fixed content of README
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
* Removed passwordless-login feature flag
* Removed conditional on login component.
* Added back reference accidentally deleted.
* Fixed initialization of the service in tests.
* Removed unused private variable.
* Updated DI to remove configService
* Undid changes to workspace file.
* Undid all changes to workspace file
* Undid merge changes to collection dialog
* Linting
* [AC-1124] Add getManyFromApiForOrganization to cipher.service.ts
* [AC-1124] Use getManyFromApiForOrganization when a user does not have access to all ciphers
* [AC-1124] Vault changes
- Show new collection access restricted view
- Include unassigned ciphers for restricted admins
- Restrict collections when creating/cloning/editing ciphers
* [AC-1124] Update edit cipher on page navigation to check if user can access the cipher
* [AC-1124] Hide ciphers from restricted collections
* [AC-1124] Ensure providers are not shown collection access restricted view
* [AC-1124] Modify add-edit component to call the correct endpoint when a restricted admin attempts to add-edit a cipher
* [AC-1124] Fix bug after merge with main
* [AC-1124] Use private this._organization
* [AC-1124] Fix broken builds
* create sso service
* rename sso service to sso-login service
* rename service
* add references to sso login service and update state calls
* fix browser
* fix desktop
* return promises
* remove sso state from account and global objects
* more descriptive org sso identifier method names
* fix sso tests
* fix tests