Commit Graph

27 Commits

Author SHA1 Message Date
Matt Gibson b4ac5a8bef
Ps 1291 fix extension icon updates (#3571)
* Add needed factories for AuthService

WIP: Allow console logs

* Add badge updates

* Init by listener

* Improve tab identification

* Define MV3 background init

* Init services in factories.

Requires conversion of all factories to promises.

We need to initialize in factory since the requester of a service
doesn't necessarily know all dependencies for that service. The only
alternative is to create an out parameter for a
generated init function, which isn't ideal.

* Improve badge setting

* Use `update-badge` in mv2 and mv3

Separates menu and badge updates

* Use update-badge everywhere

* Use BrowserApi where possible

* Update factories

* Merge duplicated methods

* Continue using private mode messager for now

* Add static platform determination.

* Break down methods and extract BrowserApi Concerns

* Prefer strict equals

* Init two-factor service in factory

* Use globalThis types

* Prefer `globalThis`

* Use Window type definition updated with Opera

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

* Distinguish Opera from Safari

Opera includes Gecko, Chrome, Safari, and Opera in its user agent. We need to make sure that
we're not in Opera prior to testing Safari.

* Update import

* Initialize search-service for update badge context

* Build all browser MV3 artifacts

only uploading Chrome, Edge and Opera artifacts for now, as those support manifest V3

Also corrects build artifact to lower case.

* Remove individual dist

Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2022-10-19 08:55:57 -05:00
Oscar Hinton e941f06bac
[SM-288] Rename models to follow naming convention (#3795) 2022-10-14 18:25:50 +02:00
Matt Gibson 4bfe44d303
PS 1569 update on command listener (#3647)
* Add windows to platform utils service

Note, this will result in conflicts with several in-flight PRs, but is necessary for following commits.

* Add necessary background service factories

* Simplify autofill command

* Remove noop event service
2022-10-11 11:24:33 -05:00
Justin Baur c6dccc354c
[PS-1092] Organization Service Observables (#3462)
* Update imports

* Implement observables in a few places

* Add tests

* Get all clients working

* Use _destroy

* Address PR feedback

* Address PR feedback

* Address feedback
2022-09-27 16:25:19 -04:00
Thomas Rittson cff2422d7f
[EC-499] Add encryptService to domain model decryption (#3385)
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2022-09-02 11:15:19 +10:00
Daniel James Smith 25207c2858
Extract settings related methods into VaultTimeoutSettingsService (#3419)
* Extract into new VaultTimeoutSettingsService

* Ensure new service is instantiated and registered for DI

* Create vaultTimeoutSettingsServiceFactory

* Fix VaultTimeoutServiceFactory

* Remove any and use void instead
2022-08-30 22:30:43 +02:00
Daniel James Smith 88a6541bd8
Refactorings for vaultTimeoutService/ServiceFactories (#3416)
* Move vaultTimeoutAbstraction  into it's own folder

* Move vaultTimeout service into it's own folder

* Added vaultTimeoutServiceFactory and it's missing dependencies
2022-08-30 16:11:19 +02:00
Matt Gibson a022c58b16
Add more factories (#3381)
* Add more factories

Revert main.background factory usage.

We could still do this, but factories must init their services and so need
to be async, which is not compatible with initializing in constructors

* Fix conflicts
2022-08-29 13:46:42 -05:00
Justin Baur 2c208edb98
Add `sync$` observable (#3384)
* Add sync$ observable

* Update lock method

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2022-08-29 14:14:59 -04:00
Daniel James Smith 364d2f311e
Remove stateService from browserPlatformUtilsService (#3362) 2022-08-24 00:22:18 +02:00
Matt Gibson 179a3b3726
[PS-1265] fix on install hook (#3278)
* Create service factories

* Add onInstall hook to service worker

* Add factory helper and common options structure

* Use factories in main.background

* simplify common factory options

* Split factory service cache and options.

Improve factory method base type handling.

* Add dev flag for managed environment.
2022-08-18 09:23:16 -05:00
Matt Gibson 5339344630
PS-1133 Feature/mv3 browser observable memory caching (#3245)
* Create sessions sync structure

* Add observing to session-syncer

* Do not run syncer logic in decorator tests

* Extract test constants

* Change Observables to BehaviorSubject

* Move sendMessage to static method in BrowserApi

* Implement session sync

* only watch in manifest v3

* Use session sync on folder service

* Add array observable sync

* Bypass cache on update from message

* Create feature and dev flags for browser

* Protect development-only methods with decorator

* Improve todo comments for long-term residency

* Use class properties in init

* Do not reuse mocks

* Use json (de)serialization patterns

* Fix failing session storage in dev environment

* Split up complex EncString constructor

* Default false for decrypted session storage

* Try removing hydrate EncString method

* PR review

* PR test review
2022-08-16 07:05:03 -05:00
Justin Baur 1ba76dec16
[PS-1107] User Verification Service Refactor (#3219)
* UserVerificationService refactor

* Remove temp change

* move import order

* Address PR feedback
2022-08-09 21:31:02 -04:00
Oscar Hinton af371af6e1
[SM-88] [BEEEP] Add support for chrome.storage.managed for environment urls (#3120)
* Add managed_schema

* Add note on login page which server you are logging into.

* Implement it

* Remove caching logic since it seems unecessary

* Add error

* Handle error in hasManagedEnvironment

* Fix compile
2022-08-08 07:40:09 -04:00
Rui Tomé c263eacd88
[EC-376] Extract API logic from PolicyService to PolicyApiService (#3203)
* Added abstractions for PolicyApiService and PolicyService

* Added implementations for PolicyApiService and PolicyService

* Updated all references to new PolicyApiService and PolicyService

* Deleted old PolicyService abstraction and implementation

* Fixed CLI import path for policy.service

* Fixed main.background.ts policyApiService dependency for policyService

* Updated policy-api.service with the correct imports

* [EC-376] Sorted methods order in PolicyApiService

* [EC-376] Removed unused clearCache method from PolicyService

* [EC-376] Added upsert method to PolicyService

* [EC-376] PolicyApiService putPolicy method now upserts data to PolicyService
2022-08-08 10:04:36 +01:00
Daniel James Smith a1e536a5ef
[PS-1175] Resolve issue with processReload not executing (#3240)
* Removed check for getBiometricLocked
It always returned false even when no biometrics were used.

* Remove the other check for getBiometricsLocked

* Ensure that biometricFingerprintValidation is reset, when biometrics are disabled

* Removed getBiometricsLocked and setBiometricsLocked
With nothing in the codebase reading the state of getBiometricsLocked, I've removed all places where it was set or saved.

* Refactor execution of reload into a separate method

* Conditonally pass the window object to `BrowserApi.reloadExtension`

* Clarify in comment, that the PIN has to be set with ask for Master Password on restart

* Ensure the process reload is executed on logout

* Use accounts instead of lastActive == null to determine a reload on logout

* Moved identical logic from desktop and browser into system.service

* Simplified check for refresh to handle no accounts found, logout, lock with lastActive longer than 5 seconds
2022-08-05 20:04:27 +02:00
Matt Gibson 528af15eb0
Do not use deprecated method (#3155) 2022-07-22 11:41:02 -05:00
Oscar Hinton fbff2e5f00
[PS-1134] Folder fixes, including revamped auth logic (#3118) 2022-07-18 14:39:12 +02:00
Addison Beck 4be301f125
[fix] System theming in the Safari extension (#3107) 2022-07-14 14:47:45 -04:00
Oscar Hinton 23253b3882
[PS-1078] Refactor FolderService to use Observables (#3022) 2022-07-12 20:25:18 +02:00
Oscar Hinton f79c4f0c65
Extract API logic from FolderService to FolderApiService (#3011) 2022-07-08 15:40:31 +02:00
Matt Gibson 399b8c2b34
PS-813 Add memory storage to state service (#2892)
* Use abstract methods and generics in StorageService

* Prepend `Abstract` to abstract classes

* Create session browser storage service

* Use memory storage service for state memory

* Inject memory storage service

* Maintain filename extensions to help ide formatting

* Preserve state if it's still in memory

* Use jslib's memory storage service

* linter

* Create prototypes on stored objects

* standardize package scripts

* Add type safety to `withPrototype` decorators

* webpack notify manifest version

* Fix desktop

* linter

* Fix script

* Improve prototye application

* do not change prototype if it already matches desired
* fix error with object values prototype application

* Handle null state

* Apply prototypes to browser-specific state

* Add angular language server to recommended extensions

* Improve browser state service tests

* Start testing state Service

* Fix abstract returns

* Move test setup files to not be picked up by default glob matchers

* Add key generation service

* Add low-dependency encrypt service

* Back crypto service with encrypt service.

We'll want to work items that don't require state over to encrypt service

* Add new storage service and tests

* Properly init more stored values

* Fix reload issues when state service is recovering state from session storage

Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com>
Co-authored-by: Justin Baur <admin@justinbaur.com>

* Simplify encrypt service

* Do not log mac failures for local-backed session storage

* `content` changed to `main` in #2245

* Fix CLI

* Remove loggin

* PR feedback

* Merge remote-tracking branch 'origin/master' into add-memory-storage-to-state-service

* Fix desktop

* Fix decrypt method signature

* Minify if not development

* Key is required

Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com>
Co-authored-by: Justin Baur <admin@justinbaur.com>
2022-06-27 12:38:12 -05:00
Andreas Coroiu fd69e163ff
[PS-683] Update negative copy (#2912)
* feat(browser): Update auto biometrics copy

* refactor(common): remove TotpService.isAutoCopyEnabled and use state directly

The TotpService was just taking the value from StateService and forwarding it, making it depend on state service.
All services that depended on the TotpService.isAutoCopyEnable flag also depended on StateService.
This therefore simplifies things by using StateService directly.

* feat(browser): update auto totp copy

* feat(browser): update add login notification copy

* feat(browser): update change password notification copy

* feat(browser): update context menu copy

* feat(browser): update show cards current tab copy

* feat(browser): update show identities current tab copy

* feat(browser): update enable favicon copy

* feat(browser): update badge counter copy

* feat(browser): update auto-fill copy

* feat(desktop): update auto biometrics prompt copy

* feat(desktop): update favicon copy

* feat(desktop): adjust copy

* feat(web): update favicons copy

* feat(web): adjust copy

* feat(web): update preference settings to sentence case

* feat(browser): update settings and options page to sentence case

* feat(desktop): update settings to sentence case

* feat(web): update copy

* feat(desktop): update copy
2022-06-23 09:53:42 +02:00
Oscar Hinton bc639688e8
Use NPM workspace (#2874) 2022-06-14 17:10:53 +02:00
Thomas Rittson 8519decb7c
[EC-177] Update Key Connector error handling (#2748)
* Update jslib, deps and messages.json
2022-05-26 11:16:05 +10:00
Robyn MacCallum 8c12ba20cb
[Feature] End User Vault Refresh (#2545)
* Initial org filter work

* update jslib

* Move filter to below cipher length check

* don't show vault filter in personal or org folder

* Use family icon for families org

* jslib and auth guard updates

* lint fixes

* rename GroupingsComponent to VaultFilterComponent

* fix no folder showing all items

* Add checks for PersonalOwnership policy

* update css class names

* lint fixes

* cleanup

* Some final cleanup

* import order lint fix

* remove unused import

* Use smaller icon for chevron

* Update src/popup/vault/organization-filter.component.ts

Co-authored-by: Addison Beck <addisonbeck1@gmail.com>

* Update src/popup/vault/organization-filter.component.ts

Co-authored-by: Addison Beck <addisonbeck1@gmail.com>

* fix lint error

* remove extra localizations

* rename orgFilter -> vaultSelect

* Rename orgFilterService to VaultSelectService

* lint fixes

* combine vault select service with vault filter service

* Use base vault filter service methods

* Use VaultFilter model and other small fixes

* lint fixes

* Final restructuring pass

* Update jslib and remove extra function

* Remove extra imports

* remove space

* Remove vaultFilterService from background services

* Update jslib to latest on feature branch

* merge fix

* update jslib

* [feat] Implement EUVR for desktop

Should contain only https://github.com/bitwarden/desktop/pull/1487, with merge resolutions and style fixes

* [fix] Delete unused GroupingsComponentTemplate

* [dep] Update jslib

Co-authored-by: Addison Beck <addisonbeck1@gmail.com>
2022-05-09 08:19:18 -04:00
Oscar Hinton 7fe51f83da
[EC-183] Mono Repository - Browser (#2531) 2022-05-03 19:38:55 +02:00