@atlasauth/backend 0.18.0 → 0.20.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 +46 -0
- package/dist/backchannel-handlers.d.ts +87 -0
- package/dist/backchannel-handlers.js +137 -0
- package/dist/backchannel-handlers.js.map +1 -0
- package/dist/client/activity.d.ts +13 -2
- package/dist/client/activity.js.map +1 -1
- package/dist/client/audit-logs.d.ts +7 -0
- package/dist/client/audit-logs.js.map +1 -1
- package/dist/client/compliance.d.ts +216 -0
- package/dist/client/compliance.js +77 -0
- package/dist/client/compliance.js.map +1 -0
- package/dist/client/credentials.d.ts +427 -0
- package/dist/client/credentials.js +162 -0
- package/dist/client/credentials.js.map +1 -0
- package/dist/client/data-subject-requests.d.ts +36 -1
- package/dist/client/data-subject-requests.js.map +1 -1
- package/dist/client/design.d.ts +48 -0
- package/dist/client/design.js +9 -0
- package/dist/client/design.js.map +1 -1
- package/dist/client/entitlement-overrides.d.ts +30 -0
- package/dist/client/entitlement-overrides.js +9 -0
- package/dist/client/entitlement-overrides.js.map +1 -1
- package/dist/client/env.d.ts +16 -0
- package/dist/client/env.js +38 -0
- package/dist/client/env.js.map +1 -0
- package/dist/client/error.d.ts +12 -0
- package/dist/client/error.js +6 -0
- package/dist/client/error.js.map +1 -1
- package/dist/client/index.d.ts +321 -7
- package/dist/client/index.js +39 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/instance.d.ts +414 -3
- package/dist/client/instance.js +77 -3
- package/dist/client/instance.js.map +1 -1
- package/dist/client/integrations.d.ts +107 -0
- package/dist/client/integrations.js +25 -0
- package/dist/client/integrations.js.map +1 -0
- package/dist/client/messaging.d.ts +18 -4
- package/dist/client/messaging.js +6 -2
- package/dist/client/messaging.js.map +1 -1
- package/dist/client/oauth-clients.d.ts +18 -3
- package/dist/client/oauth-clients.js +4 -2
- package/dist/client/oauth-clients.js.map +1 -1
- package/dist/client/operator.d.ts +100 -0
- package/dist/client/operator.js +132 -0
- package/dist/client/operator.js.map +1 -0
- package/dist/client/platform.d.ts +250 -9
- package/dist/client/platform.js +88 -6
- package/dist/client/platform.js.map +1 -1
- package/dist/client/privacy.d.ts +127 -0
- package/dist/client/privacy.js +44 -0
- package/dist/client/privacy.js.map +1 -0
- package/dist/client/referrals.d.ts +53 -6
- package/dist/client/referrals.js +9 -0
- package/dist/client/referrals.js.map +1 -1
- package/dist/client/request.d.ts +58 -1
- package/dist/client/request.js +6 -2
- package/dist/client/request.js.map +1 -1
- package/dist/client/sealed-box.d.ts +7 -0
- package/dist/client/sealed-box.js +62 -0
- package/dist/client/sealed-box.js.map +1 -0
- package/dist/client/sessions.d.ts +16 -5
- package/dist/client/sessions.js +7 -10
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/status.d.ts +200 -0
- package/dist/client/status.js +54 -0
- package/dist/client/status.js.map +1 -0
- package/dist/client/users.d.ts +2 -0
- package/dist/client/users.js.map +1 -1
- package/dist/client/webhooks.d.ts +265 -13
- package/dist/client/webhooks.js +52 -3
- package/dist/client/webhooks.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/oidc.d.ts +75 -1
- package/dist/oidc.js +48 -0
- package/dist/oidc.js.map +1 -1
- package/dist/referral-test-calls.d.ts +26 -13
- package/dist/referral-test-calls.js +40 -14
- package/dist/referral-test-calls.js.map +1 -1
- package/dist/testing.d.ts +45 -6
- package/dist/testing.js +37 -2
- package/dist/testing.js.map +1 -1
- package/dist/verify.d.ts +9 -0
- package/dist/verify.js.map +1 -1
- package/dist/webhooks.d.ts +8 -0
- package/dist/webhooks.js +13 -4
- package/dist/webhooks.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.integrationsResource = integrationsResource;
|
|
4
|
+
const request_1 = require("./request");
|
|
5
|
+
function integrationsResource(request) {
|
|
6
|
+
return {
|
|
7
|
+
/** `POST /v1/integrations/verify_errors` — record a token an integrated service refused. */
|
|
8
|
+
reportVerifyError(body) {
|
|
9
|
+
return request({ method: 'POST', path: '/v1/integrations/verify_errors', body });
|
|
10
|
+
},
|
|
11
|
+
/** `GET /v1/integrations/:integration/card` — the agent-sidebar card for a user (by token sub). */
|
|
12
|
+
card(integration, query) {
|
|
13
|
+
return request({ method: 'GET', path: `/v1/integrations/${(0, request_1.enc)(integration)}/card`, query });
|
|
14
|
+
},
|
|
15
|
+
/** `POST /v1/integrations/:integration/card/actions/revoke_sessions` — sign the user out everywhere (audited with the agent). */
|
|
16
|
+
revokeSessions(integration, body) {
|
|
17
|
+
return request({ method: 'POST', path: `/v1/integrations/${(0, request_1.enc)(integration)}/card/actions/revoke_sessions`, body });
|
|
18
|
+
},
|
|
19
|
+
/** `GET /v1/public/instances/:id` — the public metadata of an instance (no key needed). */
|
|
20
|
+
instanceMetadata(instanceId) {
|
|
21
|
+
return request({ method: 'GET', path: `/v1/public/instances/${(0, request_1.enc)(instanceId)}` });
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=integrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/client/integrations.ts"],"names":[],"mappings":";;AAuEA,oDAsBC;AA7FD,uCAAgD;AAuEhD,SAAgB,oBAAoB,CAAC,OAAkB;IACrD,OAAO;QACL,4FAA4F;QAC5F,iBAAiB,CAAC,IAA2B;YAC3C,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,EAAE,IAAI,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,mGAAmG;QACnG,IAAI,CAAC,WAAmB,EAAE,KAAoC;YAC5D,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,oBAAoB,IAAA,aAAG,EAAC,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9F,CAAC;QACD,iIAAiI;QACjI,cAAc,CACZ,WAAmB,EACnB,IAA2F;YAE3F,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,IAAA,aAAG,EAAC,WAAW,CAAC,+BAA+B,EAAE,IAAI,EAAE,CAAC,CAAC;QACtH,CAAC;QACD,2FAA2F;QAC3F,gBAAgB,CAAC,UAAkB;YACjC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,IAAA,aAAG,EAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;QACrF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -278,6 +278,16 @@ export type SmsProvider = {
|
|
|
278
278
|
}[SmsTransport];
|
|
279
279
|
/** Either channel's provider. Narrow on `transport` (or `channel`) to read its config. */
|
|
280
280
|
export type MessagingProvider = EmailProvider | SmsProvider;
|
|
281
|
+
/**
|
|
282
|
+
* What a singleton GET returns when nothing is configured yet (never a 404).
|
|
283
|
+
* A configured object carries `configured: true`.
|
|
284
|
+
*/
|
|
285
|
+
export interface NotConfigured<O extends string = string> {
|
|
286
|
+
object: O;
|
|
287
|
+
configured: false;
|
|
288
|
+
/** What to call to configure it. */
|
|
289
|
+
message?: string;
|
|
290
|
+
}
|
|
281
291
|
export interface MessagingProviders {
|
|
282
292
|
object: 'messaging_providers';
|
|
283
293
|
email: EmailProvider | null;
|
|
@@ -429,6 +439,10 @@ type LegacyInput<T extends string> = Omit<MessagingProviderInput, 'transport'> &
|
|
|
429
439
|
export declare function messagingResource(request: RequestFn): {
|
|
430
440
|
/** The instance's configured email and SMS providers, secrets omitted. */
|
|
431
441
|
get(): Promise<MessagingProviders>;
|
|
442
|
+
/** One channel's provider, or `{ configured: false, channel }` when none is set. */
|
|
443
|
+
channel<C extends "email" | "sms">(channel: C): Promise<(C extends "email" ? EmailProvider : SmsProvider) | (NotConfigured<"messaging_provider"> & {
|
|
444
|
+
channel: C;
|
|
445
|
+
})>;
|
|
432
446
|
/**
|
|
433
447
|
* Configure (or update) the email provider. `config` keys are checked per
|
|
434
448
|
* `transport`; on an update of the same transport, omitted keys — including
|
|
@@ -462,8 +476,8 @@ export declare function messagingResource(request: RequestFn): {
|
|
|
462
476
|
* Atlas's sign-in emails without a verified domain ([Atlas test] subjects, capped).
|
|
463
477
|
*/
|
|
464
478
|
developmentEmail: {
|
|
465
|
-
/**
|
|
466
|
-
get(): Promise<DevelopmentEmail
|
|
479
|
+
/** `{ configured: false }` when the provider is not in development mode. */
|
|
480
|
+
get(): Promise<DevelopmentEmail | NotConfigured<"development_email">>;
|
|
467
481
|
/** Turn development mode on. 409 `DEVELOPMENT_EMAIL_NOT_ALLOWED` on a production instance. */
|
|
468
482
|
enable(body: EnableDevelopmentEmailBody): Promise<DevelopmentEmail>;
|
|
469
483
|
/** Back to standard mode; the provider stays. */
|
|
@@ -476,8 +490,8 @@ export declare function messagingResource(request: RequestFn): {
|
|
|
476
490
|
};
|
|
477
491
|
/** Managed email: Atlas sets your sending domain up on your own Resend or Brevo account. */
|
|
478
492
|
managedEmail: {
|
|
479
|
-
/**
|
|
480
|
-
get(): Promise<ManagedEmail
|
|
493
|
+
/** `{ configured: false }` when none is configured. */
|
|
494
|
+
get(): Promise<ManagedEmail | NotConfigured<"managed_email">>;
|
|
481
495
|
/** Register the sending domain; returns the DNS `records` to publish. */
|
|
482
496
|
create(body: CreateManagedEmailBody): Promise<ManagedEmail>;
|
|
483
497
|
/** Re-check the DNS records now; `verified` is true once email can be sent. */
|
package/dist/client/messaging.js
CHANGED
|
@@ -14,6 +14,10 @@ function messagingResource(request) {
|
|
|
14
14
|
get() {
|
|
15
15
|
return request({ method: 'GET', path: '/v1/messaging_providers' });
|
|
16
16
|
},
|
|
17
|
+
/** One channel's provider, or `{ configured: false, channel }` when none is set. */
|
|
18
|
+
channel(channel) {
|
|
19
|
+
return request({ method: 'GET', path: `/v1/messaging_providers/${channel}` });
|
|
20
|
+
},
|
|
17
21
|
/**
|
|
18
22
|
* Configure (or update) the email provider. `config` keys are checked per
|
|
19
23
|
* `transport`; on an update of the same transport, omitted keys — including
|
|
@@ -45,7 +49,7 @@ function messagingResource(request) {
|
|
|
45
49
|
* Atlas's sign-in emails without a verified domain ([Atlas test] subjects, capped).
|
|
46
50
|
*/
|
|
47
51
|
developmentEmail: {
|
|
48
|
-
/**
|
|
52
|
+
/** `{ configured: false }` when the provider is not in development mode. */
|
|
49
53
|
get() {
|
|
50
54
|
return request({ method: 'GET', path: '/v1/messaging_providers/email/development' });
|
|
51
55
|
},
|
|
@@ -60,7 +64,7 @@ function messagingResource(request) {
|
|
|
60
64
|
},
|
|
61
65
|
/** Managed email: Atlas sets your sending domain up on your own Resend or Brevo account. */
|
|
62
66
|
managedEmail: {
|
|
63
|
-
/**
|
|
67
|
+
/** `{ configured: false }` when none is configured. */
|
|
64
68
|
get() {
|
|
65
69
|
return request({ method: 'GET', path: '/v1/messaging_providers/email/managed' });
|
|
66
70
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/client/messaging.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/client/messaging.ts"],"names":[],"mappings":";;AAoeA,8CA6GC;AAjlBD,uCAAgD;AAoehD,SAAgB,iBAAiB,CAAC,OAAkB;IAIlD,SAAS,QAAQ,CAAC,IAAa;QAC7B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;IAKD,SAAS,MAAM,CAAC,IAAa;QAC3B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC,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,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,uCAAuC,EAAE,CAAC,CAAC;YACnF,CAAC;YACD,yEAAyE;YACzE,MAAM,CAAC,IAA4B;gBACjC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,uCAAuC,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1F,CAAC;YACD,+EAA+E;YAC/E,MAAM;gBACJ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,8CAA8C,EAAE,CAAC,CAAC;YAC3F,CAAC;YACD;;;;eAIG;YACH,MAAM,CAAC,UAA+B,EAAE;gBACtC,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,QAAQ;oBAChB,IAAI,EAAE,uCAAuC;oBAC7C,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACvD,CAAC,CAAC;YACL,CAAC;SACF;QACD,gFAAgF;QAChF,IAAI,CAAC,OAAwB,EAAE,IAAoB;YACjD,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,2BAA2B,IAAA,aAAG,EAAC,OAAO,CAAC,OAAO;gBACpD,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type ProvisioningFields, type ProvisioningInput, type ProvisioningMetadata } from './compliance';
|
|
1
2
|
import { type RequestFn } from './request';
|
|
2
3
|
import type { ListPage } from './types';
|
|
3
|
-
export interface OAuthClient {
|
|
4
|
+
export interface OAuthClient extends ProvisioningFields {
|
|
4
5
|
object: 'oauth_client';
|
|
5
6
|
id: string;
|
|
6
7
|
client_id: string;
|
|
@@ -118,6 +119,13 @@ export interface OAuthClientLogoutFields {
|
|
|
118
119
|
/** Create/rotate reveal the secret exactly once, alongside the client. */
|
|
119
120
|
export interface OAuthClientWithSecret extends OAuthClient {
|
|
120
121
|
client_secret?: string;
|
|
122
|
+
/** With a `secretRecipient`: the client secret sealed to it (then `client_secret` is absent). */
|
|
123
|
+
sealed_client_secret?: string;
|
|
124
|
+
secrets_sealed?: {
|
|
125
|
+
algorithm: string;
|
|
126
|
+
recipient: string;
|
|
127
|
+
fields: string[];
|
|
128
|
+
};
|
|
121
129
|
note: string;
|
|
122
130
|
}
|
|
123
131
|
export interface RotateOAuthClientSecretBody {
|
|
@@ -147,7 +155,7 @@ export interface ClientGrant {
|
|
|
147
155
|
created_at: number;
|
|
148
156
|
updated_at: number;
|
|
149
157
|
}
|
|
150
|
-
export interface CreateOAuthClientBody extends OAuthClientLogoutFields, OAuthClientSubjectFields, OAuthClientTokenFields {
|
|
158
|
+
export interface CreateOAuthClientBody extends ProvisioningInput, OAuthClientLogoutFields, OAuthClientSubjectFields, OAuthClientTokenFields {
|
|
151
159
|
name: string;
|
|
152
160
|
redirect_uris: string[];
|
|
153
161
|
allowed_scopes?: string[];
|
|
@@ -157,8 +165,12 @@ export interface CreateOAuthClientBody extends OAuthClientLogoutFields, OAuthCli
|
|
|
157
165
|
first_party?: boolean;
|
|
158
166
|
/** How long the issued secret authenticates, in seconds; omit for no expiry. */
|
|
159
167
|
secret_expires_in_seconds?: number;
|
|
168
|
+
/** Require PKCE. New clients default to true (confidential ones included); send false to opt out. */
|
|
169
|
+
require_pkce?: boolean;
|
|
160
170
|
}
|
|
161
171
|
export interface UpdateOAuthClientBody extends OAuthClientLogoutFields, OAuthClientSubjectFields, OAuthClientTokenFields {
|
|
172
|
+
/** Replaces the provisioning metadata. */
|
|
173
|
+
metadata?: ProvisioningMetadata;
|
|
162
174
|
name?: string;
|
|
163
175
|
redirect_uris?: string[];
|
|
164
176
|
allowed_scopes?: string[];
|
|
@@ -250,7 +262,10 @@ export declare function oauthClientsResource(request: RequestFn): {
|
|
|
250
262
|
import(body: {
|
|
251
263
|
clients: ImportOAuthClientEntry[];
|
|
252
264
|
}, idempotencyKey?: string): Promise<ListPage<ImportedOAuthClient>>;
|
|
253
|
-
|
|
265
|
+
/** `metadata` filters on provisioning tags (`?metadata[key]=value`). */
|
|
266
|
+
list(params?: {
|
|
267
|
+
metadata?: ProvisioningMetadata;
|
|
268
|
+
}): Promise<ListPage<OAuthClient>>;
|
|
254
269
|
get(id: string): Promise<OAuthClient>;
|
|
255
270
|
create(body: CreateOAuthClientBody, idempotencyKey?: string): Promise<OAuthClientWithSecret>;
|
|
256
271
|
update(id: string, body: UpdateOAuthClientBody): Promise<OAuthClient>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.oauthClientsResource = oauthClientsResource;
|
|
4
|
+
const compliance_1 = require("./compliance");
|
|
4
5
|
const request_1 = require("./request");
|
|
5
6
|
function oauthClientsResource(request) {
|
|
6
7
|
return {
|
|
@@ -8,8 +9,9 @@ function oauthClientsResource(request) {
|
|
|
8
9
|
import(body, idempotencyKey) {
|
|
9
10
|
return request({ method: 'POST', path: '/v1/oauth_clients/import', body, idempotencyKey });
|
|
10
11
|
},
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
/** `metadata` filters on provisioning tags (`?metadata[key]=value`). */
|
|
13
|
+
list(params = {}) {
|
|
14
|
+
return request({ method: 'GET', path: '/v1/oauth_clients', query: (0, compliance_1.metadataQuery)(params.metadata) });
|
|
13
15
|
},
|
|
14
16
|
get(id) {
|
|
15
17
|
return request({ method: 'GET', path: `/v1/oauth_clients/${(0, request_1.enc)(id)}` });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-clients.js","sourceRoot":"","sources":["../../src/client/oauth-clients.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"oauth-clients.js","sourceRoot":"","sources":["../../src/client/oauth-clients.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AA,aAAG,EAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;YACvF,CAAC;YACD,MAAM,CACJ,QAAgB,EAChB,IAAuD;gBAEvD,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,QAAQ,CAAC,SAAS;oBACjD,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;YACD,MAAM,CACJ,QAAgB,EAChB,OAAe;gBAEf,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,QAAQ;oBAChB,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,QAAQ,CAAC,WAAW,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE;iBAClE,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator sign-in (`atlas login`) and token exchange, without a long-lived key.
|
|
3
|
+
*
|
|
4
|
+
* 1. `startOperatorLogin()` runs the RFC 8628 device flow against Atlas's own
|
|
5
|
+
* sign-in (the operator issuer) with the public `atlas-cli` client: show the
|
|
6
|
+
* person `verification_uri_complete` / `user_code`, then
|
|
7
|
+
* 2. `pollOperatorLogin()` until it returns the operator access token, then
|
|
8
|
+
* 3. `exchangeOperatorToken()` swaps it (RFC 8693) for a ONE-HOUR Atlas token
|
|
9
|
+
* bound to one instance (`ins_…`, Backend API) or app/account (`app_…` /
|
|
10
|
+
* `acct_…`, Platform API), with only the scopes you ask for.
|
|
11
|
+
*
|
|
12
|
+
* Root actions (create an app or instance, mint a key) need a multi-factor
|
|
13
|
+
* sign-in within 5 minutes; otherwise the API answers 403 STEP_UP_REQUIRED.
|
|
14
|
+
*/
|
|
15
|
+
export interface OperatorConfiguration {
|
|
16
|
+
issuer: string;
|
|
17
|
+
device_authorization_endpoint: string;
|
|
18
|
+
token_endpoint: string;
|
|
19
|
+
client_id: string;
|
|
20
|
+
scope: string;
|
|
21
|
+
token_exchange_endpoint: string;
|
|
22
|
+
token_exchange_audience: 'atlas';
|
|
23
|
+
root_action_max_mfa_age_seconds: number;
|
|
24
|
+
}
|
|
25
|
+
export interface DeviceAuthorization {
|
|
26
|
+
device_code: string;
|
|
27
|
+
user_code: string;
|
|
28
|
+
verification_uri: string;
|
|
29
|
+
verification_uri_complete: string;
|
|
30
|
+
expires_in: number;
|
|
31
|
+
interval: number;
|
|
32
|
+
}
|
|
33
|
+
export interface OAuthTokenResponse {
|
|
34
|
+
access_token: string;
|
|
35
|
+
token_type: string;
|
|
36
|
+
expires_in: number;
|
|
37
|
+
scope?: string;
|
|
38
|
+
refresh_token?: string;
|
|
39
|
+
id_token?: string;
|
|
40
|
+
issued_token_type?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare class OAuthFlowError extends Error {
|
|
43
|
+
readonly error: string;
|
|
44
|
+
readonly status: number;
|
|
45
|
+
constructor(error: string, message: string, status: number);
|
|
46
|
+
}
|
|
47
|
+
interface Opts {
|
|
48
|
+
apiUrl?: string;
|
|
49
|
+
fetch?: typeof fetch;
|
|
50
|
+
}
|
|
51
|
+
/** GET /v1/operator — where the operator device flow and token exchange live. */
|
|
52
|
+
export declare function operatorConfiguration(opts?: Opts): Promise<OperatorConfiguration>;
|
|
53
|
+
export declare function startOperatorLogin(opts?: Opts & {
|
|
54
|
+
config?: OperatorConfiguration;
|
|
55
|
+
}): Promise<DeviceAuthorization & {
|
|
56
|
+
config: OperatorConfiguration;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Poll until the person approves (resolves the operator token), denies or the
|
|
60
|
+
* code expires (throws). Honours `interval` and `slow_down`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function pollOperatorLogin(start: DeviceAuthorization & {
|
|
63
|
+
config: OperatorConfiguration;
|
|
64
|
+
}, opts?: Opts & {
|
|
65
|
+
sleep?: (ms: number) => Promise<void>;
|
|
66
|
+
signal?: AbortSignal;
|
|
67
|
+
}): Promise<OAuthTokenResponse>;
|
|
68
|
+
/** RFC 8693: swap an operator token for a one-hour, resource-bound Atlas token. */
|
|
69
|
+
export declare function exchangeOperatorToken(subjectToken: string, params: {
|
|
70
|
+
resource: string;
|
|
71
|
+
scope: string | string[];
|
|
72
|
+
}, opts?: Opts): Promise<OAuthTokenResponse & {
|
|
73
|
+
resource: string;
|
|
74
|
+
}>;
|
|
75
|
+
/** client_credentials with a partner link's credentials (a partner calling an instance). */
|
|
76
|
+
export declare function partnerLinkToken(clientId: string, clientSecret: string, opts?: Opts & {
|
|
77
|
+
scope?: string;
|
|
78
|
+
}): Promise<OAuthTokenResponse>;
|
|
79
|
+
/** A key pair for sealed secret delivery; pass `secretRecipient` to the client. */
|
|
80
|
+
export declare function generateSealKeyPair(): {
|
|
81
|
+
publicKey: Uint8Array;
|
|
82
|
+
secretKey: Uint8Array;
|
|
83
|
+
secretRecipient: string;
|
|
84
|
+
};
|
|
85
|
+
/** Open a `sealed_*` field (base64 libsodium sealed box) from an Atlas response. */
|
|
86
|
+
export declare function openSealedSecret(sealedBase64: string, keyPair: {
|
|
87
|
+
publicKey: Uint8Array;
|
|
88
|
+
secretKey: Uint8Array;
|
|
89
|
+
}): string;
|
|
90
|
+
/** POST /v1/keys/revoke_leaked — revoke leaked Atlas credentials (no key needed). */
|
|
91
|
+
export declare function revokeLeakedKeys(secrets: string[], opts?: Opts & {
|
|
92
|
+
url?: string;
|
|
93
|
+
}): Promise<{
|
|
94
|
+
results: Array<{
|
|
95
|
+
index: number;
|
|
96
|
+
kind: string;
|
|
97
|
+
outcome: 'revoked' | 'already_revoked' | 'not_found';
|
|
98
|
+
}>;
|
|
99
|
+
}>;
|
|
100
|
+
export { sealBox, openSealedBox } from './sealed-box';
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openSealedBox = exports.sealBox = exports.OAuthFlowError = void 0;
|
|
4
|
+
exports.operatorConfiguration = operatorConfiguration;
|
|
5
|
+
exports.startOperatorLogin = startOperatorLogin;
|
|
6
|
+
exports.pollOperatorLogin = pollOperatorLogin;
|
|
7
|
+
exports.exchangeOperatorToken = exchangeOperatorToken;
|
|
8
|
+
exports.partnerLinkToken = partnerLinkToken;
|
|
9
|
+
exports.generateSealKeyPair = generateSealKeyPair;
|
|
10
|
+
exports.openSealedSecret = openSealedSecret;
|
|
11
|
+
exports.revokeLeakedKeys = revokeLeakedKeys;
|
|
12
|
+
const sealed_box_1 = require("./sealed-box");
|
|
13
|
+
const toB64 = (b) => btoa(String.fromCharCode(...b));
|
|
14
|
+
const fromB64 = (s) => Uint8Array.from(atob(s), (c) => c.charCodeAt(0));
|
|
15
|
+
class OAuthFlowError extends Error {
|
|
16
|
+
error;
|
|
17
|
+
status;
|
|
18
|
+
constructor(error, message, status) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.error = error;
|
|
21
|
+
this.status = status;
|
|
22
|
+
this.name = 'OAuthFlowError';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.OAuthFlowError = OAuthFlowError;
|
|
26
|
+
const DEFAULT_API = 'https://api.atlasauth.net';
|
|
27
|
+
async function form(fetchImpl, url, body) {
|
|
28
|
+
const res = await fetchImpl(url, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: { 'content-type': 'application/x-www-form-urlencoded', accept: 'application/json' },
|
|
31
|
+
body: new URLSearchParams(body).toString(),
|
|
32
|
+
});
|
|
33
|
+
const json = (await res.json().catch(() => ({})));
|
|
34
|
+
return { ...json, _status: res.status };
|
|
35
|
+
}
|
|
36
|
+
/** GET /v1/operator — where the operator device flow and token exchange live. */
|
|
37
|
+
async function operatorConfiguration(opts = {}) {
|
|
38
|
+
const f = opts.fetch ?? globalThis.fetch;
|
|
39
|
+
const res = await f(`${(opts.apiUrl ?? DEFAULT_API).replace(/\/+$/, '')}/v1/operator`, { headers: { accept: 'application/json' } });
|
|
40
|
+
if (!res.ok)
|
|
41
|
+
throw new OAuthFlowError('not_configured', 'The operator issuer is not configured on this deployment.', res.status);
|
|
42
|
+
return (await res.json());
|
|
43
|
+
}
|
|
44
|
+
async function startOperatorLogin(opts = {}) {
|
|
45
|
+
const config = opts.config ?? (await operatorConfiguration(opts));
|
|
46
|
+
const out = await form(opts.fetch ?? globalThis.fetch, config.device_authorization_endpoint, { client_id: config.client_id, scope: config.scope });
|
|
47
|
+
if (out._status !== 200)
|
|
48
|
+
throw new OAuthFlowError(String(out.error ?? 'error'), String(out.error_description ?? 'Device authorization failed.'), out._status);
|
|
49
|
+
return { ...out, config };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Poll until the person approves (resolves the operator token), denies or the
|
|
53
|
+
* code expires (throws). Honours `interval` and `slow_down`.
|
|
54
|
+
*/
|
|
55
|
+
async function pollOperatorLogin(start, opts = {}) {
|
|
56
|
+
const f = opts.fetch ?? globalThis.fetch;
|
|
57
|
+
const sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
58
|
+
let interval = Math.max(1, start.interval) * 1000;
|
|
59
|
+
const deadline = Date.now() + start.expires_in * 1000;
|
|
60
|
+
while (Date.now() < deadline) {
|
|
61
|
+
if (opts.signal?.aborted)
|
|
62
|
+
throw new OAuthFlowError('aborted', 'Sign-in was cancelled.', 0);
|
|
63
|
+
await sleep(interval);
|
|
64
|
+
const out = await form(f, start.config.token_endpoint, {
|
|
65
|
+
grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
|
|
66
|
+
device_code: start.device_code,
|
|
67
|
+
client_id: start.config.client_id,
|
|
68
|
+
});
|
|
69
|
+
if (out._status === 200)
|
|
70
|
+
return out;
|
|
71
|
+
if (out.error === 'authorization_pending')
|
|
72
|
+
continue;
|
|
73
|
+
if (out.error === 'slow_down') {
|
|
74
|
+
interval += 5000;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
throw new OAuthFlowError(String(out.error ?? 'error'), String(out.error_description ?? 'Sign-in failed.'), out._status);
|
|
78
|
+
}
|
|
79
|
+
throw new OAuthFlowError('expired_token', 'The sign-in code expired. Run the login again.', 400);
|
|
80
|
+
}
|
|
81
|
+
/** RFC 8693: swap an operator token for a one-hour, resource-bound Atlas token. */
|
|
82
|
+
async function exchangeOperatorToken(subjectToken, params, opts = {}) {
|
|
83
|
+
const out = await form(opts.fetch ?? globalThis.fetch, `${(opts.apiUrl ?? DEFAULT_API).replace(/\/+$/, '')}/v1/oauth/token`, {
|
|
84
|
+
grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange',
|
|
85
|
+
subject_token: subjectToken,
|
|
86
|
+
subject_token_type: 'urn:ietf:params:oauth:token-type:access_token',
|
|
87
|
+
audience: 'atlas',
|
|
88
|
+
resource: params.resource,
|
|
89
|
+
scope: Array.isArray(params.scope) ? params.scope.join(' ') : params.scope,
|
|
90
|
+
});
|
|
91
|
+
if (out._status !== 200) {
|
|
92
|
+
const err = out.error ?? (Array.isArray(out.errors) ? out.errors[0].code : 'error');
|
|
93
|
+
const msg = out.error_description ?? (Array.isArray(out.errors) ? out.errors[0].message : 'Token exchange failed.');
|
|
94
|
+
throw new OAuthFlowError(String(err), String(msg), out._status);
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
/** client_credentials with a partner link's credentials (a partner calling an instance). */
|
|
99
|
+
async function partnerLinkToken(clientId, clientSecret, opts = {}) {
|
|
100
|
+
const body = { grant_type: 'client_credentials', client_id: clientId, client_secret: clientSecret };
|
|
101
|
+
if (opts.scope)
|
|
102
|
+
body.scope = opts.scope;
|
|
103
|
+
const out = await form(opts.fetch ?? globalThis.fetch, `${(opts.apiUrl ?? DEFAULT_API).replace(/\/+$/, '')}/v1/oauth/token`, body);
|
|
104
|
+
if (out._status !== 200)
|
|
105
|
+
throw new OAuthFlowError(String(out.error ?? 'error'), String(out.error_description ?? 'Token request failed.'), out._status);
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
/** A key pair for sealed secret delivery; pass `secretRecipient` to the client. */
|
|
109
|
+
function generateSealKeyPair() {
|
|
110
|
+
const pair = (0, sealed_box_1.generateSealKeyPair)();
|
|
111
|
+
return { ...pair, secretRecipient: `x25519:${toB64(pair.publicKey)}` };
|
|
112
|
+
}
|
|
113
|
+
/** Open a `sealed_*` field (base64 libsodium sealed box) from an Atlas response. */
|
|
114
|
+
function openSealedSecret(sealedBase64, keyPair) {
|
|
115
|
+
return new TextDecoder().decode((0, sealed_box_1.openSealedBox)(fromB64(sealedBase64), keyPair.publicKey, keyPair.secretKey));
|
|
116
|
+
}
|
|
117
|
+
/** POST /v1/keys/revoke_leaked — revoke leaked Atlas credentials (no key needed). */
|
|
118
|
+
async function revokeLeakedKeys(secrets, opts = {}) {
|
|
119
|
+
const f = opts.fetch ?? globalThis.fetch;
|
|
120
|
+
const res = await f(`${(opts.apiUrl ?? DEFAULT_API).replace(/\/+$/, '')}/v1/keys/revoke_leaked`, {
|
|
121
|
+
method: 'POST',
|
|
122
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
123
|
+
body: JSON.stringify({ secrets, ...(opts.url ? { url: opts.url } : {}) }),
|
|
124
|
+
});
|
|
125
|
+
if (!res.ok)
|
|
126
|
+
throw new OAuthFlowError('request_failed', `revoke_leaked failed (${res.status}).`, res.status);
|
|
127
|
+
return (await res.json());
|
|
128
|
+
}
|
|
129
|
+
var sealed_box_2 = require("./sealed-box");
|
|
130
|
+
Object.defineProperty(exports, "sealBox", { enumerable: true, get: function () { return sealed_box_2.sealBox; } });
|
|
131
|
+
Object.defineProperty(exports, "openSealedBox", { enumerable: true, get: function () { return sealed_box_2.openSealedBox; } });
|
|
132
|
+
//# sourceMappingURL=operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator.js","sourceRoot":"","sources":["../../src/client/operator.ts"],"names":[],"mappings":";;;AA+EA,sDAKC;AAED,gDAKC;AAMD,8CAyBC;AAGD,sDA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