* 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
* Begin migration of autofill settings
Co-authored-by: Cesar Gonzalez <cagonzalezcs@users.noreply.github.com>
Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com>
Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com>
Co-authored-by: Colton Hurst <coltonhurst@users.noreply.github.com>
* add browser dependency for AutofillSettingsService
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* update autofill settings service
* replace usages of stateService get/set autofillOnPageLoad with autofillSettingsService
* replace usages of stateService get/set autofillOnPageLoadDefault with autofillSettingsService
* replace usages of stateService get/set autoCopyTotp with autofillSettingsService
* replace usages of stateService get/set autoFillOnPageLoadCalloutIsDismissed with autofillSettingsService
* replace usages of stateService get/set activateAutoFillOnPageLoadFromPolicy with autofillSettingsService
* replace usages of get/set autoFillOverlayVisibility with autofillSettingsService
* inlineMenuVisibility should use global state
* add the AutofillSettingsService to background scripts
* fix typing
* replace additional usages of get/set autoFillOverlayVisibility and disableAutoTotpCopy with autofillSettingsService equivalents
* replace additional usages of get/set autofillOnPageLoadDefault with autofillSettingsService equivalent
* replace additional usages of get/set activateAutoFillOnPageLoadFromPolicy with autofillSettingsService equivalent
* remove additional deprecated and unused state service calls
* improve naming conventions and consistency
* fix missing mock for policy service test
* replace missing overlay background tests
* cleanup
* fix double inversion
* fix reference to wrong setter
* move handleActivateAutofillPolicy out of BrowserPolicyService
* create state migration script
* resolve linting issues
* remove migrated setting properties
* add AutofillSettingsSErvice to jslib-services
* handle conditional content script loading via autofillOnPageLoad check
* add deprecated note to getFromLocalStorage
* add jsdoc decorators to new autofill service methods
* handle undefined globalState
* move autofill settings out of BrowserPolicyService
* Move autofill settings code out of policyService
* fix tests
* fix typo in state definition
---------
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Cesar Gonzalez <cagonzalezcs@users.noreply.github.com>
Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com>
Co-authored-by: Colton Hurst <coltonhurst@users.noreply.github.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
* Added missing get$ method on SendService
* Added distinctUntilChanged to the get$ method and added more tests
* Added more validations and tests to get$
* Added some more test cases to get$
* Refactored test cases from get$
* Change passphrase generator's default wordSeparator to the empty string ''
* Create DefaultPassphraseGenerationOptions
* Use DefaultPassphraseGenerationOptions.wordSeparator in passphrase generation
* Add `empty` separator option to passphrase generator CLI and an example
* Change DefaultPassphraseGenerationOptions numWords to 3
* Use `DefaultPassphraseGenerationOptions.numWords` in CLI passphrase gen
* [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
* Disable node integration and enable context isolation
* Review comments
* Log in renderer through IPC
* Missed imports
* Mock electron API
* resourcesPath is undefined in the preload, but process.windowsStore works correctly
* Replace fromBufferToUtf8 conditional implementation for the `buffer` package
The current non-node implementation is different than the node implementation,
as the non-node would break when the contents can't be parsed as a URI component.
Replacing the impl by the `buffer` package makes the result match in both environments.
* Fix lint
* Add some more tests
* Remove buffer from devDependencies
* Wire up key definitions for OrganizationService
[`AC-2009`: Transition OrganizationService to use StateProvider](
https://bitwarden.atlassian.net/browse/AC-2009)
In order to support the new `StateProvider` APIs for managing
application state this commit modifies `OrganizationService` in the following
ways:
1. Adding a `KeyDefinition` object to `OrganizationService` to store the
`organization` record in `StateProvider`.
1. Injecting `StateProvider` and wiring up `OrganizationService` to read
from the `organizations` key definition for the active user account.
1. Expanding the capabilities of `OrganizationData` to be able to read
itself from a JSON string. Previously this was handled directly by
`StateService`.
1. Updating tests to include requirements for testing against
`StateProvider`.
1. Marking the existing `StateService`-backed `organizations`
`Observable` and `BehaviorSubject` as deprecated.
This is largely unimplemented code with no intended visible effects to
the system. Implementing getting & updating the `organizations` value
from `StateProvider` will the next step in this work.
* Rework null check on OrganizationData
* Remove deprecation signals for the time being
* Move key definition inline with its service
* Create date objects when deserialzing json from state
* added state definition and key definition
* created vault settings service
* created enable passkeys migrations
* created enable passkeys migrations
* renamed the state definition
* created vault settings service
* updated enable passkey key definition
* updated references with vault settings service
* renamed files to avoid conflict
* removed set and get enable passkeys from state service
* removed comment
* fixed comments
* added readonly keyword
* removed service registartion from service module
* removed readonly keyword from abstract class
* swicted to used optional chaining
* renamed files
* added disk-local argument for web
* [PM-5277] Introduce lastSync state via State Providers
* [PM-5277] Add migrator and tests
* [PM-5277] Use memory for web storage location
* [PM-5277] Remove lastSync methods from state service
* [PM-5277] Remove lastSync from AccountProfile
* [PM-5277] Use string instead of Date to fix serialization for chrome.storage API in Browser
* [PM-5277] Only set account if lastSync was deleted during migration
* [PM-5277] Fix spec file
* added state definitionand key definition for folder service
* added data migrations
* created folder to house key definitions
* deleted browser-folder-service and added state provider to the browser
* exposed decrypt function so it can be used by the key definition, updated folder service to use state provider
* removed memory since derived state is now used
* updated test cases
* updated test cases
* updated migrations after merge conflict fix
* added state provider to the folder service constructor
* renamed migration file
* updated comments
* updated comments
* removed service registartion from browser service module and removed unused set and get encrypted folders from state service
* renamed files
* added storage location overides and removed extra methods
* refactor login strategies into own service
* create login service factory
* replaces instances of authService with loginStrategyService
* replace more instances of authService
* move logout back to auth service
* add browser dependencies
* fix desktop dependencies
* fix cli dependencies
* fix lint and test files
* fix anonymous hub deps
* fix webauthn-login service deps
* add loginstrategyservice to bg
* move login strategy service and models to auth folder
* revert changes to tsconfig
* use alias for imports
* fix path
---------
Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>
* Create state for biometric client key halves
* Move enc string util to central utils
* Provide biometric state through service
* Use biometric state to track client key half
* Create migration for client key half
* Ensure client key half is removed on logout
* Remove account data for client key half
* Remove unnecessary key definition likes
* Remove moved state from account
* Fix null-conditional operator failure
* Simplify migration
* Remove lame test
* Fix test type
* Add migrator
* Prefer userKey when legacy not needed
* Fix tests
* Provide RSA encryption in encrypt service
* Define state for provider keys
* Require cryptoService
This is temporary until cryptoService has an observable active user private key. We don't want promise-based values in derive functions
* Update crypto service provider keys to observables
* Remove provider keys from state service
* Migrate provider keys out of state account object
* Correct Provider key state types
* Prefix migration with current version number
* PM-5638 Bumped up msv for IVIE
* Updated version to 2024.2.0 for next release.
---------
Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
* Got trial page working without the form set up
* Set up the form to create SM subscription
* Add free SM trial page and sign up
* Conner's changes
* fixed imports
* Set isFromSecretsManagerTrial
* Fixed OrgKey location
* Add isFromSecretsManager prop to free org create
* Add LTO callout
* Switch LTO to background box
* Defect: AC-2081
* Fixed typo "Secrets Manger" to "Secrets Manager"
* Removed discount price logic for storage and secrets manager prices since they don't apply
---------
Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
* Added logic to only return organisations where user has import permissions and collections that he manages on Import
* Changed the UnassignedCollections validation logic
* Added validation to check if the user is coming from AdminConsole on the import component
* Added import collection service abstraction to allow get admin collections
* Corrected feature flag reads on import component
* Refactor import component methods ngOnInit and performImport to improve codescene
Using FeatureFlag Observable
* Modified validation to allow import if user has organizations to import into
* Using the new organization flexiblecollections property on import
* Created collection-admin-import.service to return all the org collections to the import on Admin Console
* Small changes on import flexible collections
* Fix linting issues
* changed canAccessImport rules and deprecated canAccessImportExport
* Validating if user canAccessImportExport instead of admin before calling the handleOrganizationImportInit.
* AC-2095 - Corrected getAllAdminCollections from ImportCollectionAdminService to properly get all the collections on AdminConsole
* Reverting AC-2095
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* PM-5242 - First working draft of copying out web CL implementation of user verification form and dialog components into standalone libs/auth components which could be used in any client.
* PM-5242 - Rename UserVerificationFormComponent to UserVerificationFormInputComponent b/c it doesn't actually have a form and is meant to slot into a form as an input.
* PM-5242 - Update libs/auth angular index to take renamed component into account
* PM-5242 - Clean up UserVerificationDialogComponent as have much cleaner design approach now (maintain existing func while simply adding new requirements for client side validation for passkeys)
* PM-5242 - UserVerificationFormInput component - WIP draft of new client and server split of user verification logic
* PM-5242 - UserVerificationFormInput - WIP - Lots of progress on client side verification layout - more to do
* PM-5242 - UserVerificationFormInputComponent - Add hasMultipleVerificationMethods property so we can only show alternate methods if user has them.
* PM-5242 - UserVerificationFormInputComponent - rename hasMultipleVerificationMethods to hasMultipleClientVerificationOptions
* PM-5242 - Add new user verification biometrics fingerprint icon with proper secondary fill so it displays properly on all themes.
* PM-5242 - Create enum for tracking client user verification states
* PM-5242 - UserVerificationFormInputComponent - WIP - (1) Got biometrics layout working except for error state (2) Emitting active client verification option and biometrics result to dialog (3) Properly identifying if biometrics is enabled in a platform agnostic way (4) Translations TODO
* PM-5242 - UserVerificationDialogComponent - (1) Wire up new inputs and outputs for UserVerificationFormInput (2) Don't show submit button when clientside biometrics verification active
* PM-5242 - UserVerificationFormInputComponent - wired up biometrics failure and retry handling + re-arranged comp properties to put inputs & outputs at the top
* PM-5242 - UserVerificationFormInput component - Add logic to prevent currently active client verification method from being shown an option
* PM-5242 - UserVerificationFormInput - adjust margins
* PM-5242 - User verification dialog and form input comps - replace Verification with VerificationWithSecret type where applicable
* PM-5242 - UserVerificationFormComp - Default to server for backwards compatibility and to avoid requiring the input at all
* PM-5242 - UserVerificationFormInputComp - (1) Rename processChanges to processSecretChanges (2) Short circuit processSecretChanges when biometrics is active (3) Add new function for determining type of verification that has a secret.
* PM-5242 - UserVerificationDialog - Support custom, optional callout in dialog body.
* PM-5242 - UserVerificationDialogComp - support custom confirm button text and type.
* PM-5242 - UserVerificationDialog - Add user verification dialog result type to allow for handling all possible verification scenarios
* PM-5242 - UserVerificationFormInputComp - tweak comment
* PM-5242 - UserVerificationFormInput comp html - add placeholder text for no client verifications found scenario
* PM-5242 - UserVerificationDialogComponent - (1) Add confirm & cancel to dialog result (2) Add cancel method vs using bitDialogClose for specificity (3) Adjust naming of output property to properly specify that it is scoped to client verification (4) Adjust layout of dialog html to handle when no client side verification methods are found.
* PM-5242 - UserVerificationFormInput - Clean up test code
* PM-5242 - UserVerificationFormInput - For server verification, we don't need to check if the user has a local master key hash as we will generate a hash to send to the server for comparison.
* PM-5242 - UserVerificationFormInput html - Remove now unnecessary dev warning as I've provided a default
* PM-5242 - UserVerification Dialog & Form Input - add translations on all clients for all visible text.
* PM-5242 - UserVerificationFormInput html - remove no active client verification handling from form input comp as it is instead emitted upwards to parent dialog component to be handled there.
* PM-5242 - UserVerificationDialogComp - (1) Make UserVerificationDialogResult.noAvailableClientVerificationMethods optional because it isn't needed in cancel flows (thanks Will) (2) Modify static open to intercept closed observable event in order to always return a UserVerificationDialogResult as BitDialog returns empty string when the user clicks the x
* PM-5242 - UserVerificationDialogComp - Simplify dialog param names to remove redundant dialog
* PM-5242 - UserVerificationDialogParams - update comments to match new names
* PM-5242 - UserVerificationDialog Storybook - WIP first draft
* PM-5242 - UserVerificationDialogStoryComponent - WIP - try out having imports the same as the standalone component
* PM-5242 - UserVerificationDialogStoryComponent - more WIP - building now - some stuff displaying
* PM-5242 - UserVerificationDialogStoryComponent - some progress on providers setup
* PM-5242 - Not going to use storybook for user verification dialog
* PM-5242 - UserVerificationDialogComp - move types into own file + add docs
* PM-5242 - Update auth index to export user-verification-dialog.types
* PM-5242 - UserVerificationFormInput & UserVerificationService - Extract out getAvailableVerificationOptions logic into service
* PM-5242 -UserVerificationDialogComponent - Update close logic to handle escape key undefined scenario
* PM-5242 - UserVerificationFormInput - add getInvalidSecretErrorMessage for properly determining invalid secret translation
* PM-5242 - UserVerificationDialogComp - Refactor submit logic to handle different return methodologies in existing MP and OTP user verification service code vs new PIN flow (e.g., throwing an error instead of returning false)
* PM-5242 - PinCryptoService - change error logs to warnings per discussion with Justin
* PM-5242 - UserVerificationFormInput - Biometrics flow on desktop - remove accidentally added period in couldNotCompleteBiometrics translation key.
* PM-5242 - UserVerificationFormInput HTML - Re-arrange order of other client verification options to match design
* PM-5242 - UserVerificationFormInputComponent - Reset inputs as untouched on change of client verification method.
* PM-5242 - UserVerificationDialogComponent - Remove TODO as existing secret change logic turns invalidSecret false when biometrics is swapped to.
* PM-5242 - UserVerificationFormInputComponent - getInvalidSecretErrorMessage - fix PIN error message not being returned.
* PM-5242 - UserVerificationDialogComponent - Add documentation and examples to open method.
* PM-5242 - UserVerificationDialogComponent - tweak open docs
* PM-5242 - Remove accidental period from translation keys on browser & web
* PM-5242 - UserVerificationFormInputComponent - OTP flow needed button module to work
* PM-5242 - UserVerificationDialogParams - Add docs explaining that noAvailableClientVerificationMethods is only for desktop & browser.
* PM-5242 - User-verification-form-input - Adjust layout to meet new design requirements - (1) On load, send OTP without user clicking a button (2) Allow resending of the codes (3) show a code sent message for 3 seconds
* PM-5242 - Browser User Verification - Instantiate PinCryptoService and UserVerification service AFTER instantiating vaultTimeoutSettingsService so that it isn't undefined at run time.
* PM-5242 - JslibServices Module - UserVerificationService - add missing PlatformUtilsServiceAbstraction dependency.
* PM-5242 - Desktop Native Messaging Service - Wrap biometric getUserKeyFromStorage call in try catch because it throws an error if the user cancels the biometrics prompt and doesn't send a response to the browser extension when using the biometrics unlock bridge to the desktop app and OS.
* PM-5242 - Browser Extension - NativeMessagingBackground - if the desktop biometricUnlock command is executed with a canceled (not adjusting misspelling to keep side effects at a min) response, don't bother continuing.
* PM-5242 - BrowserCryptoService - When retrieving the user key via desktop biometrics, return null for user key if the user fails or cancels the biometrics prompt. Otherwise, if there is a user key in memory after unlock, biometrics user verification will always just return the user key from state regardless of if the user has successfully passed the biometrics prompt or not.
* PM-5242 - BrowserCryptoService - extra comments
* PM-5242 - Clean up translations - (1) Remove unused defaultUserVerificationDialogConfirmBtnText (2) Refactor name of defaultUserVerificationDialogTitle to just be verificationRequired which matches existing naming conventions.
* PM-5242 - CLI - fix order of service instantiations to ensure that vaultTimeoutSettingsService isn't undefined for PinCryptoService and UserVerificationService
* PM-5242 - Rename UserVerificationDialogParams to UserVerificationDialogOptions to match existing naming conventions of other CL comps.
* PM-5242 - UserVerificationDialogComponent - dialogParams renamed to dialogOptions
* PM-5242 - UserVerificationService Abstraction - Per PR feedback, use keyof for verificationType
* PM-5242 - UserVerificationBiometricsIcon - Per PR feedback, use https://jakearchibald.github.io/svgomg/ to optimize SVG by 50%.
* PM-5242 - Per PR feedback, clarify UserVerificationDialogOptions.clientSideOnlyVerification comment.
* PM-5242 - UserVerificationTypes - Add comments clarifying all text passed to the UserVerificationDialog are translation keys
* PM-5242 - UserVerificationDialogComp - fix extra new line per PR feedback
* PM-5242 - UserVerificationDialogTypes - per PR feedback and discussion with Will M., export ButtonType from CL so we (and consumers of the dialog) can properly import it via standard CL import.
* PM-5242 - BrowserCryptoService - Adjust comments per PR feedback.
* PM-5242 - UserVerificationDialogComponent - make ActiveClientVerificationOption readonly as it only for component html
* PM-5242 - UserVerificationDialogComp html - finish comment
* PM-5242 - BrowserCryptoService - add returns js doc per PR feedback.
* PM-5242 - UserVerificationDialogComponent - per PR feedback, add unexpected error toast.
* PM-5242 - UserVerificationService - getAvailableVerificationOptions - update params to use keyof like abstraction
* PM-5242 - Mark all existing client specific implemetations of user verification as deprecated.
* Add `disk-local` option for web
* Fix `web` DI
* Update libs/common/src/platform/state/state-definition.ts
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
* Rely On Default Implementation for Most of Cache Key
---------
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>