1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-18 02:41:15 +02:00
Commit Graph

847 Commits

Author SHA1 Message Date
Cesar Gonzalez
541d0cecf8
[PM-6426] Implementing jest tests for the BrowserTaskSchedulerService 2024-04-01 17:01:08 -05:00
Cesar Gonzalez
7e6d76e50c
[PM-6426] Changing the name of the state definition for the TaskScheduler 2024-04-01 16:07:19 -05:00
Cesar Gonzalez
338042b0e4
[PM-6426] Adding jest tests for added BrowserApi methods 2024-04-01 15:57:25 -05:00
Cesar Gonzalez
c365de4747
[PM-6426] Fixing dependency references in services.module.ts 2024-04-01 15:35:41 -05:00
Cesar Gonzalez
ada03c656d
[PM-6426] Renaming the scheduleNextSync alarm name 2024-04-01 15:27:38 -05:00
Cesar Gonzalez
daa8916ad6
[PM-6426] Setting up the full sync process as an interval rather than a timeout 2024-04-01 15:24:47 -05:00
Cesar Gonzalez
83cb105b49
[PM-6426] Merging main into branch 2024-04-01 15:18:50 -05:00
Cesar Gonzalez
ef1388e531
[PM-6426] Updating jest tests for GeneratePasswordToClipboardCommand 2024-04-01 15:17:29 -05:00
Jared Snider
c202c93378
Auth/PM-5268 - DeviceTrustCryptoService state provider migration (#7882)
* 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
2024-04-01 16:02:58 -04:00
Matt Gibson
136226b6be
Observable auth statuses (#8537)
* Observable has token

* Allow access to user key state observable

* Create observable auth status

* Fix DI
2024-04-01 19:15:54 +00:00
Cesar Gonzalez
2ebce58f28
[PM-6426] Implementing eventUploadInterval using TaskScheduler 2024-04-01 12:12:04 -05:00
Cesar Gonzalez
752df0612d
[PM-6426] Implementing sessionTimeout for LoginStrategyService using TaskSchedulerService 2024-04-01 12:08:16 -05:00
Cesar Gonzalez
1965d0e048
[PM-6426] Implementing reconnect timer timeout for NotificationService using the TaskSchedulerService 2024-04-01 12:02:28 -05:00
Cesar Gonzalez
f60a37fe2c
[PM-6426] Implementing abortTimeout for Fido2ClientService using TaskSchedulerService 2024-04-01 11:56:35 -05:00
Cesar Gonzalez
2f517336db
[PM-6426] Implementing clear clipboard call on generatePasswordToClipboard with the TaskSchedulerService 2024-04-01 11:45:16 -05:00
Cesar Gonzalez
d989dc3804
[PM-6426] Fixing race condition with setting/unsetting active alarms 2024-04-01 11:18:09 -05:00
Cesar Gonzalez
0444489053
[PM-6426] Implementing systemClearClipboard using TaskScheduler 2024-04-01 10:13:47 -05:00
Cesar Gonzalez
b165849cd9
[PM-6426] Implementing nextSync timeout using TaskScheduler 2024-04-01 09:43:17 -05:00
Cesar Gonzalez
66ebdc04c8
[PM-6426] Create TaskSchedulerService and update usage of long lived timeouts 2024-04-01 09:28:19 -05:00
rr-bw
2e51d96416
[PM-5264] Implement StateProvider in LoginEmailService (#7662)
* setup StateProvider in LoginService

* replace implementations

* replace implementation

* remove stateService

* change storage location for web to 'disk-local'

* implement migrate() method of Migrator

* add RememberedEmailMigrator to migrate.ts

* add rollback

* add tests

* replace implementation

* replace implementation

* add StateProvider to Desktop services

* rename LoginService to RememberEmailService

* update state definition

* rename file

* rename to storedEmail

* rename service to EmailService to avoid confusion

* add jsdocs

* refactor login.component.ts

* fix typos

* fix test

* rename to LoginEmailService

* update factory

* more renaming

* remove duplicate logic and rename method

* convert storedEmail to observable

* refactor to remove setStoredEmail() method

* move service to libs/auth/common

* address floating promises

* remove comment

* remove unnecessary deps in service registration
2024-03-30 11:00:27 -07:00
Cesar Gonzalez
77cfa8a5ad
[PM-7128] Fix cached form fields not showing the inline menu after their visibility is changed using CSS (#8509) 2024-03-29 19:08:46 +00:00
Cesar Gonzalez
670f33daa8
[PM-5743] Implement eslint rule for usage of window object in background script (#7849)
* [PM-5742] Rework Usage of Extension APIs that Cannot be Called with the Background Service Worker

* [PM-5742] Implementing jest tests for the updated BrowserApi methods

* [PM-5742] Implementing jest tests to validate logic within added API calls

* [PM-5742] Implementing jest tests to validate logic within added API calls

* [PM-5742] Fixing broken Jest tests

* [PM-5742] Fixing linter error

* [PM-5887] Refactor WebCryptoFunction to Remove Usage of the window Object in the Background Script

* [PM-5878] Rework `window` call within OverlayBackground to function within AutofillOverlayIframe service

* [PM-6122] Rework `window` call within NotificationBackground to function within content script

* [PM-5881] Adjust usage of the `chrome.extension.getViews` API to ensure expected behavior in manifest v3

* [PM-5881] Reworking how we handle early returns from `reloadOpenWindows`

* [PM-5881] Implementing jest test to validate changes within BrowserApi.reloadOpenWindows

* [PM-5743] Implement eslint rule to impeede usage of the `window` object in the background script

* [PM-5743] Working through fixing eslint rule errors, and setting up ignore statements for lines that will be refactored at a later date

* [PM-5743] Fixing broken jest tests

* [PM-5879] Removing `backgroundWindow` reference used for determing system theme preference in Safari

* [PM-5879] Removing `backgroundWindow` reference used for determing system theme preference in Safari

* [PM-5743] Updating references to NodeJS.Timeout

* [PM-5743] Adding notification bar and overaly content scripts to the eslint excluded files key

* [PM-5743] Adding other excluded files from the eslint rule

* [PM-5743] Reworking implementation to have the .eslintrc.json file present within the browser subdirectory
2024-03-29 15:55:23 +00:00
github-actions[bot]
9d1219bda6
Autosync the updated translations (#8541)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-03-29 15:54:20 +00:00
SmithThe4th
3a830789ba
[PM-5884] Allow deletion of passkey from edit view - clients (#8500)
* 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
2024-03-29 10:06:50 -04:00
Ike
3d19e3489c
[PM-5269] Key Connector state migration (#8327)
* key connector migration initial

* migrator complete

* fix dependencies

* finalized tests

* fix deps and sync main

* clean up definition file

* fixing tests

* fixed tests

* fixing CLI, Browser, Desktop builds

* fixed factory options

* reverting exports

* implemented UserKeyDefinition clearOn

* Update KeyConnector MIgration

* updated migrator and tests to match profile object

* removed unused service and updated clear

* dep fix

* dep fixes

* clear usesKeyConnector on logout
2024-03-28 12:50:24 -04:00
Jake Fink
bd6b3266d4
move auth request notification to service (#8451)
- cleanup hanging promises
2024-03-28 09:34:21 -04:00
github-actions[bot]
0fbe64e5b9
Autosync the updated translations (#8526)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-03-28 11:06:01 +00:00
Thomas Rittson
b3b344866e
[AC-2278] [AC-2296] Use SafeProvider in browser services module (#8418) 2024-03-28 08:28:51 +10:00
Matt Gibson
62ad39e697
Ps/pm 5965/better config polling (#8325)
* 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
2024-03-27 10:03:09 -07:00
Daniel James Smith
64d6f6fef3
Move export.component from @bitwarden/angular to @bitwarden/vault-export-ui (#8514)
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>
2024-03-27 17:02:56 +00:00
Tom
e98d29d2c8
[PM-5593] Removing BrowserSendService from services (#8512)
* Removing send service from services, removed browser send, and pointed to send services

* Make linter happy

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-03-27 12:34:15 -04:00
Jared Snider
a66e224d32
Auth/PM-7072 - Token Service - Access Token Secure Storage Refactor (#8412)
* PM-5263 - TokenSvc - WIP on access token secure storage refactor

* PM-5263 - Add key generation svc to token svc.

* PM-5263 - TokenSvc - more progress on encrypt access token work.

* PM-5263 - TokenSvc TODO cleanup

* PM-5263 - TokenSvc - rename

* PM-5263 - TokenSvc - decryptAccess token must return null as that is a valid case.

* PM-5263 - Add EncryptSvc dep to TokenSvc

* PM-5263 - Add secure storage to token service

* PM-5263 - TokenSvc - (1) Finish implementing accessTokenKey stored in secure storage + encrypted access token stored on disk  (2) Remove no longer necessary migration flag as the presence of the accessTokenKey now serves the same purpose.

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

* PM-5263 - TokenSvc - (1) Tweak return structure of decryptAccessToken to be more debuggable (2) Add TODO to add more error handling.

* PM-5263 - TODO: update tests

* PM-5263 - add temp logs

* PM-5263 - TokenSvc - remove logs now that I don't need them.

* fix tests for access token

* PM-5263 - TokenSvc test cleanup - small tweaks / cleanup

* PM-5263 - TokenService - per PR feedback from Justin - add error message to error message if possible.

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

---------

Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-03-26 18:41:14 -04:00
Justin Baur
f7014a973c
[PM-7071] Fallback to Emitting null When No Active User (#8486)
* Fallback to Emitting `null` When No Active User

* Fix Tests

* Update Test Names to Follow Convention

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

* Fix CLI Build

---------

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
2024-03-26 12:06:33 -04:00
Jake Fink
a46767dee2
add auth status to auth service (#8377)
* add auth status to auth service

* fix auth service factory
2024-03-26 13:56:20 +00:00
Bitwarden DevOps
bc9a888116
Bumped browser,cli,desktop,web version to 2024.3.1 (#8467) 2024-03-25 14:18:17 +00:00
github-actions[bot]
87c933acc8
Autosync the updated translations (#8461)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-03-25 10:24:34 +00:00
Daniel James Smith
eea4d5407d
Add the missing languages to the translation.service (#8459)
This enables it being shown as anm option with the language selector on the individual clients

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-03-25 11:12:32 +01:00
Will Martin
2a6f212003
[PM-4406] fix select overlay visibility when popup is zoomed (#8442) 2024-03-22 19:36:09 -04:00
Cesar Gonzalez
905d177873
[PM-4791] Injected content scripts prevent proper XML file display and disrupt XML responses (#8214)
* [PM-4791] Injected content scripts prevent proper XML file display and disrupt XML responses

* [PM-4791] Adjsuting reference for Fido2 script injection to ensure it only triggers on https protocol types
2024-03-22 13:45:33 -05:00
Will Martin
78e8f9c587
exclude bit-dialog from global header styles (#8441) 2024-03-22 13:43:02 -04:00
github-actions[bot]
468257d22a
Autosync the updated translations (#8437)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2024-03-22 09:24:58 +00:00
Cesar Gonzalez
19c97fb796
[PM-6948] Fix race condition that breaks autofill within the current tab component (#8393) 2024-03-21 18:40:37 +00:00
Cesar Gonzalez
b9f9ad029f
[PM-6921] Optimize methodology for storing page details within inline menu background processes (#8385)
* [PM-6921] Optimize methodology for storing page details within inline menu background processes

* [PM-6921] Incorporating method for ensuring that we clear the Map datastructure when the page details are being removed

* [PM-6921] Adjusting method to ensure that page details always remain up to date for when processed
2024-03-21 17:41:26 +00:00
Oscar Hinton
e767295c86
[PM-5979] Refactor EnvironmentService (#8040)
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.
2024-03-21 09:09:44 -07:00
Jason Ng
8fd76eaf9c
[AC-2161] update cipher collections org vault modal (#8027)
* 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
2024-03-21 11:54:31 -04:00
Daniel James Smith
e80ee2ec55
[PM-6195] Refactor injection of services in browser services module (#8405)
* Remove PasswordStrengthService from popup/services.module

* Remove ImportService from popup/services.module

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-03-21 11:30:01 +00:00
Jake Fink
2111b37c32
[PM-5404, PM-3518] Migrate user decryption options to new service (#7344)
* 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
2024-03-21 00:33:57 +00:00
Daniel James Smith
c6327d7f12
[PM-6780][PM-6781] Create vault-export-ui package / Migrate export-scope-callout.component to CL (#8318)
* 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>
2024-03-20 22:11:57 +00:00
Todd Martin
4a3e556bbc
[PM-4802] Update 2FA recovery link to use the webVaultUrl from environment service (#8020)
* Updated the link to use the webVaultUrl from environment service

* Updated desktop component.
2024-03-20 00:22:46 +00:00
Cesar Gonzalez
3953318c28
[PM-6546] Fix issue with blurring of elements after autofill occurs (#8153)
* [PM-6546] Fix issue with blurring of elements after autofill occurs

* [PM-6546] Implementing a methodology where Firefox browsers render the overlay UI within a div element rather than custom web component
2024-03-19 21:17:10 +00:00