1
0
mirror of https://github.com/bitwarden/web synced 2025-12-06 00:03:28 +00:00

Compare commits

...

438 Commits

Author SHA1 Message Date
Kyle Spearrin
489b93d5df fix lint errors 2017-05-20 08:55:43 -04:00
Kyle Spearrin
cfb2a4d404 version bump 2017-05-20 08:55:04 -04:00
Kyle Spearrin
3b8ad132bc ui adjustments 2017-05-19 20:33:13 -04:00
Kyle Spearrin
8510711e5d organize import dropdown. added opera and vivaldi 2017-05-19 16:03:39 -04:00
Kyle Spearrin
9918e903b2 add support for passkeep csv import 2017-05-19 14:10:45 -04:00
Kyle Spearrin
6a292d6905 Update README.md 2017-05-19 13:27:22 -04:00
Kyle Spearrin
62926d6e28 Update SECURITY.md 2017-05-19 12:03:37 -04:00
Kyle Spearrin
51edf80e48 allow bulk invite CSV list of email addresses 2017-05-18 12:19:49 -04:00
Kyle Spearrin
804f1f5610 meldium importer resolves #68 2017-05-17 16:20:22 -04:00
Kyle Spearrin
3f0b14e48a Create SECURITY.md 2017-05-17 11:34:51 -04:00
Kyle Spearrin
3e0ce5544c primary worker for forge key generation 2017-05-15 20:58:16 -04:00
Kyle Spearrin
933cbb72aa manage external ids 2017-05-15 14:42:24 -04:00
Kyle Spearrin
6bda5d5983 collection user refactor 2017-05-11 14:52:51 -04:00
Kyle Spearrin
bfae8e7def collection add/edit groups 2017-05-11 12:22:03 -04:00
Kyle Spearrin
96a91b97e9 cleanup and model changes 2017-05-11 10:32:39 -04:00
Kyle Spearrin
12096a8fb3 space out the icon a bit 2017-05-10 14:33:48 -04:00
Kyle Spearrin
e03d4d52c4 resolve issues with id on api calls 2017-05-10 14:20:45 -04:00
Kyle Spearrin
ea24d72f01 group accessall and readonly 2017-05-10 12:17:26 -04:00
Kyle Spearrin
a4473ad739 catch refresh token error 2017-05-10 11:47:53 -04:00
Kyle Spearrin
08c28950f4 dashlane importer fix for 6 cols 2017-05-10 11:37:27 -04:00
Kyle Spearrin
5cc8439f5b dont scroll to top with # on click resolves #62 2017-05-10 07:58:51 -04:00
Kyle Spearrin
eb7fd4a015 conditionally show groups option 2017-05-09 20:35:18 -04:00
Kyle Spearrin
dce609d141 no need to clean up card 2017-05-09 19:28:12 -04:00
Kyle Spearrin
f31360ecbf remove user from group 2017-05-09 19:23:49 -04:00
Kyle Spearrin
93e88d8b23 group user assignment 2017-05-09 19:04:26 -04:00
Kyle Spearrin
816cc0b17b occurred typo 2017-05-09 14:23:39 -04:00
Kyle Spearrin
1f73269480 manage groups from collection add/edit 2017-05-09 14:06:44 -04:00
Kyle Spearrin
f7d1b8821c ui tweaks 2017-05-08 22:18:07 -04:00
Kyle Spearrin
cd5ad9f85b select collections on group add/edit 2017-05-08 22:13:31 -04:00
Kyle Spearrin
9c706f07f0 groups list/add/edit 2017-05-08 16:01:36 -04:00
Kyle Spearrin
ea82925e14 new props for org profile 2017-05-08 15:28:40 -04:00
Kyle Spearrin
1c5f208ef1 enterprise plan signup 2017-05-08 15:20:01 -04:00
Kyle Spearrin
aeae0ba535 stripe key in app settings 2017-05-08 14:45:14 -04:00
Kyle Spearrin
f59b227c44 version bump 2017-05-08 12:39:46 -04:00
Kyle Spearrin
4518e7056c fixed to collection sharing. observe login edit. 2017-05-08 11:36:11 -04:00
Kyle Spearrin
565c6bafae version bump 2017-05-08 08:15:39 -04:00
Kyle Spearrin
584e8131cd version bump 2017-05-06 21:32:56 -04:00
Kyle Spearrin
20e958b1ee new identity server uri for auth 2017-05-06 21:32:51 -04:00
Kyle Spearrin
21ca3abc7e importer fixes for ipif and safe in cloud 2017-05-04 15:56:45 -04:00
Kyle Spearrin
612ad32722 update forge 2017-05-04 00:13:01 -04:00
Kyle Spearrin
8ec07266b9 trimleft on first lastpass chunk 2017-05-03 14:48:29 -04:00
Kyle Spearrin
a9a7b0b317 typo on export 2017-05-03 11:47:09 -04:00
Kyle Spearrin
e634e3e28f change stripe key to live 2017-05-03 10:34:23 -04:00
Kyle Spearrin
86de4b721f callout when registering for org create 2017-05-03 10:23:01 -04:00
Kyle Spearrin
1d95a78e75 payment page UI updates 2017-04-28 21:50:08 -04:00
Kyle Spearrin
f5e44163be style sweaks 2017-04-28 21:39:16 -04:00
Kyle Spearrin
1ffc005479 adjusted warning color to be darker 2017-04-28 21:36:03 -04:00
Kyle Spearrin
31f67d412b Two-step login UI tweaks 2017-04-28 21:31:57 -04:00
Kyle Spearrin
cc62237ab5 UI/UX tweaks 2017-04-28 15:28:00 -04:00
Kyle Spearrin
f11d4a92df notes 2017-04-27 16:40:45 -04:00
Kyle Spearrin
0be6249c2b shared bugs 2017-04-27 16:34:04 -04:00
Kyle Spearrin
a083fc9084 user vault collections changed to show all shared 2017-04-27 16:24:38 -04:00
Kyle Spearrin
54172c441f rename AccessAllCollections => AccessAll 2017-04-27 15:39:24 -04:00
Kyle Spearrin
b5f8b1014e add/edit logins from org admin vault 2017-04-27 14:47:44 -04:00
Kyle Spearrin
df42c6176d comment update 2017-04-27 12:14:11 -04:00
Kyle Spearrin
7d0a34fceb protect mac comparisons from timing attacks 2017-04-27 12:00:32 -04:00
Kyle Spearrin
b3e94b13f7 constant time equality for mac check on decrypt 2017-04-27 11:35:30 -04:00
Kyle Spearrin
4eee908f2f subvault => collections file renames 2017-04-27 09:35:21 -04:00
Kyle Spearrin
1ebae5c284 rename subvault => collection 2017-04-27 09:33:12 -04:00
Kyle Spearrin
361f03eb5f remove audits controller ref 2017-04-26 10:39:34 -04:00
Kyle Spearrin
d8f54fc15a telemetry for organizations 2017-04-26 10:32:14 -04:00
Kyle Spearrin
90b0f3201e telemetry events 2017-04-26 10:21:06 -04:00
Kyle Spearrin
b0d2374960 misc cleanup 2017-04-25 16:26:25 -04:00
Kyle Spearrin
5c471e43dd return state for org create on register/login 2017-04-25 10:46:54 -04:00
Kyle Spearrin
c69169cbf9 rename CryptoKey to SymmetricCryptoKey 2017-04-22 14:39:40 -04:00
Kyle Spearrin
f2c670dfd0 whitelist desktop IP 2017-04-21 22:40:21 -04:00
Kyle Spearrin
cfdd6dc0d9 Clear selected subvaults when changing orgs 2017-04-21 16:02:46 -04:00
Kyle Spearrin
d61b6c2faa force vault refresh upon importing 2017-04-21 14:24:24 -04:00
Kyle Spearrin
e010995b19 Add support for OAEP SHA1 digest.
Note that iOS does not support any other OAEP format, such as SHA256.
2017-04-21 13:46:07 -04:00
Kyle Spearrin
053a1c1394 arrange icons better 2017-04-20 23:58:38 -04:00
Kyle Spearrin
581184e2ae wording update 2017-04-20 23:55:07 -04:00
Kyle Spearrin
84e617b201 list details about user w/ access to all subvaults 2017-04-20 23:49:33 -04:00
Kyle Spearrin
4ba21638b1 access all subvaults option for org users 2017-04-20 22:19:18 -04:00
Kyle Spearrin
f92c5a214f crypto fix for mac 2017-04-20 16:32:03 -04:00
Kyle Spearrin
180101400f groups pages 2017-04-20 16:31:52 -04:00
Kyle Spearrin
ede10677f9 includeShared for backwards compat APIs 2017-04-19 17:03:47 -04:00
Kyle Spearrin
7627601ff8 handle legacy encrypt-then-mac scheme 2017-04-19 16:45:16 -04:00
Kyle Spearrin
cb120d2e75 opt out of backwards compat folder ciphers 2017-04-19 16:44:21 -04:00
Kyle Spearrin
ec86ccd956 org block styling 2017-04-19 13:56:11 -04:00
Kyle Spearrin
63a657cac5 encrypt key bytes when confirming, not object 2017-04-19 11:21:58 -04:00
Kyle Spearrin
c3eb6bb972 check that chunks has length 2017-04-19 10:10:27 -04:00
Kyle Spearrin
eab5c0db12 org admin delete cipher 2017-04-19 10:06:59 -04:00
Kyle Spearrin
0b9083915a remove login from individual subvault 2017-04-19 09:57:47 -04:00
Kyle Spearrin
051703234c cleanup crypto API 2017-04-19 09:27:38 -04:00
Kyle Spearrin
6d555bcf84 fix lint errors 2017-04-19 09:03:47 -04:00
Kyle Spearrin
d99fcd8e59 fix promise on register 2017-04-18 22:58:14 -04:00
Kyle Spearrin
04eee919e8 preview domain adjustments 2017-04-18 22:56:41 -04:00
Kyle Spearrin
0926c82878 wrap key into new CryptoKey object 2017-04-18 22:28:49 -04:00
Kyle Spearrin
79744d89ce constants for orguser type/status 2017-04-18 20:40:17 -04:00
Kyle Spearrin
214274f495 track by on repeats 2017-04-18 15:34:16 -04:00
Kyle Spearrin
2425eb0ff8 whitelist preview api url 2017-04-18 14:10:03 -04:00
Kyle Spearrin
c8931cde6e gulp fix for env 2017-04-18 14:01:28 -04:00
Kyle Spearrin
af698c7628 adjust configs 2017-04-18 13:54:46 -04:00
Kyle Spearrin
52745993cb preview deploy fix 2017-04-18 12:51:11 -04:00
Kyle Spearrin
7a8d23ba84 rework configs to accomedate preview env 2017-04-18 12:33:21 -04:00
Kyle Spearrin
34559f0dbd re-org menu 2017-04-18 12:10:06 -04:00
Kyle Spearrin
b34a205ace proper count for org subvaults 2017-04-18 12:05:51 -04:00
Kyle Spearrin
799fbeba72 cleanup styles and pluralize vault counts 2017-04-18 12:03:06 -04:00
Kyle Spearrin
0e36abe1ad of 2017-04-18 11:53:21 -04:00
Kyle Spearrin
69ce07ef01 no org callout on sidebar 2017-04-18 11:52:44 -04:00
Kyle Spearrin
9f32e76a99 clear vault rootScope when visiting org admin 2017-04-18 11:31:43 -04:00
Kyle Spearrin
e89e48014c manage root scope from subvault list edits 2017-04-18 11:27:44 -04:00
Kyle Spearrin
9863a95a71 root scope bug fixes 2017-04-18 10:45:35 -04:00
Kyle Spearrin
dc0bf54401 org existance check 2017-04-18 10:24:47 -04:00
Kyle Spearrin
3728f012d7 make dropdown append more generic 2017-04-18 10:19:42 -04:00
Kyle Spearrin
f904558315 manage cipher subvaults from org admin 2017-04-17 23:11:24 -04:00
Kyle Spearrin
a79556dfce org vault listing 2017-04-17 17:01:12 -04:00
Kyle Spearrin
901332dbee change from deprecated sites endpoint to logins 2017-04-17 15:48:02 -04:00
Kyle Spearrin
1ab75115f0 filter out org logins 2017-04-17 15:47:24 -04:00
Kyle Spearrin
bc431b896b change email/password adjustments 2017-04-17 14:53:26 -04:00
Kyle Spearrin
aa7a3c442c adjust vault login chunking 2017-04-15 01:02:56 -04:00
Kyle Spearrin
6825967cb9 domain rules style updates 2017-04-15 01:00:25 -04:00
Kyle Spearrin
cdc06a2b49 convert listings from uib-tooltip to title 2017-04-14 23:48:51 -04:00
Kyle Spearrin
309c73a972 update org after share 2017-04-14 23:36:43 -04:00
Kyle Spearrin
c4a3e5c4fd body dropdown tweaks 2017-04-14 23:30:58 -04:00
Kyle Spearrin
8d6cbe8e1e append dropdown menus to body 2017-04-14 22:49:51 -04:00
Kyle Spearrin
ff4e76b723 convert dropdowns back to regular bootstrap 2017-04-14 22:37:41 -04:00
Kyle Spearrin
acdbc6b9a3 undo comments 2017-04-14 14:37:36 -04:00
Kyle Spearrin
6714390890 clear root scope vault data on logout 2017-04-14 12:38:44 -04:00
Kyle Spearrin
249d00b285 cache vault data in root scope 2017-04-14 12:35:46 -04:00
Kyle Spearrin
e4ffdf6815 promisify makekeypair and generate keys on login 2017-04-13 18:18:32 -04:00
Kyle Spearrin
2228263b9f remove orderby on fav list 2017-04-13 17:25:02 -04:00
Kyle Spearrin
ee1c884ef1 load vault in chunks so that it appears faster 2017-04-13 17:19:54 -04:00
Kyle Spearrin
0d29c75e7f handle null condition when decrypting 2017-04-13 11:53:07 -04:00
Kyle Spearrin
7042f4bca8 labels in nav 2017-04-13 10:39:11 -04:00
Kyle Spearrin
ea42ed5381 move apps menu item up one 2017-04-13 10:12:48 -04:00
Kyle Spearrin
ba6ca4a6bb lowercase the 2017-04-13 10:10:46 -04:00
Kyle Spearrin
ce68c1599f apps page 2017-04-13 10:09:19 -04:00
Kyle Spearrin
ce64601e38 ui tweaks 2017-04-12 21:58:36 -04:00
Kyle Spearrin
b9f6351720 import bitwarden fav fix 2017-04-12 16:47:53 -04:00
Kyle Spearrin
da8b31533a export data fixes due to api cahnges 2017-04-12 16:41:31 -04:00
Kyle Spearrin
0591f106d3 syntax fixes 2017-04-12 16:14:29 -04:00
Kyle Spearrin
40f9961541 export and import favorites for bitwarden csv 2017-04-12 16:12:28 -04:00
Kyle Spearrin
5c8117539c add back exposify package for gulp build 2017-04-12 15:55:26 -04:00
Kyle Spearrin
af7400642b password gen message 2017-04-12 13:28:11 -04:00
Kyle Spearrin
f8c5f31f97 org owner check on side nav menu 2017-04-12 13:06:18 -04:00
Kyle Spearrin
5f2c2a8064 copy updates 2017-04-12 13:01:38 -04:00
Kyle Spearrin
08aa53748e manage subvaults for login in vault 2017-04-12 12:41:43 -04:00
Kyle Spearrin
673485b5c4 fix card scope 2017-04-12 11:16:14 -04:00
Kyle Spearrin
18bea7edb2 updates to change payment form 2017-04-12 11:13:41 -04:00
Kyle Spearrin
cdf029bc84 fix null check on subvault management 2017-04-12 11:11:01 -04:00
Kyle Spearrin
31ce92fa9d info text on invite 2017-04-12 11:01:03 -04:00
Kyle Spearrin
f6b1666cd7 leave organization 2017-04-12 10:07:16 -04:00
Kyle Spearrin
5f130bdda7 notes about sharing 2017-04-11 17:29:45 -04:00
Kyle Spearrin
d619167c02 disabled org labeling 2017-04-11 15:56:57 -04:00
Kyle Spearrin
400932c6de refresh access token after creating org 2017-04-11 15:00:53 -04:00
Kyle Spearrin
8984ec3127 change plan modal and adjust seat callouts 2017-04-11 14:26:17 -04:00
Kyle Spearrin
02076fadf4 some styling on org create form 2017-04-11 13:05:17 -04:00
Kyle Spearrin
1d93d5c687 show errors on payment form page 2017-04-11 12:27:03 -04:00
Kyle Spearrin
5f028ea65f delete organization 2017-04-11 10:52:16 -04:00
Kyle Spearrin
cf22ea2b78 move some values to constants for better sharing 2017-04-10 18:55:18 -04:00
Kyle Spearrin
58df3e692b rename to reinstate 2017-04-10 18:31:01 -04:00
Kyle Spearrin
80ca89b3f6 cancel/uncancel sub 2017-04-10 16:43:24 -04:00
Kyle Spearrin
4209d91c43 obj change fix 2017-04-10 12:45:46 -04:00
Kyle Spearrin
79b878209d revert settings commit 2017-04-10 12:30:16 -04:00
Kyle Spearrin
24cbe13ca7 billing seat adjustments 2017-04-10 12:29:06 -04:00
Kyle Spearrin
f8fcbbea85 change payment 2017-04-10 11:30:23 -04:00
Kyle Spearrin
40d38ec0db users => seats 2017-04-10 10:43:18 -04:00
Kyle Spearrin
f63f4e0aa3 change payment method for org 2017-04-08 16:42:05 -04:00
Kyle Spearrin
d4b4c7bd71 max additional users for personal plan 2017-04-08 11:05:32 -04:00
Kyle Spearrin
bdef522da7 org create styling 2017-04-07 16:13:52 -04:00
Kyle Spearrin
bb1ba1dbc4 move finalizeCreate to scope of shareKey 2017-04-07 15:09:09 -04:00
Kyle Spearrin
2b880d322a use ngif so that form elements are not on page 2017-04-07 14:15:11 -04:00
Kyle Spearrin
60f62b2b50 set teams plan when business is checked 2017-04-07 13:54:03 -04:00
Kyle Spearrin
b11d7be990 fix subvault collapse and add org plan details 2017-04-07 13:50:34 -04:00
Kyle Spearrin
05d153e1d2 org styling 2017-04-07 12:50:56 -04:00
Kyle Spearrin
eaba45369b org create desc and page scroll on state changes 2017-04-07 12:39:52 -04:00
Kyle Spearrin
71adf31f7b org create form on it's own page instead of modal 2017-04-07 12:32:15 -04:00
Kyle Spearrin
d39d49fb8f create org form styling 2017-04-07 11:39:56 -04:00
Kyle Spearrin
7c91066618 turn off enc header until all clients are updated 2017-04-07 09:26:43 -04:00
Kyle Spearrin
57116c4f54 added encType header to ciphers 2017-04-06 23:00:33 -04:00
Kyle Spearrin
80e4d2329a org settings and billing 2017-04-06 16:52:25 -04:00
Kyle Spearrin
7591843220 stub out org billing 2017-04-06 13:13:54 -04:00
Kyle Spearrin
653afe9f8b stub out org settings 2017-04-06 13:10:43 -04:00
Kyle Spearrin
8f007a70db dropdown options and iconography for subvaults 2017-04-06 11:00:53 -04:00
Kyle Spearrin
0feea6091b subvault messages when sharing 2017-04-06 10:24:15 -04:00
Kyle Spearrin
b27b4bef44 border options for avatars 2017-04-06 00:00:04 -04:00
Kyle Spearrin
2798a05e8e avatar tweaks. sidebar org avatars 2017-04-05 23:53:17 -04:00
Kyle Spearrin
fe039f7b35 custom letter avatar directive 2017-04-05 23:20:51 -04:00
Kyle Spearrin
ea5dc4b7fc remove gravatar for letter avatars #4 2017-04-05 17:59:48 -04:00
Kyle Spearrin
acc214d7c1 refactor to remove deprecated apis 2017-04-05 16:14:52 -04:00
Kyle Spearrin
83c232ecb5 edit logins from subvaults page 2017-04-05 11:37:22 -04:00
Kyle Spearrin
157875f7d5 use checkboxes for subvault selection 2017-04-04 22:08:04 -04:00
Kyle Spearrin
ef00e57f72 load cipher subvaults 2017-04-04 17:21:47 -04:00
Kyle Spearrin
8098ab50e8 organization signup plan details 2017-04-04 12:57:31 -04:00
Kyle Spearrin
ebb1044c43 cc details on org create 2017-04-04 10:14:54 -04:00
Kyle Spearrin
751935e90b persist folder/subvault collapse 2017-04-03 14:07:39 -04:00
Kyle Spearrin
a81572914a Manage subvault users 2017-04-03 12:26:43 -04:00
Kyle Spearrin
e00f033ffd resolve lint errors 2017-04-03 09:30:21 -04:00
Kyle Spearrin
bf9414199c subvault list UI updates 2017-04-01 22:17:28 -04:00
Kyle Spearrin
3011e9a804 use uib-dropdowns 2017-04-01 10:26:33 -04:00
Kyle Spearrin
a678f03284 button groups for vault 2017-03-30 23:49:35 -04:00
Kyle Spearrin
11002c2881 enum filters and org accept state 2017-03-30 22:06:01 -04:00
Kyle Spearrin
2692bbaa63 subvault operations 2017-03-30 21:08:07 -04:00
Kyle Spearrin
1db6d7f32b import via textarea 2017-03-30 00:07:26 -04:00
Kyle Spearrin
61cce7e8e7 subvault listing search and edit subvault 2017-03-29 22:23:00 -04:00
Kyle Spearrin
616a442fcb handle errors in org people edit 2017-03-29 21:26:48 -04:00
Kyle Spearrin
916519a43a org name from mail invite link 2017-03-29 20:58:27 -04:00
Kyle Spearrin
af2f7a7a5a organization listing from side menu 2017-03-29 19:21:06 -04:00
Kyle Spearrin
9ab9fcd577 adjust table label 2017-03-29 18:59:14 -04:00
Kyle Spearrin
853d1f4cfa status label 2017-03-29 18:05:56 -04:00
Kyle Spearrin
cbcfdafef6 UI updates for org pages 2017-03-28 22:09:27 -04:00
Kyle Spearrin
b156a27d1f api form 2017-03-28 22:04:09 -04:00
Kyle Spearrin
f6ce6426f1 add search to people listing 2017-03-28 21:44:12 -04:00
Kyle Spearrin
e12582c2c2 UI tweaks for org invites 2017-03-28 21:16:44 -04:00
Kyle Spearrin
4d2cae0b0f share profile promise result when called at same
time
2017-03-27 22:22:56 -04:00
Kyle Spearrin
35e0f27f52 access control on orgs pages 2017-03-27 21:55:39 -04:00
Kyle Spearrin
77ddc83a04 check status and types for org management 2017-03-25 21:52:27 -04:00
Kyle Spearrin
3c83741b13 ui updates for vault logins list 2017-03-25 16:09:06 -04:00
Kyle Spearrin
636c709671 hide favorites box when loading 2017-03-25 15:58:39 -04:00
Kyle Spearrin
f3f1b413b7 hide favorites box when no search results 2017-03-25 15:56:43 -04:00
Kyle Spearrin
8eaad64dd6 added favorites box to top of my vault listing 2017-03-25 15:50:24 -04:00
Kyle Spearrin
f80ba6b87c share promises and readonly check 2017-03-25 11:41:06 -04:00
Kyle Spearrin
5e5e3b5359 set profile after auth logIn 2017-03-25 11:03:11 -04:00
Kyle Spearrin
19203e976b convert auth service profile methods to promises 2017-03-25 10:43:19 -04:00
Kyle Spearrin
2154607d11 revert settings 2017-03-24 16:10:22 -04:00
Kyle Spearrin
072de1ea44 readonly and partial login updates 2017-03-24 16:09:57 -04:00
Kyle Spearrin
1818dad0d1 remove sharing module. move subvaults 2017-03-23 23:01:22 -04:00
Kyle Spearrin
d51eab779c subvault listing 2017-03-23 18:10:00 -04:00
Kyle Spearrin
9f1ab6f961 accept org invite. return state for login 2017-03-23 16:58:06 -04:00
Ben Brooks
0b875fc6f7 Add link to Firefox addon (#49)
* Add link to Firefox addon

* De-localise URLs

* re-instate media type param for iOS hint
2017-03-23 14:05:00 -04:00
Kyle Spearrin
fd62938db0 fix wrong org user type id 2017-03-23 00:40:23 -04:00
Kyle Spearrin
4499ec6a22 reinvite and remove org users 2017-03-23 00:33:35 -04:00
Kyle Spearrin
dde20f4451 resolve lint errors 2017-03-21 23:07:53 -04:00
Kyle Spearrin
715b91ab96 update all the things 2017-03-21 23:07:53 -04:00
Kyle Spearrin
7d26361680 Update README.md 2017-03-21 18:12:02 -04:00
Kyle Spearrin
b85a45d8f9 Move and list ciphers from org subvaults 2017-03-21 00:05:20 -04:00
Kyle Spearrin
22ab5d334e load folders from it's api 2017-03-18 22:55:54 -04:00
Kyle Spearrin
acf124c81e re-stub frontend sharing center 2017-03-16 22:44:54 -04:00
Kyle Spearrin
51d81dea9f manage user type 2017-03-13 23:31:01 -04:00
Kyle Spearrin
4a6066bb88 user vault associations 2017-03-13 22:54:57 -04:00
Kyle Spearrin
6ece16ccc9 org people subvault selection 2017-03-11 23:02:43 -05:00
Kyle Spearrin
0acab61f2e add new org to profile 2017-03-11 20:46:33 -05:00
Kyle Spearrin
1cbd322105 back to port 4001 2017-03-11 19:51:28 -05:00
Kyle Spearrin
ed9d26fd1b serialize private key to pkcs8 format 2017-03-10 20:49:50 -05:00
Kyle Spearrin
14e290c489 org key fixes 2017-03-09 22:28:14 -05:00
Kyle Spearrin
429b2b8a21 add subvault 2017-03-09 22:08:47 -05:00
Kyle Spearrin
e7707c4826 Set private key from asn1 on initial set 2017-03-09 20:59:10 -05:00
Kyle Spearrin
290cbe6b55 list subvaults for org 2017-03-07 23:05:49 -05:00
Kyle Spearrin
d5708f24e6 settings caret 2017-03-07 00:41:49 -05:00
Kyle Spearrin
3d273f041e do api calls on viewContentLoaded 2017-03-07 00:36:27 -05:00
Kyle Spearrin
22299c03cd list-groups for org box listing 2017-03-07 00:19:00 -05:00
Kyle Spearrin
0ea4b4400f org keys and optimized org profile load for sidenav 2017-03-06 23:54:06 -05:00
Kyle Spearrin
b3c8337f83 routes for org subvaults 2017-03-06 23:01:08 -05:00
Kyle Spearrin
a9e85f8765 org user invites and confirmation 2017-03-04 20:41:45 -05:00
Kyle Spearrin
b36799bf0c subvaults page stubbed out 2017-03-03 22:45:10 -05:00
Kyle Spearrin
4d71a05d2a organization pages and routing 2017-03-03 21:53:02 -05:00
Kyle Spearrin
4fdf2a98bf org dashboard route 2017-03-03 19:14:14 -05:00
Kyle Spearrin
880be03211 organization signup 2017-03-03 00:07:31 -05:00
Kyle Spearrin
27495d5055 Organization profile 2017-03-02 21:51:24 -05:00
Kyle Spearrin
492e2e693c setup new organization layout within backend 2017-03-01 22:47:24 -05:00
Kyle Spearrin
05a92ebd26 remove share login modal and add organizations box 2017-02-28 23:43:54 -05:00
Kyle Spearrin
0d2e296eda lint fixes 2017-02-28 22:53:19 -05:00
Kyle Spearrin
ad25267ed7 folder options 2017-02-28 00:20:03 -05:00
Kyle Spearrin
1ed86899bb share login modal 2017-02-28 00:18:11 -05:00
Kyle Spearrin
63c136a1ff share modal 2017-02-25 23:37:42 -05:00
Kyle Spearrin
3905b2b945 beta badge 2017-02-25 22:41:42 -05:00
Kyle Spearrin
afaaf7d73a modal UI for sharing folders/logins from vault 2017-02-25 22:38:30 -05:00
Kyle Spearrin
642b35582f vault row selectable 2017-02-25 22:22:25 -05:00
Kyle Spearrin
117188769c format vault listing 2017-02-25 22:13:16 -05:00
Kyle Spearrin
bd7aad37e6 copyright update 2017-02-25 22:09:58 -05:00
Kyle Spearrin
08b4e08820 style updates 2017-02-25 21:53:39 -05:00
Kyle Spearrin
aa4f360f59 combine import/export 2017-02-25 02:51:42 -05:00
Kyle Spearrin
2420375d56 remove unused service references 2017-02-23 19:32:56 -05:00
Kyle Spearrin
bc5c738c25 rework share pages 2017-02-23 00:45:54 -05:00
Kyle Spearrin
ccc527f329 Switch vault listing to user ciphers apis instead of calling login and folder separately 2017-02-21 22:50:48 -05:00
Kyle Spearrin
cf144aa2c1 set private key when logging in 2017-02-21 00:30:00 -05:00
Kyle Spearrin
086d924f06 generate keypair on registration 2017-02-21 00:30:00 -05:00
Kyle Spearrin
24862f31b3 tab layout for sharing center 2017-02-21 00:30:00 -05:00
Kyle Spearrin
877eb4d423 setup UI pages for sharing center 2017-02-21 00:30:00 -05:00
Kyle Spearrin
a37a5fa1b5 added rsa to gulp task for forge 2017-02-21 00:30:00 -05:00
Kyle Spearrin
2478a8f3cc updates to cryptoService for rsa keypairs 2017-02-21 00:30:00 -05:00
Kyle Spearrin
3ed69d887f utf8 encode params for key derivation 2017-02-15 19:03:56 -05:00
Kyle Spearrin
f0d440d204 Move tools from side nav into tools page boxes 2017-02-14 00:41:23 -05:00
Kyle Spearrin
3e18f812db lint errors 2017-02-11 18:22:13 -05:00
Kyle Spearrin
8cf02fd59a version bump 2017-02-11 17:12:50 -05:00
Kyle Spearrin
06bfab3afa version bump 2017-02-11 17:12:09 -05:00
Kyle Spearrin
71e4697562 two factor edits 2017-02-11 17:08:06 -05:00
Kyle Spearrin
cf1bffe2f1 change email button 2017-02-11 16:48:52 -05:00
Kyle Spearrin
55a5fd49dc Moved domain rules page out from modal into it's own page 2017-02-11 16:46:24 -05:00
Kyle Spearrin
3f6637eb8f move many account settings into main settings page instead of nav menu 2017-02-11 15:44:22 -05:00
Kyle Spearrin
7373e281ac print recovery code. changed vault and login route 2017-02-11 14:21:21 -05:00
Kyle Spearrin
52b89455d7 replace sjcl cryptoservice implementation with forge 2017-02-11 13:03:48 -05:00
Kyle Spearrin
bca7592c77 production by default settings 2017-02-01 22:56:39 -05:00
Kyle Spearrin
f6ab0bfe82 version bump 2017-02-01 22:53:38 -05:00
Kyle Spearrin
012a5c491d version bump 2017-02-01 22:53:15 -05:00
Kyle Spearrin
7666d6136d updated truekey importer to their new csv format 2017-02-01 22:52:36 -05:00
Kyle Spearrin
7bdda34f14 remove old auth endpoints from apiservice 2017-01-29 21:39:38 -05:00
Kyle Spearrin
df21f89fcb lint fix 2017-01-29 21:24:32 -05:00
Kyle Spearrin
f3b4cdca8a back to enum ints for 2fa providers 2017-01-28 17:27:37 -05:00
Kyle Spearrin
52460bf47b version bump 2017-01-28 17:00:26 -05:00
Kyle Spearrin
e674e7287e token refresh 2017-01-28 16:09:38 -05:00
Kyle Spearrin
a20e8b6228 fix string split bug on 1password 1pif importer 2017-01-28 02:03:49 -05:00
Kyle Spearrin
8d50e96dab splashid importer 2017-01-28 01:57:36 -05:00
Kyle Spearrin
1fe673951b WIP convert web vault to new identity server 2017-01-28 01:19:43 -05:00
Kyle Spearrin
3df5a9454e 1password importer naming adjustments 2017-01-21 02:08:14 -05:00
Kyle Spearrin
79fecd6b03 fix some linter complaints 2017-01-20 23:39:43 -05:00
Kyle Spearrin
f3445c24b9 added example placeholder text 2017-01-10 21:54:32 -05:00
Kyle Spearrin
a3150d8505 cleanup domain add/edit submission 2017-01-10 21:53:03 -05:00
Kyle Spearrin
828b5d8703 Add/edit equivalent domains 2017-01-10 21:38:53 -05:00
Kyle Spearrin
39559e203a react to model restructure on API 2017-01-10 17:01:38 -05:00
Kyle Spearrin
605bdd0ea0 domain rules page setup with new APIs 2017-01-09 22:26:20 -05:00
Kyle Spearrin
74945e03ce linter fixes 2017-01-06 00:03:33 -05:00
Kyle Spearrin
c772502af5 version bump fix for settings 2017-01-05 23:57:45 -05:00
Kyle Spearrin
401d9db0f2 version bump 2017-01-05 23:56:59 -05:00
Kyle Spearrin
2306da94fe More instructions for firefox password exporter. 2017-01-04 22:43:22 -05:00
Kyle Spearrin
9f7ed11082 fix bug from site rename 2017-01-04 22:32:47 -05:00
Kyle Spearrin
fff0efb095 append tooltips to body 2017-01-04 22:23:21 -05:00
Kyle Spearrin
9aa61f4bca complete import options array 2017-01-04 20:39:55 -05:00
Kyle Spearrin
bd70dc5966 Update README.md 2017-01-04 00:17:24 -05:00
Kyle Spearrin
ac6a3caa8f importer instructions 2017-01-04 00:11:27 -05:00
Kyle Spearrin
0914776152 re-ordered fields on site add/edit. marked name as required with asterisk 2017-01-03 22:09:26 -05:00
Kyle Spearrin
45d0f43e90 If searching, only show folder if it has filtered logins 2017-01-03 19:19:54 -05:00
Kyle Spearrin
7264367fa3 Collapse/Expand #32 2017-01-03 19:06:50 -05:00
Kyle Spearrin
022fa34478 switch back to sites enpoint until API is updated 2017-01-03 00:35:04 -05:00
Kyle Spearrin
f7fd28fded refactored naming Site => Login 2017-01-02 22:26:32 -05:00
Kyle Spearrin
e01a22de48 importer fixes 2017-01-02 21:37:20 -05:00
Kyle Spearrin
711c8e63c1 fixes to 1password4 1pif. new uri formatter. added importers for 1password6 csv, zoho vault csv, password boss json, keepassx csv, and ascendo data vault csv. 2017-01-02 18:20:42 -05:00
Kyle Spearrin
f186ec160a saferpass csv importer 2016-12-31 16:24:11 -05:00
Kyle Spearrin
53fcfd13ee folder and site count to vault list 2016-12-31 15:18:40 -05:00
Kyle Spearrin
c684d66ec0 use reference field names on clipperz importer 2016-12-31 14:52:04 -05:00
Kyle Spearrin
6496f750b0 roboform html importer 2016-12-31 14:48:56 -05:00
Kyle Spearrin
6aaa47cccd avira json importer 2016-12-31 01:00:51 -05:00
Kyle Spearrin
1f6677d610 clipperz html importer 2016-12-31 00:38:12 -05:00
Kyle Spearrin
54b659aff0 true key json importer 2016-12-29 15:33:37 -05:00
Kyle Spearrin
b9db21309e split newline for msecure notes 2016-12-29 11:41:13 -05:00
Kyle Spearrin
8649c3b2b1 msecure csv importer 2016-12-29 02:33:37 -05:00
Kyle Spearrin
6bf6cc365b sticky password importer (#1) 2016-12-28 10:36:44 -05:00
Kyle Spearrin
7c2d5448e8 catch bad data on all importers 2016-12-27 10:36:02 -05:00
Kyle Spearrin
a9f2ef7c10 version bump 2016-12-22 01:38:43 -05:00
Kyle Spearrin
f86bce970e dashlane csv importer (#1) 2016-12-22 01:33:47 -05:00
Kyle Spearrin
6cbd618fb8 password safe importer (#1) 2016-12-21 23:30:47 -05:00
Kyle Spearrin
11787193ed Enpass csv importer (#1) 2016-12-21 22:15:37 -05:00
Kyle Spearrin
45aae6810c added opera extension link 2016-12-19 11:06:29 -05:00
Kyle Spearrin
7f6d571ef1 Clear _aesWithMac too with key clear 2016-12-10 10:34:42 -05:00
Kyle Spearrin
908dc4727c encrypt-then-mac support 2016-12-08 22:21:46 -05:00
Kyle Spearrin
264759cfa0 Version bump and CNAME dist fix 2016-12-03 00:56:41 -05:00
Kyle Spearrin
b5d265526a space between badges 2016-12-01 00:15:35 -05:00
Kyle Spearrin
22290eafb8 update readme with appveyor build badge 2016-12-01 00:14:52 -05:00
Kyle Spearrin
3101e57c36 Reorganization a bit more. Updated readme with build/run instructions. 2016-12-01 00:07:03 -05:00
Kyle Spearrin
b72a52232d reorganize project folder structure and remove asp.net dependency 2016-11-30 23:50:00 -05:00
Kyle Spearrin
a5b8e703fc added node server via gulp serve task 2016-11-30 23:30:08 -05:00
Kyle Spearrin
fb26425f17 tweaks to two factor modal 2016-11-30 23:22:25 -05:00
Kyle Spearrin
3114e20aef remove any spaces from authenticator code input 2016-11-26 18:52:46 -05:00
Kyle Spearrin
a52d2f4b7a added account recovery page 2016-11-14 23:31:54 -05:00
Kyle Spearrin
34e484c377 null check recovery code 2016-11-14 22:45:01 -05:00
Kyle Spearrin
08e8e9ff64 Add recovery code information to two-step login modal, also make verification code required for all actions 2016-11-14 22:38:02 -05:00
Kyle Spearrin
ebf55390eb Added password dragon xml importer #1 2016-11-11 19:21:12 -05:00
Kyle Spearrin
c328144a58 keeper csv import (#1) 2016-11-11 00:10:16 -05:00
Kyle Spearrin
4b583bea9b version bump - 1.4.0 2016-11-09 21:50:04 -05:00
Kyle Spearrin
3f0ca412c6 index checking 2016-11-09 21:49:15 -05:00
Kyle Spearrin
0050b570b4 Added delete option to edit site modal #25 2016-11-09 19:26:02 -05:00
Kyle Spearrin
9405be03b0 Added importer for universal password manager csv format 2016-11-09 18:18:46 -05:00
Kyle Spearrin
b5b706fe06 check badDataLength 2016-11-09 00:42:19 -05:00
Kyle Spearrin
8313d9fa90 Better error handling for imports. Check for bad CSV data on lastpass (when no header row is included). 2016-11-09 00:41:17 -05:00
Kyle Spearrin
93b96b3be7 adjusted add/edit site sort functions for folders 2016-10-22 09:08:17 -04:00
blindly
50e6818f2b Sdd site button to each folder (#17) 2016-10-22 08:43:50 -04:00
Kyle Spearrin
104fb57bd8 Added support for Firefox Password Exporter Addon import. ref #1 2016-10-21 00:10:17 -04:00
Kyle Spearrin
7ba6b2f00a version bump 2016-10-20 08:04:40 -04:00
Kyle Spearrin
d8e8939eca remove old code from 1Password 1pif importer 2016-10-20 08:03:20 -04:00
Kyle Spearrin
26c5f4049d link to help site 2016-10-19 22:52:53 -04:00
Kyle Spearrin
b6c9dba0fc Added Chrome csv importer. Adjustments to 1Password importer in preparation for detecting different formats. 2016-10-19 18:22:18 -04:00
blindly
8badc1a354 Folders should be sorted in alphabetical order when adding or editing a site. 2016-10-19 06:07:10 -04:00
Kyle Spearrin
15097eb1f0 version bump 2016-10-18 22:11:54 -04:00
Kyle Spearrin
986306f811 fix imports error 2016-10-18 21:34:08 -04:00
Kyle Spearrin
c5de290dd4 version bump 2016-10-17 23:26:20 -04:00
Kyle Spearrin
21e9e083f5 nothing was imported error 2016-10-17 23:24:16 -04:00
Kyle Spearrin
517ea65bc9 import validation 2016-10-17 23:18:19 -04:00
Kyle Spearrin
e7a9699226 show import errors as console warning to assist in debugging issues 2016-10-17 23:11:39 -04:00
Kyle Spearrin
52b3dfd0e3 set encoding for to UTF-8 for csv parser 2016-10-17 23:00:44 -04:00
Kyle Spearrin
4c0bde9d87 1.2.0 version bump 2016-10-15 12:30:20 -04:00
Kyle Spearrin
f29bbe4316 adjust password generator to use cryptographically secure RNG 2016-10-15 00:41:03 -04:00
Kyle Spearrin
3c03ed8636 trim url for safeincloud xml import 2016-10-14 23:55:02 -04:00
Kyle Spearrin
71ca4eb84a fix safeincloudcsv value in select option 2016-10-14 23:52:31 -04:00
Kyle Spearrin
30d19b4ee1 import for safeincloud xml 2016-10-14 23:50:39 -04:00
Kyle Spearrin
7b88d30aa8 lowered uri trim to 1000 2016-10-14 23:17:20 -04:00
Kyle Spearrin
0ae11cc40c import for 1password 1pif files 2016-10-14 23:16:37 -04:00
Kyle Spearrin
dd5cda867d trim ridiculously large URLs on import 2016-10-14 21:43:00 -04:00
Kyle Spearrin
2d11bef262 padlock csv import 2016-10-13 23:10:14 -04:00
Kyle Spearrin
5d5d0bfb66 gitter badge 2016-10-13 22:02:46 -04:00
Kyle Spearrin
1b169f368b version bump to 1.1.1 2016-10-13 20:06:55 -04:00
Kyle Spearrin
3375bda789 cache tag for local assets on preprocess build 2016-10-13 19:57:56 -04:00
Kyle Spearrin
6569fbe6aa adjust importers to not require Uri and Passwords 2016-10-13 19:05:53 -04:00
Kyle Spearrin
1d2b82a302 lint fixes for import service. made passwird not required for sites 2016-10-13 18:40:42 -04:00
Kyle Spearrin
004ddb1e75 handle lastpass import when users try to upload html file instead of csv 2016-10-13 00:05:18 -04:00
Kyle Spearrin
400826baf7 minor version bump to 1.1.0 2016-10-12 22:51:59 -04:00
Kyle Spearrin
96ae20d81d fix floating labels for firefox 2016-10-12 22:50:46 -04:00
Kyle Spearrin
ef5f4df30f lint errors in import service 2016-10-12 22:49:04 -04:00
Kyle Spearrin
2ce1b12f6e Handle empty password and uri fields when encrypting/decrypting 2016-10-12 22:26:28 -04:00
Kyle Spearrin
85efba92e6 added importer for keypass 2.x xml 2016-10-12 22:14:39 -04:00
Kyle Spearrin
d17211ff86 added SafeInCloud csv import 2016-10-12 19:02:36 -04:00
Kyle Spearrin
1d5f894211 version bump and removed unnecessary version from npm package.json 2016-10-10 23:31:13 -04:00
Kyle Spearrin
d49d2275d2 normalize email with lowercase 2016-10-10 22:40:44 -04:00
Kyle Spearrin
440032ed4a relax password requirements during registration and change password 2016-10-10 22:02:17 -04:00
Kyle Spearrin
0fb2349a8e uri is not required. changed type to text so that browser does not enforce validation 2016-10-10 21:49:49 -04:00
Kyle Spearrin
41660962b4 set prng paranoia to 10 2016-10-10 21:39:19 -04:00
Kyle Spearrin
8e2f69fa8e license 2016-10-10 18:39:19 -04:00
Kyle Spearrin
16be830655 bump version for 1.0.0 release 2016-10-06 21:58:47 -04:00
Kyle Spearrin
711f1a07e9 fix typo with rememberedEmailCookieName 2016-10-06 21:57:01 -04:00
Kyle Spearrin
35d7f2e5f3 added apps/extensions to sidebar menu as well as get help link. some formatting cleanup 2016-10-06 21:54:54 -04:00
Kyle Spearrin
9478adea88 label hint as optional during registration. formatting. lint updates 2016-10-05 21:24:22 -04:00
Kyle Spearrin
abe6ff074b Password rules for registration and change. 2016-10-03 23:21:45 -04:00
Kyle Spearrin
70dc680dc9 two factor field changed to text to accomedate 0 prefixes 2016-10-03 23:21:45 -04:00
Kyle Spearrin
ec55e4566d Update README.md 2016-10-01 23:32:12 -04:00
Kyle Spearrin
e1a6bb1ddc fix lint issues with === 2016-09-17 23:00:05 -04:00
Kyle Spearrin
2f363c3e3a === warnings 2016-09-02 01:21:01 -04:00
Kyle Spearrin
92e0537bed Added analytics telemetry throughout the application. Make sure angulartics bundles before the ga dependency. 2016-08-11 20:43:05 -04:00
Kyle Spearrin
ffbf25b62f corrected tracking code 2016-08-11 18:15:04 -04:00
Kyle Spearrin
d2605c328f Added angulartics for google analytics tracking. Reformated json and xml files for new VS default (2 space indenting) 2016-08-11 18:05:33 -04:00
Kyle Spearrin
670e427800 Added google analytics tracking code 2016-08-10 18:05:23 -04:00
Kyle Spearrin
2e8789831f Fixed indenting in project.json 2016-08-08 23:53:14 -04:00
Kyle Spearrin
08d5c36f16 sort (none) folder last. Updated to .NET Core runtime. 2016-08-08 23:50:47 -04:00
Kyle Spearrin
0996ef86b7 rename "vault" to "web" 2016-08-08 19:09:19 -04:00
Kyle Spearrin
69be7be0e5 Fixed delete route 2016-07-13 21:42:28 -04:00
Kyle Spearrin
e3b98dbda4 Move all non-gets to POST in API to avoid CORS preflight 2016-07-13 20:03:57 -04:00
Kyle Spearrin
0838eff6bf update adminlte to 2.3.5 2016-07-13 19:50:31 -04:00
Kyle Spearrin
269a10fe1c Move to query string jwt token and content-type "text/plain" for POST to avoid pre-flight CORS requests. Remove GET cache headers (will move to server response headers). 2016-07-13 19:49:26 -04:00
Kyle Spearrin
fff64877ff update to aspnet core rtm 2016-07-13 18:38:55 -04:00
Kyle Spearrin
1acacf5bb6 favorite fix on lastpass import 2016-07-09 16:16:34 -04:00
Kyle Spearrin
4788d3919c updated to admin-lte v2.3.4 2016-07-02 11:44:52 -04:00
Kyle Spearrin
8dce9fe049 updared libraries and fixed lint issues 2016-06-09 21:17:15 -04:00
Kyle Spearrin
4b2cbb3e00 remove old register finalize ref 2016-06-09 19:18:00 -04:00
Kyle Spearrin
7005cee595 Added new favorite flag to sites. 2016-06-08 22:45:15 -04:00
Kyle Spearrin
4cf404d9c3 react to cipher import api change 2016-06-07 20:05:49 -04:00
Kyle Spearrin
35bdc82243 Upgrade to ASP.NET Core RC2 release. 2016-05-19 23:16:27 -04:00
Kyle Spearrin
fbeedec694 moved registration process to instant with no email confirmation 2016-03-08 21:20:21 -05:00
Kyle Spearrin
27ab6950a0 Updated jQuery and Angular in index file. 2016-02-06 12:07:05 -05:00
Kyle Spearrin
6e7a86dfcc Updated angular to 1.5.0. Updated several other libs as well. 2016-02-06 01:20:47 -05:00
Kyle Spearrin
eab65f982e added gravatar photo to settings page. moved action items in vault listing to left side for better mobile access 2016-01-07 23:00:44 -05:00
Kyle Spearrin
f68f3748d2 created import service. added local importing. 2015-12-30 20:53:43 -05:00
Kyle Spearrin
bd8dd9daf0 updated packages 2015-12-29 22:26:40 -05:00
Kyle Spearrin
9260be798e Loading messages for vault. 2015-12-29 22:01:37 -05:00
Kyle Spearrin
2bc5d92c78 Added import processing message. 2015-12-29 21:47:07 -05:00
Kyle Spearrin
0c32e890b3 Added settings account delete 2015-12-27 00:15:35 -05:00
Kyle Spearrin
9aa62e748c Added import for lastpass csv. Username no longer required. 2015-12-26 23:15:35 -05:00
Kyle Spearrin
49921f7355 adjusted viewport settings for mobile. fixed https error when resolving gravatar photo 2015-12-26 11:28:18 -05:00
Kyle Spearrin
3f0b652f29 copy CNAME on dist build 2015-12-08 22:54:29 -05:00
Kyle Spearrin
df69bdbc21 initial commit of source 2015-12-08 22:35:05 -05:00
154 changed files with 15663 additions and 0 deletions

202
.gitignore vendored Normal file
View File

@@ -0,0 +1,202 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Visual Studo 2015 cache/options directory
.vs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/
lib/
css/
dist/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Other
project.lock.json

674
LICENSE.txt Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

31
README.md Normal file
View File

@@ -0,0 +1,31 @@
[![appveyor build](https://ci.appveyor.com/api/projects/status/github/bitwarden/web?branch=master&svg=true)](https://ci.appveyor.com/project/bitwarden/web) [![Join the chat at https://gitter.im/bitwarden/Lobby](https://badges.gitter.im/bitwarden/Lobby.svg)](https://gitter.im/bitwarden/Lobby)
# bitwarden Web
The bitwarden Web project is an AngularJS application that powers the web vault (https://vault.bitwarden.com/).
<img src="https://i.imgur.com/rxrykeX.png" alt="" width="791" height="739" />
# Build/Run
**Requirements**
- Node.js
- Gulp
Unless you are running the [Core](https://github.com/bitwarden/core) API locally, you'll probably need to switch the
application to target the production API. Open `package.json` and set `production` to `true`.
Then run the following commands:
- `npm install`
- `gulp build`
- `gulp serve`
You can now access the web vault at `http://localhost:4001`.
# Contribute
Code contributions are welcome! Please commit any pull requests against the `master` branch.
Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the [`SECURITY.md`](SECURITY.md) file.

45
SECURITY.md Normal file
View File

@@ -0,0 +1,45 @@
bitwarden believes that working with security researchers across the globe is crucial to keeping our
users safe. If you believe you've found a security issue in our product or service, we encourage you to
notify us. We welcome working with you to resolve the issue promptly. Thanks in advance!
# Disclosure Policy
- Let us know as soon as possible upon discovery of a potential security issue, and we'll make every
effort to quickly resolve the issue.
- Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a
third-party. We may publicly disclose the issue before resolving it, if appropriate.
- Make a good faith effort to avoid privacy violations, destruction of data, and interruption or
degradation of our service. Only interact with accounts you own or with explicit permission of the
account holder.
- If you would like to encrypt your report, please use the PGP key with long ID
`0xDE6887086F892325FEC04CC0D847525B6931381F` (available in the public keyserver pool).
# In-scope
- Security issues in any current release of bitwarden. This includes the web vault, browser extension,
and mobile apps (iOS and Android). Product downloads are available at https://bitwarden.com. Source
code is available at https://github.com/bitwarden.
# Exclusions
The following bug classes are out-of scope:
- Bugs that are already reported on any of bitwarden's issue trackers (https://github.com/bitwarden),
or that we already know of. Note that some of our issue tracking is private.
- Issues in an upstream software dependency (ex: Xamarin, ASP.NET) which are already reported to the
upstream maintainer.
- Attacks requiring physical access to a user's device.
- Self-XSS
- Issues related to software or protocols not under bitwarden's control
- Vulnerabilities in outdated versions of bitwarden
- Missing security best practices that do not directly lead to a vulnerability
- Issues that do not have any impact on the general public
While researching, we'd like to ask you to refrain from:
- Denial of service
- Spamming
- Social engineering (including phishing) of bitwarden staff or contractors
- Any physical attempts against bitwarden property or data centers
Thank you for helping keep bitwarden and our users safe!

39
bitwarden-web.sln Normal file
View File

@@ -0,0 +1,39 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "bitwarden-web", ".", "{25BEDEF4-2CAF-445A-807D-63C17FF85694}"
ProjectSection(WebsiteProperties) = preProject
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.6.1"
Debug.AspNetCompiler.VirtualPath = "/localhost_15509"
Debug.AspNetCompiler.PhysicalPath = "."
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_15509\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_15509"
Release.AspNetCompiler.PhysicalPath = "."
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_15509\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "15509"
SlnRelativePath = "."
DefaultWebSiteLanguage = "Visual C#"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{25BEDEF4-2CAF-445A-807D-63C17FF85694}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25BEDEF4-2CAF-445A-807D-63C17FF85694}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

401
gulpfile.js Normal file
View File

@@ -0,0 +1,401 @@
/// <binding BeforeBuild='build, dist' Clean='clean' ProjectOpened='build. dist' />
var gulp = require('gulp'),
rimraf = require('rimraf'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
cssmin = require('gulp-cssmin'),
uglify = require('gulp-uglify'),
ghPages = require('gulp-gh-pages'),
less = require('gulp-less'),
connect = require('gulp-connect'),
ngAnnotate = require('gulp-ng-annotate'),
preprocess = require('gulp-preprocess'),
runSequence = require('run-sequence'),
merge = require('merge-stream'),
ngConfig = require('gulp-ng-config'),
settings = require('./settings.json'),
project = require('./package.json'),
jshint = require('gulp-jshint'),
_ = require('lodash'),
webpack = require('webpack-stream'),
browserify = require('browserify'),
derequire = require('gulp-derequire'),
source = require('vinyl-source-stream');
var paths = {};
paths.dist = './dist/';
paths.webroot = './src/'
paths.js = paths.webroot + 'js/**/*.js';
paths.minJs = paths.webroot + 'js/**/*.min.js';
paths.concatJsDest = paths.webroot + 'js/bw.min.js';
paths.libDir = paths.webroot + 'lib/';
paths.npmDir = 'node_modules/';
paths.lessDir = paths.webroot + 'less/';
paths.cssDir = paths.webroot + 'css/';
paths.jsDir = paths.webroot + 'js/';
var randomString = Math.random().toString(36).substring(7);
gulp.task('lint', function () {
return gulp.src(paths.webroot + 'app/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('build', function (cb) {
return runSequence(
'clean',
['browserify', 'lib', 'webpack', 'less', 'settings', 'lint'],
cb);
});
gulp.task('clean:js', function (cb) {
return rimraf(paths.concatJsDest, cb);
});
gulp.task('clean:css', function (cb) {
return rimraf(paths.cssDir, cb);
});
gulp.task('clean:lib', function (cb) {
return rimraf(paths.libDir, cb);
});
gulp.task('clean', ['clean:js', 'clean:css', 'clean:lib', 'dist:clean']);
gulp.task('min:js', ['clean:js'], function () {
return gulp.src([paths.js, '!' + paths.minJs], { base: '.' })
.pipe(concat(paths.concatJsDest))
.pipe(uglify())
.pipe(gulp.dest('.'));
});
gulp.task('min:css', [], function () {
return gulp.src([paths.cssDir + '**/*.css', '!' + paths.cssDir + '**/*.min.css'], { base: '.' })
.pipe(cssmin())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('.'));
});
gulp.task('min', ['min:js', 'min:css']);
gulp.task('lib', ['clean:lib'], function () {
var libs = [
{
src: [
paths.npmDir + 'bootstrap/dist/**/*',
'!' + paths.npmDir + 'bootstrap/dist/**/npm.js',
'!' + paths.npmDir + 'bootstrap/dist/**/css/*theme*'
],
dest: paths.libDir + 'bootstrap'
},
{
src: paths.npmDir + 'font-awesome/css/*',
dest: paths.libDir + 'font-awesome/css'
},
{
src: paths.npmDir + 'font-awesome/fonts/*',
dest: paths.libDir + 'font-awesome/fonts'
},
{
src: paths.npmDir + 'jquery/dist/*.js',
dest: paths.libDir + 'jquery'
},
{
src: paths.npmDir + 'admin-lte/dist/js/app*.js',
dest: paths.libDir + 'admin-lte/js'
},
{
src: paths.npmDir + 'angular/angular*.js',
dest: paths.libDir + 'angular'
},
{
src: paths.npmDir + 'angular-ui-bootstrap/dist/*tpls*.js',
dest: paths.libDir + 'angular-ui-bootstrap'
},
{
src: paths.npmDir + 'angular-bootstrap-show-errors/src/*.js',
dest: paths.libDir + 'angular-bootstrap-show-errors'
},
{
src: paths.npmDir + 'angular-cookies/*cookies*.js',
dest: paths.libDir + 'angular-cookies'
},
{
src: paths.npmDir + 'angular-jwt/dist/*.js',
dest: paths.libDir + 'angular-jwt'
},
{
src: paths.npmDir + 'angular-resource/*resource*.js',
dest: paths.libDir + 'angular-resource'
},
{
src: [paths.npmDir + 'angular-toastr/dist/**/*.css', paths.npmDir + 'angular-toastr/dist/**/*.js'],
dest: paths.libDir + 'angular-toastr'
},
{
src: paths.npmDir + 'angular-ui-router/release/*.js',
dest: paths.libDir + 'angular-ui-router'
},
{
src: paths.npmDir + 'angular-messages/*messages*.js',
dest: paths.libDir + 'angular-messages'
},
{
src: paths.npmDir + 'ngstorage/*.js',
dest: paths.libDir + 'ngstorage'
},
{
src: paths.npmDir + 'papaparse/papaparse*.js',
dest: paths.libDir + 'papaparse'
},
{
src: paths.npmDir + 'ngclipboard/dist/ngclipboard*.js',
dest: paths.libDir + 'ngclipboard'
},
{
src: paths.npmDir + 'clipboard/dist/clipboard*.js',
dest: paths.libDir + 'clipboard'
},
{
src: paths.npmDir + 'node-forge/dist/prime.worker.*',
dest: paths.libDir + 'forge'
},
{
src: [
paths.npmDir + 'angulartics-google-analytics/lib/angulartics*.js',
paths.npmDir + 'angulartics/src/angulartics.js'
],
dest: paths.libDir + 'angulartics'
}
];
var tasks = libs.map(function (lib) {
return gulp.src(lib.src).pipe(gulp.dest(lib.dest));
});
return merge(tasks);
});
gulp.task('webpack', ['webpack:forge']);
gulp.task('webpack:forge', function () {
var forgeDir = paths.npmDir + '/node-forge/lib/';
return gulp.src([
forgeDir + 'pbkdf2.js',
forgeDir + 'aes.js',
forgeDir + 'rsa.js',
forgeDir + 'hmac.js',
forgeDir + 'sha256.js',
forgeDir + 'random.js',
forgeDir + 'forge.js'
]).pipe(webpack({
output: {
filename: 'forge.js',
library: 'forge',
libraryTarget: 'umd'
},
node: {
Buffer: false,
process: false,
crypto: false,
setImmediate: false
}
})).pipe(gulp.dest(paths.libDir + 'forge'));
});
gulp.task('settings', function () {
return config()
.pipe(gulp.dest(paths.webroot + 'app'));
});
function config() {
return gulp.src('./settings.json')
.pipe(ngConfig('bit', {
createModule: false,
constants: _.merge({}, {
appSettings: {
version: project.version,
environment: project.env
}
}, require('./settings' + (project.env !== 'Development' ? ('.' + project.env) : '') + '.json') || {})
}));
}
gulp.task('less', function () {
return gulp.src(paths.lessDir + 'vault.less')
.pipe(less())
.pipe(gulp.dest(paths.cssDir));
});
gulp.task('watch', function () {
gulp.watch(paths.lessDir + '*.less', ['less']);
gulp.watch('./settings*.json', ['settings']);
});
gulp.task('browserify', ['browserify:stripe', 'browserify:cc']);
gulp.task('browserify:stripe', function () {
return browserify(paths.npmDir + 'angular-stripe/src/index.js',
{
entry: '.',
standalone: 'angularStripe',
global: true
})
.transform('exposify', { expose: { angular: 'angular' } })
.bundle()
.pipe(source('angular-stripe.js'))
.pipe(derequire())
.pipe(gulp.dest(paths.libDir + 'angular-stripe'));
});
gulp.task('browserify:cc', function () {
return browserify(paths.npmDir + 'angular-credit-cards/src/index.js',
{
entry: '.',
standalone: 'angularCreditCards'
})
.transform('exposify', { expose: { angular: 'angular' } })
.bundle()
.pipe(source('angular-credit-cards.js'))
.pipe(derequire())
.pipe(gulp.dest(paths.libDir + 'angular-credit-cards'));
});
gulp.task('dist:clean', function (cb) {
return rimraf(paths.dist, cb);
});
gulp.task('dist:move', function () {
var moves = [
{
src: './CNAME',
dest: paths.dist
},
{
src: [
paths.npmDir + 'bootstrap/dist/**/bootstrap.min.js',
paths.npmDir + 'bootstrap/dist/**/bootstrap.min.css',
paths.npmDir + 'bootstrap/dist/**/fonts/**/*',
],
dest: paths.dist + 'lib/bootstrap'
},
{
src: [
paths.npmDir + 'font-awesome/**/font-awesome.min.css',
paths.npmDir + 'font-awesome/**/fonts/**/*'
],
dest: paths.dist + 'lib/font-awesome'
},
{
src: paths.npmDir + 'jquery/dist/jquery.min.js',
dest: paths.dist + 'lib/jquery'
},
{
src: paths.npmDir + 'angular/angular.min.js',
dest: paths.dist + 'lib/angular'
},
{
src: paths.npmDir + 'node-forge/dist/prime.worker.*',
dest: paths.dist + 'lib/forge'
},
{
src: [
paths.webroot + '**/app/**/*.html',
paths.webroot + '**/images/**/*',
paths.webroot + 'index.html',
paths.webroot + 'favicon.ico'
],
dest: paths.dist
}
];
var tasks = moves.map(function (move) {
return gulp.src(move.src).pipe(gulp.dest(move.dest));
});
return merge(tasks);
});
gulp.task('dist:css', function () {
return gulp
.src([
paths.cssDir + '**/*.css',
'!' + paths.cssDir + '**/*.min.css'
])
.pipe(preprocess({ context: { cacheTag: randomString } }))
.pipe(cssmin())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest(paths.dist + 'css'));
});
gulp.task('dist:js:app', function () {
var mainStream = gulp
.src([
paths.webroot + 'app/app.js',
'!' + paths.webroot + 'app/settings.js',
paths.webroot + 'app/**/*Module.js',
paths.webroot + 'app/**/*.js'
]);
merge(mainStream, config())
.pipe(preprocess({ context: { cacheTag: randomString } }))
.pipe(concat(paths.dist + '/js/app.min.js'))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(gulp.dest('.'));
});
gulp.task('dist:js:lib', function () {
return gulp
.src([
paths.libDir + 'angulartics/angulartics.js',
paths.libDir + '**/*.js',
'!' + paths.libDir + '**/*.min.js',
'!' + paths.libDir + 'angular/**/*',
'!' + paths.libDir + 'bootstrap/**/*',
'!' + paths.libDir + 'jquery/**/*'
])
.pipe(concat(paths.dist + '/js/lib.min.js'))
.pipe(uglify())
.pipe(gulp.dest('.'));
});
gulp.task('dist:preprocess', function () {
return gulp
.src([
paths.dist + '/**/*.html'
], { base: '.' })
.pipe(preprocess({ context: { cacheTag: randomString } }))
.pipe(gulp.dest('.'));
});
gulp.task('dist', ['build'], function (cb) {
return runSequence(
'dist:clean',
['dist:move', 'dist:css', 'dist:js:app', 'dist:js:lib'],
'dist:preprocess',
cb);
});
gulp.task('deploy', ['dist'], function () {
return gulp.src(paths.dist + '**/*')
.pipe(ghPages({ cacheDir: paths.dist + '.publish' }));
});
gulp.task('deploy-preview', ['dist'], function () {
return gulp.src(paths.dist + '**/*')
.pipe(ghPages({
cacheDir: paths.dist + '.publish',
remoteUrl: 'git@github.com:bitwarden/web-preview.git'
}));
});
gulp.task('serve', function () {
connect.server({
port: 4001,
root: ['src']
});
});

52
package.json Normal file
View File

@@ -0,0 +1,52 @@
{
"name": "bitwarden",
"version": "1.11.0",
"env": "Production",
"devDependencies": {
"connect": "3.6.0",
"lodash": "4.17.4",
"gulp": "3.9.1",
"gulp-concat": "2.6.1",
"gulp-cssmin": "0.1.7",
"gulp-less": "3.3.0",
"gulp-rename": "1.2.2",
"gulp-uglify": "2.1.2",
"gulp-gh-pages": "0.5.4",
"gulp-preprocess": "2.0.0",
"gulp-ng-annotate": "2.0.0",
"gulp-ng-config": "1.4.0",
"gulp-connect": "5.0.0",
"jshint": "2.9.4",
"gulp-jshint": "2.0.4",
"rimraf": "2.6.1",
"run-sequence": "1.2.2",
"merge-stream": "1.0.1",
"jquery": "2.2.4",
"font-awesome": "4.7.0",
"bootstrap": "3.3.7",
"angular": "1.6.3",
"angular-resource": "1.6.3",
"angular-ui-bootstrap": "2.5.0",
"angular-ui-router": "0.4.2",
"angular-jwt": "0.1.9",
"angular-cookies": "1.6.3",
"admin-lte": "2.3.11",
"angular-toastr": "2.1.1",
"angular-bootstrap-show-errors": "2.3.0",
"angular-messages": "1.6.3",
"ngstorage": "0.3.11",
"papaparse": "4.2.0",
"clipboard": "1.6.1",
"ngclipboard": "1.1.1",
"angulartics": "1.4.0",
"angulartics-google-analytics": "0.4.0",
"node-forge": "0.7.1",
"webpack-stream": "3.2.0",
"angular-stripe": "4.2.12",
"angular-credit-cards": "3.1.6",
"browserify": "14.1.0",
"vinyl-source-stream": "1.1.0",
"gulp-derequire": "2.1.0",
"exposify": "0.5.0"
}
}

7
settings.Preview.json Normal file
View File

@@ -0,0 +1,7 @@
{
"appSettings": {
"apiUri": "https://preview-api.bitwarden.com",
"identityUri": "https://preview-identity.bitwarden.com",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD"
}
}

7
settings.Production.json Normal file
View File

@@ -0,0 +1,7 @@
{
"appSettings": {
"apiUri": "https://api.bitwarden.com",
"identityUri": "https://identity.bitwarden.com",
"stripeKey": "pk_live_bpN0P37nMxrMQkcaHXtAybJk"
}
}

7
settings.json Normal file
View File

@@ -0,0 +1,7 @@
{
"appSettings": {
"apiUri": "http://localhost:4000",
"identityUri": "http://localhost:33656",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD"
}
}

View File

@@ -0,0 +1,79 @@
angular
.module('bit.accounts')
.controller('accountsLoginController', function ($scope, $rootScope, $cookies, apiService, cryptoService, authService,
$state, constants, $analytics) {
$scope.state = $state;
var returnState;
if (!$state.params.returnState && $state.params.org) {
returnState = {
name: 'backend.user.settingsCreateOrg',
params: { plan: $state.params.org }
};
}
else {
returnState = $state.params.returnState;
}
var rememberedEmail = $cookies.get(constants.rememberedEmailCookieName);
if (rememberedEmail || $state.params.email) {
$scope.model = {
email: $state.params.email ? $state.params.email : rememberedEmail,
rememberEmail: rememberedEmail !== null
};
}
var email,
masterPassword;
$scope.login = function (model) {
$scope.loginPromise = authService.logIn(model.email, model.masterPassword);
$scope.loginPromise.then(function (twoFactorProviders) {
if (model.rememberEmail) {
var cookieExpiration = new Date();
cookieExpiration.setFullYear(cookieExpiration.getFullYear() + 10);
$cookies.put(
constants.rememberedEmailCookieName,
model.email,
{ expires: cookieExpiration });
}
else {
$cookies.remove(constants.rememberedEmailCookieName);
}
if (twoFactorProviders && twoFactorProviders.length > 0) {
email = model.email;
masterPassword = model.masterPassword;
$analytics.eventTrack('Logged In To Two-step');
$state.go('frontend.login.twoFactor', { returnState: returnState });
}
else {
$analytics.eventTrack('Logged In');
loggedInGo();
}
});
};
$scope.twoFactor = function (model) {
// Only supporting Authenticator (0) provider for now
$scope.twoFactorPromise = authService.logIn(email, masterPassword, model.code, 0);
$scope.twoFactorPromise.then(function () {
$analytics.eventTrack('Logged In From Two-step');
loggedInGo();
});
};
function loggedInGo() {
if (returnState) {
$state.go(returnState.name, returnState.params);
}
else {
$state.go('backend.user.vault');
}
}
});

View File

@@ -0,0 +1,8 @@
angular
.module('bit.accounts')
.controller('accountsLogoutController', function ($scope, authService, $state, $analytics) {
authService.logOut();
$analytics.eventTrack('Logged Out');
$state.go('frontend.login.info');
});

View File

@@ -0,0 +1,2 @@
angular
.module('bit.accounts', ['ui.bootstrap', 'ngCookies']);

View File

@@ -0,0 +1,49 @@
angular
.module('bit.accounts')
.controller('accountsOrganizationAcceptController', function ($scope, $state, apiService, authService, toastr, $analytics) {
$scope.state = {
name: $state.current.name,
params: $state.params
};
if (!$state.params.organizationId || !$state.params.organizationUserId || !$state.params.token ||
!$state.params.email || !$state.params.organizationName) {
$state.go('frontend.login.info').then(function () {
toastr.error('Invalid parameters.');
});
return;
}
$scope.$on('$viewContentLoaded', function () {
if (authService.isAuthenticated()) {
$scope.accepting = true;
apiService.organizationUsers.accept(
{
orgId: $state.params.organizationId,
id: $state.params.organizationUserId
},
{
token: $state.params.token
}, function () {
$analytics.eventTrack('Accepted Invitation');
$state.go('backend.user.vault', null, { location: 'replace' }).then(function () {
toastr.success('You can access this organization once an administrator confirms your membership.' +
' We\'ll send an email when that happens.', 'Invite Accepted', { timeOut: 10000 });
});
}, function () {
$analytics.eventTrack('Failed To Accept Invitation');
$state.go('backend.user.vault', null, { location: 'replace' }).then(function () {
toastr.error('Unable to accept invitation.', 'Error');
});
});
}
else {
$scope.loading = false;
}
});
$scope.submit = function (model) {
};
});

View File

@@ -0,0 +1,13 @@
angular
.module('bit.accounts')
.controller('accountsPasswordHintController', function ($scope, $rootScope, apiService, $analytics) {
$scope.success = false;
$scope.submit = function (model) {
$scope.submitPromise = apiService.accounts.postPasswordHint({ email: model.email }, function () {
$analytics.eventTrack('Requested Password Hint');
$scope.success = true;
}).$promise;
};
});

View File

@@ -0,0 +1,22 @@
angular
.module('bit.accounts')
.controller('accountsRecoverController', function ($scope, apiService, cryptoService, $analytics) {
$scope.success = false;
$scope.submit = function (model) {
var email = model.email.toLowerCase();
var key = cryptoService.makeKey(model.masterPassword, email);
var request = {
email: email,
masterPasswordHash: cryptoService.hashPassword(model.masterPassword, key),
recoveryCode: model.code.replace(/\s/g, '').toLowerCase()
};
$scope.submitPromise = apiService.accounts.postTwoFactorRecover(request, function () {
$analytics.eventTrack('Recovered 2FA');
$scope.success = true;
}).$promise;
};
});

View File

@@ -0,0 +1,71 @@
angular
.module('bit.accounts')
.controller('accountsRegisterController', function ($scope, $location, apiService, cryptoService, validationService,
$analytics, $state) {
var params = $location.search();
var stateParams = $state.params;
$scope.createOrg = stateParams.org;
if (!stateParams.returnState && stateParams.org) {
$scope.returnState = {
name: 'backend.user.settingsCreateOrg',
params: { plan: $state.params.org }
};
}
else {
$scope.returnState = stateParams.returnState;
}
$scope.success = false;
$scope.model = {
email: params.email ? params.email : stateParams.email
};
$scope.readOnlyEmail = stateParams.email !== null;
$scope.registerPromise = null;
$scope.register = function (form) {
var error = false;
if ($scope.model.masterPassword.length < 8) {
validationService.addError(form, 'MasterPassword', 'Master password must be at least 8 characters long.', true);
error = true;
}
if ($scope.model.masterPassword !== $scope.model.confirmMasterPassword) {
validationService.addError(form, 'ConfirmMasterPassword', 'Master password confirmation does not match.', true);
error = true;
}
if (error) {
return;
}
var email = $scope.model.email.toLowerCase();
var key = cryptoService.makeKey($scope.model.masterPassword, email);
$scope.registerPromise = cryptoService.makeKeyPair(key).then(function (result) {
var request = {
name: $scope.model.name,
email: email,
masterPasswordHash: cryptoService.hashPassword($scope.model.masterPassword, key),
masterPasswordHint: $scope.model.masterPasswordHint,
keys: {
publicKey: result.publicKey,
encryptedPrivateKey: result.privateKeyEnc
}
};
return apiService.accounts.register(request).$promise;
}, function (errors) {
validationService.addError(form, null, 'Problem generating keys.', true);
return false;
}).then(function (result) {
if (result === false) {
return;
}
$scope.success = true;
$analytics.eventTrack('Registered');
});
};
});

View File

@@ -0,0 +1,7 @@
<div class="login-box">
<div class="login-logo">
<i class="fa fa-shield"></i> <b>bit</b>warden
</div>
<div class="login-box-body" ui-view>
</div>
</div>

View File

@@ -0,0 +1,49 @@
<p class="login-box-msg">Log in to access your vault.</p>
<form name="loginForm" ng-submit="loginForm.$valid && login(model)" api-form="loginPromise">
<div class="callout callout-danger validation-errors" ng-show="loginForm.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in loginForm.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group has-feedback" show-errors>
<label for="email" class="sr-only">Email</label>
<input type="email" id="email" name="Email" class="form-control" placeholder="Email" ng-model="model.email"
required api-field />
<span class="fa fa-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback" show-errors>
<label for="masterPassword" class="sr-only">Master Password</label>
<input type="password" id="masterPassword" name="MasterPasswordHash" class="form-control" placeholder="Master Password"
ng-model="model.masterPassword"
required api-field />
<span class="fa fa-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-7">
<div class="checkbox">
<label>
<input type="checkbox" id="rememberEmail" ng-model="model.rememberEmail" /> Remember Email
</label>
</div>
</div>
<div class="col-xs-5">
<button type="submit" class="btn btn-primary btn-block btn-flat" ng-disabled="loginForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="loginForm.$loading"></i>Log In
</button>
</div>
</div>
<hr />
<ul>
<li>
<a ui-sref="frontend.register({returnState: state.params.returnState, email: state.params.email})">
Create a new account
</a>
</li>
<li>
<a ui-sref="frontend.passwordHint">
Get master password hint
</a>
</li>
</ul>
</form>

View File

@@ -0,0 +1,25 @@
<p class="login-box-msg">Enter your two-step verification code.</p>
<form name="twoFactorForm" ng-submit="twoFactorForm.$valid && twoFactor(model)" api-form="twoFactorPromise">
<div class="callout callout-danger validation-errors" ng-show="twoFactorForm.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in twoFactorForm.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group has-feedback" show-errors>
<label for="code" class="sr-only">Code</label>
<input type="text" id="code" name="Code" class="form-control" placeholder="Verification code" ng-model="model.code"
required api-field />
<span class="fa fa-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-7">
<a ui-sref="frontend.recover">Lost authenticator app?</a>
</div>
<div class="col-xs-5">
<button type="submit" class="btn btn-primary btn-block btn-flat" ng-disabled="twoFactorForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="twoFactorForm.$loading"></i>Log In
</button>
</div>
</div>
</form>

View File

@@ -0,0 +1,32 @@
<div class="login-box">
<div class="login-logo">
<i class="fa fa-shield"></i> <b>bit</b>warden
</div>
<div class="login-box-body">
<div ng-show="loading">
Loading...
</div>
<div ng-show="accepting">
Accepting invitation...
</div>
<div ng-show="!loading && !accepting">
<p class="login-box-msg">Join {{state.params.organizationName}}</p>
<p class="text-center"><strong>{{state.params.email}}</strong></p>
<p>
You've been invited to join the organization listed above.
To accept the invitation, you need to log in or create a new bitwarden account.
</p>
<hr />
<div class="row">
<div class="col-sm-6">
<a ui-sref="frontend.login.info({returnState: state, email: state.params.email})"
class="btn btn-primary btn-block btn-flat">Log In</a>
</div>
<div class="col-sm-6">
<a ui-sref="frontend.register({returnState: state, email: state.params.email})"
class="btn btn-primary btn-block btn-flat">Create Account</a>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,39 @@
<div class="login-box">
<div class="login-logo">
<i class="fa fa-shield"></i> <b>bit</b>warden
</div>
<div class="login-box-body">
<p class="login-box-msg">Get your master password hint.</p>
<div class="text-center" ng-show="success">
<div class="callout callout-success">
If your account exists ({{model.email}}) we've sent you an email with your master password hint.
</div>
<a ui-sref="frontend.login.info">Ready to log in?</a>
</div>
<form name="passwordHintForm" ng-submit="passwordHintForm.$valid && submit(model)" ng-show="!success"
api-form="submitPromise">
<div class="callout callout-danger validation-errors" ng-show="passwordHintForm.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in passwordHintForm.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group has-feedback" show-errors>
<label for="email" class="sr-only">Your account email address</label>
<input type="email" id="email" name="Email" class="form-control" placeholder="Your account email address"
ng-model="model.email" required api-field />
<span class="fa fa-envelope form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-7">
<a ui-sref="frontend.login.info">Ready to log in?</a>
</div>
<div class="col-xs-5">
<button type="submit" class="btn btn-primary btn-block btn-flat" ng-disabled="passwordHintForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="passwordHintForm.$loading"></i>Submit
</button>
</div>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,52 @@
<div class="login-box">
<div class="login-logo">
<i class="fa fa-shield"></i> <b>bit</b>warden
</div>
<div class="login-box-body">
<p class="login-box-msg">Lost your authenticator app?</p>
<div class="text-center" ng-show="success">
<div class="callout callout-success">
Two-step login has been successfully disabled on your account.
</div>
<a ui-sref="frontend.login.info">Ready to log in?</a>
</div>
<form name="recoverForm" ng-submit="recoverForm.$valid && submit(model)" ng-show="!success"
api-form="submitPromise">
<div class="callout callout-danger validation-errors" ng-show="recoverForm.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in recoverForm.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group has-feedback" show-errors>
<label for="email" class="sr-only">Email</label>
<input type="email" id="email" name="Email" class="form-control" placeholder="Email" ng-model="model.email"
required api-field />
<span class="fa fa-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback" show-errors>
<label for="masterPassword" class="sr-only">Master Password</label>
<input type="password" id="masterPassword" name="MasterPasswordHash" class="form-control" placeholder="Master Password"
ng-model="model.masterPassword"
required api-field />
<span class="fa fa-lock form-control-feedback"></span>
</div>
<div class="form-group has-feedback" show-errors>
<label for="code" class="sr-only">Recovery code</label>
<input type="text" id="code" name="RecoveryCode" class="form-control" placeholder="Recovery code"
ng-model="model.code" required api-field />
<span class="fa fa-key form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-7">
<a ui-sref="frontend.login.info">Ready to log in?</a>
</div>
<div class="col-xs-5">
<button type="submit" class="btn btn-primary btn-block btn-flat" ng-disabled="recoverForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="recoverForm.$loading"></i>Submit
</button>
</div>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,77 @@
<div class="register-box">
<div class="register-logo">
<i class="fa fa-shield"></i> <b>bit</b>warden
</div>
<div class="register-box-body">
<p class="login-box-msg">Create a new account.</p>
<div class="text-center" ng-show="success">
<div class="callout callout-success">
<h4>Account Created!</h4>
<p>You may now log in to your new account.</p>
</div>
<a ui-sref="frontend.login.info({returnState: returnState, email: model.email})">Ready to log in?</a>
</div>
<form name="registerForm" ng-submit="registerForm.$valid && register(registerForm)" ng-show="!success"
api-form="registerPromise">
<div class="callout callout-default" ng-show="createOrg">
<h4>Create Organization, Step 1</h4>
<p>Before creating your organization, you first need to create a free personal account.</p>
</div>
<div class="callout callout-danger validation-errors" ng-show="registerForm.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in registerForm.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group has-feedback" show-errors>
<label for="email" class="sr-only">Email</label>
<input type="email" id="email" name="Email" class="form-control" placeholder="Email" ng-model="model.email"
ng-readonly="readOnlyEmail" required api-field />
<span class="fa fa-envelope form-control-feedback"></span>
<p class="help-block">You'll use your email address to log in.</p>
</div>
<div class="form-group has-feedback" show-errors>
<label for="name" class="sr-only">Your Name</label>
<input type="text" id="name" name="Name" class="form-control" ng-model="model.name"
placeholder="Your Name" api-field>
<span class="fa fa-user form-control-feedback"></span>
<p class="help-block">What should we call you?</p>
</div>
<div class="form-group has-feedback" show-errors>
<label for="masterPassword" class="sr-only">Master Password</label>
<input type="password" id="masterPassword" name="MasterPasswordHash" class="form-control"
ng-model="model.masterPassword" placeholder="Master Password" required api-field>
<span class="fa fa-lock form-control-feedback"></span>
<p class="help-block">The master password is the password you use to access your vault.</p>
</div>
<div class="form-group has-feedback" show-errors>
<label form="confirmMasterPassword" class="sr-only">Re-type Master Password</label>
<input type="password" id="confirmMasterPassword" name="ConfirmMasterPassword" class="form-control"
placeholder="Re-type Master Password"
ng-model="model.confirmMasterPassword" required api-field>
<span class="fa fa-lock form-control-feedback"></span>
<p class="help-block">
It is very important that you do not forget your master password.
There is <u>no way</u> to recover the password in the event that you forget it.
</p>
</div>
<div class="form-group has-feedback" show-errors>
<label for="hint" class="sr-only">Master Password Hint (optional)</label>
<input type="text" id="hint" name="MasterPasswordHint" class="form-control" ng-model="model.masterPasswordHint"
placeholder="Master Password Hint (optional)" api-field>
<span class="fa fa-lightbulb-o form-control-feedback"></span>
<p class="help-block">A master password hint can help you remember your password if you forget it.</p>
</div>
<div class="row">
<div class="col-xs-7">
<a ui-sref="frontend.login.info({returnState: returnState})">Already have an account?</a>
</div>
<div class="col-xs-5">
<button type="submit" class="btn btn-primary btn-block btn-flat" ng-disabled="registerForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="registerForm.$loading"></i>Submit
</button>
</div>
</div>
</form>
</div>
</div>

29
src/app/apiInterceptor.js Normal file
View File

@@ -0,0 +1,29 @@
angular
.module('bit')
.factory('apiInterceptor', function ($injector, $q, toastr) {
return {
request: function (config) {
return config;
},
response: function (response) {
if (response.status === 401 || response.status === 403) {
$injector.get('authService').logOut();
$injector.get('$state').go('frontend.login.info').then(function () {
toastr.warning('Your login session has expired.', 'Logged out');
});
}
return response || $q.when(response);
},
responseError: function (rejection) {
if (rejection.status === 401 || rejection.status === 403) {
$injector.get('authService').logOut();
$injector.get('$state').go('frontend.login.info').then(function () {
toastr.warning('Your login session has expired.', 'Logged out');
});
}
return $q.reject(rejection);
}
};
});

23
src/app/app.js Normal file
View File

@@ -0,0 +1,23 @@
angular
.module('bit', [
'ui.router',
'ngMessages',
'angular-jwt',
'ui.bootstrap.showErrors',
'toastr',
'angulartics',
'angulartics.google.analytics',
'angular-stripe',
'credit-cards',
'bit.directives',
'bit.filters',
'bit.services',
'bit.global',
'bit.accounts',
'bit.vault',
'bit.settings',
'bit.tools',
'bit.organization'
]);

293
src/app/config.js Normal file
View File

@@ -0,0 +1,293 @@
angular
.module('bit')
.config(function ($stateProvider, $urlRouterProvider, $httpProvider, jwtInterceptorProvider, jwtOptionsProvider,
$uibTooltipProvider, toastrConfig, $locationProvider, $qProvider, stripeProvider, appSettings) {
$qProvider.errorOnUnhandledRejections(false);
$locationProvider.hashPrefix('');
jwtOptionsProvider.config({
urlParam: 'access_token3',
whiteListedDomains: ['api.bitwarden.com', 'preview-api.bitwarden.com', 'localhost', '192.168.1.8']
});
var refreshPromise;
jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (options, tokenService, authService) {
if (options.url.indexOf(appSettings.apiUri) !== 0) {
return;
}
if (refreshPromise) {
return refreshPromise;
}
var token = tokenService.getToken();
if (!token) {
return;
}
if (!tokenService.tokenNeedsRefresh(token)) {
return token;
}
refreshPromise = authService.refreshAccessToken().then(function (newToken) {
refreshPromise = null;
return newToken || token;
});
return refreshPromise;
};
stripeProvider.setPublishableKey(appSettings.stripeKey);
angular.extend(toastrConfig, {
closeButton: true,
progressBar: true,
showMethod: 'slideDown',
target: '.toast-target'
});
$uibTooltipProvider.options({
popupDelay: 600,
appendToBody: true
});
if ($httpProvider.defaults.headers.post) {
$httpProvider.defaults.headers.post = {};
}
$httpProvider.defaults.headers.post['Content-Type'] = 'text/plain; charset=utf-8';
$httpProvider.interceptors.push('apiInterceptor');
$httpProvider.interceptors.push('jwtInterceptor');
$urlRouterProvider.otherwise('/');
$stateProvider
// Backend
.state('backend', {
templateUrl: 'app/views/backendLayout.html',
abstract: true,
data: {
authorize: true
}
})
.state('backend.user', {
templateUrl: 'app/views/userLayout.html',
abstract: true
})
.state('backend.user.vault', {
url: '^/vault',
templateUrl: 'app/vault/views/vault.html',
controller: 'vaultController',
data: { pageTitle: 'My Vault' },
params: {
refreshFromServer: false
}
})
.state('backend.user.shared', {
url: '^/shared',
templateUrl: 'app/vault/views/vaultShared.html',
controller: 'vaultSharedController',
data: { pageTitle: 'Shared' }
})
.state('backend.user.settings', {
url: '^/settings',
templateUrl: 'app/settings/views/settings.html',
controller: 'settingsController',
data: { pageTitle: 'Settings' }
})
.state('backend.user.settingsDomains', {
url: '^/settings/domains',
templateUrl: 'app/settings/views/settingsDomains.html',
controller: 'settingsDomainsController',
data: { pageTitle: 'Domain Settings' }
})
.state('backend.user.settingsCreateOrg', {
url: '^/settings/create-organization',
templateUrl: 'app/settings/views/settingsCreateOrganization.html',
controller: 'settingsCreateOrganizationController',
data: { pageTitle: 'Create Organization' }
})
.state('backend.user.tools', {
url: '^/tools',
templateUrl: 'app/tools/views/tools.html',
controller: 'toolsController',
data: { pageTitle: 'Tools' }
})
.state('backend.user.apps', {
url: '^/apps',
templateUrl: 'app/views/apps.html',
controller: 'appsController',
data: { pageTitle: 'Get the Apps' }
})
.state('backend.org', {
templateUrl: 'app/views/organizationLayout.html',
abstract: true
})
.state('backend.org.dashboard', {
url: '^/organization/:orgId',
templateUrl: 'app/organization/views/organizationDashboard.html',
controller: 'organizationDashboardController',
data: { pageTitle: 'Organization Dashboard' }
})
.state('backend.org.people', {
url: '/organization/:orgId/people',
templateUrl: 'app/organization/views/organizationPeople.html',
controller: 'organizationPeopleController',
data: { pageTitle: 'Organization People' }
})
.state('backend.org.collections', {
url: '/organization/:orgId/collections',
templateUrl: 'app/organization/views/organizationCollections.html',
controller: 'organizationCollectionsController',
data: { pageTitle: 'Organization Collections' }
})
.state('backend.org.settings', {
url: '/organization/:orgId/settings',
templateUrl: 'app/organization/views/organizationSettings.html',
controller: 'organizationSettingsController',
data: { pageTitle: 'Organization Settings' }
})
.state('backend.org.billing', {
url: '/organization/:orgId/billing',
templateUrl: 'app/organization/views/organizationBilling.html',
controller: 'organizationBillingController',
data: { pageTitle: 'Organization Billing' }
})
.state('backend.org.vault', {
url: '/organization/:orgId/vault',
templateUrl: 'app/organization/views/organizationVault.html',
controller: 'organizationVaultController',
data: { pageTitle: 'Organization Vault' }
})
.state('backend.org.groups', {
url: '/organization/:orgId/groups',
templateUrl: 'app/organization/views/organizationGroups.html',
controller: 'organizationGroupsController',
data: { pageTitle: 'Organization Groups' }
})
// Frontend
.state('frontend', {
templateUrl: 'app/views/frontendLayout.html',
abstract: true,
data: {
authorize: false
}
})
.state('frontend.login', {
templateUrl: 'app/accounts/views/accountsLogin.html',
controller: 'accountsLoginController',
params: {
returnState: null,
email: null
},
data: {
bodyClass: 'login-page'
}
})
.state('frontend.login.info', {
url: '^/?org',
templateUrl: 'app/accounts/views/accountsLoginInfo.html',
data: {
pageTitle: 'Log In'
}
})
.state('frontend.login.twoFactor', {
url: '^/two-factor',
templateUrl: 'app/accounts/views/accountsLoginTwoFactor.html',
data: {
pageTitle: 'Log In (Two Factor)',
authorizeTwoFactor: true
}
})
.state('frontend.logout', {
url: '^/logout',
controller: 'accountsLogoutController',
data: {
authorize: true
}
})
.state('frontend.passwordHint', {
url: '^/password-hint',
templateUrl: 'app/accounts/views/accountsPasswordHint.html',
controller: 'accountsPasswordHintController',
data: {
pageTitle: 'Master Password Hint',
bodyClass: 'login-page'
}
})
.state('frontend.recover', {
url: '^/recover',
templateUrl: 'app/accounts/views/accountsRecover.html',
controller: 'accountsRecoverController',
data: {
pageTitle: 'Recover Account',
bodyClass: 'login-page'
}
})
.state('frontend.register', {
url: '^/register?org',
templateUrl: 'app/accounts/views/accountsRegister.html',
controller: 'accountsRegisterController',
params: {
returnState: null,
email: null
},
data: {
pageTitle: 'Register',
bodyClass: 'register-page'
}
})
.state('frontend.organizationAccept', {
url: '^/accept-organization?organizationId&organizationUserId&token&email&organizationName',
templateUrl: 'app/accounts/views/accountsOrganizationAccept.html',
controller: 'accountsOrganizationAcceptController',
data: {
pageTitle: 'Accept Organization Invite',
bodyClass: 'login-page',
skipAuthorize: true
}
});
})
.run(function ($rootScope, authService, $state) {
$rootScope.$on('$stateChangeSuccess', function () {
$('html, body').animate({ scrollTop: 0 }, 200);
});
$rootScope.$on('$stateChangeStart', function (event, toState, toParams) {
if (!toState.data || !toState.data.authorize) {
if (toState.data && toState.data.skipAuthorize) {
return;
}
if (!authService.isAuthenticated()) {
return;
}
event.preventDefault();
$state.go('backend.user.vault');
return;
}
if (!authService.isAuthenticated()) {
event.preventDefault();
authService.logOut();
$state.go('frontend.login.info');
return;
}
// user is guaranteed to be authenticated becuase of previous check
if (toState.name.indexOf('backend.org.') > -1 && toParams.orgId) {
// clear vault rootScope when visiting org admin section
$rootScope.vaultLogins = $rootScope.vaultFolders = null;
authService.getUserProfile().then(function (profile) {
var orgs = profile.organizations;
if (!orgs || !(toParams.orgId in orgs) || orgs[toParams.orgId].status !== 2 ||
orgs[toParams.orgId].type === 2) {
event.preventDefault();
$state.go('backend.user.vault');
}
});
}
});
});

59
src/app/constants.js Normal file
View File

@@ -0,0 +1,59 @@
angular.module('bit')
.constant('constants', {
rememberedEmailCookieName: 'bit.rememberedEmail',
encType: {
AesCbc256_B64: 0,
AesCbc128_HmacSha256_B64: 1,
AesCbc256_HmacSha256_B64: 2,
Rsa2048_OaepSha256_B64: 3,
Rsa2048_OaepSha1_B64: 4
},
orgUserType: {
owner: 0,
admin: 1,
user: 2
},
orgUserStatus: {
invited: 0,
accepted: 1,
confirmed: 2
},
plans: {
free: {
basePrice: 0,
noAdditionalSeats: true,
noPayment: true,
upgradeSortOrder: -1
},
personal: {
basePrice: 1,
annualBasePrice: 12,
baseSeats: 5,
seatPrice: 1,
annualSeatPrice: 12,
maxAdditionalSeats: 5,
annualPlanType: 'personalAnnually',
upgradeSortOrder: 1
},
teams: {
basePrice: 5,
annualBasePrice: 60,
monthlyBasePrice: 8,
baseSeats: 5,
seatPrice: 2,
annualSeatPrice: 24,
monthlySeatPrice: 2.5,
monthPlanType: 'teamsMonthly',
annualPlanType: 'teamsAnnually',
upgradeSortOrder: 2
},
enterprise: {
seatPrice: 3,
annualSeatPrice: 36,
monthlySeatPrice: 4,
monthPlanType: 'enterpriseMonthly',
annualPlanType: 'enterpriseAnnually',
upgradeSortOrder: 3
}
}
});

View File

@@ -0,0 +1,30 @@
angular
.module('bit.directives')
.directive('apiField', function () {
var linkFn = function (scope, element, attrs, ngModel) {
ngModel.$registerApiError = registerApiError;
ngModel.$validators.apiValidate = apiValidator;
function apiValidator() {
ngModel.$setValidity('api', true);
return true;
}
function registerApiError() {
ngModel.$setValidity('api', false);
}
};
return {
require: 'ngModel',
restrict: 'A',
compile: function (elem, attrs) {
if (!attrs.name || attrs.name === '') {
throw 'api-field element does not have a valid name attribute';
}
return linkFn;
}
};
});

View File

@@ -0,0 +1,36 @@
angular
.module('bit.directives')
.directive('apiForm', function ($rootScope, validationService) {
return {
require: 'form',
restrict: 'A',
link: function (scope, element, attrs, formCtrl) {
var watchPromise = attrs.apiForm || null;
if (watchPromise !== void 0) {
scope.$watch(watchPromise, formSubmitted.bind(null, formCtrl, scope));
}
}
};
function formSubmitted(form, scope, promise) {
if (!promise || !promise.then) {
return;
}
// reset errors
form.$errors = null;
// start loading
form.$loading = true;
promise.then(function success(response) {
form.$loading = false;
}, function failure(reason) {
form.$loading = false;
validationService.addErrors(form, reason);
scope.$broadcast('show-errors-check-validity');
$('html, body').animate({ scrollTop: 0 }, 200);
});
}
});

View File

@@ -0,0 +1,2 @@
angular
.module('bit.directives', []);

View File

@@ -0,0 +1,151 @@
angular
.module('bit.directives')
// adaptation of https://github.com/uttesh/ngletteravatar
.directive('letterAvatar', function () {
// ref: http://stackoverflow.com/a/16348977/1090359
function stringToColor(str) {
var hash = 0,
i = 0;
for (i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
}
var color = '#';
for (i = 0; i < 3; i++) {
var value = (hash >> (i * 8)) & 0xFF;
color += ('00' + value.toString(16)).substr(-2);
}
return color;
}
function getFirstLetters(data, count) {
var parts = data.split(' ');
if (parts && parts.length > 1) {
var text = '';
for (var i = 0; i < count; i++) {
text += parts[i].substr(0, 1);
}
return text;
}
return null;
}
function getSvg(width, height, color) {
var svgTag = angular.element('<svg></svg>')
.attr({
'xmlns': 'http://www.w3.org/2000/svg',
'pointer-events': 'none',
'width': width,
'height': height
})
.css({
'background-color': color,
'width': width + 'px',
'height': height + 'px'
});
return svgTag;
}
function getCharText(character, textColor, fontFamily, fontWeight, fontsize) {
var textTag = angular.element('<text text-anchor="middle"></text>')
.attr({
'y': '50%',
'x': '50%',
'dy': '0.35em',
'pointer-events': 'auto',
'fill': textColor,
'font-family': fontFamily
})
.text(character)
.css({
'font-weight': fontWeight,
'font-size': fontsize + 'px',
});
return textTag;
}
return {
restrict: 'AE',
replace: true,
scope: {
data: '@'
},
link: function (scope, element, attrs) {
var params = {
charCount: attrs.charcount || 2,
data: attrs.data,
textColor: attrs.textcolor || '#ffffff',
bgColor: attrs.bgcolor,
height: attrs.avheight || 45,
width: attrs.avwidth || 45,
fontSize: attrs.fontsize || 20,
fontWeight: attrs.fontweight || 300,
fontFamily: attrs.fontfamily || 'Open Sans, HelveticaNeue-Light, Helvetica Neue Light, ' +
'Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif',
round: attrs.round || 'true',
dynamic: attrs.dynamic || 'true',
class: attrs.avclass || '',
border: attrs.avborder || 'false',
borderStyle: attrs.borderstyle || '3px solid white'
};
if (params.dynamic === 'true') {
scope.$watch('data', function () {
generateLetterAvatar();
});
}
else {
generateLetterAvatar();
}
function generateLetterAvatar() {
var c = null,
upperData = scope.data.toUpperCase();
if (params.charCount > 1) {
c = getFirstLetters(upperData, params.charCount);
}
if (!c) {
c = upperData.substr(0, params.charCount);
}
var cobj = getCharText(c, params.textColor, params.fontFamily, params.fontWeight, params.fontSize);
var color = params.bgColor ? params.bgColor : stringToColor(upperData);
var svg = getSvg(params.width, params.height, color);
svg.append(cobj);
var lvcomponent = angular.element('<div>').append(svg).html();
var svgHtml = window.btoa(unescape(encodeURIComponent(lvcomponent)));
var src = 'data:image/svg+xml;base64,' + svgHtml;
var img = angular.element('<img>').attr({ src: src, title: scope.data });
if (params.round === 'true') {
img.css('border-radius', '50%');
}
if (params.border === 'true') {
img.css('border', params.borderStyle);
}
if (params.class) {
img.addClass(params.class);
}
if (params.dynamic === 'true') {
element.empty();
element.append(img);
}
else {
element.replaceWith(img);
}
}
}
};
});

View File

@@ -0,0 +1,37 @@
angular
.module('bit.directives')
.directive('masterPassword', function (cryptoService, authService) {
return {
require: 'ngModel',
restrict: 'A',
link: function (scope, elem, attr, ngModel) {
authService.getUserProfile().then(function (profile) {
// For DOM -> model validation
ngModel.$parsers.unshift(function (value) {
if (!value) {
return undefined;
}
var key = cryptoService.makeKey(value, profile.email);
var valid = key.keyB64 === cryptoService.getKey().keyB64;
ngModel.$setValidity('masterPassword', valid);
return valid ? value : undefined;
});
// For model -> DOM validation
ngModel.$formatters.unshift(function (value) {
if (!value) {
return undefined;
}
var key = cryptoService.makeKey(value, profile.email);
var valid = key.keyB64 === cryptoService.getKey().keyB64;
ngModel.$setValidity('masterPassword', valid);
return value;
});
});
}
};
});

View File

@@ -0,0 +1,22 @@
angular
.module('bit.directives')
.directive('pageTitle', function ($rootScope, $timeout, appSettings) {
return {
link: function (scope, element) {
var listener = function (event, toState, toParams, fromState, fromParams) {
// Default title
var title = 'bitwarden Password Manager';
if (toState.data && toState.data.pageTitle) {
title = toState.data.pageTitle + ' - bitwarden Password Manager';
}
$timeout(function () {
element.text(title);
});
};
$rootScope.$on('$stateChangeStart', listener);
}
};
});

View File

@@ -0,0 +1,73 @@
angular
.module('bit.directives')
.directive('passwordMeter', function () {
return {
template: '<div class="progress {{outerClass}}"><div class="progress-bar progress-bar-{{valueClass}}" ' +
'role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="100" ' +
'ng-style="{width : ( value + \'%\' ) }"><span class="sr-only">{{value}}%</span></div></div>',
restrict: 'A',
scope: {
password: '=passwordMeter',
username: '=passwordMeterUsername',
outerClass: '@?'
},
link: function (scope) {
var measureStrength = function (username, password) {
if (!password || password === username) {
return 0;
}
var strength = password.length;
if (username && username !== '') {
if (username.indexOf(password) !== -1) strength -= 15;
if (password.indexOf(username) !== -1) strength -= username.length;
}
if (password.length > 0 && password.length <= 4) strength += password.length;
else if (password.length >= 5 && password.length <= 7) strength += 6;
else if (password.length >= 8 && password.length <= 15) strength += 12;
else if (password.length >= 16) strength += 18;
if (password.match(/[a-z]/)) strength += 1;
if (password.match(/[A-Z]/)) strength += 5;
if (password.match(/\d/)) strength += 5;
if (password.match(/.*\d.*\d.*\d/)) strength += 5;
if (password.match(/[!,@,#,$,%,^,&,*,?,_,~]/)) strength += 5;
if (password.match(/.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~]/)) strength += 5;
if (password.match(/(?=.*[a-z])(?=.*[A-Z])/)) strength += 2;
if (password.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/)) strength += 2;
if (password.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!,@,#,$,%,^,&,*,?,_,~])/)) strength += 2;
strength = Math.round(strength * 2);
return Math.max(0, Math.min(100, strength));
};
var getClass = function (strength) {
switch (Math.round(strength / 33)) {
case 0:
case 1:
return 'danger';
case 2:
return 'warning';
case 3:
return 'success';
}
};
var updateMeter = function (scope) {
scope.value = measureStrength(scope.username, scope.password);
scope.valueClass = getClass(scope.value);
};
scope.$watch('password', function () {
updateMeter(scope);
});
scope.$watch('username', function () {
updateMeter(scope);
});
},
};
});

View File

@@ -0,0 +1,27 @@
angular
.module('bit.directives')
.directive('passwordViewer', function () {
return {
restrict: 'A',
link: function (scope, element, attr) {
var passwordViewer = attr.passwordViewer;
if (!passwordViewer) {
return;
}
element.onclick = function (event) { };
element.on('click', function (event) {
var passwordElement = $(passwordViewer);
if (passwordElement && passwordElement.attr('type') === 'password') {
element.removeClass('fa-eye').addClass('fa-eye-slash');
passwordElement.attr('type', 'text');
}
else if (passwordElement && passwordElement.attr('type') === 'text') {
element.removeClass('fa-eye-slash').addClass('fa-eye');
passwordElement.attr('type', 'password');
}
});
}
};
});

View File

@@ -0,0 +1,32 @@
angular
.module('bit.filters')
.filter('enumLabelClass', function () {
return function (input, name) {
if (typeof input !== 'number') {
return input.toString();
}
var output;
switch (name) {
case 'OrgUserStatus':
switch (input) {
case 0:
output = 'label-default';
break;
case 1:
output = 'label-warning';
break;
case 2:
/* falls through */
default:
output = 'label-success';
}
break;
default:
output = 'label-default';
}
return output;
};
});

View File

@@ -0,0 +1,46 @@
angular
.module('bit.filters')
.filter('enumName', function () {
return function (input, name) {
if (typeof input !== 'number') {
return input.toString();
}
var output;
switch (name) {
case 'OrgUserStatus':
switch (input) {
case 0:
output = 'Invited';
break;
case 1:
output = 'Accepted';
break;
case 2:
/* falls through */
default:
output = 'Confirmed';
}
break;
case 'OrgUserType':
switch (input) {
case 0:
output = 'Owner';
break;
case 1:
output = 'Admin';
break;
case 2:
/* falls through */
default:
output = 'User';
}
break;
default:
output = input.toString();
}
return output;
};
});

View File

@@ -0,0 +1,2 @@
angular
.module('bit.filters', []);

View File

@@ -0,0 +1,6 @@
angular
.module('bit.global')
.controller('appsController', function ($scope, $state) {
});

View File

@@ -0,0 +1,2 @@
angular
.module('bit.global', []);

View File

@@ -0,0 +1,150 @@
angular
.module('bit.global')
.controller('mainController', function ($scope, $state, authService, appSettings, toastr, $window, $document) {
var vm = this;
vm.bodyClass = '';
vm.searchVaultText = null;
vm.version = appSettings.version;
$scope.currentYear = new Date().getFullYear();
$scope.$on('$viewContentLoaded', function () {
authService.getUserProfile().then(function (profile) {
vm.userProfile = profile;
});
if ($.AdminLTE) {
if ($.AdminLTE.layout) {
$.AdminLTE.layout.fix();
$.AdminLTE.layout.fixSidebar();
}
if ($.AdminLTE.pushMenu) {
$.AdminLTE.pushMenu.expandOnHover();
}
$(document).off('click', '.sidebar li a');
}
});
$scope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
vm.searchVaultText = null;
if (toState.data.bodyClass) {
vm.bodyClass = toState.data.bodyClass;
return;
}
else {
vm.bodyClass = '';
}
});
$scope.addLogin = function () {
$scope.$broadcast('vaultAddLogin');
};
$scope.addFolder = function () {
$scope.$broadcast('vaultAddFolder');
};
$scope.addOrganizationLogin = function () {
$scope.$broadcast('organizationVaultAddLogin');
};
$scope.addOrganizationCollection = function () {
$scope.$broadcast('organizationCollectionsAdd');
};
$scope.inviteOrganizationUser = function () {
$scope.$broadcast('organizationPeopleInvite');
};
$scope.addOrganizationGroup = function () {
$scope.$broadcast('organizationGroupsAdd');
};
// Append dropdown menu somewhere else
var bodyScrollbarWidth,
appendedDropdownMenu,
appendedDropdownMenuParent;
var dropdownHelpers = {
scrollbarWidth: function () {
if (!bodyScrollbarWidth) {
var bodyElem = $('body');
bodyElem.addClass('bit-position-body-scrollbar-measure');
bodyScrollbarWidth = $window.innerWidth - bodyElem[0].clientWidth;
bodyScrollbarWidth = isFinite(bodyScrollbarWidth) ? bodyScrollbarWidth : 0;
bodyElem.removeClass('bit-position-body-scrollbar-measure');
}
return bodyScrollbarWidth;
},
scrollbarInfo: function () {
return {
width: dropdownHelpers.scrollbarWidth(),
visible: $document.height() > $($window).height()
};
}
};
$(window).on('show.bs.dropdown', function (e) {
/*jshint -W120 */
var target = appendedDropdownMenuParent = $(e.target);
var appendTo = target.data('appendTo');
if (!appendTo) {
return true;
}
appendedDropdownMenu = target.find('.dropdown-menu');
var appendToEl = $(appendTo);
appendToEl.append(appendedDropdownMenu.detach());
var offset = target.offset();
var css = {
display: 'block',
top: offset.top + target.outerHeight()
};
if (appendedDropdownMenu.hasClass('dropdown-menu-right')) {
var scrollbarInfo = dropdownHelpers.scrollbarInfo();
var scrollbarWidth = 0;
if (scrollbarInfo.visible && scrollbarInfo.width) {
scrollbarWidth = scrollbarInfo.width;
}
css.right = $window.innerWidth - scrollbarWidth - (offset.left + target.prop('offsetWidth')) + 'px';
css.left = 'auto';
}
else {
css.left = offset.left + 'px';
css.right = 'auto';
}
appendedDropdownMenu.css(css);
});
$(window).on('hide.bs.dropdown', function (e) {
if (!appendedDropdownMenu) {
return true;
}
$(e.target).append(appendedDropdownMenu.detach());
appendedDropdownMenu.hide();
appendedDropdownMenu = null;
appendedDropdownMenuParent = null;
});
$scope.$on('removeAppendedDropdownMenu', function (event, args) {
if (!appendedDropdownMenu && !appendedDropdownMenuParent) {
return true;
}
appendedDropdownMenuParent.append(appendedDropdownMenu.detach());
appendedDropdownMenu.hide();
appendedDropdownMenu = null;
appendedDropdownMenuParent = null;
});
});

View File

@@ -0,0 +1,54 @@
angular
.module('bit.global')
.controller('sideNavController', function ($scope, $state, authService, toastr, $analytics) {
$scope.$state = $state;
$scope.params = $state.params;
$scope.orgs = [];
$scope.name = '';
authService.getUserProfile().then(function (userProfile) {
$scope.name = userProfile.extended && userProfile.extended.name ?
userProfile.extended.name : userProfile.email;
if (!userProfile.organizations) {
return;
}
if ($state.includes('backend.org') && ($state.params.orgId in userProfile.organizations)) {
$scope.orgProfile = userProfile.organizations[$state.params.orgId];
}
else {
var orgs = [];
for (var orgId in userProfile.organizations) {
if (userProfile.organizations.hasOwnProperty(orgId) &&
(userProfile.organizations[orgId].enabled || userProfile.organizations[orgId].type < 2)) { // 2 = User
orgs.push(userProfile.organizations[orgId]);
}
}
$scope.orgs = orgs;
}
});
$scope.viewOrganization = function (org) {
if (org.type === 2) { // 2 = User
toastr.error('You cannot manage this organization.');
return;
}
$analytics.eventTrack('View Organization From Side Nav');
$state.go('backend.org.dashboard', { orgId: org.id });
};
$scope.searchVault = function () {
$state.go('backend.user.vault');
};
$scope.searchOrganizationVault = function () {
$state.go('backend.org.vault', { orgId: $state.params.orgId });
};
$scope.isOrgOwner = function (org) {
return org && org.type === 0;
};
});

View File

@@ -0,0 +1,6 @@
angular
.module('bit.global')
.controller('topNavController', function ($scope) {
});

View File

@@ -0,0 +1,37 @@
angular
.module('bit.organization')
.controller('organizationBillingAdjustSeatsController', function ($scope, $state, $uibModalInstance, apiService,
$analytics, toastr, add) {
$analytics.eventTrack('organizationBillingAdjustSeatsController', { category: 'Modal' });
$scope.add = add;
$scope.seatAdjustment = 0;
$scope.submit = function () {
var request = {
seatAdjustment: $scope.seatAdjustment
};
if (!add) {
request.seatAdjustment *= -1;
}
$scope.submitPromise = apiService.organizations.putSeat({ id: $state.params.orgId }, request)
.$promise.then(function (response) {
if (add) {
$analytics.eventTrack('Added Seats');
toastr.success('You have added ' + $scope.seatAdjustment + ' seats.');
}
else {
$analytics.eventTrack('Removed Seats');
toastr.success('You have removed ' + $scope.seatAdjustment + ' seats.');
}
$uibModalInstance.close();
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,34 @@
angular
.module('bit.organization')
.controller('organizationBillingChangePaymentController', function ($scope, $state, $uibModalInstance, apiService, stripe,
$analytics, toastr, existingPaymentMethod) {
$analytics.eventTrack('organizationBillingChangePaymentController', { category: 'Modal' });
$scope.existingPaymentMethod = existingPaymentMethod;
$scope.submit = function () {
$scope.submitPromise = stripe.card.createToken($scope.card).then(function (response) {
var request = {
paymentToken: response.id
};
return apiService.organizations.putPayment({ id: $state.params.orgId }, request).$promise;
}).then(function (response) {
$scope.card = null;
if (existingPaymentMethod) {
$analytics.eventTrack('Changed Payment Method');
toastr.success('You have changed your payment method.');
}
else {
$analytics.eventTrack('Added Payment Method');
toastr.success('You have added a payment method.');
}
$uibModalInstance.close();
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,14 @@
angular
.module('bit.organization')
.controller('organizationBillingChangePlanController', function ($scope, $state, apiService, $uibModalInstance,
toastr, $analytics) {
$analytics.eventTrack('organizationBillingChangePlanController', { category: 'Modal' });
$scope.submit = function () {
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,163 @@
angular
.module('bit.organization')
.controller('organizationBillingController', function ($scope, apiService, $state, $uibModal, toastr, $analytics) {
$scope.charges = [];
$scope.paymentSource = null;
$scope.plan = null;
$scope.subscription = null;
$scope.loading = true;
$scope.$on('$viewContentLoaded', function () {
load();
});
$scope.changePayment = function () {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationBillingChangePayment.html',
controller: 'organizationBillingChangePaymentController',
resolve: {
existingPaymentMethod: function () {
return $scope.paymentSource ? $scope.paymentSource.description : null;
}
}
});
modal.result.then(function () {
load();
});
};
$scope.changePlan = function () {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationBillingChangePlan.html',
controller: 'organizationBillingChangePlanController',
resolve: {
plan: function () {
return $scope.plan;
}
}
});
modal.result.then(function () {
load();
});
};
$scope.adjustSeats = function (add) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationBillingAdjustSeats.html',
controller: 'organizationBillingAdjustSeatsController',
resolve: {
add: function () {
return add;
}
}
});
modal.result.then(function () {
load();
});
};
$scope.cancel = function () {
if (!confirm('Are you sure you want to cancel? All users will lose access to the organization ' +
'at the end of this billing cycle.')) {
return;
}
apiService.organizations.putCancel({ id: $state.params.orgId }, {})
.$promise.then(function (response) {
$analytics.eventTrack('Canceled Plan');
toastr.success('Organization subscription has been canceled.');
load();
});
};
$scope.reinstate = function () {
if (!confirm('Are you sure you want to remove the cancellation request and reinstate this organization?')) {
return;
}
apiService.organizations.putReinstate({ id: $state.params.orgId }, {})
.$promise.then(function (response) {
$analytics.eventTrack('Reinstated Plan');
toastr.success('Organization cancellation request has been removed.');
load();
});
};
function load() {
apiService.organizations.getBilling({ id: $state.params.orgId }, function (org) {
$scope.loading = false;
$scope.noSubscription = org.PlanType === 0;
var i = 0;
$scope.plan = {
name: org.Plan,
type: org.PlanType,
seats: org.Seats
};
$scope.subscription = null;
if (org.Subscription) {
$scope.subscription = {
trialEndDate: org.Subscription.TrialEndDate,
cancelledDate: org.Subscription.CancelledDate,
status: org.Subscription.Status,
cancelled: org.Subscription.Status === 'cancelled',
markedForCancel: org.Subscription.Status === 'active' && org.Subscription.CancelledDate
};
}
$scope.nextInvoice = null;
if (org.UpcomingInvoice) {
$scope.nextInvoice = {
date: org.UpcomingInvoice.Date,
amount: org.UpcomingInvoice.Amount
};
}
if (org.Subscription && org.Subscription.Items) {
$scope.subscription.items = [];
for (i = 0; i < org.Subscription.Items.length; i++) {
$scope.subscription.items.push({
amount: org.Subscription.Items[i].Amount,
name: org.Subscription.Items[i].Name,
interval: org.Subscription.Items[i].Interval,
qty: org.Subscription.Items[i].Quantity
});
}
}
$scope.paymentSource = null;
if (org.PaymentSource) {
$scope.paymentSource = {
type: org.PaymentSource.Type,
description: org.PaymentSource.Description,
cardBrand: org.PaymentSource.CardBrand
};
}
var charges = [];
for (i = 0; i < org.Charges.length; i++) {
charges.push({
date: org.Charges[i].CreatedDate,
paymentSource: org.Charges[i].PaymentSource ? org.Charges[i].PaymentSource.Description : '-',
amount: org.Charges[i].Amount,
status: org.Charges[i].Status,
failureMessage: org.Charges[i].FailureMessage,
refunded: org.Charges[i].Refunded,
partiallyRefunded: org.Charges[i].PartiallyRefunded,
refundedAmount: org.Charges[i].RefundedAmount,
invoiceId: org.Charges[i].InvoiceId
});
}
$scope.charges = charges;
});
}
});

View File

@@ -0,0 +1,120 @@
angular
.module('bit.organization')
.controller('organizationCollectionsAddController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
$analytics, authService) {
$analytics.eventTrack('organizationCollectionsAddController', { category: 'Modal' });
var groupsLength = 0;
$scope.groups = [];
$scope.selectedGroups = {};
$scope.loading = true;
$scope.useGroups = false;
$uibModalInstance.opened.then(function () {
return authService.getUserProfile();
}).then(function (profile) {
if (profile.organizations) {
var org = profile.organizations[$state.params.orgId];
$scope.useGroups = !!org.useGroups;
}
if ($scope.useGroups) {
return apiService.groups.listOrganization({ orgId: $state.params.orgId }).$promise;
}
return null;
}).then(function (groups) {
if (!groups) {
$scope.loading = false;
return;
}
var groupsArr = [];
for (var i = 0; i < groups.Data.length; i++) {
groupsArr.push({
id: groups.Data[i].Id,
name: groups.Data[i].Name,
accessAll: groups.Data[i].AccessAll
});
if (!groups.Data[i].AccessAll) {
groupsLength++;
}
}
$scope.groups = groupsArr;
$scope.loading = false;
});
$scope.toggleGroupSelectionAll = function ($event) {
var groups = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.groups.length; i++) {
groups[$scope.groups[i].id] = {
id: $scope.groups[i].id,
readOnly: ($scope.groups[i].id in $scope.selectedGroups) ?
$scope.selectedGroups[$scope.groups[i].id].readOnly : false
};
}
}
$scope.selectedGroups = groups;
};
$scope.toggleGroupSelection = function (id) {
if (id in $scope.selectedGroups) {
delete $scope.selectedGroups[id];
}
else {
$scope.selectedGroups[id] = {
id: id,
readOnly: false
};
}
};
$scope.toggleGroupReadOnlySelection = function (group) {
if (group.id in $scope.selectedGroups) {
$scope.selectedGroups[group.id].readOnly = !group.accessAll && !!!$scope.selectedGroups[group.id].readOnly;
}
};
$scope.groupSelected = function (group) {
return group.id in $scope.selectedGroups || group.accessAll;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedGroups).length >= groupsLength;
};
$scope.submit = function (model) {
var collection = cipherService.encryptCollection(model, $state.params.orgId);
if ($scope.useGroups) {
collection.groups = [];
for (var groupId in $scope.selectedGroups) {
if ($scope.selectedGroups.hasOwnProperty(groupId)) {
for (var i = 0; i < $scope.groups.length; i++) {
if ($scope.groups[i].id === $scope.selectedGroups[groupId].id) {
if (!$scope.groups[i].accessAll) {
collection.groups.push($scope.selectedGroups[groupId]);
}
break;
}
}
}
}
}
$scope.submitPromise = apiService.collections.post({ orgId: $state.params.orgId }, collection, function (response) {
$analytics.eventTrack('Created Collection');
var decCollection = cipherService.decryptCollection(response, $state.params.orgId, true);
$uibModalInstance.close(decCollection);
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,101 @@
angular
.module('bit.organization')
.controller('organizationCollectionsController', function ($scope, $state, apiService, $uibModal, cipherService, $filter,
toastr, $analytics) {
$scope.collections = [];
$scope.loading = true;
$scope.$on('$viewContentLoaded', function () {
loadList();
});
$scope.$on('organizationCollectionsAdd', function (event, args) {
$scope.add();
});
$scope.add = function () {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationCollectionsAdd.html',
controller: 'organizationCollectionsAddController'
});
modal.result.then(function (collection) {
$scope.collections.push(collection);
});
};
$scope.edit = function (collection) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationCollectionsEdit.html',
controller: 'organizationCollectionsEditController',
resolve: {
id: function () { return collection.id; }
}
});
modal.result.then(function (editedCollection) {
var existingCollections = $filter('filter')($scope.collections, { id: editedCollection.id }, true);
if (existingCollections && existingCollections.length > 0) {
existingCollections[0].name = editedCollection.name;
}
});
};
$scope.users = function (collection) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationCollectionsUsers.html',
controller: 'organizationCollectionsUsersController',
size: 'lg',
resolve: {
collection: function () { return collection; }
}
});
modal.result.then(function () {
// nothing to do
});
};
$scope.groups = function (collection) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationCollectionsGroups.html',
controller: 'organizationCollectionsGroupsController',
resolve: {
collection: function () { return collection; }
}
});
modal.result.then(function () {
// nothing to do
});
};
$scope.delete = function (collection) {
if (!confirm('Are you sure you want to delete this collection (' + collection.name + ')?')) {
return;
}
apiService.collections.del({ orgId: $state.params.orgId, id: collection.id }, function () {
var index = $scope.collections.indexOf(collection);
if (index > -1) {
$scope.collections.splice(index, 1);
}
$analytics.eventTrack('Deleted Collection');
toastr.success(collection.name + ' has been deleted.', 'Collection Deleted');
}, function () {
toastr.error(collection.name + ' was not able to be deleted.', 'Error');
});
};
function loadList() {
apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (list) {
$scope.collections = cipherService.decryptCollections(list.Data, $state.params.orgId, true);
$scope.loading = false;
});
}
});

View File

@@ -0,0 +1,139 @@
angular
.module('bit.organization')
.controller('organizationCollectionsEditController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
$analytics, id, authService) {
$analytics.eventTrack('organizationCollectionsEditController', { category: 'Modal' });
var groupsLength = 0;
$scope.collection = {};
$scope.groups = [];
$scope.selectedGroups = {};
$scope.loading = true;
$scope.useGroups = false;
$uibModalInstance.opened.then(function () {
return apiService.collections.getDetails({ orgId: $state.params.orgId, id: id }).$promise;
}).then(function (collection) {
$scope.collection = cipherService.decryptCollection(collection);
var groups = {};
if (collection.Groups) {
for (var i = 0; i < collection.Groups.length; i++) {
groups[collection.Groups[i].Id] = {
id: collection.Groups[i].Id,
readOnly: collection.Groups[i].ReadOnly
};
}
}
$scope.selectedGroups = groups;
return authService.getUserProfile();
}).then(function (profile) {
if (profile.organizations) {
var org = profile.organizations[$state.params.orgId];
$scope.useGroups = !!org.useGroups;
}
if ($scope.useGroups) {
return apiService.groups.listOrganization({ orgId: $state.params.orgId }).$promise;
}
return null;
}).then(function (groups) {
if (!groups) {
$scope.loading = false;
return;
}
var groupsArr = [];
for (var i = 0; i < groups.Data.length; i++) {
groupsArr.push({
id: groups.Data[i].Id,
name: groups.Data[i].Name,
accessAll: groups.Data[i].AccessAll
});
if (!groups.Data[i].AccessAll) {
groupsLength++;
}
}
$scope.groups = groupsArr;
$scope.loading = false;
});
$scope.toggleGroupSelectionAll = function ($event) {
var groups = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.groups.length; i++) {
groups[$scope.groups[i].id] = {
id: $scope.groups[i].id,
readOnly: ($scope.groups[i].id in $scope.selectedGroups) ?
$scope.selectedGroups[$scope.groups[i].id].readOnly : false
};
}
}
$scope.selectedGroups = groups;
};
$scope.toggleGroupSelection = function (id) {
if (id in $scope.selectedGroups) {
delete $scope.selectedGroups[id];
}
else {
$scope.selectedGroups[id] = {
id: id,
readOnly: false
};
}
};
$scope.toggleGroupReadOnlySelection = function (group) {
if (group.id in $scope.selectedGroups) {
$scope.selectedGroups[group.id].readOnly = !group.accessAll && !!!$scope.selectedGroups[group.id].readOnly;
}
};
$scope.groupSelected = function (group) {
return group.id in $scope.selectedGroups || group.accessAll;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedGroups).length >= groupsLength;
};
$scope.submit = function (model) {
var collection = cipherService.encryptCollection(model, $state.params.orgId);
if ($scope.useGroups) {
collection.groups = [];
for (var groupId in $scope.selectedGroups) {
if ($scope.selectedGroups.hasOwnProperty(groupId)) {
for (var i = 0; i < $scope.groups.length; i++) {
if ($scope.groups[i].id === $scope.selectedGroups[groupId].id) {
if (!$scope.groups[i].accessAll) {
collection.groups.push($scope.selectedGroups[groupId]);
}
break;
}
}
}
}
}
$scope.submitPromise = apiService.collections.put({
orgId: $state.params.orgId,
id: id
}, collection, function (response) {
$analytics.eventTrack('Edited Collection');
var decCollection = cipherService.decryptCollection(response, $state.params.orgId, true);
$uibModalInstance.close(decCollection);
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,63 @@
angular
.module('bit.organization')
.controller('organizationCollectionsUsersController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
$analytics, collection, toastr) {
$analytics.eventTrack('organizationCollectionsUsersController', { category: 'Modal' });
$scope.loading = true;
$scope.collection = collection;
$scope.users = [];
$uibModalInstance.opened.then(function () {
$scope.loading = false;
apiService.collections.listUsers(
{
orgId: $state.params.orgId,
id: collection.id
},
function (userList) {
if (userList && userList.Data.length) {
var users = [];
for (var i = 0; i < userList.Data.length; i++) {
users.push({
organizationUserId: userList.Data[i].OrganizationUserId,
name: userList.Data[i].Name,
email: userList.Data[i].Email,
type: userList.Data[i].Type,
status: userList.Data[i].Status,
readOnly: userList.Data[i].ReadOnly,
accessAll: userList.Data[i].AccessAll
});
}
$scope.users = users;
}
});
});
$scope.remove = function (user) {
if (!confirm('Are you sure you want to remove this user (' + user.email + ') from this ' +
'collection (' + collection.name + ')?')) {
return;
}
apiService.collections.delUser(
{
orgId: $state.params.orgId,
id: collection.id,
orgUserId: user.organizationUserId
}, null, function () {
toastr.success(user.email + ' has been removed.', 'User Removed');
$analytics.eventTrack('Removed User From Collection');
var index = $scope.users.indexOf(user);
if (index > -1) {
$scope.users.splice(index, 1);
}
}, function () {
toastr.error('Unable to remove user.', 'Error');
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,13 @@
angular
.module('bit.organization')
.controller('organizationDashboardController', function ($scope, authService, $state) {
$scope.$on('$viewContentLoaded', function () {
authService.getUserProfile().then(function (userProfile) {
if (!userProfile.organizations) {
return;
}
$scope.orgProfile = userProfile.organizations[$state.params.orgId];
});
});
});

View File

@@ -0,0 +1,26 @@
angular
.module('bit.organization')
.controller('organizationDeleteController', function ($scope, $state, apiService, $uibModalInstance, cryptoService,
authService, toastr, $analytics) {
$analytics.eventTrack('organizationDeleteController', { category: 'Modal' });
$scope.submit = function () {
var request = {
masterPasswordHash: cryptoService.hashPassword($scope.masterPassword)
};
$scope.submitPromise = apiService.organizations.del({ id: $state.params.orgId }, request, function () {
$uibModalInstance.dismiss('cancel');
authService.removeProfileOrganization($state.params.orgId);
$analytics.eventTrack('Deleted Organization');
$state.go('backend.user.vault').then(function () {
toastr.success('This organization and all associated data has been deleted.',
'Organization Deleted');
});
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,87 @@
angular
.module('bit.organization')
.controller('organizationGroupsAddController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
$analytics) {
$analytics.eventTrack('organizationGroupsAddController', { category: 'Modal' });
$scope.collections = [];
$scope.selectedCollections = {};
$scope.loading = true;
$uibModalInstance.opened.then(function () {
return apiService.collections.listOrganization({ orgId: $state.params.orgId }).$promise;
}).then(function (collections) {
$scope.collections = cipherService.decryptCollections(collections.Data, $state.params.orgId, true);
$scope.loading = false;
});
$scope.toggleCollectionSelectionAll = function ($event) {
var collections = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.collections.length; i++) {
collections[$scope.collections[i].id] = {
id: $scope.collections[i].id,
readOnly: ($scope.collections[i].id in $scope.selectedCollections) ?
$scope.selectedCollections[$scope.collections[i].id].readOnly : false
};
}
}
$scope.selectedCollections = collections;
};
$scope.toggleCollectionSelection = function (id) {
if (id in $scope.selectedCollections) {
delete $scope.selectedCollections[id];
}
else {
$scope.selectedCollections[id] = {
id: id,
readOnly: false
};
}
};
$scope.toggleCollectionReadOnlySelection = function (id) {
if (id in $scope.selectedCollections) {
$scope.selectedCollections[id].readOnly = !!!$scope.selectedCollections[id].readOnly;
}
};
$scope.collectionSelected = function (collection) {
return collection.id in $scope.selectedCollections;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedCollections).length === $scope.collections.length;
};
$scope.submit = function (model) {
var group = {
name: model.name,
accessAll: !!model.accessAll,
externalId: model.externalId
};
if (!group.accessAll) {
group.collections = [];
for (var collectionId in $scope.selectedCollections) {
if ($scope.selectedCollections.hasOwnProperty(collectionId)) {
group.collections.push($scope.selectedCollections[collectionId]);
}
}
}
$scope.submitPromise = apiService.groups.post({ orgId: $state.params.orgId }, group, function (response) {
$analytics.eventTrack('Created Group');
$uibModalInstance.close({
id: response.Id,
name: response.Name
});
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,93 @@
angular
.module('bit.organization')
.controller('organizationGroupsController', function ($scope, $state, apiService, $uibModal, $filter,
toastr, $analytics) {
$scope.groups = [];
$scope.loading = true;
$scope.$on('$viewContentLoaded', function () {
loadList();
});
$scope.$on('organizationGroupsAdd', function (event, args) {
$scope.add();
});
$scope.add = function () {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationGroupsAdd.html',
controller: 'organizationGroupsAddController'
});
modal.result.then(function (group) {
$scope.groups.push(group);
});
};
$scope.edit = function (group) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationGroupsEdit.html',
controller: 'organizationGroupsEditController',
resolve: {
id: function () { return group.id; }
}
});
modal.result.then(function (editedGroup) {
var existingGroups = $filter('filter')($scope.groups, { id: editedGroup.id }, true);
if (existingGroups && existingGroups.length > 0) {
existingGroups[0].name = editedGroup.name;
}
});
};
$scope.users = function (group) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationGroupsUsers.html',
controller: 'organizationGroupsUsersController',
size: 'lg',
resolve: {
group: function () { return group; }
}
});
modal.result.then(function () {
// nothing to do
});
};
$scope.delete = function (group) {
if (!confirm('Are you sure you want to delete this group (' + group.name + ')?')) {
return;
}
apiService.groups.del({ orgId: $state.params.orgId, id: group.id }, function () {
var index = $scope.groups.indexOf(group);
if (index > -1) {
$scope.groups.splice(index, 1);
}
$analytics.eventTrack('Deleted Group');
toastr.success(group.name + ' has been deleted.', 'Group Deleted');
}, function () {
toastr.error(group.name + ' was not able to be deleted.', 'Error');
});
};
function loadList() {
apiService.groups.listOrganization({ orgId: $state.params.orgId }, function (list) {
var groups = [];
for (var i = 0; i < list.Data.length; i++) {
groups.push({
id: list.Data[i].Id,
name: list.Data[i].Name
});
}
$scope.groups = groups;
$scope.loading = false;
});
}
});

View File

@@ -0,0 +1,110 @@
angular
.module('bit.organization')
.controller('organizationGroupsEditController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
$analytics, id) {
$analytics.eventTrack('organizationGroupsEditController', { category: 'Modal' });
$scope.collections = [];
$scope.selectedCollections = {};
$scope.loading = true;
$uibModalInstance.opened.then(function () {
return apiService.groups.getDetails({ orgId: $state.params.orgId, id: id }).$promise;
}).then(function (group) {
$scope.group = {
id: id,
name: group.Name,
externalId: group.ExternalId,
accessAll: group.AccessAll
};
var collections = {};
if (group.Collections) {
for (var i = 0; i < group.Collections.length; i++) {
collections[group.Collections[i].Id] = {
id: group.Collections[i].Id,
readOnly: group.Collections[i].ReadOnly
};
}
}
$scope.selectedCollections = collections;
return apiService.collections.listOrganization({ orgId: $state.params.orgId }).$promise;
}).then(function (collections) {
$scope.collections = cipherService.decryptCollections(collections.Data, $state.params.orgId, true);
$scope.loading = false;
});
$scope.toggleCollectionSelectionAll = function ($event) {
var collections = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.collections.length; i++) {
collections[$scope.collections[i].id] = {
id: $scope.collections[i].id,
readOnly: ($scope.collections[i].id in $scope.selectedCollections) ?
$scope.selectedCollections[$scope.collections[i].id].readOnly : false
};
}
}
$scope.selectedCollections = collections;
};
$scope.toggleCollectionSelection = function (id) {
if (id in $scope.selectedCollections) {
delete $scope.selectedCollections[id];
}
else {
$scope.selectedCollections[id] = {
id: id,
readOnly: false
};
}
};
$scope.toggleCollectionReadOnlySelection = function (id) {
if (id in $scope.selectedCollections) {
$scope.selectedCollections[id].readOnly = !!!$scope.selectedCollections[id].readOnly;
}
};
$scope.collectionSelected = function (collection) {
return collection.id in $scope.selectedCollections;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedCollections).length === $scope.collections.length;
};
$scope.submit = function () {
var group = {
name: $scope.group.name,
accessAll: !!$scope.group.accessAll,
externalId: $scope.group.externalId
};
if (!group.accessAll) {
group.collections = [];
for (var collectionId in $scope.selectedCollections) {
if ($scope.selectedCollections.hasOwnProperty(collectionId)) {
group.collections.push($scope.selectedCollections[collectionId]);
}
}
}
$scope.submitPromise = apiService.groups.put({
orgId: $state.params.orgId,
id: id
}, group, function (response) {
$analytics.eventTrack('Edited Group');
$uibModalInstance.close({
id: response.Id,
name: response.Name
});
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,57 @@
angular
.module('bit.organization')
.controller('organizationGroupsUsersController', function ($scope, $state, $uibModalInstance, apiService,
$analytics, group, toastr) {
$analytics.eventTrack('organizationGroupUsersController', { category: 'Modal' });
$scope.loading = true;
$scope.group = group;
$scope.users = [];
$uibModalInstance.opened.then(function () {
return apiService.groups.listUsers({
orgId: $state.params.orgId,
id: group.id
}).$promise;
}).then(function (userList) {
var users = [];
if (userList && userList.Data.length) {
for (var i = 0; i < userList.Data.length; i++) {
users.push({
organizationUserId: userList.Data[i].OrganizationUserId,
name: userList.Data[i].Name,
email: userList.Data[i].Email,
type: userList.Data[i].Type,
status: userList.Data[i].Status,
accessAll: userList.Data[i].AccessAll
});
}
}
$scope.users = users;
$scope.loading = false;
});
$scope.remove = function (user) {
if (!confirm('Are you sure you want to remove this user (' + user.email + ') from this ' +
'group (' + group.name + ')?')) {
return;
}
apiService.groups.delUser({ orgId: $state.params.orgId, id: group.id, orgUserId: user.organizationUserId }, null,
function () {
toastr.success(user.email + ' has been removed.', 'User Removed');
$analytics.eventTrack('Removed User From Group');
var index = $scope.users.indexOf(user);
if (index > -1) {
$scope.users.splice(index, 1);
}
}, function () {
toastr.error('Unable to remove user.', 'Error');
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,2 @@
angular
.module('bit.organization', ['ui.bootstrap']);

View File

@@ -0,0 +1,134 @@
angular
.module('bit.organization')
.controller('organizationPeopleController', function ($scope, $state, $uibModal, cryptoService, apiService, authService,
toastr, $analytics) {
$scope.users = [];
$scope.useGroups = false;
$scope.$on('$viewContentLoaded', function () {
loadList();
authService.getUserProfile().then(function (profile) {
if (profile.organizations) {
var org = profile.organizations[$state.params.orgId];
$scope.useGroups = !!org.useGroups;
}
});
});
$scope.reinvite = function (user) {
apiService.organizationUsers.reinvite({ orgId: $state.params.orgId, id: user.id }, null, function () {
$analytics.eventTrack('Reinvited User');
toastr.success(user.email + ' has been invited again.', 'User Invited');
}, function () {
toastr.error('Unable to invite user.', 'Error');
});
};
$scope.delete = function (user) {
if (!confirm('Are you sure you want to remove this user (' + user.email + ')?')) {
return;
}
apiService.organizationUsers.del({ orgId: $state.params.orgId, id: user.id }, null, function () {
$analytics.eventTrack('Deleted User');
toastr.success(user.email + ' has been removed.', 'User Removed');
var index = $scope.users.indexOf(user);
if (index > -1) {
$scope.users.splice(index, 1);
}
}, function () {
toastr.error('Unable to remove user.', 'Error');
});
};
$scope.confirm = function (user) {
apiService.users.getPublicKey({ id: user.userId }, function (userKey) {
var orgKey = cryptoService.getOrgKey($state.params.orgId);
if (!orgKey) {
toastr.error('Unable to confirm user.', 'Error');
return;
}
var key = cryptoService.rsaEncrypt(orgKey.key, userKey.PublicKey);
apiService.organizationUsers.confirm({ orgId: $state.params.orgId, id: user.id }, { key: key }, function () {
user.status = 2;
$analytics.eventTrack('Confirmed User');
toastr.success(user.email + ' has been confirmed.', 'User Confirmed');
}, function () {
toastr.error('Unable to confirm user.', 'Error');
});
}, function () {
toastr.error('Unable to confirm user.', 'Error');
});
};
$scope.$on('organizationPeopleInvite', function (event, args) {
$scope.invite();
});
$scope.invite = function () {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationPeopleInvite.html',
controller: 'organizationPeopleInviteController'
});
modal.result.then(function () {
loadList();
});
};
$scope.edit = function (orgUser) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationPeopleEdit.html',
controller: 'organizationPeopleEditController',
resolve: {
orgUser: function () { return orgUser; }
}
});
modal.result.then(function () {
loadList();
});
};
$scope.groups = function (user) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationPeopleGroups.html',
controller: 'organizationPeopleGroupsController',
resolve: {
orgUser: function () { return user; }
}
});
modal.result.then(function () {
});
};
function loadList() {
apiService.organizationUsers.list({ orgId: $state.params.orgId }, function (list) {
var users = [];
for (var i = 0; i < list.Data.length; i++) {
var user = {
id: list.Data[i].Id,
userId: list.Data[i].UserId,
name: list.Data[i].Name,
email: list.Data[i].Email,
status: list.Data[i].Status,
type: list.Data[i].Type,
accessAll: list.Data[i].AccessAll
};
users.push(user);
}
$scope.users = users;
});
}
});

View File

@@ -0,0 +1,104 @@
angular
.module('bit.organization')
.controller('organizationPeopleEditController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
orgUser, $analytics) {
$analytics.eventTrack('organizationPeopleEditController', { category: 'Modal' });
$scope.loading = true;
$scope.collections = [];
$scope.selectedCollections = {};
$uibModalInstance.opened.then(function () {
apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (list) {
$scope.collections = cipherService.decryptCollections(list.Data, $state.params.orgId, true);
$scope.loading = false;
});
apiService.organizationUsers.get({ orgId: $state.params.orgId, id: orgUser.id }, function (user) {
var collections = {};
if (user && user.Collections) {
for (var i = 0; i < user.Collections.length; i++) {
collections[user.Collections[i].Id] = {
id: user.Collections[i].Id,
readOnly: user.Collections[i].ReadOnly
};
}
}
$scope.email = orgUser.email;
$scope.type = user.Type;
$scope.accessAll = user.AccessAll;
$scope.selectedCollections = collections;
});
});
$scope.toggleCollectionSelectionAll = function ($event) {
var collections = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.collections.length; i++) {
collections[$scope.collections[i].id] = {
id: $scope.collections[i].id,
readOnly: ($scope.collections[i].id in $scope.selectedCollections) ?
$scope.selectedCollections[$scope.collections[i].id].readOnly : false
};
}
}
$scope.selectedCollections = collections;
};
$scope.toggleCollectionSelection = function (id) {
if (id in $scope.selectedCollections) {
delete $scope.selectedCollections[id];
}
else {
$scope.selectedCollections[id] = {
id: id,
readOnly: false
};
}
};
$scope.toggleCollectionReadOnlySelection = function (id) {
if (id in $scope.selectedCollections) {
$scope.selectedCollections[id].readOnly = !!!$scope.selectedCollections[id].readOnly;
}
};
$scope.collectionSelected = function (collection) {
return collection.id in $scope.selectedCollections;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedCollections).length === $scope.collections.length;
};
$scope.submitPromise = null;
$scope.submit = function (model) {
var collections = [];
if (!$scope.accessAll) {
for (var collectionId in $scope.selectedCollections) {
if ($scope.selectedCollections.hasOwnProperty(collectionId)) {
collections.push($scope.selectedCollections[collectionId]);
}
}
}
$scope.submitPromise = apiService.organizationUsers.put(
{
orgId: $state.params.orgId,
id: orgUser.id
}, {
type: $scope.type,
collections: collections,
accessAll: $scope.accessAll
}, function () {
$analytics.eventTrack('Edited User');
$uibModalInstance.close();
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,85 @@
angular
.module('bit.organization')
.controller('organizationPeopleGroupsController', function ($scope, $state, $uibModalInstance, apiService,
orgUser, $analytics) {
$analytics.eventTrack('organizationPeopleGroupsController', { category: 'Modal' });
$scope.loading = true;
$scope.groups = [];
$scope.selectedGroups = {};
$scope.orgUser = orgUser;
$uibModalInstance.opened.then(function () {
return apiService.groups.listOrganization({ orgId: $state.params.orgId }).$promise;
}).then(function (groupsList) {
var groups = [];
for (var i = 0; i < groupsList.Data.length; i++) {
groups.push({
id: groupsList.Data[i].Id,
name: groupsList.Data[i].Name
});
}
$scope.groups = groups;
return apiService.organizationUsers.listGroups({ orgId: $state.params.orgId, id: orgUser.id }).$promise;
}).then(function (groupIds) {
var selectedGroups = {};
if (groupIds) {
for (var i = 0; i < groupIds.length; i++) {
selectedGroups[groupIds[i]] = true;
}
}
$scope.selectedGroups = selectedGroups;
$scope.loading = false;
});
$scope.toggleGroupSelectionAll = function ($event) {
var groups = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.groups.length; i++) {
groups[$scope.groups[i].id] = true;
}
}
$scope.selectedGroups = groups;
};
$scope.toggleGroupSelection = function (id) {
if (id in $scope.selectedGroups) {
delete $scope.selectedGroups[id];
}
else {
$scope.selectedGroups[id] = true;
}
};
$scope.groupSelected = function (group) {
return group.id in $scope.selectedGroups;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedGroups).length === $scope.groups.length;
};
$scope.submitPromise = null;
$scope.submit = function (model) {
var groups = [];
for (var groupId in $scope.selectedGroups) {
if ($scope.selectedGroups.hasOwnProperty(groupId)) {
groups.push(groupId);
}
}
$scope.submitPromise = apiService.organizationUsers.putGroups({ orgId: $state.params.orgId, id: orgUser.id }, {
groupIds: groups,
}, function () {
$analytics.eventTrack('Edited User Groups');
$uibModalInstance.close();
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,91 @@
angular
.module('bit.organization')
.controller('organizationPeopleInviteController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
$analytics) {
$analytics.eventTrack('organizationPeopleInviteController', { category: 'Modal' });
$scope.loading = true;
$scope.collections = [];
$scope.selectedCollections = {};
$scope.model = {
type: 'User'
};
$uibModalInstance.opened.then(function () {
apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (list) {
$scope.collections = cipherService.decryptCollections(list.Data, $state.params.orgId, true);
$scope.loading = false;
});
});
$scope.toggleCollectionSelectionAll = function ($event) {
var collections = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.collections.length; i++) {
collections[$scope.collections[i].id] = {
id: $scope.collections[i].id,
readOnly: ($scope.collections[i].id in $scope.selectedCollections) ?
$scope.selectedCollections[$scope.collections[i].id].readOnly : false
};
}
}
$scope.selectedCollections = collections;
};
$scope.toggleCollectionSelection = function (id) {
if (id in $scope.selectedCollections) {
delete $scope.selectedCollections[id];
}
else {
$scope.selectedCollections[id] = {
id: id,
readOnly: false
};
}
};
$scope.toggleCollectionReadOnlySelection = function (id) {
if (id in $scope.selectedCollections) {
$scope.selectedCollections[id].readOnly = !!!$scope.selectedCollections[id].readOnly;
}
};
$scope.collectionSelected = function (collection) {
return collection.id in $scope.selectedCollections;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedCollections).length === $scope.collections.length;
};
$scope.submitPromise = null;
$scope.submit = function (model) {
var collections = [];
if (!model.accessAll) {
for (var collectionId in $scope.selectedCollections) {
if ($scope.selectedCollections.hasOwnProperty(collectionId)) {
collections.push($scope.selectedCollections[collectionId]);
}
}
}
var splitEmails = model.emails.trim().split(/\s*,\s*/);
$scope.submitPromise = apiService.organizationUsers.invite({ orgId: $state.params.orgId }, {
emails: splitEmails,
type: model.type,
collections: collections,
accessAll: model.accessAll
}, function () {
$analytics.eventTrack('Invited User');
$uibModalInstance.close();
}).$promise;
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,33 @@
angular
.module('bit.organization')
.controller('organizationSettingsController', function ($scope, $state, apiService, toastr, authService, $uibModal,
$analytics) {
$scope.model = {};
$scope.$on('$viewContentLoaded', function () {
apiService.organizations.get({ id: $state.params.orgId }, function (org) {
$scope.model = {
name: org.Name,
billingEmail: org.BillingEmail,
businessName: org.BusinessName
};
});
});
$scope.generalSave = function () {
$scope.generalPromise = apiService.organizations.put({ id: $state.params.orgId }, $scope.model, function (org) {
authService.updateProfileOrganization(org).then(function (updatedOrg) {
$analytics.eventTrack('Updated Organization Settings');
toastr.success('Organization has been updated.', 'Success!');
});
}).$promise;
};
$scope.delete = function () {
$uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationDelete.html',
controller: 'organizationDeleteController'
});
};
});

View File

@@ -0,0 +1,50 @@
angular
.module('bit.vault')
.controller('organizationVaultAddLoginController', function ($scope, apiService, $uibModalInstance, cryptoService,
cipherService, passwordService, $analytics, orgId) {
$analytics.eventTrack('organizationVaultAddLoginController', { category: 'Modal' });
$scope.login = {};
$scope.hideFolders = $scope.hideFavorite = true;
$scope.savePromise = null;
$scope.save = function (model) {
model.organizationId = orgId;
var login = cipherService.encryptLogin(model);
$scope.savePromise = apiService.logins.postAdmin(login, function (loginResponse) {
$analytics.eventTrack('Created Organization Login');
var decLogin = cipherService.decryptLogin(loginResponse);
$uibModalInstance.close(decLogin);
}).$promise;
};
$scope.generatePassword = function () {
if (!$scope.login.password || confirm('Are you sure you want to overwrite the current password?')) {
$analytics.eventTrack('Generated Password From Add');
$scope.login.password = passwordService.generatePassword({ length: 12, special: true });
}
};
$scope.clipboardSuccess = function (e) {
e.clearSelection();
selectPassword(e);
};
$scope.clipboardError = function (e, password) {
if (password) {
selectPassword(e);
}
alert('Your web browser does not support easy clipboard copying. Copy it manually instead.');
};
function selectPassword(e) {
var target = $(e.trigger).parent().prev();
if (target.attr('type') === 'text') {
target.select();
}
}
$scope.close = function () {
$uibModalInstance.dismiss('close');
};
});

View File

@@ -0,0 +1,176 @@
angular
.module('bit.organization')
.controller('organizationVaultController', function ($scope, apiService, cipherService, $analytics, $q, $state,
$localStorage, $uibModal, $filter) {
$scope.logins = [];
$scope.collections = [];
$scope.loading = true;
$scope.$on('$viewContentLoaded', function () {
var collectionPromise = apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (collections) {
var decCollections = [{
id: null,
name: 'Unassigned',
collapsed: $localStorage.collapsedOrgCollections && 'unassigned' in $localStorage.collapsedOrgCollections
}];
for (var i = 0; i < collections.Data.length; i++) {
var decCollection = cipherService.decryptCollection(collections.Data[i], null, true);
decCollection.collapsed = $localStorage.collapsedOrgCollections &&
decCollection.id in $localStorage.collapsedOrgCollections;
decCollections.push(decCollection);
}
$scope.collections = decCollections;
}).$promise;
var cipherPromise = apiService.ciphers.listOrganizationDetails({ organizationId: $state.params.orgId },
function (ciphers) {
var decLogins = [];
for (var i = 0; i < ciphers.Data.length; i++) {
if (ciphers.Data[i].Type === 1) {
var decLogin = cipherService.decryptLoginPreview(ciphers.Data[i]);
decLogins.push(decLogin);
}
}
$scope.logins = decLogins;
}).$promise;
$q.all([collectionPromise, cipherPromise]).then(function () {
$scope.loading = false;
});
});
$scope.filterByCollection = function (collection) {
return function (cipher) {
if (!cipher.collectionIds || !cipher.collectionIds.length) {
return collection.id === null;
}
return cipher.collectionIds.indexOf(collection.id) > -1;
};
};
$scope.collectionSort = function (item) {
if (!item.id) {
return '';
}
return item.name.toLowerCase();
};
$scope.collapseExpand = function (collection) {
if (!$localStorage.collapsedOrgCollections) {
$localStorage.collapsedOrgCollections = {};
}
var id = collection.id || 'unassigned';
if (id in $localStorage.collapsedOrgCollections) {
delete $localStorage.collapsedOrgCollections[id];
}
else {
$localStorage.collapsedOrgCollections[id] = true;
}
};
$scope.editLogin = function (login) {
var editModel = $uibModal.open({
animation: true,
templateUrl: 'app/vault/views/vaultEditLogin.html',
controller: 'organizationVaultEditLoginController',
resolve: {
loginId: function () { return login.id; }
}
});
editModel.result.then(function (returnVal) {
if (returnVal.action === 'edit') {
login.name = returnVal.data.name;
login.username = returnVal.data.username;
}
else if (returnVal.action === 'delete') {
var index = $scope.logins.indexOf(login);
if (index > -1) {
$scope.logins.splice(index, 1);
}
}
});
};
$scope.$on('organizationVaultAddLogin', function (event, args) {
$scope.addLogin();
});
$scope.addLogin = function () {
var addModel = $uibModal.open({
animation: true,
templateUrl: 'app/vault/views/vaultAddLogin.html',
controller: 'organizationVaultAddLoginController',
resolve: {
orgId: function () { return $state.params.orgId; }
}
});
addModel.result.then(function (addedLogin) {
$scope.logins.push(addedLogin);
});
};
$scope.editCollections = function (cipher) {
var modal = $uibModal.open({
animation: true,
templateUrl: 'app/organization/views/organizationVaultLoginCollections.html',
controller: 'organizationVaultLoginCollectionsController',
resolve: {
cipher: function () { return cipher; },
collections: function () { return $scope.collections; }
}
});
modal.result.then(function (response) {
if (response.collectionIds) {
cipher.collectionIds = response.collectionIds;
}
});
};
$scope.removeLogin = function (login, collection) {
if (!confirm('Are you sure you want to remove this login (' + login.name + ') from the ' +
'collection (' + collection.name + ') ?')) {
return;
}
var request = {
collectionIds: []
};
for (var i = 0; i < login.collectionIds.length; i++) {
if (login.collectionIds[i] !== collection.id) {
request.collectionIds.push(login.collectionIds[i]);
}
}
apiService.ciphers.putCollections({ id: login.id }, request).$promise.then(function (response) {
$analytics.eventTrack('Removed Login From Collection');
login.collectionIds = request.collectionIds;
});
};
$scope.deleteLogin = function (login) {
if (!confirm('Are you sure you want to delete this login (' + login.name + ')?')) {
return;
}
apiService.ciphers.delAdmin({ id: login.id }, function () {
$analytics.eventTrack('Deleted Login');
var index = $scope.logins.indexOf(login);
if (index > -1) {
$scope.logins.splice(index, 1);
}
});
};
});

View File

@@ -0,0 +1,69 @@
angular
.module('bit.vault')
.controller('organizationVaultEditLoginController', function ($scope, apiService, $uibModalInstance, cryptoService,
cipherService, passwordService, loginId, $analytics) {
$analytics.eventTrack('organizationVaultEditLoginController', { category: 'Modal' });
$scope.login = {};
$scope.hideFolders = $scope.hideFavorite = true;
apiService.logins.getAdmin({ id: loginId }, function (login) {
$scope.login = cipherService.decryptLogin(login);
});
$scope.save = function (model) {
var login = cipherService.encryptLogin(model);
$scope.savePromise = apiService.logins.putAdmin({ id: loginId }, login, function (loginResponse) {
$analytics.eventTrack('Edited Organization Login');
var decLogin = cipherService.decryptLogin(loginResponse);
$uibModalInstance.close({
action: 'edit',
data: decLogin
});
}).$promise;
};
$scope.generatePassword = function () {
if (!$scope.login.password || confirm('Are you sure you want to overwrite the current password?')) {
$analytics.eventTrack('Generated Password From Edit');
$scope.login.password = passwordService.generatePassword({ length: 12, special: true });
}
};
$scope.clipboardSuccess = function (e) {
e.clearSelection();
selectPassword(e);
};
$scope.clipboardError = function (e, password) {
if (password) {
selectPassword(e);
}
alert('Your web browser does not support easy clipboard copying. Copy it manually instead.');
};
function selectPassword(e) {
var target = $(e.trigger).parent().prev();
if (target.attr('type') === 'text') {
target.select();
}
}
$scope.delete = function () {
if (!confirm('Are you sure you want to delete this login (' + $scope.login.name + ')?')) {
return;
}
apiService.ciphers.delAdmin({ id: $scope.login.id }, function () {
$analytics.eventTrack('Deleted Organization Login From Edit');
$uibModalInstance.close({
action: 'delete',
data: $scope.login.id
});
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,83 @@
angular
.module('bit.organization')
.controller('organizationVaultLoginCollectionsController', function ($scope, apiService, $uibModalInstance, cipherService,
cipher, $analytics, collections) {
$analytics.eventTrack('organizationVaultLoginCollectionsController', { category: 'Modal' });
$scope.cipher = {};
$scope.collections = [];
$scope.selectedCollections = {};
$uibModalInstance.opened.then(function () {
var collectionUsed = [];
for (var i = 0; i < collections.length; i++) {
if (collections[i].id) {
collectionUsed.push(collections[i]);
}
}
$scope.collections = collectionUsed;
$scope.cipher = cipher;
var selectedCollections = {};
if ($scope.cipher.collectionIds) {
for (i = 0; i < $scope.cipher.collectionIds.length; i++) {
selectedCollections[$scope.cipher.collectionIds[i]] = true;
}
}
$scope.selectedCollections = selectedCollections;
});
$scope.toggleCollectionSelectionAll = function ($event) {
var collections = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.collections.length; i++) {
collections[$scope.collections[i].id] = true;
}
}
$scope.selectedCollections = collections;
};
$scope.toggleCollectionSelection = function (id) {
if (id in $scope.selectedCollections) {
delete $scope.selectedCollections[id];
}
else {
$scope.selectedCollections[id] = true;
}
};
$scope.collectionSelected = function (collection) {
return collection.id in $scope.selectedCollections;
};
$scope.allSelected = function () {
return Object.keys($scope.selectedCollections).length === $scope.collections.length;
};
$scope.submit = function () {
var request = {
collectionIds: []
};
for (var id in $scope.selectedCollections) {
if ($scope.selectedCollections.hasOwnProperty(id)) {
request.collectionIds.push(id);
}
}
$scope.submitPromise = apiService.ciphers.putCollectionsAdmin({ id: cipher.id }, request)
.$promise.then(function (response) {
$analytics.eventTrack('Edited Login Collections');
$uibModalInstance.close({
action: 'collectionsEdit',
collectionIds: request.collectionIds
});
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@@ -0,0 +1,161 @@
<section class="content-header">
<h1>
Billing
<small>manage your payments</small>
</h1>
</section>
<section class="content">
<div class="callout callout-warning" ng-if="subscription && subscription.cancelled">
<h4><i class="fa fa-warning"></i> Cancelled</h4>
The subscription to this organization has been canceled.
</div>
<div class="callout callout-warning" ng-if="subscription && subscription.markedForCancel">
<h4><i class="fa fa-warning"></i> Pending Cancellation</h4>
<p>
The subscription to this organization has been marked for cancellation at the end of the
current billing period.
</p>
<button type="button" class="btn btn-default btn-flat" ng-click="reinstate()">
Reinstate Plan
</button>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Plan</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-sm-6">
<dl>
<dt>Name</dt>
<dd>{{plan.name || '-'}}</dd>
<dt>Total Seats</dt>
<dd>{{plan.seats || '-'}}</dd>
</dl>
</div>
<div class="col-sm-6">
<dl>
<dt>Status</dt>
<dd style="text-transform: capitalize;">{{(subscription && subscription.status) || '-'}}</dd>
<dt>Next Charge</dt>
<dd>{{nextInvoice ? ((nextInvoice.date | date: format: mediumDate) + ', ' + (nextInvoice.amount | currency:'$')) : '-'}}</dd>
</dl>
</div>
</div>
<div class="row" ng-if="!noSubscription">
<div class="col-md-6">
<strong>Details</strong>
<div ng-show="loading">
Loading...
</div>
<div class="table-responsive" style="margin: 0;" ng-show="!loading">
<table class="table" style="margin: 0;">
<tbody>
<tr ng-repeat="item in subscription.items">
<td>
{{item.name}} {{item.qty > 1 ? '&times;' + item.qty : ''}}
@ {{item.amount | currency:'$'}} /{{item.interval}}
</td>
<td class="text-right">{{(item.qty * item.amount) | currency:'$'}} /{{item.interval}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-default btn-flat" ng-click="changePlan()">
Change Plan
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="cancel()"
ng-if="!noSubscription && !subscription.cancelled && !subscription.markedForCancel">
Cancel Plan
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="reinstate()"
ng-if="!noSubscription && subscription.markedForCancel">
Reinstate Plan
</button>
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">User Seats</h3>
</div>
<div class="box-body">
<div ng-show="loading">
Loading...
</div>
<div ng-show="!loading">
You plan currently has a total of <b>{{plan.seats}}</b> seats.
</div>
</div>
<div class="box-footer" ng-if="!noSubscription">
<button type="button" class="btn btn-default btn-flat" ng-click="adjustSeats(true)">
Add Seats
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="adjustSeats(false)">
Remove Seats
</button>
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Payment Method</h3>
</div>
<div class="box-body">
<div ng-show="loading">
Loading...
</div>
<div ng-show="!loading && !paymentSource">
<i class="fa fa-credit-card"></i> No payment method on file.
</div>
<div ng-show="!loading && paymentSource">
<i class="fa" ng-class="{'fa-credit-card': paymentSource.type === 0,
'fa-university': paymentSource.type === 1}"></i>
{{paymentSource.description}}
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-default btn-flat" ng-click="changePayment()">
{{ paymentSource ? 'Change Payment Method' : 'Add Payment Method' }}
</button>
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Charges</h3>
</div>
<div class="box-body">
<div ng-show="loading">
Loading...
</div>
<div ng-show="!loading && !charges.length">
No charges.
</div>
<div class="table-responsive" ng-show="charges.length">
<table class="table">
<tbody>
<tr ng-repeat="charge in charges">
<td style="width: 200px">
{{charge.date | date: format: mediumDate}}
</td>
<td>
{{charge.paymentSource}}
</td>
<td style="width: 150px; text-transform: capitalize;">
{{charge.status}}
</td>
<td class="text-right" style="width: 150px;">
{{charge.amount | currency:'$'}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-footer">
Note: Any charges will appears on your credit card statement as <b>BITWARDEN</b>.
</div>
</div>
</section>

View File

@@ -0,0 +1,46 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
<i class="fa fa-users"></i>
{{add ? 'Add Seats' : 'Remove Seats'}}
</h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-default" ng-show="add">
<h4><i class="fa fa-dollar"></i> Note About Charges</h4>
<p>
Adding seats to your plan will result in adjustments to your billing totals and immediately charge your
payment method on file. The first charge will be prorated for the remainder of the current billing cycle.
</p>
</div>
<div class="callout callout-default" ng-show="!add">
<h4><i class="fa fa-dollar"></i> Note About Charges</h4>
<p>
Removing seats will result in adjustments to your billing totals that will be prorated as credits
to your next billing charge.
</p>
</div>
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="seats">{{add ? 'Seats To Add' : 'Seats To Remove'}}</label>
<input type="number" id="seats" name="SeatAdjustment" ng-model="seatAdjustment" class="form-control"
required min="0" />
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,364 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
<i class="fa fa-credit-card"></i>
{{existingPaymentMethod ? 'Change Payment Method' : 'Add Payment Method'}}
</h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group" show-errors>
<label for="card_number">Card Number</label>
<input type="text" id="card_number" name="card_number" ng-model="card.number"
class="form-control" cc-number required api-field />
</div>
</div>
</div>
<ul class="list-inline">
<li><div class="cc visa"></div></li>
<li><div class="cc mastercard"></div></li>
<li><div class="cc amex"></div></li>
<li><div class="cc discover"></div></li>
<li><div class="cc diners"></div></li>
<li><div class="cc jcb"></div></li>
</ul>
<div class="row">
<div class="col-sm-4">
<div class="form-group" show-errors>
<label for="exp_month">Expiration Month</label>
<select id="exp_month" class="form-control" ng-model="card.exp_month" required cc-exp-month
name="exp_month" api-field>
<option value="">-- Select --</option>
<option value="01">01 - January</option>
<option value="02">02 - February</option>
<option value="03">03 - March</option>
<option value="04">04 - April</option>
<option value="05">05 - May</option>
<option value="06">06 - June</option>
<option value="07">07 - July</option>
<option value="08">08 - August</option>
<option value="09">09 - September</option>
<option value="10">10 - October</option>
<option value="11">11 - November</option>
<option value="12">12 - December</option>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group" show-errors>
<label for="exp_year">Expiration Year</label>
<select id="exp_year" class="form-control" ng-model="card.exp_year" required cc-exp-year
name="exp_year" api-field>
<option value="">-- Select --</option>
<option value="17">2017</option>
<option value="18">2018</option>
<option value="19">2019</option>
<option value="20">2020</option>
<option value="21">2021</option>
<option value="22">2022</option>
<option value="23">2023</option>
<option value="24">2024</option>
<option value="25">2025</option>
<option value="26">2026</option>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group" show-errors>
<label for="cvc">
CVC
<a href="https://www.cvvnumber.com/cvv.html" target="_blank" title="What is this?"
rel="noopener noreferrer">
<i class="fa fa-question-circle"></i>
</a>
</label>
<input type="text" id="cvc" ng-model="card.cvc" class="form-control" name="cvc"
cc-type="number.$ccType" cc-cvc required api-field />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group" show-errors>
<label for="address_country">Country</label>
<select id="address_country" class="form-control" ng-model="card.address_country"
required name="address_country" api-field>
<option value="">-- Select --</option>
<option value="US">United States</option>
<option value="CN">China</option>
<option value="FR">France</option>
<option value="DE">Germany</option>
<option value="CA">Canada</option>
<option value="GB">United Kingdom</option>
<option value="AU">Australia</option>
<option value="IN">India</option>
<option value="-" disabled></option>
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
<option value="AG">Antigua and Barbuda</option>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AW">Aruba</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BS">Bahamas</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BB">Barbados</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BM">Bermuda</option>
<option value="BT">Bhutan</option>
<option value="BO">Bolivia, Plurinational State of</option>
<option value="BQ">Bonaire, Sint Eustatius and Saba</option>
<option value="BA">Bosnia and Herzegovina</option>
<option value="BW">Botswana</option>
<option value="BV">Bouvet Island</option>
<option value="BR">Brazil</option>
<option value="IO">British Indian Ocean Territory</option>
<option value="BN">Brunei Darussalam</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BI">Burundi</option>
<option value="KH">Cambodia</option>
<option value="CM">Cameroon</option>
<option value="CV">Cape Verde</option>
<option value="KY">Cayman Islands</option>
<option value="CF">Central African Republic</option>
<option value="TD">Chad</option>
<option value="CL">Chile</option>
<option value="CX">Christmas Island</option>
<option value="CC">Cocos (Keeling) Islands</option>
<option value="CO">Colombia</option>
<option value="KM">Comoros</option>
<option value="CG">Congo</option>
<option value="CD">Congo, the Democratic Republic of the</option>
<option value="CK">Cook Islands</option>
<option value="CR">Costa Rica</option>
<option value="CI">Côte d'Ivoire</option>
<option value="HR">Croatia</option>
<option value="CU">Cuba</option>
<option value="CW">Curaçao</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="DM">Dominica</option>
<option value="DO">Dominican Republic</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="SV">El Salvador</option>
<option value="GQ">Equatorial Guinea</option>
<option value="ER">Eritrea</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FK">Falkland Islands (Malvinas)</option>
<option value="FO">Faroe Islands</option>
<option value="FJ">Fiji</option>
<option value="FI">Finland</option>
<option value="GF">French Guiana</option>
<option value="PF">French Polynesia</option>
<option value="TF">French Southern Territories</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="GH">Ghana</option>
<option value="GI">Gibraltar</option>
<option value="GR">Greece</option>
<option value="GL">Greenland</option>
<option value="GD">Grenada</option>
<option value="GP">Guadeloupe</option>
<option value="GU">Guam</option>
<option value="GT">Guatemala</option>
<option value="GG">Guernsey</option>
<option value="GN">Guinea</option>
<option value="GW">Guinea-Bissau</option>
<option value="GY">Guyana</option>
<option value="HT">Haiti</option>
<option value="HM">Heard Island and McDonald Islands</option>
<option value="VA">Holy See (Vatican City State)</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="ID">Indonesia</option>
<option value="IR">Iran, Islamic Republic of</option>
<option value="IQ">Iraq</option>
<option value="IE">Ireland</option>
<option value="IM">Isle of Man</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="JE">Jersey</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KE">Kenya</option>
<option value="KI">Kiribati</option>
<option value="KP">Korea, Democratic People's Republic of</option>
<option value="KR">Korea, Republic of</option>
<option value="KW">Kuwait</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Lao People's Democratic Republic</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LS">Lesotho</option>
<option value="LR">Liberia</option>
<option value="LY">Libya</option>
<option value="LI">Liechtenstein</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MO">Macao</option>
<option value="MK">Macedonia, the former Yugoslav Republic of</option>
<option value="MG">Madagascar</option>
<option value="MW">Malawi</option>
<option value="MY">Malaysia</option>
<option value="MV">Maldives</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MH">Marshall Islands</option>
<option value="MQ">Martinique</option>
<option value="MR">Mauritania</option>
<option value="MU">Mauritius</option>
<option value="YT">Mayotte</option>
<option value="MX">Mexico</option>
<option value="FM">Micronesia, Federated States of</option>
<option value="MD">Moldova, Republic of</option>
<option value="MC">Monaco</option>
<option value="MN">Mongolia</option>
<option value="ME">Montenegro</option>
<option value="MS">Montserrat</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="MM">Myanmar</option>
<option value="NA">Namibia</option>
<option value="NR">Nauru</option>
<option value="NP">Nepal</option>
<option value="NL">Netherlands</option>
<option value="NC">New Caledonia</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NU">Niue</option>
<option value="NF">Norfolk Island</option>
<option value="MP">Northern Mariana Islands</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PW">Palau</option>
<option value="PS">Palestinian Territory, Occupied</option>
<option value="PA">Panama</option>
<option value="PG">Papua New Guinea</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PN">Pitcairn</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="QA">Qatar</option>
<option value="RE">Réunion</option>
<option value="RO">Romania</option>
<option value="RU">Russian Federation</option>
<option value="RW">Rwanda</option>
<option value="BL">Saint Barthélemy</option>
<option value="SH">Saint Helena, Ascension and Tristan da Cunha</option>
<option value="KN">Saint Kitts and Nevis</option>
<option value="LC">Saint Lucia</option>
<option value="MF">Saint Martin (French part)</option>
<option value="PM">Saint Pierre and Miquelon</option>
<option value="VC">Saint Vincent and the Grenadines</option>
<option value="WS">Samoa</option>
<option value="SM">San Marino</option>
<option value="ST">Sao Tome and Principe</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="RS">Serbia</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SX">Sint Maarten (Dutch part)</option>
<option value="SK">Slovakia</option>
<option value="SI">Slovenia</option>
<option value="SB">Solomon Islands</option>
<option value="SO">Somalia</option>
<option value="ZA">South Africa</option>
<option value="GS">South Georgia and the South Sandwich Islands</option>
<option value="SS">South Sudan</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SD">Sudan</option>
<option value="SR">Suriname</option>
<option value="SJ">Svalbard and Jan Mayen</option>
<option value="SZ">Swaziland</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syrian Arab Republic</option>
<option value="TW">Taiwan, Province of China</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania, United Republic of</option>
<option value="TH">Thailand</option>
<option value="TL">Timor-Leste</option>
<option value="TG">Togo</option>
<option value="TK">Tokelau</option>
<option value="TO">Tonga</option>
<option value="TT">Trinidad and Tobago</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TM">Turkmenistan</option>
<option value="TC">Turks and Caicos Islands</option>
<option value="TV">Tuvalu</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="UM">United States Minor Outlying Islands</option>
<option value="UY">Uruguay</option>
<option value="UZ">Uzbekistan</option>
<option value="VU">Vanuatu</option>
<option value="VE">Venezuela, Bolivarian Republic of</option>
<option value="VN">Viet Nam</option>
<option value="VG">Virgin Islands, British</option>
<option value="VI">Virgin Islands, U.S.</option>
<option value="WF">Wallis and Futuna</option>
<option value="EH">Western Sahara</option>
<option value="YE">Yemen</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
</select>
</div>
</div>
<div class="col-sm-6">
<div class="form-group" show-errors>
<label for="address_zip"
ng-bind="card.address_country === 'US' ? 'Zip Code' : 'Postal Code'"></label>
<input type="text" id="address_zip" ng-model="card.address_zip"
class="form-control" required name="address_zip" api-field />
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,14 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-file-text-o"></i> Change Plan</h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
You can <a href="https://bitwarden.com/contact/" target="_blank">contact us</a>
if you would like to change your plan. Please ensure that you have an active payment
method on file.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,70 @@
<section class="content-header">
<h1>
Collections
<small>control what you share</small>
</h1>
</section>
<section class="content">
<div class="box">
<div class="box-header with-border">
&nbsp;
<div class="box-filters hidden-xs">
<div class="form-group form-group-sm has-feedback has-feedback-left">
<input type="text" id="search" class="form-control" placeholder="Search collections..."
style="width: 200px;" ng-model="filterSearch">
<span class="fa fa-search form-control-feedback text-muted" aria-hidden="true"></span>
</div>
</div>
<div class="box-tools">
<button type="button" class="btn btn-primary btn-sm btn-flat" ng-click="add()">
<i class="fa fa-fw fa-plus-circle"></i> New Collection
</button>
</div>
</div>
<div class="box-body" ng-class="{'no-padding': filteredCollections.length}">
<div ng-show="loading && !collections.length">
Loading...
</div>
<div ng-show="!filteredCollections.length && filterSearch">
No collections to list.
</div>
<div ng-show="!loading && !collections.length">
<p>There are no collections yet for your organization.</p>
<button type="button" ng-click="add()" class="btn btn-default btn-flat">Add a Collection</button>
</div>
<div class="table-responsive" ng-show="collections.length">
<table class="table table-striped table-hover table-vmiddle">
<tbody>
<tr ng-repeat="collection in filteredCollections = (collections | filter: (filterSearch || '') |
orderBy: ['name']) track by collection.id">
<td style="width: 70px;">
<div class="btn-group" data-append-to="body">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0)" ng-click="users(collection)">
<i class="fa fa-fw fa-users"></i> Users
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="delete(collection)" class="text-red">
<i class="fa fa-fw fa-trash"></i> Delete
</a>
</li>
</ul>
</div>
</td>
<td valign="middle">
<a href="javascript:void(0)" ng-click="edit(collection)">
{{collection.name}}
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,83 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-cubes"></i> Add New Collection</h4>
</div>
<form name="form" ng-submit="form.$valid && submit(model)" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-default">
<h4><i class="fa fa-info-circle"></i> Note</h4>
<p>
After creating the collection, you can associate a user to it by selecting a specific user on the "People" page.
</p>
<p>
You can associate new logins to the collection from your organization's "Vault" or by sharing an existing
login from "My vault".
</p>
</div>
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group" show-errors>
<label for="email">Name</label>
<input type="text" id="name" name="Name" ng-model="model.name" class="form-control" required api-field />
</div>
<div ng-if="useGroups">
<h4>Group Access</h4>
<div ng-show="loading && !groups.length">
Loading groups...
</div>
<div ng-show="!loading && !groups.length">
<p>No groups for your organization.</p>
</div>
<div class="table-responsive" ng-show="groups.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleGroupSelectionAll($event)">
</th>
<th>Name</th>
<th style="width: 100px; text-align: center;">Read Only</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="group in groups | orderBy: ['name']">
<td valign="middle">
<input type="checkbox"
name="selectedGroups[]"
value="{{group.id}}"
ng-checked="groupSelected(group)"
ng-click="toggleGroupSelection(group.id)"
ng-disabled="group.accessAll">
</td>
<td valign="middle">
{{group.name}}
<i class="fa fa-unlock text-muted fa-fw" ng-show="group.accessAll"
title="This group can access all items"></i>
</td>
<td style="width: 100px; text-align: center;" valign="middle">
<input type="checkbox"
name="selectedGroupsReadonly[]"
value="{{group.id}}"
ng-disabled="!groupSelected(group) || group.accessAll"
ng-checked="groupSelected(group) && selectedGroups[group.id].readOnly"
ng-click="toggleGroupReadOnlySelection(group)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,84 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-cubes"></i> Edit Collection</h4>
</div>
<form name="form" ng-submit="form.$valid && submit(collection)" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-default">
<h4><i class="fa fa-info-circle"></i> Note</h4>
<p>
Select "Users" from the listing options to manage existing users for this collection. Associate new users by
editing the user's access on the "People" page.
</p>
<p>
You can associate new logins to the collection from your organization's "Vault" or by sharing an existing
login from "My vault".
</p>
</div>
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group" show-errors>
<label for="email">Name</label>
<input type="text" id="name" name="Name" ng-model="collection.name" class="form-control" required api-field />
</div>
<div ng-if="useGroups">
<h4>Group Access</h4>
<div ng-show="loading && !groups.length">
Loading groups...
</div>
<div ng-show="!loading && !groups.length">
<p>No groups for your organization.</p>
</div>
<div class="table-responsive" ng-show="groups.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleGroupSelectionAll($event)">
</th>
<th>Name</th>
<th style="width: 100px; text-align: center;">Read Only</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="group in groups | orderBy: ['name']">
<td valign="middle">
<input type="checkbox"
name="selectedGroups[]"
value="{{group.id}}"
ng-checked="groupSelected(group)"
ng-click="toggleGroupSelection(group.id)"
ng-disabled="group.accessAll">
</td>
<td valign="middle">
{{group.name}}
<i class="fa fa-unlock text-muted fa-fw" ng-show="group.accessAll"
title="This group can access all items"></i>
</td>
<td style="width: 100px; text-align: center;" valign="middle">
<input type="checkbox"
name="selectedGroupsReadonly[]"
value="{{group.id}}"
ng-disabled="!groupSelected(group) || group.accessAll"
ng-checked="groupSelected(group) && selectedGroups[group.id].readOnly"
ng-click="toggleGroupReadOnlySelection(group)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,64 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-users"></i> User Access <small>{{collection.name}}</small></h4>
</div>
<div class="modal-body">
<div ng-show="loading && !users.length">
Loading...
</div>
<div ng-show="!loading && !users.length">
<p>
No users for this collection. You can associate a new user to this collection by
selecting a specific user on the "People" page.
</p>
</div>
<div class="table-responsive" ng-show="users.length" style="margin: 0;">
<table class="table table-striped table-hover table-vmiddle" style="margin: 0;">
<tbody>
<tr ng-repeat="user in users | orderBy: ['email']">
<td style="width: 70px;">
<div class="btn-group" data-append-to=".modal">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-show="!user.accessAll">
<a href="javascript:void(0)" ng-click="remove(user)" class="text-red">
<i class="fa fa-fw fa-remove"></i> Remove
</a>
</li>
<li ng-show="user.accessAll">
<a href="javascript:void(0)">
No options...
</a>
</li>
</ul>
</div>
</td>
<td style="width: 45px;">
<letter-avatar data="{{user.name || user.email}}"></letter-avatar>
</td>
<td>
{{user.email}}
<div ng-if="user.name"><small class="text-muted">{{user.name}}</small></div>
</td>
<td style="width: 60px;" class="text-right">
<i class="fa fa-unlock" ng-show="user.accessAll" title="Can Access All Items"></i>
<i class="fa fa-pencil-square-o" ng-show="!user.readOnly" title="Can Edit"></i>
</td>
<td style="width: 100px;">
{{user.type | enumName: 'OrgUserType'}}
</td>
<td style="width: 120px;">
<span class="label {{user.status | enumLabelClass: 'OrgUserStatus'}}">
{{user.status | enumName: 'OrgUserStatus'}}
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>

View File

@@ -0,0 +1,32 @@
<section class="content-header">
<h1>
Dashboard
<small>{{orgProfile.name}}</small>
</h1>
</section>
<section class="content">
<div class="callout callout-warning" ng-if="!orgProfile.enabled">
<h4><i class="fa fa-warning"></i> Organization Disabled</h4>
<p>
This organization is currently disabled. Users will not see your shared logins or collections.
Contact us if you would like to reinstate this organization.
</p>
<a class="btn btn-default btn-flat" href="https://bitwarden.com/contact/" target="_blank">
Contact Us
</a>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Let's Get Started!</h3>
</div>
<div class="box-body">
<p>Dashboard features are coming soon. Get started by inviting users and creating your collections.</p>
<a class="btn btn-default btn-flat" ui-sref="backend.org.people({orgId: orgProfile.id})">
Invite Users
</a>
<a class="btn btn-default btn-flat" ui-sref="backend.org.collections({orgId: orgProfile.id})">
Manage Collections
</a>
</div>
</div>
</section>

View File

@@ -0,0 +1,34 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-trash"></i> Delete Organization</h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<p>
Continue below to delete this organization and all associated data. This data includes any collections and
their associated logins. Individual user accounts will remain, though they will not be associated to this
organization anymore.
</p>
<div class="callout callout-warning">
<h4><i class="fa fa-warning"></i> Warning</h4>
Deleting this organization is permanent. It cannot be undone.
</div>
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group" show-errors>
<label for="masterPassword">Master Password</label>
<input type="password" id="masterPassword" name="MasterPasswordHash" ng-model="masterPassword" class="form-control"
required api-field />
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Delete
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,70 @@
<section class="content-header">
<h1>
Groups
<small>organize your users</small>
</h1>
</section>
<section class="content">
<div class="box">
<div class="box-header with-border">
&nbsp;
<div class="box-filters hidden-xs">
<div class="form-group form-group-sm has-feedback has-feedback-left">
<input type="text" id="search" class="form-control" placeholder="Search groups..."
style="width: 200px;" ng-model="filterSearch">
<span class="fa fa-search form-control-feedback text-muted" aria-hidden="true"></span>
</div>
</div>
<div class="box-tools">
<button type="button" class="btn btn-primary btn-sm btn-flat" ng-click="add()">
<i class="fa fa-fw fa-plus-circle"></i> New Group
</button>
</div>
</div>
<div class="box-body" ng-class="{'no-padding': filteredGroups.length}">
<div ng-show="loading && !groups.length">
Loading...
</div>
<div ng-show="!filteredGroups.length && filterSearch">
No groups to list.
</div>
<div ng-show="!loading && !groups.length">
<p>There are no groups yet for your organization.</p>
<button type="button" ng-click="add()" class="btn btn-default btn-flat">Add a Group</button>
</div>
<div class="table-responsive" ng-show="groups.length">
<table class="table table-striped table-hover table-vmiddle">
<tbody>
<tr ng-repeat="group in filteredGroups = (groups | filter: (filterSearch || '') |
orderBy: ['name']) track by group.id">
<td style="width: 70px;">
<div class="btn-group" data-append-to="body">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0)" ng-click="users(group)">
<i class="fa fa-fw fa-users"></i> Users
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="delete(group)" class="text-red">
<i class="fa fa-fw fa-trash"></i> Delete
</a>
</li>
</ul>
</div>
</td>
<td valign="middle">
<a href="javascript:void(0)" ng-click="edit(group)">
{{group.name}}
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,95 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-sitemap"></i> Add New Group</h4>
</div>
<form name="form" ng-submit="form.$valid && submit(model)" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-default">
<h4><i class="fa fa-info-circle"></i> Note</h4>
<p>
After creating the group, you can associate a user to it by selecting the "Groups" option for a specific user
on the "People" page.
</p>
</div>
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group" show-errors>
<label for="name">Name</label>
<input type="text" id="name" name="Name" ng-model="model.name" class="form-control" required api-field />
</div>
<div class="form-group" show-errors>
<label for="externalId">External Id</label>
<input type="text" id="externalId" name="ExternalId" ng-model="model.externalId" class="form-control" api-field />
</div>
<h4>Access</h4>
<div class="radio">
<label>
<input type="radio" ng-model="model.accessAll" name="AccessAll"
ng-value="true" ng-checked="model.accessAll">
This group can access and modify <u>all items</u>.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="model.accessAll" name="AccessAll"
ng-value="false" ng-checked="!model.accessAll">
This group can access only the selected collections.
</label>
</div>
<div ng-show="!model.accessAll">
<div ng-show="loading && !collections.length">
Loading collections...
</div>
<div ng-show="!loading && !collections.length">
<p>No collections for your organization.</p>
</div>
<div class="table-responsive" ng-show="collections.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleCollectionSelectionAll($event)">
</th>
<th>Name</th>
<th style="width: 100px; text-align: center;">Read Only</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="collection in collections | orderBy: ['name']">
<td valign="middle">
<input type="checkbox"
name="selectedCollections[]"
value="{{collection.id}}"
ng-checked="collectionSelected(collection)"
ng-click="toggleCollectionSelection(collection.id)">
</td>
<td valign="middle">
{{collection.name}}
</td>
<td style="width: 100px; text-align: center;" valign="middle">
<input type="checkbox"
name="selectedCollectionsReadonly[]"
value="{{collection.id}}"
ng-disabled="!collectionSelected(collection)"
ng-checked="collectionSelected(collection) && selectedCollections[collection.id].readOnly"
ng-click="toggleCollectionReadOnlySelection(collection.id)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,95 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-sitemap"></i> Edit Group</h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-default">
<h4><i class="fa fa-info-circle"></i> Note</h4>
<p>
Select "Users" from the listing options to manage existing users for this group. Associate new users by
selecting "Groups" the "People" page for a specific user.
</p>
</div>
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group" show-errors>
<label for="name">Name</label>
<input type="text" id="name" name="Name" ng-model="group.name" class="form-control" required api-field />
</div>
<div class="form-group" show-errors>
<label for="externalId">External Id</label>
<input type="text" id="externalId" name="ExternalId" ng-model="group.externalId" class="form-control" api-field />
</div>
<h4>Access</h4>
<div class="radio">
<label>
<input type="radio" ng-model="group.accessAll" name="AccessAll"
ng-value="true" ng-checked="group.accessAll">
This group can access and modify <u>all items</u>.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="group.accessAll" name="AccessAll"
ng-value="false" ng-checked="!group.accessAll">
This group can access only the selected collections.
</label>
</div>
<div ng-show="!group.accessAll">
<div ng-show="loading && !collections.length">
Loading collections...
</div>
<div ng-show="!loading && !collections.length">
<p>No collections for your organization.</p>
</div>
<div class="table-responsive" ng-show="collections.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleCollectionSelectionAll($event)">
</th>
<th>Name</th>
<th style="width: 100px; text-align: center;">Read Only</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="collection in collections | orderBy: ['name']">
<td valign="middle">
<input type="checkbox"
name="selectedCollections[]"
value="{{collection.id}}"
ng-checked="collectionSelected(collection)"
ng-click="toggleCollectionSelection(collection.id)">
</td>
<td valign="middle">
{{collection.name}}
</td>
<td style="width: 100px; text-align: center;" valign="middle">
<input type="checkbox"
name="selectedCollectionsReadonly[]"
value="{{collection.id}}"
ng-disabled="!collectionSelected(collection)"
ng-checked="collectionSelected(collection) && selectedCollections[collection.id].readOnly"
ng-click="toggleCollectionReadOnlySelection(collection.id)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,55 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-users"></i> User Access <small>{{group.name}}</small></h4>
</div>
<div class="modal-body">
<div ng-show="loading && !users.length">
Loading...
</div>
<div ng-show="!loading && !users.length">
<p>
No users for this group. You can associate a new user to this group by
selecting a specific user's "Groups" on the "People" page.
</p>
</div>
<div class="table-responsive" ng-show="users.length" style="margin: 0;">
<table class="table table-striped table-hover table-vmiddle" style="margin: 0;">
<tbody>
<tr ng-repeat="user in users | orderBy: ['email']">
<td style="width: 70px;">
<div class="btn-group" data-append-to=".modal">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-show="user.organizationUserId">
<a href="javascript:void(0)" ng-click="remove(user)" class="text-red">
<i class="fa fa-fw fa-remove"></i> Remove
</a>
</li>
</ul>
</div>
</td>
<td style="width: 45px;">
<letter-avatar data="{{user.name || user.email}}"></letter-avatar>
</td>
<td>
{{user.email}}
<div ng-if="user.name"><small class="text-muted">{{user.name}}</small></div>
</td>
<td style="width: 100px;">
{{user.type | enumName: 'OrgUserType'}}
</td>
<td style="width: 120px;">
<span class="label {{user.status | enumLabelClass: 'OrgUserStatus'}}">
{{user.status | enumName: 'OrgUserStatus'}}
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>

View File

@@ -0,0 +1,90 @@
<section class="content-header">
<h1>
People
<small>users for your organization</small>
</h1>
</section>
<section class="content">
<div class="box">
<div class="box-header with-border">
&nbsp;
<div class="box-filters hidden-xs">
<div class="form-group form-group-sm has-feedback has-feedback-left">
<input type="text" id="search" class="form-control" placeholder="Search people..."
style="width: 200px;" ng-model="filterSearch">
<span class="fa fa-search form-control-feedback text-muted" aria-hidden="true"></span>
</div>
</div>
<div class="box-tools">
<button type="button" class="btn btn-primary btn-sm btn-flat" ng-click="invite()">
<i class="fa fa-fw fa-plus-circle"></i> Invite User
</button>
</div>
</div>
<div class="box-body" ng-class="{'no-padding': filteredUsers.length}">
<div ng-show="!filteredUsers.length && !filterSearch">
Loading...
</div>
<div class="table-responsive" ng-show="filteredUsers.length">
<table class="table table-striped table-hover table-vmiddle">
<tbody>
<tr ng-repeat="user in filteredUsers = (users | filter: (filterSearch || '') |
orderBy: ['type', 'name', 'email']) track by user.id">
<td style="width: 70px;">
<div class="btn-group" data-append-to="body">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0)" ng-click="edit(user)">
<i class="fa fa-fw fa-pencil"></i> Edit
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="groups(user)" ng-if="useGroups">
<i class="fa fa-fw fa-sitemap"></i> Groups
</a>
</li>
<li ng-show="user.status === 1">
<a href="javascript:void(0)" ng-click="confirm(user)">
<i class="fa fa-fw fa-check"></i> Confirm
</a>
</li>
<li ng-show="user.status === 0">
<a href="javascript:void(0)" ng-click="reinvite(user)">
<i class="fa fa-fw fa-envelope-o"></i> Re-send Invitation
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="delete(user)" class="text-red">
<i class="fa fa-fw fa-remove"></i> Remove
</a>
</li>
</ul>
</div>
</td>
<td style="width: 45px;">
<letter-avatar data="{{user.name || user.email}}"></letter-avatar>
</td>
<td>
<a href="javascript:void(0)" ng-click="edit(user)">{{user.email}}</a>
<i class="fa fa-unlock text-muted" ng-show="user.accessAll"
title="Can Access All Items"></i>
<div ng-if="user.name"><small class="text-muted">{{user.name}}</small></div>
</td>
<td style="width: 100px;">
{{user.type | enumName: 'OrgUserType'}}
</td>
<td style="width: 120px;">
<span class="label {{user.status | enumLabelClass: 'OrgUserStatus'}}">
{{user.status | enumName: 'OrgUserStatus'}}
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,101 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-user"></i> Edit User <small>{{email}}</small></h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<h4>User Type</h4>
<div class="form-group">
<div class="radio">
<label>
<input type="radio" id="user-type" ng-model="type" name="Type" value="2" ng-checked="type === 2">
<strong>User</strong> - A regular user with access to your organization's collections.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="type" name="Type" value="1" ng-checked="type === 1">
<strong>Admin</strong> - Admins can manage collections and users for your organization.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="type" name="Type" value="0" ng-checked="type === 0">
<strong>Owner</strong> - The highest access user that can manage all aspects of your organization.
</label>
</div>
</div>
<h4>Access</h4>
<div class="radio">
<label>
<input type="radio" ng-model="accessAll" name="AccessAll"
ng-value="true" ng-checked="accessAll">
This user can access and modify <u>all items</u>.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="accessAll" name="AccessAll"
ng-value="false" ng-checked="!accessAll">
This user can access only the selected collections.
</label>
</div>
<div ng-show="!accessAll">
<div ng-show="loading && !collections.length">
Loading collections...
</div>
<div ng-show="!loading && !collections.length">
<p>No collections for your organization.</p>
</div>
<div class="table-responsive" ng-show="collections.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleCollectionSelectionAll($event)">
</th>
<th>Name</th>
<th style="width: 100px; text-align: center;">Read Only</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="collection in collections | orderBy: ['name']">
<td valign="middle">
<input type="checkbox"
name="selectedCollections[]"
value="{{collection.id}}"
ng-checked="collectionSelected(collection)"
ng-click="toggleCollectionSelection(collection.id)">
</td>
<td valign="middle">
{{collection.name}}
</td>
<td style="text-align: center;" valign="middle">
<input type="checkbox"
name="selectedCollectionsReadonly[]"
value="{{collection.id}}"
ng-disabled="!collectionSelected(collection)"
ng-checked="collectionSelected(collection) && selectedCollections[collection.id].readOnly"
ng-click="toggleCollectionReadOnlySelection(collection.id)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,55 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-sitemap"></i> Edit User Groups <small>{{orgUser.email}}</small></h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div ng-show="loading && !groups.length">
Loading...
</div>
<div ng-show="!loading && !groups.length">
<p>No groups for your organization.</p>
</div>
<p ng-show="groups.length">Edit the groups that this user belongs to.</p>
<div class="table-responsive" ng-show="groups.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleGroupSelectionAll($event)">
</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="group in groups | orderBy: ['name']">
<td valign="middle">
<input type="checkbox"
name="selectedGroups[]"
value="{{group.id}}"
ng-checked="groupSelected(group)"
ng-click="toggleGroupSelection(group.id)">
</td>
<td valign="middle">
{{group.name}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Submit
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,110 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-user"></i> Invite User</h4>
</div>
<form name="inviteForm" ng-submit="inviteForm.$valid && submit(model)" api-form="submitPromise">
<div class="modal-body">
<p>
Invite a new user to your organization by entering their bitwarden account email address below. If they do not have
a bitwarden account already, they will be prompted to create a new account.
</p>
<div class="callout callout-danger validation-errors" ng-show="inviteForm.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in inviteForm.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group" show-errors>
<label for="emails">Email</label>
<input type="text" id="emails" name="Emails" ng-model="model.emails" class="form-control" required api-field />
<p class="help-block">You can invite up to 20 users at a time by comma separating a list of email addresses.</p>
</div>
<h4>User Type</h4>
<div class="form-group">
<div class="radio">
<label>
<input type="radio" id="user-type" ng-model="model.type" name="Type" value="User">
<strong>User</strong> - A regular user with access to your organization's collections.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="model.type" name="Type" value="Admin">
<strong>Admin</strong> - Admins can manage collections and users for your organization.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="model.type" name="Type" value="Owner">
<strong>Owner</strong> - The highest access user that can manage all aspects of your organization.
</label>
</div>
</div>
<h4>Access</h4>
<div class="radio">
<label>
<input type="radio" ng-model="model.accessAll" name="AccessAll"
ng-value="true" ng-checked="model.accessAll">
This user can access and modify <u>all items</u>.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="model.accessAll" name="AccessAll"
ng-value="false" ng-checked="!model.accessAll">
This user can access only the selected collections.
</label>
</div>
<div ng-show="!model.accessAll">
<div ng-show="loading && !collections.length">
Loading collections...
</div>
<div ng-show="!loading && !collections.length">
<p>No collections for your organization.</p>
</div>
<div class="table-responsive" ng-show="collections.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleCollectionSelectionAll($event)">
</th>
<th>Name</th>
<th style="width: 100px; text-align: center;">Read Only</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="collection in collections | orderBy: ['name'] track by collection.id">
<td style="width: 40px;" valign="middle">
<input type="checkbox"
name="selectedCollections[]"
value="{{collection.id}}"
ng-checked="collectionSelected(collection)"
ng-click="toggleCollectionSelection(collection.id)">
</td>
<td valign="middle">
{{collection.name}}
</td>
<td style="width: 100px; text-align: center;" valign="middle">
<input type="checkbox"
name="selectedCollectionsReadonly[]"
value="{{collection.id}}"
ng-disabled="!collectionSelected(collection)"
ng-checked="collectionSelected(collection) && selectedCollections[collection.id].readOnly"
ng-click="toggleCollectionReadOnlySelection(collection.id)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="inviteForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="inviteForm.$loading"></i>Send Invite
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,65 @@
<section class="content-header">
<h1>
Settings
<small>manage your organization</small>
</h1>
</section>
<section class="content">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">General</h3>
</div>
<form role="form" name="generalForm" ng-submit="generalForm.$valid && generalSave()" api-form="generalPromise">
<div class="box-body">
<div class="row">
<div class="col-sm-9">
<div class="callout callout-danger validation-errors" ng-show="generalForm.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in generalForm.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group" show-errors>
<label for="name">Organization Name</label>
<input type="text" id="name" name="Name" ng-model="model.name" class="form-control"
required api-field />
</div>
<div class="form-group" show-errors>
<label for="name">Business Name</label>
<input type="text" id="businessName" name="BusinessName" ng-model="model.businessName"
class="form-control" api-field />
</div>
<div class="form-group" show-errors>
<label for="name">Billing Email</label>
<input type="email" id="billingEmail" name="BillingEmail" ng-model="model.billingEmail"
class="form-control" required api-field />
</div>
</div>
<div class="col-sm-3 settings-photo">
<letter-avatar data="{{model.name}}" round="false"
avclass="img-responsive img-rounded" avwidth="200" avheight="200"
fontsize="90"></letter-avatar>
</div>
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="generalForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="generalForm.$loading"></i>Save
</button>
</div>
</form>
</div>
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Danger Zone</h3>
</div>
<div class="box-body">
Careful, these actions are not reversible!
</div>
<div class="box-footer">
<button type="submit" class="btn btn-default btn-flat" ng-click="delete()">
Delete Organization
</button>
</div>
</div>
</section>

View File

@@ -0,0 +1,78 @@
<section class="content-header">
<h1>
Org<span class="hidden-xs">anization</span> Vault
<small>
<span ng-pluralize
count="collections.length > 0 ? collections.length - 1 : 0"
when="{'1': '{} collection', 'other': '{} collections'}"></span>,
<span ng-pluralize count="logins.length" when="{'1': '{} login', 'other': '{} logins'}"></span>
</small>
</h1>
</section>
<section class="content">
<p ng-show="loading && !collections.length">Loading...</p>
<div class="box" ng-class="{'collapsed-box': collection.collapsed}" ng-repeat="collection in collections |
orderBy: collectionSort track by collection.id"
ng-show="collections.length && (!main.searchVaultText || collectionLogins.length)">
<div class="box-header with-border">
<h3 class="box-title">
<i class="fa" ng-class="{'fa-cubes': collection.id, 'fa-sitemap': !collection.id}"></i>
{{collection.name}}
<small ng-pluralize count="collectionLogins.length" when="{'1': '{} login', 'other': '{} logins'}"></small>
</h3>
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-widget="collapse" title="Collapse/Expand"
ng-click="collapseExpand(collection)">
<i class="fa" ng-class="{'fa-minus': !collection.collapsed, 'fa-plus': collection.collapsed}"></i>
</button>
</div>
</div>
<div class="box-body" ng-class="{'no-padding': collectionLogins.length}">
<div ng-show="!collectionLogins.length && collection.id">No logins in this collection.</div>
<div ng-show="!collectionLogins.length && !collection.id">No unassigned logins.</div>
<div class="table-responsive" ng-show="collectionLogins.length">
<table class="table table-striped table-hover table-vmiddle">
<tbody>
<tr ng-repeat="login in collectionLogins = (logins | filter: filterByCollection(collection) |
filter: (main.searchVaultText || '') | orderBy: ['name', 'username']) track by login.id">
<td style="width: 70px;">
<div class="btn-group" data-append-to="body">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0)" ng-click="editLogin(login)">
<i class="fa fa-fw fa-pencil"></i> Edit
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="editCollections(login)">
<i class="fa fa-fw fa-cubes"></i> Collections
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="removeLogin(login, collection)" class="text-red"
ng-if="collection.id">
<i class="fa fa-fw fa-remove"></i> Remove
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="deleteLogin(login)" class="text-red">
<i class="fa fa-fw fa-trash"></i> Delete
</a>
</li>
</ul>
</div>
</td>
<td>
<a href="javascript:void(0)" ng-click="editLogin(login)">{{login.name}}</a>
<div class="text-sm text-muted">{{login.username}}</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,52 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-cubes"></i> Collections <small>{{cipher.name}}</small></h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<p>Edit the collections that this login is being shared with.</p>
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occurred</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div ng-show="!collections.length" class="callout callout-default">
<p>There are no collections yet for your organization.</p>
</div>
<div class="table-responsive" ng-show="collections.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleCollectionSelectionAll($event)">
</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="collection in collections | orderBy: ['name'] track by collection.id">
<td valign="middle">
<input type="checkbox"
name="selectedCollections[]"
value="{{collection.id}}"
ng-checked="collectionSelected(collection)"
ng-click="toggleCollectionSelection(collection.id)">
</td>
<td valign="middle" ng-click="toggleCollectionSelection(collection.id)">
{{collection.name}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading" ng-show="collections.length">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="form.$loading"></i>Save
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@@ -0,0 +1,139 @@
angular
.module('bit.services')
.factory('apiService', function ($resource, tokenService, appSettings, $httpParamSerializer) {
var _service = {},
_apiUri = appSettings.apiUri,
_identityUri = appSettings.identityUri;
_service.logins = $resource(_apiUri + '/logins/:id', {}, {
get: { method: 'GET', params: { id: '@id' } },
getAdmin: { url: _apiUri + '/logins/:id/admin', method: 'GET', params: { id: '@id' } },
list: { method: 'GET', params: {} },
post: { method: 'POST', params: {} },
postAdmin: { url: _apiUri + '/logins/admin', method: 'POST', params: {} },
put: { method: 'POST', params: { id: '@id' } },
putAdmin: { url: _apiUri + '/logins/:id/admin', method: 'POST', params: { id: '@id' } },
del: { url: _apiUri + '/logins/:id/delete', method: 'POST', params: { id: '@id' } }
});
_service.folders = $resource(_apiUri + '/folders/:id', {}, {
get: { method: 'GET', params: { id: '@id' } },
list: { method: 'GET', params: {} },
post: { method: 'POST', params: {} },
put: { method: 'POST', params: { id: '@id' } },
del: { url: _apiUri + '/folders/:id/delete', method: 'POST', params: { id: '@id' } }
});
_service.ciphers = $resource(_apiUri + '/ciphers/:id', {}, {
get: { method: 'GET', params: { id: '@id' } },
getDetails: { url: _apiUri + '/ciphers/:id/details', method: 'GET', params: { id: '@id' } },
list: { method: 'GET', params: { includeFolders: false, includeShared: true } },
listDetails: { url: _apiUri + '/ciphers/details', method: 'GET', params: {} },
listOrganizationDetails: { url: _apiUri + '/ciphers/organization-details', method: 'GET', params: {} },
'import': { url: _apiUri + '/ciphers/import', method: 'POST', params: {} },
favorite: { url: _apiUri + '/ciphers/:id/favorite', method: 'POST', params: { id: '@id' } },
putPartial: { url: _apiUri + '/ciphers/:id/partial', method: 'POST', params: { id: '@id' } },
putShare: { url: _apiUri + '/ciphers/:id/share', method: 'POST', params: { id: '@id' } },
putCollections: { url: _apiUri + '/ciphers/:id/collections', method: 'POST', params: { id: '@id' } },
putCollectionsAdmin: { url: _apiUri + '/ciphers/:id/collections-admin', method: 'POST', params: { id: '@id' } },
del: { url: _apiUri + '/ciphers/:id/delete', method: 'POST', params: { id: '@id' } },
delAdmin: { url: _apiUri + '/ciphers/:id/delete-admin', method: 'POST', params: { id: '@id' } }
});
_service.organizations = $resource(_apiUri + '/organizations/:id', {}, {
get: { method: 'GET', params: { id: '@id' } },
getBilling: { url: _apiUri + '/organizations/:id/billing', method: 'GET', params: { id: '@id' } },
list: { method: 'GET', params: {} },
post: { method: 'POST', params: {} },
put: { method: 'POST', params: { id: '@id' } },
putPayment: { url: _apiUri + '/organizations/:id/payment', method: 'POST', params: { id: '@id' } },
putSeat: { url: _apiUri + '/organizations/:id/seat', method: 'POST', params: { id: '@id' } },
putUpgrade: { url: _apiUri + '/organizations/:id/upgrade', method: 'POST', params: { id: '@id' } },
putCancel: { url: _apiUri + '/organizations/:id/cancel', method: 'POST', params: { id: '@id' } },
putReinstate: { url: _apiUri + '/organizations/:id/reinstate', method: 'POST', params: { id: '@id' } },
postLeave: { url: _apiUri + '/organizations/:id/leave', method: 'POST', params: { id: '@id' } },
del: { url: _apiUri + '/organizations/:id/delete', method: 'POST', params: { id: '@id' } }
});
_service.organizationUsers = $resource(_apiUri + '/organizations/:orgId/users/:id', {}, {
get: { method: 'GET', params: { id: '@id', orgId: '@orgId' } },
list: { method: 'GET', params: { orgId: '@orgId' } },
listGroups: { url: _apiUri + '/organizations/:orgId/users/:id/groups', method: 'GET', params: { id: '@id', orgId: '@orgId' }, isArray: true },
invite: { url: _apiUri + '/organizations/:orgId/users/invite', method: 'POST', params: { orgId: '@orgId' } },
reinvite: { url: _apiUri + '/organizations/:orgId/users/:id/reinvite', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
accept: { url: _apiUri + '/organizations/:orgId/users/:id/accept', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
confirm: { url: _apiUri + '/organizations/:orgId/users/:id/confirm', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
put: { method: 'POST', params: { id: '@id', orgId: '@orgId' } },
putGroups: { url: _apiUri + '/organizations/:orgId/users/:id/groups', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
del: { url: _apiUri + '/organizations/:orgId/users/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } }
});
_service.collections = $resource(_apiUri + '/organizations/:orgId/collections/:id', {}, {
get: { method: 'GET', params: { id: '@id', orgId: '@orgId' } },
getDetails: { url: _apiUri + '/organizations/:orgId/collections/:id/details', method: 'GET', params: { id: '@id', orgId: '@orgId' } },
listMe: { url: _apiUri + '/collections', method: 'GET', params: {} },
listOrganization: { method: 'GET', params: { orgId: '@orgId' } },
listUsers: { url: _apiUri + '/organizations/:orgId/collections/:id/users', method: 'GET', params: { id: '@id', orgId: '@orgId' } },
post: { method: 'POST', params: { orgId: '@orgId' } },
put: { method: 'POST', params: { id: '@id', orgId: '@orgId' } },
del: { url: _apiUri + '/organizations/:orgId/collections/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
delUser: { url: _apiUri + '/organizations/:orgId/collections/:id/delete-user/:orgUserId', method: 'POST', params: { id: '@id', orgId: '@orgId', orgUserId: '@orgUserId' } }
});
_service.groups = $resource(_apiUri + '/organizations/:orgId/groups/:id', {}, {
get: { method: 'GET', params: { id: '@id', orgId: '@orgId' } },
getDetails: { url: _apiUri + '/organizations/:orgId/groups/:id/details', method: 'GET', params: { id: '@id', orgId: '@orgId' } },
listOrganization: { method: 'GET', params: { orgId: '@orgId' } },
listUsers: { url: _apiUri + '/organizations/:orgId/groups/:id/users', method: 'GET', params: { id: '@id', orgId: '@orgId' } },
post: { method: 'POST', params: { orgId: '@orgId' } },
put: { method: 'POST', params: { id: '@id', orgId: '@orgId' } },
del: { url: _apiUri + '/organizations/:orgId/groups/:id/delete', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
delUser: { url: _apiUri + '/organizations/:orgId/groups/:id/delete-user/:orgUserId', method: 'POST', params: { id: '@id', orgId: '@orgId', orgUserId: '@orgUserId' } }
});
_service.accounts = $resource(_apiUri + '/accounts', {}, {
register: { url: _apiUri + '/accounts/register', method: 'POST', params: {} },
emailToken: { url: _apiUri + '/accounts/email-token', method: 'POST', params: {} },
email: { url: _apiUri + '/accounts/email', method: 'POST', params: {} },
putPassword: { url: _apiUri + '/accounts/password', method: 'POST', params: {} },
getProfile: { url: _apiUri + '/accounts/profile', method: 'GET', params: {} },
putProfile: { url: _apiUri + '/accounts/profile', method: 'POST', params: {} },
getDomains: { url: _apiUri + '/accounts/domains', method: 'GET', params: {} },
putDomains: { url: _apiUri + '/accounts/domains', method: 'POST', params: {} },
getTwoFactor: { url: _apiUri + '/accounts/two-factor', method: 'GET', params: {} },
putTwoFactor: { url: _apiUri + '/accounts/two-factor', method: 'POST', params: {} },
postTwoFactorRecover: { url: _apiUri + '/accounts/two-factor-recover', method: 'POST', params: {} },
postPasswordHint: { url: _apiUri + '/accounts/password-hint', method: 'POST', params: {} },
putSecurityStamp: { url: _apiUri + '/accounts/security-stamp', method: 'POST', params: {} },
putKeys: { url: _apiUri + '/accounts/keys', method: 'POST', params: {} },
'import': { url: _apiUri + '/accounts/import', method: 'POST', params: {} },
postDelete: { url: _apiUri + '/accounts/delete', method: 'POST', params: {} }
});
_service.settings = $resource(_apiUri + '/settings', {}, {
getDomains: { url: _apiUri + '/settings/domains', method: 'GET', params: {} },
putDomains: { url: _apiUri + '/settings/domains', method: 'POST', params: {} },
});
_service.users = $resource(_apiUri + '/users/:id', {}, {
getPublicKey: { url: _apiUri + '/users/:id/public-key', method: 'GET', params: { id: '@id' } }
});
_service.identity = $resource(_identityUri + '/connect', {}, {
token: {
url: _identityUri + '/connect/token',
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' },
transformRequest: transformUrlEncoded,
skipAuthorization: true,
params: {}
}
});
function transformUrlEncoded(data) {
return $httpParamSerializer(data);
}
return _service;
});

View File

@@ -0,0 +1,216 @@
angular
.module('bit.services')
.factory('authService', function (cryptoService, apiService, tokenService, $q, jwtHelper, $rootScope) {
var _service = {},
_userProfile = null;
_service.logIn = function (email, masterPassword, token, provider) {
email = email.toLowerCase();
var key = cryptoService.makeKey(masterPassword, email);
var request = {
username: email,
password: cryptoService.hashPassword(masterPassword, key),
grant_type: 'password',
scope: 'api offline_access',
client_id: 'web'
};
if (token && typeof (provider) !== 'undefined' && provider !== null) {
request.twoFactorToken = token.replace(' ', '');
request.twoFactorProvider = provider;
}
// TODO: device information one day?
var deferred = $q.defer();
apiService.identity.token(request).$promise.then(function (response) {
if (!response || !response.access_token) {
return;
}
tokenService.setToken(response.access_token);
tokenService.setRefreshToken(response.refresh_token);
cryptoService.setKey(key);
if (response.PrivateKey) {
cryptoService.setPrivateKey(response.PrivateKey, key);
return true;
}
else {
return cryptoService.makeKeyPair(key);
}
}).then(function (keyResults) {
if (keyResults === true) {
return;
}
cryptoService.setPrivateKey(keyResults.privateKeyEnc, key);
return apiService.accounts.putKeys({
publicKey: keyResults.publicKey,
encryptedPrivateKey: keyResults.privateKeyEnc
}).$promise;
}).then(function () {
return _service.setUserProfile();
}).then(function () {
deferred.resolve();
}, function (error) {
_service.logOut();
if (error.status === 400 && error.data.TwoFactorProviders && error.data.TwoFactorProviders.length) {
deferred.resolve(error.data.TwoFactorProviders);
}
else {
deferred.reject(error);
}
});
return deferred.promise;
};
_service.logOut = function () {
tokenService.clearToken();
tokenService.clearRefreshToken();
cryptoService.clearKeys();
$rootScope.vaultFolders = $rootScope.vaultLogins = null;
_userProfile = null;
};
_service.getUserProfile = function () {
if (!_userProfile) {
return _service.setUserProfile();
}
var deferred = $q.defer();
deferred.resolve(_userProfile);
return deferred.promise;
};
var _setDeferred = null;
_service.setUserProfile = function () {
if (_setDeferred && _setDeferred.promise.$$state.status === 0) {
return _setDeferred.promise;
}
_setDeferred = $q.defer();
var token = tokenService.getToken();
if (!token) {
_setDeferred.reject();
return _setDeferred.promise;
}
var decodedToken = jwtHelper.decodeToken(token);
apiService.accounts.getProfile({}, function (profile) {
_userProfile = {
id: decodedToken.name,
email: decodedToken.email,
extended: {
name: profile.Name,
twoFactorEnabled: profile.TwoFactorEnabled,
culture: profile.Culture
}
};
if (profile.Organizations) {
var orgs = {};
for (var i = 0; i < profile.Organizations.length; i++) {
orgs[profile.Organizations[i].Id] = {
id: profile.Organizations[i].Id,
name: profile.Organizations[i].Name,
key: profile.Organizations[i].Key,
status: profile.Organizations[i].Status,
type: profile.Organizations[i].Type,
enabled: profile.Organizations[i].Enabled,
maxCollections: profile.Organizations[i].MaxCollections,
seats: profile.Organizations[i].Seats,
useGroups: profile.Organizations[i].UseGroups
};
}
_userProfile.organizations = orgs;
cryptoService.setOrgKeys(orgs);
_setDeferred.resolve(_userProfile);
}
}, function () {
_setDeferred.reject();
});
return _setDeferred.promise;
};
_service.addProfileOrganizationOwner = function (org, keyCt) {
return _service.getUserProfile().then(function (profile) {
if (profile) {
if (!profile.organizations) {
profile.organizations = {};
}
var o = {
id: org.Id,
name: org.Name,
key: keyCt,
status: 2, // 2 = Confirmed
type: 0, // 0 = Owner
enabled: true,
maxCollections: org.MaxCollections,
seats: org.Seats,
useGroups: org.UseGroups
};
profile.organizations[o.id] = o;
_userProfile = profile;
cryptoService.addOrgKey(o.id, o.key);
}
});
};
_service.removeProfileOrganization = function (orgId) {
return _service.getUserProfile().then(function (profile) {
if (profile) {
if (profile.organizations && profile.organizations.hasOwnProperty(orgId)) {
delete profile.organizations[orgId];
_userProfile = profile;
}
cryptoService.clearOrgKey(orgId);
}
});
};
_service.updateProfileOrganization = function (org) {
return _service.getUserProfile().then(function (profile) {
if (profile) {
if (profile.organizations && org.Id in profile.organizations) {
profile.organizations[org.Id].name = org.Name;
_userProfile = profile;
}
}
});
};
_service.isAuthenticated = function () {
return tokenService.getToken() !== null;
};
_service.refreshAccessToken = function () {
var refreshToken = tokenService.getRefreshToken();
if (!refreshToken) {
return null;
}
return apiService.identity.token({
grant_type: 'refresh_token',
client_id: 'web',
refresh_token: refreshToken
}).$promise.then(function (response) {
tokenService.setToken(response.access_token);
tokenService.setRefreshToken(response.refresh_token);
return response.access_token;
}, function (response) { });
};
return _service;
});

View File

@@ -0,0 +1,208 @@
angular
.module('bit.services')
.factory('cipherService', function (cryptoService, apiService) {
var _service = {};
_service.decryptLogins = function (encryptedLogins) {
if (!encryptedLogins) throw "encryptedLogins is undefined or null";
var unencryptedLogins = [];
for (var i = 0; i < encryptedLogins.length; i++) {
unencryptedLogins.push(_service.decryptLogin(encryptedLogins[i]));
}
return unencryptedLogins;
};
_service.decryptLogin = function (encryptedLogin) {
if (!encryptedLogin) throw "encryptedLogin is undefined or null";
var key = null;
if (encryptedLogin.OrganizationId) {
key = cryptoService.getOrgKey(encryptedLogin.OrganizationId);
}
var login = {
id: encryptedLogin.Id,
organizationId: encryptedLogin.OrganizationId,
collectionIds: encryptedLogin.CollectionIds || [],
'type': 1,
folderId: encryptedLogin.FolderId,
favorite: encryptedLogin.Favorite,
edit: encryptedLogin.Edit,
name: cryptoService.decrypt(encryptedLogin.Name, key),
uri: encryptedLogin.Uri && encryptedLogin.Uri !== '' ? cryptoService.decrypt(encryptedLogin.Uri, key) : null,
username: encryptedLogin.Username && encryptedLogin.Username !== '' ? cryptoService.decrypt(encryptedLogin.Username, key) : null,
password: encryptedLogin.Password && encryptedLogin.Password !== '' ? cryptoService.decrypt(encryptedLogin.Password, key) : null,
notes: encryptedLogin.Notes && encryptedLogin.Notes !== '' ? cryptoService.decrypt(encryptedLogin.Notes, key) : null
};
return login;
};
_service.decryptLoginPreview = function (encryptedCipher) {
if (!encryptedCipher) throw "encryptedCipher is undefined or null";
var key = null;
if (encryptedCipher.OrganizationId) {
key = cryptoService.getOrgKey(encryptedCipher.OrganizationId);
}
var login = {
id: encryptedCipher.Id,
organizationId: encryptedCipher.OrganizationId,
collectionIds: encryptedCipher.CollectionIds || [],
folderId: encryptedCipher.FolderId,
favorite: encryptedCipher.Favorite,
edit: encryptedCipher.Edit,
name: _service.decryptProperty(encryptedCipher.Data.Name, key, false),
username: _service.decryptProperty(encryptedCipher.Data.Username, key, true)
};
return login;
};
_service.decryptFolders = function (encryptedFolders) {
if (!encryptedFolders) throw "encryptedFolders is undefined or null";
var unencryptedFolders = [];
for (var i = 0; i < encryptedFolders.length; i++) {
unencryptedFolders.push(_service.decryptFolder(encryptedFolders[i]));
}
return unencryptedFolders;
};
_service.decryptFolder = function (encryptedFolder) {
if (!encryptedFolder) throw "encryptedFolder is undefined or null";
return {
id: encryptedFolder.Id,
name: cryptoService.decrypt(encryptedFolder.Name)
};
};
_service.decryptFolderPreview = function (encryptedFolder) {
if (!encryptedFolder) throw "encryptedFolder is undefined or null";
return {
id: encryptedFolder.Id,
name: _service.decryptProperty(encryptedFolder.Name, null, false)
};
};
_service.decryptCollections = function (encryptedCollections, orgId, catchError) {
if (!encryptedCollections) throw "encryptedCollections is undefined or null";
var unencryptedCollections = [];
for (var i = 0; i < encryptedCollections.length; i++) {
unencryptedCollections.push(_service.decryptCollection(encryptedCollections[i], orgId, catchError));
}
return unencryptedCollections;
};
_service.decryptCollection = function (encryptedCollection, orgId, catchError) {
if (!encryptedCollection) throw "encryptedCollection is undefined or null";
catchError = catchError === true ? true : false;
orgId = orgId || encryptedCollection.OrganizationId;
var key = cryptoService.getOrgKey(orgId);
return {
id: encryptedCollection.Id,
name: catchError ? _service.decryptProperty(encryptedCollection.Name, key, false) :
cryptoService.decrypt(encryptedCollection.Name, key)
};
};
_service.decryptProperty = function (property, key, checkEmpty) {
if (checkEmpty && (!property || property === '')) {
return null;
}
try {
property = cryptoService.decrypt(property, key);
}
catch (err) {
property = null;
}
return property || '[error: cannot decrypt]';
};
_service.encryptLogins = function (unencryptedLogins, key) {
if (!unencryptedLogins) throw "unencryptedLogins is undefined or null";
var encryptedLogins = [];
for (var i = 0; i < unencryptedLogins.length; i++) {
encryptedLogins.push(_service.encryptLogin(unencryptedLogins[i], key));
}
return encryptedLogins;
};
_service.encryptLogin = function (unencryptedLogin, key) {
if (!unencryptedLogin) throw "unencryptedLogin is undefined or null";
if (unencryptedLogin.organizationId) {
key = key || cryptoService.getOrgKey(unencryptedLogin.organizationId);
}
return {
id: unencryptedLogin.id,
'type': 1,
organizationId: unencryptedLogin.organizationId || null,
folderId: unencryptedLogin.folderId === '' ? null : unencryptedLogin.folderId,
favorite: unencryptedLogin.favorite !== null ? unencryptedLogin.favorite : false,
uri: !unencryptedLogin.uri || unencryptedLogin.uri === '' ? null : cryptoService.encrypt(unencryptedLogin.uri, key),
name: cryptoService.encrypt(unencryptedLogin.name, key),
username: !unencryptedLogin.username || unencryptedLogin.username === '' ? null : cryptoService.encrypt(unencryptedLogin.username, key),
password: !unencryptedLogin.password || unencryptedLogin.password === '' ? null : cryptoService.encrypt(unencryptedLogin.password, key),
notes: !unencryptedLogin.notes || unencryptedLogin.notes === '' ? null : cryptoService.encrypt(unencryptedLogin.notes, key)
};
};
_service.encryptFolders = function (unencryptedFolders, key) {
if (!unencryptedFolders) throw "unencryptedFolders is undefined or null";
var encryptedFolders = [];
for (var i = 0; i < unencryptedFolders.length; i++) {
encryptedFolders.push(_service.encryptFolder(unencryptedFolders[i], key));
}
return encryptedFolders;
};
_service.encryptFolder = function (unencryptedFolder, key) {
if (!unencryptedFolder) throw "unencryptedFolder is undefined or null";
return {
id: unencryptedFolder.id,
name: cryptoService.encrypt(unencryptedFolder.name, key)
};
};
_service.encryptCollections = function (unencryptedCollections, orgId) {
if (!unencryptedCollections) throw "unencryptedCollections is undefined or null";
var encryptedCollections = [];
for (var i = 0; i < unencryptedCollections.length; i++) {
encryptedCollections.push(_service.encryptCollection(unencryptedCollections[i], orgId));
}
return encryptedCollections;
};
_service.encryptCollection = function (unencryptedCollection, orgId) {
if (!unencryptedCollection) throw "unencryptedCollection is undefined or null";
return {
id: unencryptedCollection.id,
name: cryptoService.encrypt(unencryptedCollection.name, cryptoService.getOrgKey(orgId))
};
};
return _service;
});

View File

@@ -0,0 +1,503 @@
angular
.module('bit.services')
.factory('cryptoService', function ($sessionStorage, constants, $q) {
var _service = {},
_key,
_legacyEtmKey,
_orgKeys,
_privateKey,
_publicKey;
_service.setKey = function (key) {
_key = key;
$sessionStorage.key = _key.keyB64;
};
_service.setPrivateKey = function (privateKeyCt, key) {
try {
var privateKeyBytes = _service.decrypt(privateKeyCt, key, 'raw');
$sessionStorage.privateKey = forge.util.encode64(privateKeyBytes);
_privateKey = forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(privateKeyBytes));
}
catch (e) {
console.log('Cannot set private key. Decryption failed.');
}
};
_service.setOrgKeys = function (orgKeysCt, privateKey) {
if (!orgKeysCt || Object.keys(orgKeysCt).length === 0) {
return;
}
_service.clearOrgKeys();
var orgKeysb64 = {},
_orgKeys = {},
setKey = false;
for (var orgId in orgKeysCt) {
if (orgKeysCt.hasOwnProperty(orgId)) {
try {
var decBytes = _service.rsaDecrypt(orgKeysCt[orgId].key, privateKey);
var decKey = new SymmetricCryptoKey(decBytes);
_orgKeys[orgId] = decKey;
orgKeysb64[orgId] = decKey.keyB64;
setKey = true;
}
catch (e) {
console.log('Cannot set org key ' + i + '. Decryption failed.');
}
}
}
if (setKey) {
$sessionStorage.orgKeys = orgKeysb64;
}
else {
_orgKeys = null;
}
};
_service.addOrgKey = function (orgId, encOrgKey, privateKey) {
_orgKeys = _service.getOrgKeys();
if (!_orgKeys) {
_orgKeys = {};
}
var orgKeysb64 = $sessionStorage.orgKeys;
if (!orgKeysb64) {
orgKeysb64 = {};
}
try {
var decBytes = _service.rsaDecrypt(encOrgKey, privateKey);
var decKey = new SymmetricCryptoKey(decBytes);
_orgKeys[orgId] = decKey;
orgKeysb64[orgId] = decKey.keyB64;
}
catch (e) {
_orgKeys = null;
console.log('Cannot set org key. Decryption failed.');
}
$sessionStorage.orgKeys = orgKeysb64;
};
_service.getKey = function () {
if (!_key && $sessionStorage.key) {
_key = new SymmetricCryptoKey($sessionStorage.key, true);
}
if (!_key) {
throw 'key unavailable';
}
return _key;
};
_service.getPrivateKey = function (outputEncoding) {
outputEncoding = outputEncoding || 'native';
if (_privateKey) {
if (outputEncoding === 'raw') {
var privateKeyAsn1 = forge.pki.privateKeyToAsn1(_privateKey);
var privateKeyPkcs8 = forge.pki.wrapRsaPrivateKey(privateKeyAsn1);
return forge.asn1.toDer(privateKeyPkcs8).getBytes();
}
return _privateKey;
}
if ($sessionStorage.privateKey) {
var privateKeyBytes = forge.util.decode64($sessionStorage.privateKey);
_privateKey = forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(privateKeyBytes));
if (outputEncoding === 'raw') {
return privateKeyBytes;
}
}
return _privateKey;
};
_service.getPublicKey = function () {
if (_publicKey) {
return _publicKey;
}
var privateKey = _service.getPrivateKey();
if (!privateKey) {
return null;
}
_publicKey = forge.pki.setRsaPublicKey(privateKey.n, privateKey.e);
return _publicKey;
};
_service.getOrgKeys = function () {
if (_orgKeys) {
return _orgKeys;
}
if ($sessionStorage.orgKeys) {
var orgKeys = {},
setKey = false;
for (var orgId in $sessionStorage.orgKeys) {
if ($sessionStorage.orgKeys.hasOwnProperty(orgId)) {
orgKeys[orgId] = new SymmetricCryptoKey($sessionStorage.orgKeys[orgId], true);
setKey = true;
}
}
if (setKey) {
_orgKeys = orgKeys;
}
}
return _orgKeys;
};
_service.getOrgKey = function (orgId) {
var orgKeys = _service.getOrgKeys();
if (!orgKeys || !(orgId in orgKeys)) {
return null;
}
return orgKeys[orgId];
};
_service.clearKey = function () {
_key = null;
_legacyEtmKey = null;
delete $sessionStorage.key;
};
_service.clearKeyPair = function () {
_privateKey = null;
_publicKey = null;
delete $sessionStorage.privateKey;
};
_service.clearOrgKeys = function () {
_orgKeys = null;
delete $sessionStorage.orgKeys;
};
_service.clearOrgKey = function (orgId) {
if (_orgKeys.hasOwnProperty(orgId)) {
delete _orgKeys[orgId];
}
if ($sessionStorage.orgKeys.hasOwnProperty(orgId)) {
delete $sessionStorage.orgKeys[orgId];
}
};
_service.clearKeys = function () {
_service.clearKey();
_service.clearKeyPair();
_service.clearOrgKeys();
};
_service.makeKey = function (password, salt) {
var keyBytes = forge.pbkdf2(forge.util.encodeUtf8(password), forge.util.encodeUtf8(salt),
5000, 256 / 8, 'sha256');
return new SymmetricCryptoKey(keyBytes);
};
_service.makeKeyPair = function (key) {
var deferred = $q.defer();
forge.pki.rsa.generateKeyPair({
bits: 2048,
workers: 2,
workerScript: '/lib/forge/prime.worker.min.js'
}, function (error, keypair) {
if (error) {
deferred.reject(error);
return;
}
var privateKeyAsn1 = forge.pki.privateKeyToAsn1(keypair.privateKey);
var privateKeyPkcs8 = forge.pki.wrapRsaPrivateKey(privateKeyAsn1);
var privateKeyBytes = forge.asn1.toDer(privateKeyPkcs8).getBytes();
var privateKeyEncCt = _service.encrypt(privateKeyBytes, key, 'raw');
var publicKeyAsn1 = forge.pki.publicKeyToAsn1(keypair.publicKey);
var publicKeyBytes = forge.asn1.toDer(publicKeyAsn1).getBytes();
deferred.resolve({
publicKey: forge.util.encode64(publicKeyBytes),
privateKeyEnc: privateKeyEncCt
});
});
return deferred.promise;
};
_service.makeShareKeyCt = function () {
return _service.rsaEncrypt(forge.random.getBytesSync(512 / 8));
};
_service.hashPassword = function (password, key) {
if (!key) {
key = _service.getKey();
}
if (!password || !key) {
throw 'Invalid parameters.';
}
var hashBits = forge.pbkdf2(key.key, forge.util.encodeUtf8(password), 1, 256 / 8, 'sha256');
return forge.util.encode64(hashBits);
};
_service.encrypt = function (plainValue, key, plainValueEncoding) {
key = key || _service.getKey();
if (!key) {
throw 'Encryption key unavailable.';
}
plainValueEncoding = plainValueEncoding || 'utf8';
var buffer = forge.util.createBuffer(plainValue, plainValueEncoding);
var ivBytes = forge.random.getBytesSync(16);
var cipher = forge.cipher.createCipher('AES-CBC', key.encKey);
cipher.start({ iv: ivBytes });
cipher.update(buffer);
cipher.finish();
var iv = forge.util.encode64(ivBytes);
var ctBytes = cipher.output.getBytes();
var ct = forge.util.encode64(ctBytes);
var cipherString = iv + '|' + ct;
if (key.macKey) {
var mac = computeMac(ctBytes, ivBytes, key.macKey, true);
cipherString = cipherString + '|' + mac;
}
if (key.encType === constants.encType.AesCbc256_B64) {
return cipherString;
}
return key.encType + '.' + cipherString;
};
_service.rsaEncrypt = function (plainValue, publicKey) {
publicKey = publicKey || _service.getPublicKey();
if (!publicKey) {
throw 'Public key unavailable.';
}
if (typeof publicKey === 'string') {
var publicKeyBytes = forge.util.decode64(publicKey);
publicKey = forge.pki.publicKeyFromAsn1(forge.asn1.fromDer(publicKeyBytes));
}
var encryptedBytes = publicKey.encrypt(plainValue, 'RSA-OAEP', {
md: forge.md.sha1.create()
});
return constants.encType.Rsa2048_OaepSha1_B64 + '.' + forge.util.encode64(encryptedBytes);
};
_service.decrypt = function (encValue, key, outputEncoding) {
key = key || _service.getKey();
var headerPieces = encValue.split('.'),
encType,
encPieces;
if (headerPieces.length === 2) {
try {
encType = parseInt(headerPieces[0]);
encPieces = headerPieces[1].split('|');
}
catch (e) {
return null;
}
}
else {
encPieces = encValue.split('|');
encType = encPieces.length === 3 ? constants.encType.AesCbc128_HmacSha256_B64 :
constants.encType.AesCbc256_B64;
}
if (encType === constants.encType.AesCbc128_HmacSha256_B64 && key.encType === constants.encType.AesCbc256_B64) {
// Old encrypt-then-mac scheme, swap out the key
_legacyEtmKey = _legacyEtmKey ||
new SymmetricCryptoKey(key.key, false, constants.encType.AesCbc128_HmacSha256_B64);
key = _legacyEtmKey;
}
if (encType !== key.encType) {
throw 'encType unavailable.';
}
switch (encType) {
case constants.encType.AesCbc128_HmacSha256_B64:
if (encPieces.length !== 3) {
return null;
}
break;
case constants.encType.AesCbc256_HmacSha256_B64:
if (encPieces.length !== 3) {
return null;
}
break;
case constants.encType.AesCbc256_B64:
if (encPieces.length !== 2) {
return null;
}
break;
default:
return null;
}
var ivBytes = forge.util.decode64(encPieces[0]);
var ctBytes = forge.util.decode64(encPieces[1]);
if (key.macKey && encPieces.length > 2) {
var macBytes = forge.util.decode64(encPieces[2]);
var computedMacBytes = computeMac(ctBytes, ivBytes, key.macKey, false);
if (!macsEqual(key.macKey, macBytes, computedMacBytes)) {
console.error('MAC failed.');
return null;
}
}
var ctBuffer = forge.util.createBuffer(ctBytes);
var decipher = forge.cipher.createDecipher('AES-CBC', key.encKey);
decipher.start({ iv: ivBytes });
decipher.update(ctBuffer);
decipher.finish();
outputEncoding = outputEncoding || 'utf8';
if (outputEncoding === 'utf8') {
return decipher.output.toString('utf8');
}
else {
return decipher.output.getBytes();
}
};
_service.rsaDecrypt = function (encValue, privateKey) {
privateKey = privateKey || _service.getPrivateKey();
if (!privateKey) {
throw 'Private key unavailable.';
}
var headerPieces = encValue.split('.'),
encType,
encPiece;
if (headerPieces.length === 1) {
encType = constants.encType.Rsa2048_OaepSha256_B64;
encPiece = headerPieces[0];
}
else if (headerPieces.length === 2) {
try {
encType = parseInt(headerPieces[0]);
encPiece = headerPieces[1];
}
catch (e) {
return null;
}
}
var ctBytes = forge.util.decode64(encPiece);
var md;
if (encType === constants.encType.Rsa2048_OaepSha256_B64) {
md = forge.md.sha256.create();
}
else if (encType === constants.encType.Rsa2048_OaepSha1_B64) {
md = forge.md.sha1.create();
}
else {
throw 'encType unavailable.';
}
var decBytes = privateKey.decrypt(ctBytes, 'RSA-OAEP', {
md: md
});
return decBytes;
};
function computeMac(ct, iv, macKey, b64Output) {
var hmac = forge.hmac.create();
hmac.start('sha256', macKey);
hmac.update(iv + ct);
var mac = hmac.digest();
return b64Output ? forge.util.encode64(mac.getBytes()) : mac.getBytes();
}
// Safely compare two MACs in a way that protects against timing attacks (Double HMAC Verification).
// ref: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/
function macsEqual(macKey, mac1, mac2) {
var hmac = forge.hmac.create();
hmac.start('sha256', macKey);
hmac.update(mac1);
mac1 = hmac.digest().getBytes();
hmac.start(null, null);
hmac.update(mac2);
mac2 = hmac.digest().getBytes();
return mac1 === mac2;
}
function SymmetricCryptoKey(keyBytes, b64KeyBytes, encType) {
if (b64KeyBytes) {
keyBytes = forge.util.decode64(keyBytes);
}
if (!keyBytes) {
throw 'Must provide keyBytes';
}
var buffer = forge.util.createBuffer(keyBytes);
if (!buffer || buffer.length() === 0) {
throw 'Couldn\'t make buffer';
}
var bufferLength = buffer.length();
if (encType === null || encType === undefined) {
if (bufferLength === 32) {
encType = constants.encType.AesCbc256_B64;
}
else if (bufferLength === 64) {
encType = constants.encType.AesCbc256_HmacSha256_B64;
}
else {
throw 'Unable to determine encType.';
}
}
this.key = keyBytes;
this.keyB64 = forge.util.encode64(keyBytes);
this.encType = encType;
if (encType === constants.encType.AesCbc256_B64 && bufferLength === 32) {
this.encKey = keyBytes;
this.macKey = null;
}
else if (encType === constants.encType.AesCbc128_HmacSha256_B64 && bufferLength === 32) {
this.encKey = buffer.getBytes(16); // first half
this.macKey = buffer.getBytes(16); // second half
}
else if (encType === constants.encType.AesCbc256_HmacSha256_B64 && bufferLength === 64) {
this.encKey = buffer.getBytes(32); // first half
this.macKey = buffer.getBytes(32); // second half
}
else {
throw 'Unsupported encType/key length.';
}
}
return _service;
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,136 @@
angular
.module('bit.services')
.factory('passwordService', function () {
var _service = {};
_service.generatePassword = function (options) {
var defaults = {
length: 10,
ambiguous: false,
number: true,
minNumber: 1,
uppercase: true,
minUppercase: 1,
lowercase: true,
minLowercase: 1,
special: false,
minSpecial: 1
};
// overload defaults with given options
var o = angular.extend({}, defaults, options);
// sanitize
if (o.uppercase && o.minUppercase < 0) o.minUppercase = 1;
if (o.lowercase && o.minLowercase < 0) o.minLowercase = 1;
if (o.number && o.minNumber < 0) o.minNumber = 1;
if (o.special && o.minSpecial < 0) o.minSpecial = 1;
if (!o.length || o.length < 1) o.length = 10;
var minLength = o.minUppercase + o.minLowercase + o.minNumber + o.minSpecial;
if (o.length < minLength) o.length = minLength;
var positions = [];
if (o.lowercase && o.minLowercase > 0) {
for (var i = 0; i < o.minLowercase; i++) {
positions.push('l');
}
}
if (o.uppercase && o.minUppercase > 0) {
for (var j = 0; j < o.minUppercase; j++) {
positions.push('u');
}
}
if (o.number && o.minNumber > 0) {
for (var k = 0; k < o.minNumber; k++) {
positions.push('n');
}
}
if (o.special && o.minSpecial > 0) {
for (var l = 0; l < o.minSpecial; l++) {
positions.push('s');
}
}
while (positions.length < o.length) {
positions.push('a');
}
// shuffle
positions.sort(function () {
return randomInt(0, 1) * 2 - 1;
});
// build out the char sets
var allCharSet = '';
var lowercaseCharSet = 'abcdefghijkmnopqrstuvwxyz';
if (o.ambiguous) lowercaseCharSet += 'l';
if (o.lowercase) allCharSet += lowercaseCharSet;
var uppercaseCharSet = 'ABCDEFGHIJKLMNPQRSTUVWXYZ';
if (o.ambiguous) uppercaseCharSet += 'O';
if (o.uppercase) allCharSet += uppercaseCharSet;
var numberCharSet = '23456789';
if (o.ambiguous) numberCharSet += '01';
if (o.number) allCharSet += numberCharSet;
var specialCharSet = '!@#$%^&*';
if (o.special) allCharSet += specialCharSet;
var password = '';
for (var m = 0; m < o.length; m++) {
var positionChars;
switch (positions[m]) {
case 'l': positionChars = lowercaseCharSet; break;
case 'u': positionChars = uppercaseCharSet; break;
case 'n': positionChars = numberCharSet; break;
case 's': positionChars = specialCharSet; break;
case 'a': positionChars = allCharSet; break;
}
var randomCharIndex = randomInt(0, positionChars.length - 1);
password += positionChars.charAt(randomCharIndex);
}
return password;
};
// EFForg/OpenWireless
// ref https://github.com/EFForg/OpenWireless/blob/master/app/js/diceware.js
function randomInt(min, max) {
var rval = 0;
var range = max - min;
var bits_needed = Math.ceil(Math.log2(range));
if (bits_needed > 53) {
throw new Exception("We cannot generate numbers larger than 53 bits.");
}
var bytes_needed = Math.ceil(bits_needed / 8);
var mask = Math.pow(2, bits_needed) - 1;
// 7776 -> (2^13 = 8192) -1 == 8191 or 0x00001111 11111111
// Create byte array and fill with N random numbers
var byteArray = new Uint8Array(bytes_needed);
window.crypto.getRandomValues(byteArray);
var p = (bytes_needed - 1) * 8;
for (var i = 0; i < bytes_needed; i++) {
rval += byteArray[i] * Math.pow(2, p);
p -= 8;
}
// Use & to apply the mask and reduce the number of recursive lookups
rval = rval & mask;
if (rval >= range) {
// Integer out of acceptable range
return randomInt(min, max);
}
// Return an integer that falls within the range
return min + rval;
}
return _service;
});

View File

@@ -0,0 +1,2 @@
angular
.module('bit.services', ['ngResource', 'ngStorage', 'angular-jwt']);

View File

@@ -0,0 +1,63 @@
angular
.module('bit.services')
.factory('tokenService', function ($sessionStorage, jwtHelper) {
var _service = {},
_token = null,
_refreshToken = null;
_service.setToken = function (token) {
$sessionStorage.accessToken = token;
_token = token;
};
_service.getToken = function () {
if (!_token) {
_token = $sessionStorage.accessToken;
}
return _token ? _token : null;
};
_service.clearToken = function () {
_token = null;
delete $sessionStorage.accessToken;
};
_service.setRefreshToken = function (token) {
$sessionStorage.refreshToken = token;
_refreshToken = token;
};
_service.getRefreshToken = function () {
if (!_refreshToken) {
_refreshToken = $sessionStorage.refreshToken;
}
return _refreshToken ? _refreshToken : null;
};
_service.clearRefreshToken = function () {
_refreshToken = null;
delete $sessionStorage.refreshToken;
};
_service.tokenSecondsRemaining = function (token, offsetSeconds) {
var d = jwtHelper.getTokenExpirationDate(token);
offsetSeconds = offsetSeconds || 0;
if (d === null) {
return 0;
}
var msRemaining = d.valueOf() - (new Date().valueOf() + (offsetSeconds * 1000));
return Math.round(msRemaining / 1000);
};
_service.tokenNeedsRefresh = function (token, minutes) {
minutes = minutes || 5; // default 5 minutes
var sRemaining = _service.tokenSecondsRemaining(token);
return sRemaining < (60 * minutes);
};
return _service;
});

View File

@@ -0,0 +1,66 @@
angular
.module('bit.services')
.factory('validationService', function () {
var _service = {};
_service.addErrors = function (form, reason) {
var data = reason.data;
var defaultErrorMessage = 'An unexpected error has occurred.';
form.$errors = [];
if (!data || !angular.isObject(data)) {
form.$errors.push(defaultErrorMessage);
return;
}
if (data && data.ErrorModel) {
data = data.ErrorModel;
}
if (!data.ValidationErrors) {
if (data.Message) {
form.$errors.push(data.Message);
}
else {
form.$errors.push(defaultErrorMessage);
}
return;
}
for (var key in data.ValidationErrors) {
if (!data.ValidationErrors.hasOwnProperty(key)) {
continue;
}
for (var i = 0; i < data.ValidationErrors[key].length; i++) {
_service.addError(form, key, data.ValidationErrors[key][i]);
}
}
};
_service.addError = function (form, key, errorMessage, clearExistingErrors) {
if (clearExistingErrors || !form.$errors) {
form.$errors = [];
}
var pushError = true;
for (var i = 0; i < form.$errors.length; i++) {
if (form.$errors[i] === errorMessage) {
pushError = false;
break;
}
}
if (pushError) {
form.$errors.push(errorMessage);
}
if (key && key !== '' && form[key] && form[key].$registerApiError) {
form[key].$registerApiError();
}
};
return _service;
});

2
src/app/settings.js Normal file
View File

@@ -0,0 +1,2 @@
angular.module("bit")
.constant("appSettings", {"apiUri":"https://api.bitwarden.com","identityUri":"https://identity.bitwarden.com","stripeKey":"pk_live_bpN0P37nMxrMQkcaHXtAybJk","version":"1.11.0","environment":"Production"});

View File

@@ -0,0 +1,19 @@
angular
.module('bit.vault')
.controller('settingsAddEditEquivalentDomainController', function ($scope, $uibModalInstance, $analytics,
domainIndex, domains) {
$analytics.eventTrack('settingsAddEditEquivalentDomainController', { category: 'Modal' });
$scope.domains = domains;
$scope.index = domainIndex;
$scope.submit = function (form) {
$analytics.eventTrack((domainIndex ? 'Edited' : 'Added') + ' Equivalent Domain');
$uibModalInstance.close({ domains: $scope.domains, index: domainIndex });
};
$scope.close = function () {
$uibModalInstance.dismiss('close');
};
});

Some files were not shown because too many files have changed in this diff Show More