@atlasauth/cli 0.7.0 → 0.9.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 +36 -0
- package/dist/args.d.ts +155 -0
- package/dist/args.js +66 -1
- package/dist/args.js.map +1 -1
- package/dist/commands/auth.js +5 -1
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/config.d.ts +56 -1
- package/dist/commands/config.js +188 -29
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/csp.d.ts +32 -0
- package/dist/commands/csp.js +180 -0
- package/dist/commands/csp.js.map +1 -0
- package/dist/commands/import-better-auth.d.ts +3 -0
- package/dist/commands/import-better-auth.js +164 -0
- package/dist/commands/import-better-auth.js.map +1 -0
- package/dist/commands/import.js +7 -0
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/info.js +1 -1
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.js +26 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/integrations.d.ts +8 -0
- package/dist/commands/integrations.js +112 -0
- package/dist/commands/integrations.js.map +1 -0
- package/dist/commands/listen.d.ts +17 -0
- package/dist/commands/listen.js +223 -0
- package/dist/commands/listen.js.map +1 -0
- package/dist/commands/migrate.js +40 -1
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/move-origin.d.ts +11 -0
- package/dist/commands/move-origin.js +95 -0
- package/dist/commands/move-origin.js.map +1 -0
- package/dist/commands/operator.d.ts +26 -0
- package/dist/commands/operator.js +198 -0
- package/dist/commands/operator.js.map +1 -0
- package/dist/commands/project-commands.d.ts +12 -0
- package/dist/commands/project-commands.js +130 -30
- package/dist/commands/project-commands.js.map +1 -1
- package/dist/commands/referrals.d.ts +4 -4
- package/dist/commands/referrals.js +203 -33
- package/dist/commands/referrals.js.map +1 -1
- package/dist/commands/shared.d.ts +6 -0
- package/dist/commands/shared.js +10 -1
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.js +77 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/webhooks.d.ts +29 -2
- package/dist/commands/webhooks.js +257 -24
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/config.d.ts +14 -0
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +13 -0
- package/dist/context.js.map +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +221 -17
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/migrate/better-auth/integration.d.ts +59 -0
- package/dist/migrate/better-auth/integration.js +81 -0
- package/dist/migrate/better-auth/integration.js.map +1 -0
- package/dist/migrate/better-auth/orchestrator.d.ts +43 -0
- package/dist/migrate/better-auth/orchestrator.js +525 -0
- package/dist/migrate/better-auth/orchestrator.js.map +1 -0
- package/dist/migrate/better-auth/output.d.ts +20 -0
- package/dist/migrate/better-auth/output.js +146 -0
- package/dist/migrate/better-auth/output.js.map +1 -0
- package/dist/migrate/better-auth/translate.d.ts +77 -0
- package/dist/migrate/better-auth/translate.js +1989 -0
- package/dist/migrate/better-auth/translate.js.map +1 -0
- package/dist/run.js +14 -0
- package/dist/run.js.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @atlasauth/cli changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 — 2026-10-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `atlas webhooks` gains `upsert`, `update`, `test`, `deliveries`, `redeliver`, `replay`, `rotate` and `reveal`. Secrets go to 0600 files.
|
|
8
|
+
- `atlas listen --forward-to <url> [--events user.*]`: signed local webhook forwarding with no tunnel.
|
|
9
|
+
- `atlas move-origin --from --to [--dry-run]`: one-step domain move with a diff, a confirmation and a test delivery per moved webhook.
|
|
10
|
+
- `atlas csp --framework next|express|nginx`: the CSP sources for your integration shape; `--manifest` merges any provider's embed manifest.
|
|
11
|
+
- `atlas config plan`: field-level drift diff with `--exit-code` and `--json`. New `atlas-plan` GitHub Action.
|
|
12
|
+
- `atlas env --format k8s`, and `atlas env` without `--product` reads the live instance.
|
|
13
|
+
- `atlas migrate code --from openid-client|jose|generic-oidc`.
|
|
14
|
+
- `ATLAS_API_BASE` is accepted everywhere `ATLAS_API_URL` is (BASE wins when both are set); `atlas env` prints both.
|
|
15
|
+
- `atlas referrals conformance`: runs `@atlasauth/referral-conformance` against any referral platform (`--protocol webhook` for the generic Atlas referral protocol, `connection` for the Referalli dialect; defaults to the connected one), with `--secret-file`, `--only` and `--simulate`. Exits 1 on a failed case.
|
|
16
|
+
- `atlas referrals connect --oauth [--preset <id>]`: one-click connect. Prints the platform's link, waits for the connection to appear, pings it. No key or secret is copied.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Referalli is `--provider referalli`; `--provider referally`, `--referally-key`, `--referally-key-file`, `REFERALLY_BASE_URL` and `REFERALLY_API_KEY` still work and print a notice.
|
|
21
|
+
|
|
22
|
+
- `atlas status`: Atlas's components and regions, the open Atlas incidents that concern the instance, its status subscription, and the state of every upstream status page it declared. Exits 1 on an Atlas major outage or a major / critical incident that concerns the instance, or an upstream partial / major outage; `--json` for scripts.
|
|
23
|
+
- `atlas doctor` (the integration-health report, exit 1 on a failing check) and `atlas csp` (the Content-Security-Policy sources for your pages, from the embed manifest).
|
|
24
|
+
- `atlas init --backchannel <url>`: sets the first-party OAuth client's back-channel logout URI (on create, or on a re-run) and points at the ready-made receivers in `@atlasauth/backend`.
|
|
25
|
+
|
|
26
|
+
## 0.8.0 — 2026-10-24
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- `atlas migrate better-auth [path]`: moves a Better Auth app to Atlas end to end in resumable steps (preflight, translate, apply, export, import, bridge, code, verify), saved in `atlas-migrate/state.json`. Supports `--dry-run`, `--yes`, `--resume`, `--force`, `--skip <step,...>`, `--json`, `--entry`, `--bundle`, `--run-export` and `--bridge-days`. Placeholders are filled from the environment and the app's `.env` files, and the values are only sent to Atlas.
|
|
31
|
+
- `atlas migrate better-auth config [path]`: reads the app's `betterAuth({...})` options without running it and writes `atlas config import` files plus `better-auth-report.md` / `.json`. The report sorts every option into maps 1:1, maps with a difference, and needs a manual step, each with its file and line. Secrets become `${ENV}` placeholders; a secret hard-coded in source is flagged and never copied.
|
|
32
|
+
- `atlas config import` / `export`: new `permissions` (applied before `roles`) and `custom_oauth_providers` resource files. Provider settings (Microsoft tenant, Okta domain, Apple team and key ids, SIWE domain) are passed through.
|
|
33
|
+
- `atlas import --from better-auth --bundle <file>`: uploads the encrypted bundle from `npx atlas-better-auth-export`, prints the dry-run report (per-model counts, conflicts, action items), asks, then imports with live progress. `--import <id>` applies an uploaded import or resumes one that stopped; `--dry-run`, `--confirm-conflicts`, `--options <json|@file>`, `--yes`, `--json`. With no bundle it prints the instance import key and the export command.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- `atlas config import`: an `instance` file without `allowed_origins` now leaves the live origins as they are, instead of clearing them.
|
|
38
|
+
|
|
3
39
|
## 0.7.0 — 2026-10-24
|
|
4
40
|
|
|
5
41
|
### Added
|
package/dist/args.d.ts
CHANGED
|
@@ -31,6 +31,30 @@ declare const OPTIONS: {
|
|
|
31
31
|
readonly 'secret-key': {
|
|
32
32
|
readonly type: "string";
|
|
33
33
|
};
|
|
34
|
+
readonly device: {
|
|
35
|
+
readonly type: "boolean";
|
|
36
|
+
};
|
|
37
|
+
readonly resource: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
};
|
|
40
|
+
readonly scope: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
};
|
|
43
|
+
readonly scopes: {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
};
|
|
46
|
+
readonly owner: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
};
|
|
49
|
+
readonly 'expires-at': {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
};
|
|
52
|
+
readonly 'allowed-ips': {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
};
|
|
55
|
+
readonly out: {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
};
|
|
34
58
|
readonly email: {
|
|
35
59
|
readonly type: "string";
|
|
36
60
|
};
|
|
@@ -104,6 +128,9 @@ declare const OPTIONS: {
|
|
|
104
128
|
readonly 'webhook-url': {
|
|
105
129
|
readonly type: "string";
|
|
106
130
|
};
|
|
131
|
+
readonly backchannel: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
};
|
|
107
134
|
readonly yes: {
|
|
108
135
|
readonly type: "boolean";
|
|
109
136
|
readonly short: "y";
|
|
@@ -120,6 +147,18 @@ declare const OPTIONS: {
|
|
|
120
147
|
readonly 'fail-on': {
|
|
121
148
|
readonly type: "string";
|
|
122
149
|
};
|
|
150
|
+
readonly only: {
|
|
151
|
+
readonly type: "string";
|
|
152
|
+
};
|
|
153
|
+
readonly 'no-probe': {
|
|
154
|
+
readonly type: "boolean";
|
|
155
|
+
};
|
|
156
|
+
readonly shape: {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
};
|
|
159
|
+
readonly origin: {
|
|
160
|
+
readonly type: "string";
|
|
161
|
+
};
|
|
123
162
|
readonly now: {
|
|
124
163
|
readonly type: "boolean";
|
|
125
164
|
};
|
|
@@ -132,6 +171,55 @@ declare const OPTIONS: {
|
|
|
132
171
|
readonly events: {
|
|
133
172
|
readonly type: "string";
|
|
134
173
|
};
|
|
174
|
+
readonly delivery: {
|
|
175
|
+
readonly type: "string";
|
|
176
|
+
};
|
|
177
|
+
readonly status: {
|
|
178
|
+
readonly type: "string";
|
|
179
|
+
};
|
|
180
|
+
readonly 'event-type': {
|
|
181
|
+
readonly type: "string";
|
|
182
|
+
};
|
|
183
|
+
readonly until: {
|
|
184
|
+
readonly type: "string";
|
|
185
|
+
};
|
|
186
|
+
readonly active: {
|
|
187
|
+
readonly type: "boolean";
|
|
188
|
+
};
|
|
189
|
+
readonly inactive: {
|
|
190
|
+
readonly type: "boolean";
|
|
191
|
+
};
|
|
192
|
+
readonly timeout: {
|
|
193
|
+
readonly type: "string";
|
|
194
|
+
};
|
|
195
|
+
readonly 'no-wait': {
|
|
196
|
+
readonly type: "boolean";
|
|
197
|
+
};
|
|
198
|
+
readonly to: {
|
|
199
|
+
readonly type: "string";
|
|
200
|
+
};
|
|
201
|
+
readonly 'forward-to': {
|
|
202
|
+
readonly type: "string";
|
|
203
|
+
};
|
|
204
|
+
readonly count: {
|
|
205
|
+
readonly type: "string";
|
|
206
|
+
};
|
|
207
|
+
readonly 'no-forward': {
|
|
208
|
+
readonly type: "boolean";
|
|
209
|
+
};
|
|
210
|
+
readonly framework: {
|
|
211
|
+
readonly type: "string";
|
|
212
|
+
};
|
|
213
|
+
readonly manifest: {
|
|
214
|
+
readonly type: "string";
|
|
215
|
+
readonly multiple: true;
|
|
216
|
+
};
|
|
217
|
+
readonly 'no-atlas': {
|
|
218
|
+
readonly type: "boolean";
|
|
219
|
+
};
|
|
220
|
+
readonly 'exit-code': {
|
|
221
|
+
readonly type: "boolean";
|
|
222
|
+
};
|
|
135
223
|
readonly provider: {
|
|
136
224
|
readonly type: "string";
|
|
137
225
|
};
|
|
@@ -141,12 +229,33 @@ declare const OPTIONS: {
|
|
|
141
229
|
readonly 'base-url': {
|
|
142
230
|
readonly type: "string";
|
|
143
231
|
};
|
|
232
|
+
readonly 'referalli-key': {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
};
|
|
235
|
+
readonly 'referalli-key-file': {
|
|
236
|
+
readonly type: "string";
|
|
237
|
+
};
|
|
144
238
|
readonly 'referally-key': {
|
|
145
239
|
readonly type: "string";
|
|
146
240
|
};
|
|
147
241
|
readonly 'referally-key-file': {
|
|
148
242
|
readonly type: "string";
|
|
149
243
|
};
|
|
244
|
+
readonly oauth: {
|
|
245
|
+
readonly type: "boolean";
|
|
246
|
+
};
|
|
247
|
+
readonly preset: {
|
|
248
|
+
readonly type: "string";
|
|
249
|
+
};
|
|
250
|
+
readonly 'connection-id': {
|
|
251
|
+
readonly type: "string";
|
|
252
|
+
};
|
|
253
|
+
readonly protocol: {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
};
|
|
256
|
+
readonly simulate: {
|
|
257
|
+
readonly type: "boolean";
|
|
258
|
+
};
|
|
150
259
|
readonly 'auto-enroll': {
|
|
151
260
|
readonly type: "boolean";
|
|
152
261
|
};
|
|
@@ -201,6 +310,52 @@ declare const OPTIONS: {
|
|
|
201
310
|
readonly 'create-orgs': {
|
|
202
311
|
readonly type: "boolean";
|
|
203
312
|
};
|
|
313
|
+
readonly bundle: {
|
|
314
|
+
readonly type: "string";
|
|
315
|
+
};
|
|
316
|
+
readonly import: {
|
|
317
|
+
readonly type: "string";
|
|
318
|
+
};
|
|
319
|
+
readonly 'confirm-conflicts': {
|
|
320
|
+
readonly type: "boolean";
|
|
321
|
+
};
|
|
322
|
+
readonly options: {
|
|
323
|
+
readonly type: "string";
|
|
324
|
+
};
|
|
325
|
+
readonly entry: {
|
|
326
|
+
readonly type: "string";
|
|
327
|
+
};
|
|
328
|
+
readonly 'run-export': {
|
|
329
|
+
readonly type: "boolean";
|
|
330
|
+
};
|
|
331
|
+
readonly 'bridge-days': {
|
|
332
|
+
readonly type: "string";
|
|
333
|
+
};
|
|
334
|
+
readonly resume: {
|
|
335
|
+
readonly type: "boolean";
|
|
336
|
+
};
|
|
337
|
+
readonly skip: {
|
|
338
|
+
readonly type: "string";
|
|
339
|
+
readonly multiple: true;
|
|
340
|
+
};
|
|
341
|
+
readonly audience: {
|
|
342
|
+
readonly type: "string";
|
|
343
|
+
};
|
|
344
|
+
readonly 'events-url': {
|
|
345
|
+
readonly type: "string";
|
|
346
|
+
};
|
|
347
|
+
readonly 'backchannel-logout-url': {
|
|
348
|
+
readonly type: "string";
|
|
349
|
+
};
|
|
350
|
+
readonly 'oauth-client-id': {
|
|
351
|
+
readonly type: "string";
|
|
352
|
+
};
|
|
353
|
+
readonly trace: {
|
|
354
|
+
readonly type: "string";
|
|
355
|
+
};
|
|
356
|
+
readonly disable: {
|
|
357
|
+
readonly type: "boolean";
|
|
358
|
+
};
|
|
204
359
|
readonly cursor: {
|
|
205
360
|
readonly type: "boolean";
|
|
206
361
|
};
|
package/dist/args.js
CHANGED
|
@@ -23,6 +23,16 @@ const OPTIONS = {
|
|
|
23
23
|
// login (non-interactive overrides for the prompts).
|
|
24
24
|
url: { type: 'string' },
|
|
25
25
|
'secret-key': { type: 'string' },
|
|
26
|
+
// login --device / token: the operator device flow and token exchange.
|
|
27
|
+
device: { type: 'boolean' },
|
|
28
|
+
resource: { type: 'string' },
|
|
29
|
+
scope: { type: 'string' },
|
|
30
|
+
// keys create / rotate.
|
|
31
|
+
scopes: { type: 'string' },
|
|
32
|
+
owner: { type: 'string' },
|
|
33
|
+
'expires-at': { type: 'string' },
|
|
34
|
+
'allowed-ips': { type: 'string' },
|
|
35
|
+
out: { type: 'string' },
|
|
26
36
|
// users create.
|
|
27
37
|
email: { type: 'string' },
|
|
28
38
|
'first-name': { type: 'string' },
|
|
@@ -55,23 +65,61 @@ const OPTIONS = {
|
|
|
55
65
|
'email-key-file': { type: 'string' },
|
|
56
66
|
'client-redirect': { type: 'string', multiple: true },
|
|
57
67
|
'webhook-url': { type: 'string' },
|
|
68
|
+
backchannel: { type: 'string' },
|
|
58
69
|
yes: { type: 'boolean', short: 'y' },
|
|
59
70
|
force: { type: 'boolean' },
|
|
60
71
|
'rotate-secret': { type: 'boolean' },
|
|
61
72
|
instance: { type: 'string' },
|
|
62
73
|
'fail-on': { type: 'string' },
|
|
74
|
+
// doctor / csp.
|
|
75
|
+
only: { type: 'string' },
|
|
76
|
+
'no-probe': { type: 'boolean' },
|
|
77
|
+
shape: { type: 'string' },
|
|
78
|
+
origin: { type: 'string' },
|
|
63
79
|
now: { type: 'boolean' },
|
|
64
80
|
overlap: { type: 'string' },
|
|
65
81
|
// Any command that receives a secret: print it instead of writing a 0600 file.
|
|
66
82
|
'print-secret': { type: 'boolean' },
|
|
67
|
-
// webhooks create.
|
|
83
|
+
// webhooks create / update / listen.
|
|
68
84
|
events: { type: 'string' },
|
|
85
|
+
// webhooks deliveries / redeliver / test / update.
|
|
86
|
+
delivery: { type: 'string' },
|
|
87
|
+
status: { type: 'string' },
|
|
88
|
+
'event-type': { type: 'string' },
|
|
89
|
+
until: { type: 'string' },
|
|
90
|
+
active: { type: 'boolean' },
|
|
91
|
+
inactive: { type: 'boolean' },
|
|
92
|
+
timeout: { type: 'string' },
|
|
93
|
+
'no-wait': { type: 'boolean' },
|
|
94
|
+
// move-origin.
|
|
95
|
+
to: { type: 'string' },
|
|
96
|
+
// listen.
|
|
97
|
+
'forward-to': { type: 'string' },
|
|
98
|
+
count: { type: 'string' },
|
|
99
|
+
'no-forward': { type: 'boolean' },
|
|
100
|
+
// csp.
|
|
101
|
+
framework: { type: 'string' },
|
|
102
|
+
manifest: { type: 'string', multiple: true },
|
|
103
|
+
'no-atlas': { type: 'boolean' },
|
|
104
|
+
// config plan.
|
|
105
|
+
'exit-code': { type: 'boolean' },
|
|
69
106
|
// referrals connect / backfill.
|
|
70
107
|
provider: { type: 'string' },
|
|
71
108
|
program: { type: 'string' },
|
|
72
109
|
'base-url': { type: 'string' },
|
|
110
|
+
'referalli-key': { type: 'string' },
|
|
111
|
+
'referalli-key-file': { type: 'string' },
|
|
112
|
+
// The old spellings (Referalli was first published as "Referally"): still accepted, with a notice.
|
|
73
113
|
'referally-key': { type: 'string' },
|
|
74
114
|
'referally-key-file': { type: 'string' },
|
|
115
|
+
// referrals connect --oauth: one-click connect (no key to paste).
|
|
116
|
+
oauth: { type: 'boolean' },
|
|
117
|
+
preset: { type: 'string' },
|
|
118
|
+
// referrals conformance: the platform under test.
|
|
119
|
+
'connection-id': { type: 'string' },
|
|
120
|
+
// referrals conformance: webhook (generic protocol) or connection (Referalli dialect).
|
|
121
|
+
protocol: { type: 'string' },
|
|
122
|
+
simulate: { type: 'boolean' },
|
|
75
123
|
'auto-enroll': { type: 'boolean' },
|
|
76
124
|
destination: { type: 'string' },
|
|
77
125
|
'tracking-token': { type: 'string' },
|
|
@@ -91,6 +139,23 @@ const OPTIONS = {
|
|
|
91
139
|
'hash-config': { type: 'string' },
|
|
92
140
|
hashes: { type: 'string' },
|
|
93
141
|
'create-orgs': { type: 'boolean' },
|
|
142
|
+
// import --from better-auth --bundle <file> | --import <id>; migrate better-auth.
|
|
143
|
+
bundle: { type: 'string' },
|
|
144
|
+
import: { type: 'string' },
|
|
145
|
+
'confirm-conflicts': { type: 'boolean' },
|
|
146
|
+
options: { type: 'string' },
|
|
147
|
+
entry: { type: 'string' },
|
|
148
|
+
'run-export': { type: 'boolean' },
|
|
149
|
+
'bridge-days': { type: 'string' },
|
|
150
|
+
resume: { type: 'boolean' },
|
|
151
|
+
skip: { type: 'string', multiple: true },
|
|
152
|
+
// integrations set / deliveries.
|
|
153
|
+
audience: { type: 'string' },
|
|
154
|
+
'events-url': { type: 'string' },
|
|
155
|
+
'backchannel-logout-url': { type: 'string' },
|
|
156
|
+
'oauth-client-id': { type: 'string' },
|
|
157
|
+
trace: { type: 'string' },
|
|
158
|
+
disable: { type: 'boolean' },
|
|
94
159
|
// mcp install.
|
|
95
160
|
cursor: { type: 'boolean' },
|
|
96
161
|
'claude-code': { type: 'boolean' },
|
package/dist/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":";;AAiLA,sBAeC;AAGD,kBAGC;AAGD,oBAOC;AAGD,sBAQC;AA3ND,yCAAsC;AACtC,qCAAoC;AAEpC;;;;;GAKG;AACH,MAAM,OAAO,GAAG;IACd,UAAU;IACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,OAAO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GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE,OAAO,GAAG;SACP,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAED,yFAAyF;AACzF,SAAgB,KAAK,CAAC,MAAc;IAClC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,iBAAQ,CAAC,4CAA4C,GAAG,IAAI,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/commands/auth.js
CHANGED
|
@@ -9,6 +9,7 @@ const errors_1 = require("../errors");
|
|
|
9
9
|
const output_1 = require("../output");
|
|
10
10
|
const project_1 = require("../project");
|
|
11
11
|
const shared_1 = require("./shared");
|
|
12
|
+
const operator_1 = require("./operator");
|
|
12
13
|
/**
|
|
13
14
|
* `atlas login` — prompt for an API URL + a secret key, PROVE the key works
|
|
14
15
|
* with one cheap Backend call, then store it under a named profile (0600).
|
|
@@ -21,6 +22,9 @@ const shared_1 = require("./shared");
|
|
|
21
22
|
*/
|
|
22
23
|
async function login(ctx, args) {
|
|
23
24
|
const { values } = args;
|
|
25
|
+
// `--device`: operator sign-in through Atlas's own sign-in page (no key stored).
|
|
26
|
+
if (values.device === true)
|
|
27
|
+
return (0, operator_1.deviceLogin)(ctx, args);
|
|
24
28
|
const profile = (0, args_1.str)(values, 'profile') || 'default';
|
|
25
29
|
const apiUrl = (0, args_1.str)(values, 'url') ||
|
|
26
30
|
(await ctx.prompt.text('Atlas API URL', { default: backend_1.DEFAULT_API_URL })) ||
|
|
@@ -31,7 +35,7 @@ async function login(ctx, args) {
|
|
|
31
35
|
// Prove the credential before persisting it. A platform key (psk_, for
|
|
32
36
|
// `atlas init`) is proven against the platform API instead.
|
|
33
37
|
try {
|
|
34
|
-
if (secretKey.startsWith('psk_'))
|
|
38
|
+
if (secretKey.startsWith('psk_') || /^atlas_(live|test)_psk_/.test(secretKey))
|
|
35
39
|
await (0, project_1.httpFor)(ctx, { secretKey, apiUrl }).get('/v1/platform/apps');
|
|
36
40
|
else
|
|
37
41
|
await ctx.makeClient({ secretKey, apiUrl }).users.list({ limit: 1 });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":";;AAmBA,sBAsCC;AAOD,wBAkBC;AAOD,wBAkBC;AA3GD,gDAAoE;AACpE,kCAA+C;AAE/C,sCAAqC;AACrC,sCAAsC;AACtC,wCAAqC;AACrC,qCAA8D;AAC9D,yCAAyC;AAEzC;;;;;;;;;GASG;AACI,KAAK,UAAU,KAAK,CAAC,GAAe,EAAE,IAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,iFAAiF;IACjF,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,IAAA,sBAAW,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAA,UAAG,EAAC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gs } from '../args';
|
|
1
|
+
import { type ParsedArgs, type Values } from '../args';
|
|
2
|
+
import { type ConfigHttp } from '../config-http';
|
|
2
3
|
import type { RunContext } from '../context';
|
|
4
|
+
import { type Format, type Json } from '../serialize';
|
|
5
|
+
/** A config document ready for disk / comparison: a plain, redacted JSON value. */
|
|
6
|
+
type Config = Json;
|
|
3
7
|
/** `atlas config export|import` — Auth0 `deploy-cli`-style config-as-code. */
|
|
4
8
|
export declare function config(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
9
|
+
export declare function resolveFormat(values: Values): Format;
|
|
10
|
+
export interface Change {
|
|
11
|
+
type: string;
|
|
12
|
+
action: 'create' | 'update' | 'delete';
|
|
13
|
+
key: string;
|
|
14
|
+
/** The live document (absent on a create). Carried for `atlas config plan`'s field diff. */
|
|
15
|
+
before?: Config;
|
|
16
|
+
/** The desired document (absent on a delete). */
|
|
17
|
+
after?: Config;
|
|
18
|
+
}
|
|
19
|
+
/** A planned change and the call that applies it. */
|
|
20
|
+
export interface PlannedChange extends Change {
|
|
21
|
+
apply: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/** What `atlas config import` would do: the changes, the unchanged count and the skipped deletes. */
|
|
24
|
+
export interface ConfigPlan {
|
|
25
|
+
changes: PlannedChange[];
|
|
26
|
+
unchanged: number;
|
|
27
|
+
skippedDeletes: Change[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Diff a config directory against the live instance. Nothing is written: the
|
|
31
|
+
* returned changes carry their own `apply`. Used by `atlas config import` and by
|
|
32
|
+
* `atlas migrate better-auth` (which shows the plan before applying it).
|
|
33
|
+
*/
|
|
34
|
+
export declare function planConfigImport(http: ConfigHttp, opts: {
|
|
35
|
+
dir: string;
|
|
36
|
+
format: Format;
|
|
37
|
+
env: NodeJS.ProcessEnv;
|
|
38
|
+
prune: boolean;
|
|
39
|
+
}): Promise<ConfigPlan>;
|
|
40
|
+
/** One differing field between the live and the desired document. */
|
|
41
|
+
export interface FieldDiff {
|
|
42
|
+
path: string;
|
|
43
|
+
before?: Json;
|
|
44
|
+
after?: Json;
|
|
45
|
+
}
|
|
46
|
+
/** Leaf-level differences between two documents, as dotted paths (arrays compare whole). */
|
|
47
|
+
export declare function diffFields(before: Json | undefined, after: Json | undefined, path?: string): FieldDiff[];
|
|
48
|
+
export declare function printPlan(ctx: RunContext, changes: Change[], unchanged: number, skippedDeletes: Change[], opts: {
|
|
49
|
+
dryRun: boolean;
|
|
50
|
+
prune: boolean;
|
|
51
|
+
}): void;
|
|
52
|
+
/**
|
|
53
|
+
* Replace `${ENV_VAR}` placeholders inside any string with the environment's
|
|
54
|
+
* value — the one sanctioned way a secret enters an import without ever living
|
|
55
|
+
* on disk. An unset variable is left verbatim so the plan surfaces it rather
|
|
56
|
+
* than silently blanking a credential.
|
|
57
|
+
*/
|
|
58
|
+
export declare function interpolate(value: Json, env: NodeJS.ProcessEnv): Json;
|
|
59
|
+
export {};
|