@doist/comms-cli 1.4.0 → 1.6.0
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/CHANGELOG.md +12 -0
- package/README.md +5 -3
- package/dist/commands/auth/helpers.d.ts +2 -0
- package/dist/commands/auth/helpers.d.ts.map +1 -1
- package/dist/commands/auth/helpers.js +52 -0
- package/dist/commands/auth/helpers.js.map +1 -1
- package/dist/commands/auth/login.d.ts.map +1 -1
- package/dist/commands/auth/login.js +13 -4
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/status.d.ts +5 -8
- package/dist/commands/auth/status.d.ts.map +1 -1
- package/dist/commands/auth/status.js +28 -22
- package/dist/commands/auth/status.js.map +1 -1
- package/dist/commands/config/view.d.ts.map +1 -1
- package/dist/commands/config/view.js +7 -1
- package/dist/commands/config/view.js.map +1 -1
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/thread/index.d.ts.map +1 -1
- package/dist/commands/thread/index.js +19 -0
- package/dist/commands/thread/index.js.map +1 -1
- package/dist/commands/thread/read.d.ts +4 -0
- package/dist/commands/thread/read.d.ts.map +1 -0
- package/dist/commands/thread/read.js +109 -0
- package/dist/commands/thread/read.js.map +1 -0
- package/dist/commands/view.d.ts.map +1 -1
- package/dist/commands/view.js +2 -7
- package/dist/commands/view.js.map +1 -1
- package/dist/lib/api.d.ts +4 -1
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +13 -6
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/auth-pages.d.ts.map +1 -1
- package/dist/lib/auth-pages.js +173 -302
- package/dist/lib/auth-pages.js.map +1 -1
- package/dist/lib/auth-provider.d.ts +41 -18
- package/dist/lib/auth-provider.d.ts.map +1 -1
- package/dist/lib/auth-provider.js +368 -81
- package/dist/lib/auth-provider.js.map +1 -1
- package/dist/lib/auth.d.ts +12 -1
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +41 -10
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/comms-account.d.ts +6 -0
- package/dist/lib/comms-account.d.ts.map +1 -1
- package/dist/lib/comms-account.js +6 -0
- package/dist/lib/comms-account.js.map +1 -1
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +76 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/input.d.ts +1 -0
- package/dist/lib/input.d.ts.map +1 -1
- package/dist/lib/input.js +27 -0
- package/dist/lib/input.js.map +1 -1
- package/dist/lib/refs.d.ts +2 -0
- package/dist/lib/refs.d.ts.map +1 -1
- package/dist/lib/refs.js +62 -26
- package/dist/lib/refs.js.map +1 -1
- package/dist/lib/search-api.d.ts.map +1 -1
- package/dist/lib/search-api.js +8 -4
- package/dist/lib/search-api.js.map +1 -1
- package/dist/lib/skills/content.d.ts +1 -1
- package/dist/lib/skills/content.d.ts.map +1 -1
- package/dist/lib/skills/content.js +16 -3
- package/dist/lib/skills/content.js.map +1 -1
- package/dist/lib/user-records.js +27 -0
- package/dist/lib/user-records.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { type AccountRef, type AuthAccount, type AuthProvider, type KeyringTokenStore } from '@doist/cli-core/auth';
|
|
2
2
|
import { type AuthMode } from './config.js';
|
|
3
|
-
export declare const AUTHORIZATION_URL = "https://comms.todoist.com/oauth/authorize";
|
|
4
|
-
export declare const TOKEN_URL = "https://comms.todoist.com/oauth/access_token";
|
|
5
|
-
export declare const REGISTRATION_URL = "https://comms.todoist.com/oauth/register";
|
|
6
|
-
export declare const READ_WRITE_SCOPES: string[];
|
|
7
3
|
export declare const READ_ONLY_SCOPES: string[];
|
|
4
|
+
export declare const READ_WRITE_SCOPES: string[];
|
|
5
|
+
export declare const FULL_ACCESS_SCOPES: string[];
|
|
8
6
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* account), so the two can't drift.
|
|
7
|
+
* Single source of truth shared by `attachCommsLoginCommand`'s `resolveScopes`
|
|
8
|
+
* (what we request at authorize) and the provider's token-response fallback
|
|
9
|
+
* (what we record on the account), so the two can't drift.
|
|
13
10
|
*/
|
|
14
|
-
export declare function getScopes(readOnly
|
|
11
|
+
export declare function getScopes({ readOnly, fullAccess, }: {
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
fullAccess?: boolean;
|
|
14
|
+
}): string[];
|
|
15
15
|
/**
|
|
16
16
|
* Narrow account shape: only fields that round-trip through the local token
|
|
17
17
|
* store. `id` is the stringified numeric Comms user id (so cli-core's
|
|
@@ -24,6 +24,9 @@ export type CommsAccount = AuthAccount & {
|
|
|
24
24
|
label: string;
|
|
25
25
|
authMode: AuthMode;
|
|
26
26
|
authScope: string;
|
|
27
|
+
oauthClientId?: string;
|
|
28
|
+
authBaseUrl?: string;
|
|
29
|
+
authResource?: string;
|
|
27
30
|
};
|
|
28
31
|
export type CommsTokenStore = KeyringTokenStore<CommsAccount>;
|
|
29
32
|
/**
|
|
@@ -36,18 +39,38 @@ export type CommsTokenStore = KeyringTokenStore<CommsAccount>;
|
|
|
36
39
|
export declare const MANUAL_TOKEN_ACCOUNT: CommsAccount;
|
|
37
40
|
/** True when `account` is the identity-less snapshot produced by `tdc auth token`. */
|
|
38
41
|
export declare function isManualTokenAccount(account: Pick<CommsAccount, 'id' | 'label'>): boolean;
|
|
42
|
+
export type CommsOAuthConfig = {
|
|
43
|
+
authBaseUrl: string;
|
|
44
|
+
authorizationUrl: string;
|
|
45
|
+
tokenUrl: string;
|
|
46
|
+
registrationUrl: string;
|
|
47
|
+
resource: string;
|
|
48
|
+
};
|
|
39
49
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* `
|
|
50
|
+
* Todoist is the OAuth authorization server; Comms is the protected resource.
|
|
51
|
+
* The CLI registers as a public DCR client (PKCE, no client secret) and pins
|
|
52
|
+
* tokens to the Comms resource via the RFC 8707 `resource` indicator. The
|
|
53
|
+
* registration / authorize / token-exchange / refresh mechanics all live in
|
|
54
|
+
* cli-core's `createDcrProvider`; the Comms-specific behaviour is:
|
|
45
55
|
*
|
|
46
|
-
*
|
|
47
|
-
* `
|
|
48
|
-
*
|
|
56
|
+
* - endpoint + resource resolution from `COMMS_BASE_URL` / `COMMS_AS_URL`
|
|
57
|
+
* (see `getCommsOAuthResource` / `getTodoistAuthBaseUrl`),
|
|
58
|
+
* - caching the registered `client_id` in config (`loadClient` / `saveClient`),
|
|
59
|
+
* - recording the server-granted scope on the account (the `exchangeCode`
|
|
60
|
+
* wrapper stashes it on the handshake for `validate`; `refreshToken`
|
|
61
|
+
* refreshes it), and
|
|
62
|
+
* - `validate`: probe `getSessionUser`, derive `authMode` from the granted
|
|
63
|
+
* scope, and build the `CommsAccount`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function createCommsAuthProvider(fetchImpl?: typeof fetch): AuthProvider<CommsAccount>;
|
|
66
|
+
/**
|
|
67
|
+
* The handshake `refreshAccessToken` forwards to the provider's
|
|
68
|
+
* `refreshToken`. cli-core doesn't persist the DCR handshake, so we
|
|
69
|
+
* reconstruct it from the stored account: `clientId` (read by cli-core's
|
|
70
|
+
* refresh grant), the resource / auth base URL (read by the endpoint
|
|
71
|
+
* resolvers), and the identity fields (read by `buildRefreshAccount`).
|
|
49
72
|
*/
|
|
50
|
-
export declare function
|
|
73
|
+
export declare function getCommsOAuthRefreshHandshake(account: CommsAccount): Record<string, unknown>;
|
|
51
74
|
/**
|
|
52
75
|
* Accepts `42`, `id:42`, and case-insensitive labels — `parseRef` normalises
|
|
53
76
|
* the numeric forms. Broader than cli-core's default strict-equality matcher.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EAMjB,KAAK,iBAAiB,EAKzB,MAAM,sBAAsB,CAAA;AAI7B,OAAO,EACH,KAAK,QAAQ,EAKhB,MAAM,aAAa,CAAA;AAUpB,eAAO,MAAM,gBAAgB,UAM5B,CAAA;AAaD,eAAO,MAAM,iBAAiB,UAAiD,CAAA;AAE/E,eAAO,MAAM,kBAAkB,UAAsD,CAAA;AAOrF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACtB,QAAQ,EACR,UAAkB,GACrB,EAAE;IACC,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;CACvB,GAAG,MAAM,EAAE,CAGX;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAA;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,YAKlC,CAAA;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,OAAO,CAEzF;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,GAAE,OAAO,KAAa,GAChC,YAAY,CAAC,YAAY,CAAC,CAgD5B;AAmED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgB5F;AAuPD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAUjF;AAmBD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACpC,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,UAAU,GAChB,OAAO,CAAC,YAAY,CAAC,CAcvB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CAmDvD;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,KAAK,GAAG,cAAc,GAAG,aAAa,CAAC,CAM5F"}
|
|
@@ -1,60 +1,44 @@
|
|
|
1
1
|
import { createDcrProvider, createKeyringTokenStore, } from '@doist/cli-core/auth';
|
|
2
2
|
import { createWrappedCommsClient } from './api.js';
|
|
3
3
|
import { SECURE_STORE_SERVICE } from './auth-constants.js';
|
|
4
|
-
import { toCommsAccount } from './comms-account.js';
|
|
5
|
-
import { getConfig, getConfigPath } from './config.js';
|
|
4
|
+
import { makeCommsAccount, toCommsAccount } from './comms-account.js';
|
|
5
|
+
import { getConfig, getConfigPath, updateConfig, } from './config.js';
|
|
6
6
|
import { CliError } from './errors.js';
|
|
7
7
|
import { parseRef } from './refs.js';
|
|
8
8
|
import { createCommsUserRecordStore, getDefaultUserRecord } from './user-records.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const LOGO_URI = 'https://raw.githubusercontent.com/Doist/comms-cli/d65c447ff453eb36af585044c2f5f2f602bcdb34/icons/comms-cli.png';
|
|
13
|
-
export const READ_WRITE_SCOPES = [
|
|
14
|
-
'user:read',
|
|
15
|
-
'user:write',
|
|
16
|
-
'workspaces:read',
|
|
17
|
-
'channels:read',
|
|
18
|
-
'channels:write',
|
|
19
|
-
'channels:remove',
|
|
20
|
-
'threads:read',
|
|
21
|
-
'threads:write',
|
|
22
|
-
'comments:read',
|
|
23
|
-
'comments:write',
|
|
24
|
-
'messages:read',
|
|
25
|
-
'messages:write',
|
|
26
|
-
'reactions:read',
|
|
27
|
-
'reactions:write',
|
|
28
|
-
'groups:read',
|
|
29
|
-
'groups:write',
|
|
30
|
-
'groups:remove',
|
|
31
|
-
'search:read',
|
|
32
|
-
'notifications:read',
|
|
33
|
-
'attachments:read',
|
|
34
|
-
'attachments:write',
|
|
35
|
-
];
|
|
9
|
+
const DEFAULT_TODOIST_AUTH_BASE_URL = 'https://todoist.com';
|
|
10
|
+
const DEFAULT_COMMS_OAUTH_RESOURCE = 'https://comms.todoist.com';
|
|
11
|
+
const LOGO_URI = 'https://raw.githubusercontent.com/doist/comms-cli/main/icons/comms-cli.png';
|
|
36
12
|
export const READ_ONLY_SCOPES = [
|
|
37
13
|
'user:read',
|
|
38
14
|
'workspaces:read',
|
|
39
|
-
'channels:read',
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'messages:read',
|
|
43
|
-
'reactions:read',
|
|
44
|
-
'groups:read',
|
|
45
|
-
'search:read',
|
|
46
|
-
'notifications:read',
|
|
47
|
-
'attachments:read',
|
|
15
|
+
'comms:channels:read',
|
|
16
|
+
'comms:content:read',
|
|
17
|
+
'comms:messages:read',
|
|
48
18
|
];
|
|
19
|
+
const DEFAULT_WRITE_SCOPES = ['comms:content:write', 'comms:messages:write'];
|
|
20
|
+
const FULL_ACCESS_EXTRA_SCOPES = [
|
|
21
|
+
'user:write',
|
|
22
|
+
'workspaces:write',
|
|
23
|
+
'comms:channels:write',
|
|
24
|
+
'comms:channels:delete',
|
|
25
|
+
'comms:content:delete',
|
|
26
|
+
'comms:messages:delete',
|
|
27
|
+
];
|
|
28
|
+
export const READ_WRITE_SCOPES = [...READ_ONLY_SCOPES, ...DEFAULT_WRITE_SCOPES];
|
|
29
|
+
export const FULL_ACCESS_SCOPES = [...READ_WRITE_SCOPES, ...FULL_ACCESS_EXTRA_SCOPES];
|
|
49
30
|
const AUTH_HINTS = ['Try again: tdc auth login', 'Or set COMMS_API_TOKEN environment variable'];
|
|
31
|
+
const WRITE_SCOPES = new Set([...DEFAULT_WRITE_SCOPES, ...FULL_ACCESS_EXTRA_SCOPES]);
|
|
32
|
+
const MAX_CACHED_OAUTH_CLIENTS = 25;
|
|
50
33
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* account), so the two can't drift.
|
|
34
|
+
* Single source of truth shared by `attachCommsLoginCommand`'s `resolveScopes`
|
|
35
|
+
* (what we request at authorize) and the provider's token-response fallback
|
|
36
|
+
* (what we record on the account), so the two can't drift.
|
|
55
37
|
*/
|
|
56
|
-
export function getScopes(readOnly) {
|
|
57
|
-
|
|
38
|
+
export function getScopes({ readOnly, fullAccess = false, }) {
|
|
39
|
+
if (readOnly)
|
|
40
|
+
return READ_ONLY_SCOPES;
|
|
41
|
+
return fullAccess ? FULL_ACCESS_SCOPES : READ_WRITE_SCOPES;
|
|
58
42
|
}
|
|
59
43
|
/**
|
|
60
44
|
* Sentinel for the `{ id: '', label: '' }` snapshot that `tdc auth token`
|
|
@@ -74,53 +58,353 @@ export function isManualTokenAccount(account) {
|
|
|
74
58
|
return !account.id || !account.label;
|
|
75
59
|
}
|
|
76
60
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* `
|
|
61
|
+
* Todoist is the OAuth authorization server; Comms is the protected resource.
|
|
62
|
+
* The CLI registers as a public DCR client (PKCE, no client secret) and pins
|
|
63
|
+
* tokens to the Comms resource via the RFC 8707 `resource` indicator. The
|
|
64
|
+
* registration / authorize / token-exchange / refresh mechanics all live in
|
|
65
|
+
* cli-core's `createDcrProvider`; the Comms-specific behaviour is:
|
|
82
66
|
*
|
|
83
|
-
*
|
|
84
|
-
* `
|
|
85
|
-
*
|
|
67
|
+
* - endpoint + resource resolution from `COMMS_BASE_URL` / `COMMS_AS_URL`
|
|
68
|
+
* (see `getCommsOAuthResource` / `getTodoistAuthBaseUrl`),
|
|
69
|
+
* - caching the registered `client_id` in config (`loadClient` / `saveClient`),
|
|
70
|
+
* - recording the server-granted scope on the account (the `exchangeCode`
|
|
71
|
+
* wrapper stashes it on the handshake for `validate`; `refreshToken`
|
|
72
|
+
* refreshes it), and
|
|
73
|
+
* - `validate`: probe `getSessionUser`, derive `authMode` from the granted
|
|
74
|
+
* scope, and build the `CommsAccount`.
|
|
86
75
|
*/
|
|
87
|
-
export function createCommsAuthProvider() {
|
|
88
|
-
|
|
89
|
-
registrationUrl:
|
|
90
|
-
authorizeUrl:
|
|
91
|
-
tokenUrl:
|
|
76
|
+
export function createCommsAuthProvider(fetchImpl = fetch) {
|
|
77
|
+
const base = createDcrProvider({
|
|
78
|
+
registrationUrl: ({ handshake }) => getOAuthConfigForHandshake(handshake).registrationUrl,
|
|
79
|
+
authorizeUrl: ({ handshake }) => getOAuthConfigForHandshake(handshake).authorizationUrl,
|
|
80
|
+
tokenUrl: ({ handshake }) => getOAuthConfigForHandshake(handshake).tokenUrl,
|
|
81
|
+
resource: ({ handshake }) => getOAuthConfigForHandshake(handshake).resource,
|
|
92
82
|
clientMetadata: {
|
|
93
83
|
clientName: 'Comms CLI',
|
|
94
84
|
clientUri: 'https://github.com/doist/comms-cli',
|
|
95
85
|
logoUri: LOGO_URI,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
|
|
86
|
+
tokenEndpointAuthMethod: 'none',
|
|
87
|
+
grantTypes: ['authorization_code', 'refresh_token'],
|
|
88
|
+
responseTypes: ['code'],
|
|
89
|
+
// DCR scope is the upper bound this public client may request.
|
|
90
|
+
// Per-login authorize scopes are still narrowed by `resolveScopes`;
|
|
91
|
+
// keeping registration broad lets one cached client serve read-only,
|
|
92
|
+
// default, and full-access logins.
|
|
93
|
+
extra: { scope: FULL_ACCESS_SCOPES.join(' ') },
|
|
104
94
|
},
|
|
95
|
+
loadClient: loadCachedClient,
|
|
96
|
+
saveClient: saveCachedClient,
|
|
97
|
+
validate: validateCommsToken,
|
|
105
98
|
errorHints: AUTH_HINTS,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
99
|
+
fetchImpl,
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
...base,
|
|
103
|
+
async exchangeCode(input) {
|
|
104
|
+
const exchange = await base.exchangeCode(input);
|
|
105
|
+
// cli-core threads this same handshake object into `validateToken`
|
|
106
|
+
// next, so stash the server-granted scope (so `validate` records the
|
|
107
|
+
// authoritative scope) and the token-response diagnostics (so a
|
|
108
|
+
// Comms rejection can explain what Todoist actually issued).
|
|
109
|
+
if (exchange.scope)
|
|
110
|
+
input.handshake.grantedScope = exchange.scope;
|
|
111
|
+
input.handshake.tokenDiagnostics = describeTokenResponse(exchange);
|
|
112
|
+
return exchange;
|
|
113
|
+
},
|
|
114
|
+
async refreshToken(input) {
|
|
115
|
+
const exchange = await base.refreshToken(input);
|
|
116
|
+
const grantedScope = exchange.scope ?? optionalHandshakeString(input.handshake, 'authScope');
|
|
117
|
+
const account = grantedScope
|
|
118
|
+
? buildRefreshAccount(input.handshake, grantedScope)
|
|
119
|
+
: undefined;
|
|
120
|
+
return account ? { ...exchange, account } : exchange;
|
|
121
121
|
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Probe `getSessionUser` to confirm the token works, then build a
|
|
126
|
+
* `CommsAccount`. Granted scope comes from the server (stashed on the
|
|
127
|
+
* handshake by `exchangeCode`); it falls back to the requested scope set when
|
|
128
|
+
* the token endpoint didn't echo one.
|
|
129
|
+
*/
|
|
130
|
+
async function validateCommsToken({ token, handshake }) {
|
|
131
|
+
const readOnly = requireHandshakeReadOnly(handshake);
|
|
132
|
+
const grantedScope = optionalHandshakeString(handshake, 'grantedScope') ??
|
|
133
|
+
getScopes({ readOnly, fullAccess: isFullAccessHandshake(handshake) }).join(' ');
|
|
134
|
+
const authMode = getAuthModeForGrantedScope(grantedScope);
|
|
135
|
+
const config = getOAuthConfigForHandshake(handshake);
|
|
136
|
+
const client = createWrappedCommsClient(token, { baseUrl: config.resource });
|
|
137
|
+
let user;
|
|
138
|
+
try {
|
|
139
|
+
user = await client.users.getSessionUser();
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
if (hasErrorCode(error, 'FORBIDDEN')) {
|
|
143
|
+
const diagnostics = Array.isArray(handshake.tokenDiagnostics)
|
|
144
|
+
? handshake.tokenDiagnostics
|
|
145
|
+
: [];
|
|
146
|
+
throw new CliError('AUTH_FAILED', 'Comms rejected the OAuth token during validation.', [
|
|
147
|
+
...diagnostics,
|
|
148
|
+
'Check Comms logs for Todoist OAuth introspection: active, aud, exp, scope, user_id/sub',
|
|
149
|
+
]);
|
|
150
|
+
}
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
return toCommsAccount(user, {
|
|
154
|
+
authMode,
|
|
155
|
+
authScope: normalizeScopeString(grantedScope),
|
|
156
|
+
oauthClientId: requireHandshakeString(handshake, 'clientId', 'AUTH_FAILED'),
|
|
157
|
+
authBaseUrl: config.authBaseUrl,
|
|
158
|
+
authResource: config.resource,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Rebuild the rotated `CommsAccount` after a refresh so the stored
|
|
163
|
+
* `authScope` / `authMode` track the (possibly changed) granted scope. Returns
|
|
164
|
+
* `undefined` when the refresh handshake lacks the identity fields, leaving the
|
|
165
|
+
* previously-stored account in place.
|
|
166
|
+
*/
|
|
167
|
+
function buildRefreshAccount(handshake, grantedScope) {
|
|
168
|
+
const id = optionalHandshakeString(handshake, 'accountId');
|
|
169
|
+
const label = optionalHandshakeString(handshake, 'accountLabel');
|
|
170
|
+
const clientId = optionalHandshakeString(handshake, 'clientId');
|
|
171
|
+
if (!id || !label || !clientId)
|
|
172
|
+
return undefined;
|
|
173
|
+
const config = getOAuthConfigForHandshake(handshake);
|
|
174
|
+
return makeCommsAccount({
|
|
175
|
+
id,
|
|
176
|
+
label,
|
|
177
|
+
authMode: getAuthModeForGrantedScope(grantedScope),
|
|
178
|
+
authScope: normalizeScopeString(grantedScope),
|
|
179
|
+
oauthClientId: clientId,
|
|
180
|
+
authBaseUrl: config.authBaseUrl,
|
|
181
|
+
authResource: config.resource,
|
|
122
182
|
});
|
|
123
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* The handshake `refreshAccessToken` forwards to the provider's
|
|
186
|
+
* `refreshToken`. cli-core doesn't persist the DCR handshake, so we
|
|
187
|
+
* reconstruct it from the stored account: `clientId` (read by cli-core's
|
|
188
|
+
* refresh grant), the resource / auth base URL (read by the endpoint
|
|
189
|
+
* resolvers), and the identity fields (read by `buildRefreshAccount`).
|
|
190
|
+
*/
|
|
191
|
+
export function getCommsOAuthRefreshHandshake(account) {
|
|
192
|
+
if (!account.oauthClientId || !account.authBaseUrl || !account.authResource) {
|
|
193
|
+
throw new CliError('NO_TOKEN', 'Stored OAuth token cannot be refreshed because its client metadata is missing.', ['Run: tdc auth login']);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
clientId: account.oauthClientId,
|
|
197
|
+
accountId: account.id,
|
|
198
|
+
accountLabel: account.label,
|
|
199
|
+
authScope: account.authScope,
|
|
200
|
+
authBaseUrl: account.authBaseUrl,
|
|
201
|
+
resource: account.authResource,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/** Endpoint + resource config derived from the environment (login path). */
|
|
205
|
+
function getCommsOAuthConfig() {
|
|
206
|
+
const resource = getCommsOAuthResource();
|
|
207
|
+
return buildCommsOAuthConfig(getTodoistAuthBaseUrl(resource), resource);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Endpoint + resource config for a provider hook. Prefers values carried on
|
|
211
|
+
* the handshake (the refresh path reconstructs them from the stored account)
|
|
212
|
+
* and falls back to the environment (the login path, where the handshake
|
|
213
|
+
* doesn't carry them).
|
|
214
|
+
*/
|
|
215
|
+
function getOAuthConfigForHandshake(handshake) {
|
|
216
|
+
const resource = optionalHandshakeString(handshake, 'resource') ?? getCommsOAuthResource();
|
|
217
|
+
const authBaseUrl = optionalHandshakeString(handshake, 'authBaseUrl') ?? getTodoistAuthBaseUrl(resource);
|
|
218
|
+
return buildCommsOAuthConfig(authBaseUrl, resource);
|
|
219
|
+
}
|
|
220
|
+
function buildCommsOAuthConfig(authBaseUrl, resource) {
|
|
221
|
+
return {
|
|
222
|
+
authBaseUrl,
|
|
223
|
+
authorizationUrl: `${authBaseUrl}/oauth/authorize`,
|
|
224
|
+
tokenUrl: `${authBaseUrl}/oauth/access_token`,
|
|
225
|
+
registrationUrl: `${authBaseUrl}/oauth/register`,
|
|
226
|
+
resource,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* `loadClient` hook: reuse a registered `client_id` cached in config for the
|
|
231
|
+
* current auth server + resource + redirect URI. Keying on `redirectUri` is
|
|
232
|
+
* required — the registration is bound to its `redirect_uris` and the callback
|
|
233
|
+
* port can change between logins.
|
|
234
|
+
*/
|
|
235
|
+
async function loadCachedClient(input) {
|
|
236
|
+
const config = getCommsOAuthConfig();
|
|
237
|
+
const { oauthClients } = await getConfig();
|
|
238
|
+
const cached = (Array.isArray(oauthClients) ? oauthClients : [])
|
|
239
|
+
.filter(isStoredOAuthClient)
|
|
240
|
+
.find((client) => client.authBaseUrl === config.authBaseUrl &&
|
|
241
|
+
client.authResource === config.resource &&
|
|
242
|
+
client.redirectUri === input.redirectUri);
|
|
243
|
+
return cached ? { clientId: cached.clientId } : undefined;
|
|
244
|
+
}
|
|
245
|
+
/** `saveClient` hook: persist a freshly registered public client for reuse. */
|
|
246
|
+
async function saveCachedClient(client, input) {
|
|
247
|
+
const config = getCommsOAuthConfig();
|
|
248
|
+
const entry = {
|
|
249
|
+
clientId: client.clientId,
|
|
250
|
+
authBaseUrl: config.authBaseUrl,
|
|
251
|
+
authResource: config.resource,
|
|
252
|
+
redirectUri: input.redirectUri,
|
|
253
|
+
};
|
|
254
|
+
const stored = await getConfig();
|
|
255
|
+
const existing = (Array.isArray(stored.oauthClients) ? stored.oauthClients : [])
|
|
256
|
+
.filter(isStoredOAuthClient)
|
|
257
|
+
.filter((other) => other.authBaseUrl !== entry.authBaseUrl ||
|
|
258
|
+
other.authResource !== entry.authResource ||
|
|
259
|
+
other.redirectUri !== entry.redirectUri);
|
|
260
|
+
await updateConfig({
|
|
261
|
+
oauthClients: [...existing, entry].slice(-MAX_CACHED_OAUTH_CLIENTS),
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function isStoredOAuthClient(value) {
|
|
265
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
266
|
+
return false;
|
|
267
|
+
const record = value;
|
|
268
|
+
return (typeof record.clientId === 'string' &&
|
|
269
|
+
typeof record.authBaseUrl === 'string' &&
|
|
270
|
+
typeof record.authResource === 'string' &&
|
|
271
|
+
typeof record.redirectUri === 'string');
|
|
272
|
+
}
|
|
273
|
+
function getCommsOAuthResource() {
|
|
274
|
+
const override = process.env.COMMS_BASE_URL;
|
|
275
|
+
if (!override)
|
|
276
|
+
return DEFAULT_COMMS_OAUTH_RESOURCE;
|
|
277
|
+
let url;
|
|
278
|
+
try {
|
|
279
|
+
url = new URL(override);
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
throw new CliError('INVALID_URL', `COMMS_BASE_URL is not a valid URL: ${override}`, [
|
|
283
|
+
'Use a URL like https://comms.todoist.com',
|
|
284
|
+
'Or unset COMMS_BASE_URL before running OAuth login',
|
|
285
|
+
]);
|
|
286
|
+
}
|
|
287
|
+
if (url.protocol !== 'https:') {
|
|
288
|
+
throw new CliError('INVALID_URL', 'Todoist OAuth requires an HTTPS Comms resource.', [
|
|
289
|
+
'Use https://comms.todoist.com, https://comms.staging.todoist.com, or https://comms.local.todoist.com',
|
|
290
|
+
]);
|
|
291
|
+
}
|
|
292
|
+
const origin = url.origin;
|
|
293
|
+
const host = url.hostname.toLowerCase();
|
|
294
|
+
if (host === 'comms.todoist.com' ||
|
|
295
|
+
host === 'comms.staging.todoist.com' ||
|
|
296
|
+
host === 'comms.local.todoist.com') {
|
|
297
|
+
return origin;
|
|
298
|
+
}
|
|
299
|
+
throw new CliError('INVALID_URL', `Unsupported Comms OAuth resource: ${origin}`, [
|
|
300
|
+
'Use COMMS_API_TOKEN for custom Comms hosts',
|
|
301
|
+
'Supported OAuth hosts: comms.todoist.com, comms.staging.todoist.com, comms.local.todoist.com',
|
|
302
|
+
]);
|
|
303
|
+
}
|
|
304
|
+
function getTodoistAuthBaseUrl(resource) {
|
|
305
|
+
const override = process.env.COMMS_AS_URL;
|
|
306
|
+
if (override)
|
|
307
|
+
return normalizeAuthBaseUrlOverride(override);
|
|
308
|
+
const host = new URL(resource).hostname.toLowerCase();
|
|
309
|
+
if (host === 'comms.staging.todoist.com')
|
|
310
|
+
return 'https://staging.todoist.com';
|
|
311
|
+
if (host === 'comms.local.todoist.com')
|
|
312
|
+
return 'https://local.todoist.com';
|
|
313
|
+
return DEFAULT_TODOIST_AUTH_BASE_URL;
|
|
314
|
+
}
|
|
315
|
+
function normalizeAuthBaseUrlOverride(raw) {
|
|
316
|
+
let url;
|
|
317
|
+
try {
|
|
318
|
+
url = new URL(raw);
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
throw new CliError('INVALID_URL', `COMMS_AS_URL is not a valid URL: ${raw}`, [
|
|
322
|
+
'Use a URL like https://todoist.com',
|
|
323
|
+
]);
|
|
324
|
+
}
|
|
325
|
+
if (url.protocol !== 'https:') {
|
|
326
|
+
throw new CliError('INVALID_URL', 'COMMS_AS_URL must use HTTPS.', [
|
|
327
|
+
'Use a URL like https://todoist.com',
|
|
328
|
+
]);
|
|
329
|
+
}
|
|
330
|
+
const host = url.hostname.toLowerCase();
|
|
331
|
+
if (host !== 'todoist.com' && !host.endsWith('.todoist.com')) {
|
|
332
|
+
throw new CliError('INVALID_URL', 'COMMS_AS_URL must point to a Todoist host.', [
|
|
333
|
+
'Use a URL like https://todoist.com or https://staging.todoist.com',
|
|
334
|
+
]);
|
|
335
|
+
}
|
|
336
|
+
return url.origin;
|
|
337
|
+
}
|
|
338
|
+
function requireHandshakeString(handshake, key, code = 'AUTH_TOKEN_EXCHANGE_FAILED') {
|
|
339
|
+
const value = handshake[key];
|
|
340
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
341
|
+
throw new CliError(code, `Internal: OAuth handshake missing ${key}.`, [
|
|
342
|
+
'Try again: tdc auth login',
|
|
343
|
+
]);
|
|
344
|
+
}
|
|
345
|
+
return value;
|
|
346
|
+
}
|
|
347
|
+
function optionalHandshakeString(handshake, key) {
|
|
348
|
+
const value = handshake[key];
|
|
349
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
350
|
+
}
|
|
351
|
+
function requireHandshakeReadOnly(handshake) {
|
|
352
|
+
if (typeof handshake.readOnly !== 'boolean') {
|
|
353
|
+
throw new CliError('AUTH_FAILED', 'Internal: auth handshake missing the readOnly flag.', AUTH_HINTS);
|
|
354
|
+
}
|
|
355
|
+
return handshake.readOnly;
|
|
356
|
+
}
|
|
357
|
+
/** Read the `--full-access` flag from the runtime flags folded onto the handshake. */
|
|
358
|
+
function isFullAccessHandshake(handshake) {
|
|
359
|
+
const flags = handshake.flags;
|
|
360
|
+
return (typeof flags === 'object' &&
|
|
361
|
+
flags !== null &&
|
|
362
|
+
flags.fullAccess === true);
|
|
363
|
+
}
|
|
364
|
+
function hasErrorCode(error, code) {
|
|
365
|
+
return (typeof error === 'object' &&
|
|
366
|
+
error !== null &&
|
|
367
|
+
'code' in error &&
|
|
368
|
+
typeof error.code === 'string' &&
|
|
369
|
+
error.code === code);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Operator-facing hints describing what Todoist's token endpoint actually
|
|
373
|
+
* issued — surfaced only when Comms later rejects the token during `validate`.
|
|
374
|
+
* Reconstructed from the `ExchangeResult` (cli-core's DCR exchange surfaces the
|
|
375
|
+
* access token, refresh-token presence, and granted scope).
|
|
376
|
+
*/
|
|
377
|
+
function describeTokenResponse(exchange) {
|
|
378
|
+
const hints = [
|
|
379
|
+
`Todoist token response: refresh_token=${exchange.refreshToken ? 'yes' : 'no'}`,
|
|
380
|
+
`Todoist token response access_token: ${describeAccessTokenShape(exchange.accessToken)}`,
|
|
381
|
+
];
|
|
382
|
+
if (exchange.scope)
|
|
383
|
+
hints.push(`Todoist token response scope: ${exchange.scope}`);
|
|
384
|
+
if (!exchange.refreshToken) {
|
|
385
|
+
hints.push('Todoist issued a non-refresh access token; Comms intentionally rejects tokens without expiring introspection.');
|
|
386
|
+
}
|
|
387
|
+
return hints;
|
|
388
|
+
}
|
|
389
|
+
function describeAccessTokenShape(accessToken) {
|
|
390
|
+
const shape = /^[0-9a-f]{40}$/.test(accessToken) ? 'raw-hex-40' : 'other';
|
|
391
|
+
return `shape=${shape}, length=${accessToken.length}`;
|
|
392
|
+
}
|
|
393
|
+
function getAuthModeForGrantedScope(scope) {
|
|
394
|
+
return splitScopeString(scope).some((scopeCode) => WRITE_SCOPES.has(scopeCode))
|
|
395
|
+
? 'read-write'
|
|
396
|
+
: 'read-only';
|
|
397
|
+
}
|
|
398
|
+
function normalizeScopeString(scope) {
|
|
399
|
+
return splitScopeString(scope).join(' ');
|
|
400
|
+
}
|
|
401
|
+
function splitScopeString(scope) {
|
|
402
|
+
return scope
|
|
403
|
+
.replaceAll(',', ' ')
|
|
404
|
+
.split(/\s+/)
|
|
405
|
+
.map((part) => part.trim())
|
|
406
|
+
.filter(Boolean);
|
|
407
|
+
}
|
|
124
408
|
/**
|
|
125
409
|
* Accepts `42`, `id:42`, and case-insensitive labels — `parseRef` normalises
|
|
126
410
|
* the numeric forms. Broader than cli-core's default strict-equality matcher.
|
|
@@ -215,6 +499,9 @@ export function createCommsTokenStore() {
|
|
|
215
499
|
async set(account, token) {
|
|
216
500
|
return inner.set(account, token);
|
|
217
501
|
},
|
|
502
|
+
async setBundle(account, bundle, options) {
|
|
503
|
+
return inner.setBundle(account, bundle, options);
|
|
504
|
+
},
|
|
218
505
|
async clear(ref) {
|
|
219
506
|
return inner.clear(ref);
|
|
220
507
|
},
|
|
@@ -236,7 +523,7 @@ export async function getActiveTokenSource() {
|
|
|
236
523
|
return 'env';
|
|
237
524
|
const config = await getConfig();
|
|
238
525
|
const record = getDefaultUserRecord(config);
|
|
239
|
-
if (record?.fallbackToken)
|
|
526
|
+
if (record?.fallbackToken || record?.fallbackRefreshToken)
|
|
240
527
|
return 'config-file';
|
|
241
528
|
return 'secure-store';
|
|
242
529
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.js","sourceRoot":"","sources":["../../src/lib/auth-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,iBAAiB,EACjB,uBAAuB,GAE1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,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