clavarium 0.2.60-beta.1 → 0.2.61-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/server/accounts.mjs +5 -6
- package/server/oauth.mjs +17 -15
- package/web/app.js +1 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.61-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.61-beta.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/server/accounts.mjs
CHANGED
|
@@ -12,10 +12,9 @@
|
|
|
12
12
|
*
|
|
13
13
|
* ONE ACCOUNT, ONE TOKEN, SEVERAL TARGETS. A consent for mail+calendar+contacts
|
|
14
14
|
* yields a single refresh token; this makes one host-only secret and a Tether
|
|
15
|
-
* target per kind, each naming that secret. Both providers borrow
|
|
16
|
-
* desktop client verified for all three: Google
|
|
17
|
-
*
|
|
18
|
-
* contacts all over Microsoft Graph).
|
|
15
|
+
* target per kind, each naming that secret. Both providers borrow Thunderbird's
|
|
16
|
+
* own open-source desktop client, verified for all three: Google over IMAP +
|
|
17
|
+
* CalDAV/CardDAV, Microsoft over Microsoft Graph (mail, calendar and contacts).
|
|
19
18
|
*
|
|
20
19
|
* A CREATED TARGET IS GIVEN TO NO ONE. The person grants it per conversation, at
|
|
21
20
|
* its own level, from the page (Assets > Access) -- like git: one mailbox, many
|
|
@@ -29,8 +28,8 @@ import { consentUrl, exchangeCode, extractCode, thunderbird, scopeFor, pkcePair,
|
|
|
29
28
|
person's browser lands on a page that will not load, and they copy the whole
|
|
30
29
|
address -- which carries the code -- back into Clavarium. The same address
|
|
31
30
|
trades the code, so it must match what the borrowed client registered. Both
|
|
32
|
-
borrowed clients (
|
|
33
|
-
|
|
31
|
+
borrowed Thunderbird clients (one for Google, one for Microsoft) registered the
|
|
32
|
+
loopback on any 127.0.0.1 port, so one address serves both. */
|
|
34
33
|
const REDIRECT = 'http://127.0.0.1:47813/';
|
|
35
34
|
const redirectFor = () => REDIRECT;
|
|
36
35
|
const PENDING_MS = 10 * 60_000;
|
package/server/oauth.mjs
CHANGED
|
@@ -37,16 +37,14 @@ const b64url = (buf) => Buffer.from(buf).toString('base64url');
|
|
|
37
37
|
|
|
38
38
|
/* Per-provider endpoints, the scopes we may ask for by kind, and a built-in,
|
|
39
39
|
already-verified open-source desktop client as the default (the `thunderbird`
|
|
40
|
-
field
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
on the consent URL to return a refresh token; `offlineScope` is the same thing
|
|
49
|
-
when it is a scope rather than a parameter (Microsoft). */
|
|
40
|
+
field). We borrow THUNDERBIRD's own client for BOTH providers: each registered
|
|
41
|
+
the loopback 127.0.0.1 redirect on any port, so the person always lands on the
|
|
42
|
+
same copy-pastable http://127.0.0.1 address, and each is cleared for the three
|
|
43
|
+
kinds -- Google's client carries the mail + CalDAV + CardDAV scopes; Microsoft's
|
|
44
|
+
takes mail, calendar and contacts over Graph (a multitenant public client, by
|
|
45
|
+
dynamic consent). `consentExtra` is what a provider needs on the consent URL to
|
|
46
|
+
return a refresh token; `offlineScope` is the same thing when it is a scope
|
|
47
|
+
rather than a parameter (Microsoft). */
|
|
50
48
|
export const PROVIDERS = {
|
|
51
49
|
google: {
|
|
52
50
|
label: 'Google',
|
|
@@ -60,12 +58,16 @@ export const PROVIDERS = {
|
|
|
60
58
|
calendar: 'https://www.googleapis.com/auth/calendar',
|
|
61
59
|
contacts: 'https://www.googleapis.com/auth/carddav',
|
|
62
60
|
},
|
|
63
|
-
/*
|
|
64
|
-
sanctioned by Google for an installed app
|
|
65
|
-
|
|
61
|
+
/* Thunderbird's own built-in Google client (open source, embedded secret
|
|
62
|
+
sanctioned by Google for an installed app; comm-central
|
|
63
|
+
OAuth2Providers.sys.mjs). Its GOOGLE_SCOPES carry mail AND CalDAV AND
|
|
64
|
+
CardDAV, so one consent gives all three -- the same loopback 127.0.0.1
|
|
65
|
+
redirect as before. Using Thunderbird for Google too means one borrowed
|
|
66
|
+
identity for both providers. (GNOME Online Accounts' client
|
|
67
|
+
44438659992-... worked as well; we unified on Thunderbird.) */
|
|
66
68
|
thunderbird: {
|
|
67
|
-
clientId: '
|
|
68
|
-
clientSecret: '-
|
|
69
|
+
clientId: '406964657835-aq8lmia8j95dhl1a2bvharmfk3t1hgqj.apps.googleusercontent.com',
|
|
70
|
+
clientSecret: 'kSmqreRr0qwBWJgbf5Y-PjSU',
|
|
69
71
|
},
|
|
70
72
|
},
|
|
71
73
|
microsoft: {
|
package/web/app.js
CHANGED
|
@@ -6193,7 +6193,7 @@
|
|
|
6193
6193
|
const who = MAILBOX_PROVIDER[provider];
|
|
6194
6194
|
const all = kinds.includes('calendar') && kinds.includes('contacts');
|
|
6195
6195
|
$('connexion-notice').textContent = provider === 'google'
|
|
6196
|
-
? `Clavarium signs in with
|
|
6196
|
+
? `Clavarium signs in with Thunderbird's app — that is what Google sees.${all ? ' Mail, calendar and contacts can be connected together.' : ''}`
|
|
6197
6197
|
: `Clavarium signs in with Thunderbird's app — that is what Microsoft sees.${all ? ' Mail, calendar and contacts together, over Microsoft Graph.' : ''}`;
|
|
6198
6198
|
$('connexion-open').textContent = `Open the ${who} sign-in page`;
|
|
6199
6199
|
};
|