1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00
Commit Graph

133 Commits

Author SHA1 Message Date
Oscar Hinton
3f56834716
Update jest configs to remove roots (#766) 2022-04-12 16:55:59 +02:00
Thomas Rittson
0f0adc9bd9
Add jsdoc comments for user verification, password reprompt, and appApiAction (#754)
* Rename and add comments to clarify password reprompt classes

* Add comment for appApiAction
2022-04-12 11:48:33 +10:00
Thomas Rittson
e595c0548e
EC-134 Fix api token refresh (#749)
* Fix apikey token refresh

* Refactor: use class for TokenRequestTwoFactor
2022-04-01 11:28:23 +10:00
Kyle Spearrin
4d58200ee9
Generator cleanup (#753)
* type is null by default

* rename generator component

* remove showWebsiteOption

* shorthand if check
2022-03-31 18:26:59 -04:00
Thomas Rittson
e0da3116f1
Add ColorPasswordCountPipe to JslibModule (#751) 2022-04-01 07:32:44 +10:00
Robyn MacCallum
56f5aba11e
Add ellipsis pipe to jslib module (#746)
* add ellipsis pipe to jslib module

* Add ellipsis pipe to exports
2022-03-31 09:57:19 -04:00
Oscar Hinton
47473b7ede
Remove the VerifyMasterPasswordComponent from jslib module (#747) 2022-03-29 10:38:22 +02:00
Matt Gibson
a4fba0e1c5
Feature/move to jest (#744)
* Switch to jest

* Fix jslib-angular package name

* Make angular test project

* Split up tests by jslib project

* Remove obsolete node test script

* Use legacy deps with jest-preset-angular

* Move web tests to common

* Remove build from pipeline

This was only being used because we were not using ts runners.
We are now, so build is unnecessary
2022-03-28 16:00:42 +02:00
Thomas Rittson
13ef7aea7d
Add DatePipe provider to JslibModule (#741) 2022-03-27 22:40:47 +02:00
Oscar Hinton
9d1df26dfa
Fix jslibModule forms (#742) 2022-03-28 06:32:21 +10:00
Kyle Spearrin
fa73c13b8c
support for username gen website setting (#738) 2022-03-25 10:32:01 +01:00
Kyle Spearrin
bfdd3561da
Username generator (#734)
* add support for username generation

* remove unused Router

* pr feedback
2022-03-24 12:19:19 -04:00
Oscar Hinton
5b7b2a03dd
Remove Internet Explorer logic (#723) 2022-03-24 10:42:11 +01:00
Robyn MacCallum
5409525ea2
Add ellipsis pipe (#728)
* add ellipsis pipe

* run prettier

* Account for ellipsis length in returned string

* Fix complete words case

* Fix another complete words issue

* fix for if there are not spaces in long value

* extract length check to beginning of method

* condense if statements

* remove log
2022-03-21 15:46:54 -04:00
Thomas Rittson
9950fb42a1
[JslibModule] Add JslibModule (#733) 2022-03-21 19:32:55 +10:00
Matt Gibson
f88515745c
Remove error Response type check (#731)
* Remove error Response type check

Minimization is impacting type checking in a non-consistent way.
The previous type check works locally,
but not from build artifacts 🤷. We only set `captchaRequired` on
our errors when we want a resubmit with captcha included, so we're safe
keying off that

* linter
2022-03-18 12:24:22 +10:00
Matt Gibson
3ec0f6977a
Check runtime name vs mangled name (#724) 2022-03-14 20:12:31 -05:00
Oscar Hinton
f7375e9064
Add premium and unless-premium directives (#710) 2022-03-08 15:21:49 +01:00
Oscar Hinton
813457c348
Expose logger in lock component (#703) 2022-03-03 17:19:52 +01:00
Vincent Salucci
48a4c27fe7
[Captcha] Failed login attempts (#698)
* [Captcha] Failed login attempts

* Fix logIn.strategy test

* Updated with the stark majority of requested changes

* Fix typo

* Unused import
2022-03-02 19:47:57 -06:00
Thomas Rittson
adfc2f234d
Remove unused SSO Form code (#701)
* Remove unused SAML Artifact Binding properties

* Remove unused validators
2022-03-03 07:52:11 +10:00
Thomas Rittson
e47eb5e74f
Fix linting (#700) 2022-03-01 23:11:12 +01:00
Thomas Rittson
d81eb7ddae
Improve SSO Config validation (#572)
* Extract SsoConfig enums to own file

* Add ChangeStripSpaces directive

* Move custom validators to jslib

* Add a11y-invalid directive

* Add and implement dirtyValidators

* Create ssoConfigView model and factory methods

* Add interface for select options

* Don't build SsoConfigData if null

Co-authored-by: Oscar Hinton <oscar@oscarhinton.com>
2022-03-02 07:31:00 +10:00
Thomas Rittson
1cbc119ad8
[AuthService refactor] Don't clear state if 2FA is invalid (#690)
* Don't clear state if 2FA is invalid

* Add session timeout to 2FA

* Clear internal authService state if unhandled error
2022-02-23 21:08:43 -06:00
Thomas Rittson
fdaa4f9fa5
Fix linting (#693) 2022-02-23 15:33:34 -06:00
Melanie Kanavakatini
2779cd0966
feat: add hidden char count toggle (#341)
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2022-02-24 07:18:46 +10:00
Addison Beck
78b5f15042
[feature] Implement scope warning for exports (#688)
* [feature] Add a hasOrganizations() service method

* [feature] Add a component to warn users about export scope
2022-02-23 13:56:46 +10:00
Oscar Hinton
60878cd4ed
Add eslint (#610) 2022-02-22 15:39:11 +01:00
Vincent Salucci
6d186bb204
[Icons] Fix sass deprecation warnings (#680)
* [Icons] Cleanup deprecation warnings

* Reverted to calc since math.div is not available in our current version

* Removed * -1 trick
2022-02-18 17:17:58 -06:00
Addison Beck
a6092916d8
[bug] Persistantly store collapsedGroupings (#686)
Collapsed groupings have regressed to not maintaining their state through restarting clients.

The state mangement refactor erroniously began saving this field to memory instead of disk, but there were some other issues that changing this brought on that are also fixed in this commit.

Changes:
1. Save collapsedGroupings persistantly in StateService
2. Adjust the type of collapsedGroupings on the Account model from a Set<string> to a string[]
	* This is the way we were storing this value in previous releases, and saving the entire set object breaks.
3. Adjust the StateService getter/setter for collapsedGroupings to expect a string[]
4. Extract a string[] from the GroupingsComponent groupings that is a Set<string> before saving
2022-02-15 12:54:22 -05:00
Matt Gibson
b0f735814f
Load component on init, then watch (#669) 2022-02-11 03:31:40 -06:00
Addison Beck
c282ef8575
[bug] Fix logout timeout action for inactive accounts (#660)
* [bug] Fix logout timeout action for inactive accounts

* Pass userId in to the logout callback parameter to the vaultTimeoutService. The message handle in desktop already expects this.
* Set lastActive on account login, and null it on account deauthentication. This prevents an issue where newly logged in accounts immediatly time out due to inactivity.

* Add userId to locked callbacks

* Add userId to log out callback
2022-02-09 12:15:20 -05:00
Vincent Salucci
8cb029947b
[Help] Update links to new pattern (#658)
* [Help] Updated urls to current pattern

* Rotate key update
2022-02-08 17:35:29 -06:00
Jake Howard
4252501620
Add lazy loading and decoding to images (#591)
The lazy loading will work in addition to any already being done, rather
than conflicting with it.

Co-authored-by: Daniel James Smith <djsmith@web.de>
2022-02-04 12:38:56 +01:00
Oscar Hinton
9dccd3198f
Fix avatar error when src is undefined (#652) 2022-02-03 19:37:51 +01:00
Addison Beck
067cd1e0e1
[bug] Assign client specific account settings during migration (#653)
* [bug] Assign client specific account settings during migration

* [refactor] Write State type arguements in consistent order

* [style] Ran prettier
2022-02-03 13:32:42 -05:00
Jake Fink
ca5c6a9c32
Master password policy is not checked when accepting invite from an existing account (#597)
* create update-password component

* linting and prettier
2022-02-02 23:31:37 -05:00
Thomas Rittson
aa2bdd00be
[Tech debt] Refactor authService and remove LogInHelper (#588)
* Use different strategy classes for different types of login
* General refactor and cleanup of auth logic
* Create subclasses for different types of login credentials
* Create subclasses for different types of tokenRequests
* Create TwoFactorService, move code out of authService
* refactor base CLI commands to use new interface
2022-02-01 09:51:32 +10:00
Addison Beck
92a65b7b36
[bug] Allow for GlobalState to be extended and modified in clients (#646)
Some clients have unique global setting defaults (and unique global settings)
For example: the web vault defaults to light theme, but most clients with theme support default to system theme.

The current way we handle GlobalState is buried in jslib and not easily extendible in clients.

To fix this, we need to treat GlobalState as a generic in the StateService and StateMigration service and allow for its extension in those methods and anywhere GlobalState is inited.
2022-01-31 14:33:31 -05:00
Oscar Hinton
6b4ed5fcce
Icon fixes for callouts and verify mp (#640) 2022-01-27 17:40:58 +01:00
Oscar Hinton
5249e55522
Update the fallback icon name (#639) 2022-01-27 16:48:50 +01:00
Oscar Hinton
0186610ca4
Change the icon baseline to 14% (#637) 2022-01-27 15:31:13 +01:00
Vincent Salucci
0a2ebf6e50
[Icons] Fix source paths (#636)
Co-authored-by: Hinton <oscar@oscarhinton.com>
2022-01-27 11:21:32 +01:00
Addison Beck
4722a287ec
[bug] Ensure clients that always remember emails have an avenue to do so (#635) 2022-01-25 12:34:11 -05:00
Vincent Salucci
946fc20674
[Icons] Global variable update (#632)
* [Icons] Global variable update

* Reverted to base class in order to reduce redundant css

* Adjusted comment
2022-01-25 09:58:53 -06:00
Vincent Salucci
a985621bb9
[Icons] Update font sheet (#582)
* Initial commit for icon update

* Updated lg to reflect current usage

* Created BitwardenIconsService

* Prettier updates

* More prettier updates

* Updated font

* Prettier

* Added new icons to service map

* Removed variables and converted css to use scss maps and exported list

* Updated font sheet (130)

* Removed base class and replaced bolt icon

* Added 3x icon size

* Added sm text size helper

* Added rotate 270 helper

* Prettier

* Updated font sheet

* Requested Changes

* Removed BitwardenIcons Util - obsolete
2022-01-24 15:40:04 -06:00
Addison Beck
ccd715d7b8
[Bug] [Account Switching] Improve State Management Performance (#611)
* [bug] Improve state management performance

Large vaults see a clear degrade in performance using the state service, especially when multiple vaults are authed and unlocked at the same time.

Some changes made to address this:
1. Clearing in memory decrypted data for non active accounts. This really should have been something we were doing anyway, but letting go of that memory burden has a noticable performance boost.
2. Not loading a bunch of unecsassary data from disk accounts into memory on application startup. This was being done to initilize in memory accounts, but brought a lot of extra baggage with it like storing encrypted data in memory, even though it is never referenced that way.
3. Breaking the on disk state object up into seperate keys for accounts instead of storing everything together under a "state" key. This ensures there is less information fetched from disk each time we call for an account.

There were some restructuring changes needed to facilitate these items:
1. We need to be able to construct an account in the StateService, but typescript doesn't allow for new() constraints on generics so a factory needs to be created and passed into the StateService for this to work.
2. Since we can't reference an all-knowing "accounts" object for on disk state anymore we have to maintain a list of authenticated accounts, and this has been added.
3. The StateMigration service needed to be updated to break up the accounts object, so current dev and QA state will be broken and need to be reset.

Some other general refactorings that were helpful gettings this working:
1. Added a constant for keys to the StateService and StateMigrationService.
2. Bundling everything needed to deauthenticate a user into a dedicated method.
3. Bundling all the disk storage clear methods (that should be refactored later into client specific state services) into one helper method.
4. Bundling everything needed to dynamically select a new active user into a dedicated method.

* [bug] Set environmentUrls appropriatly on account add

* [bug] Stop tracking activity without an active user

* [bug] Remove lastActive from globalState and globalState migration

* [style] Ran prettier
2022-01-19 10:51:10 -05:00
Oscar Hinton
12011bf4da
Add a shared tsconfig file (#609) 2022-01-17 13:21:20 +01:00
Addison Beck
c7ccb997bd
[bug] Use the correct login url in lock guard (#606) 2022-01-12 10:15:39 -05:00
Addison Beck
57d60bdfa6
Misc Account Switching Fixes & Refactors (#600)
* [refactor] Restructure EnvironmentUrls in state

* Patch up (add missing fields) and more extensivly use the EnvironmentUrls class instead of passing around an any
* Add environmentUrls to the AccountSettings model in addition to GlobalState for use in both scopes
* Move EnvironmentUrls initialization to the model level and out of StateSerice
* Adjust the StateMigrationService to account for these changes

* [refactor] Improve order of operations for LockGuardService

We currently jump through a bunch of hoops to verify users can access the Lock page, like checking authentication first.
If a user is not authenticated, they are not locked, so we can improve performance for the happy path of this serivice by checking isLocked first and using isAuthenticated to deviate from the normal flow if needed.

* [bug] Subscribe to State.accounts in EnvironmentService and set urls accordingly

The EnvironmentService has no context for account changes currently and does not update actively used urls based on active account.
This commit addresses this issue by subscribing to State.accounts and resetting the service's urls on account change.

* [bug] Clear AccessToken from State on clean

In order for logout flows to function as expected we need to deauthenticate users when cleaning up state before checking for the next active user
Otherwise the service will continue to think the user being logged out is active

* [refactor] Stop pushing accounts when modifying disk state

There is no reason to push new accounts to subscribers when updating disk state.
Subscribers recieve a copy of in memory state, so changes to disk will not be refelected and have to be fetched seperatly from the service.
Pushing when saving disk state is just creating an unecassary performance burden.

* [refactor] Default to in memory active user if availible, even when accessing disk state

Sometimes we need to pull activeUserId from storage to access a bit of data, like on initial boot, but most of the time this isn't necassary.
Since we pull this userId a lot, checking disk each time is a performance burden. Defaulting to the in memory user ID if avaible helps alleviate this.

* [style] Ran prettier

* [style] Change a let to a const
2022-01-07 09:30:54 -05:00