@atlasauth/backend 0.17.0 → 0.19.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 +40 -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 +409 -0
- package/dist/client/credentials.js +158 -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 +10 -0
- package/dist/client/error.js +4 -0
- package/dist/client/error.js.map +1 -1
- package/dist/client/index.d.ts +382 -7
- package/dist/client/index.js +44 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/instance.d.ts +401 -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 +11 -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 +233 -9
- package/dist/client/platform.js +74 -6
- package/dist/client/platform.js.map +1 -1
- package/dist/client/policies.d.ts +316 -0
- package/dist/client/policies.js +103 -0
- package/dist/client/policies.js.map +1 -0
- 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 +38 -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 +15 -0
- package/dist/client/webhooks.d.ts +244 -11
- package/dist/client/webhooks.js +52 -3
- package/dist/client/webhooks.js.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/oidc.d.ts +65 -1
- package/dist/oidc.js +46 -0
- package/dist/oidc.js.map +1 -1
- package/dist/policy-source.d.ts +104 -0
- package/dist/policy-source.js +99 -0
- package/dist/policy-source.js.map +1 -0
- 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 +41 -6
- package/dist/testing.js +34 -2
- package/dist/testing.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 +6 -3
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusResource = statusResource;
|
|
4
|
+
const request_1 = require("./request");
|
|
5
|
+
function statusResource(request) {
|
|
6
|
+
return {
|
|
7
|
+
/** `GET /v1/status` — the public service status (components with group and regions, open incidents). */
|
|
8
|
+
service() {
|
|
9
|
+
return request({ method: 'GET', path: '/v1/status' });
|
|
10
|
+
},
|
|
11
|
+
/** `GET /v1/instance/status_subscription`. */
|
|
12
|
+
getSubscription() {
|
|
13
|
+
return request({ method: 'GET', path: '/v1/instance/status_subscription' });
|
|
14
|
+
},
|
|
15
|
+
/** `PUT /v1/instance/status_subscription` — create or change it; only the fields sent change. */
|
|
16
|
+
updateSubscription(body) {
|
|
17
|
+
return request({ method: 'PUT', path: '/v1/instance/status_subscription', body });
|
|
18
|
+
},
|
|
19
|
+
/** `DELETE /v1/instance/status_subscription` — turn it off (settings are kept). */
|
|
20
|
+
disableSubscription() {
|
|
21
|
+
return request({ method: 'DELETE', path: '/v1/instance/status_subscription' });
|
|
22
|
+
},
|
|
23
|
+
/** `POST /v1/instance/status_subscription/rotate_feed` — a new private feed URL; the old one 404s. */
|
|
24
|
+
rotateFeed() {
|
|
25
|
+
return request({ method: 'POST', path: '/v1/instance/status_subscription/rotate_feed' });
|
|
26
|
+
},
|
|
27
|
+
/** `GET /v1/instance/status_incidents` — incidents that concern this instance, newest first. */
|
|
28
|
+
listIncidents(params = {}) {
|
|
29
|
+
return request({ method: 'GET', path: '/v1/instance/status_incidents', query: { ...params } });
|
|
30
|
+
},
|
|
31
|
+
/** `GET /v1/instance/status_dependencies` — with `state`, the worst among the enabled ones. */
|
|
32
|
+
listDependencies() {
|
|
33
|
+
return request({ method: 'GET', path: '/v1/instance/status_dependencies' });
|
|
34
|
+
},
|
|
35
|
+
/** `POST /v1/instance/status_dependencies` — read at once; the answer carries the state or `last_error`. */
|
|
36
|
+
createDependency(body) {
|
|
37
|
+
return request({ method: 'POST', path: '/v1/instance/status_dependencies', body });
|
|
38
|
+
},
|
|
39
|
+
getDependency(id) {
|
|
40
|
+
return request({ method: 'GET', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}` });
|
|
41
|
+
},
|
|
42
|
+
updateDependency(id, body) {
|
|
43
|
+
return request({ method: 'PATCH', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}`, body });
|
|
44
|
+
},
|
|
45
|
+
deleteDependency(id) {
|
|
46
|
+
return request({ method: 'DELETE', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}` });
|
|
47
|
+
},
|
|
48
|
+
/** `POST /v1/instance/status_dependencies/:id/refresh` — read the page now. */
|
|
49
|
+
refreshDependency(id) {
|
|
50
|
+
return request({ method: 'POST', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}/refresh` });
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/client/status.ts"],"names":[],"mappings":";;AA8JA,wCAgDC;AA9MD,uCAAgD;AA8JhD,SAAgB,cAAc,CAAC,OAAkB;IAC/C,OAAO;QACL,wGAAwG;QACxG,OAAO;YACL,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,8CAA8C;QAC9C,eAAe;YACb,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kCAAkC,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,iGAAiG;QACjG,kBAAkB,CAAC,IAAkC;YACnD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kCAAkC,EAAE,IAAI,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,mFAAmF;QACnF,mBAAmB;YACjB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,k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OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oCAAoC,IAAA,aAAG,EAAC,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QAClG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/client/users.d.ts
CHANGED
|
@@ -664,6 +664,14 @@ export interface RecordUserConsentBody {
|
|
|
664
664
|
status?: 'accepted' | 'withdrawn';
|
|
665
665
|
source?: string;
|
|
666
666
|
metadata?: Record<string, unknown>;
|
|
667
|
+
/** Policy acceptance evidence: the exact version (must be that version of that policy). */
|
|
668
|
+
policy_version_id?: string;
|
|
669
|
+
/** Must equal the version's `content_sha256` when given. */
|
|
670
|
+
content_sha256?: string;
|
|
671
|
+
display?: 'checkbox' | 'scroll' | 'link';
|
|
672
|
+
scrolled_to_end?: boolean;
|
|
673
|
+
view_ms?: number;
|
|
674
|
+
locale?: string;
|
|
667
675
|
}
|
|
668
676
|
export interface UserConsent {
|
|
669
677
|
object: 'consent';
|
|
@@ -673,6 +681,13 @@ export interface UserConsent {
|
|
|
673
681
|
status: 'accepted' | 'withdrawn' | (string & {});
|
|
674
682
|
source: string | null;
|
|
675
683
|
metadata?: unknown;
|
|
684
|
+
/** Policy acceptance evidence (null on records made outside a policy flow). */
|
|
685
|
+
policy_version_id?: string | null;
|
|
686
|
+
content_sha256?: string | null;
|
|
687
|
+
display?: 'checkbox' | 'scroll' | 'link' | null;
|
|
688
|
+
scrolled_to_end?: boolean | null;
|
|
689
|
+
view_ms?: number | null;
|
|
690
|
+
locale?: string | null;
|
|
676
691
|
created_at: number;
|
|
677
692
|
}
|
|
678
693
|
export interface CreateUserApprovalRequestBody {
|
|
@@ -1,13 +1,98 @@
|
|
|
1
|
+
import { type ProvisioningFields, type ProvisioningInput, type ProvisioningMetadata } from './compliance';
|
|
1
2
|
import { type RequestFn } from './request';
|
|
2
|
-
export
|
|
3
|
+
export type WebhookDestinationType = 'https' | 'aws_eventbridge' | 'gcp_pubsub' | 'cloudflare_queue';
|
|
4
|
+
/** Where deliveries go. Credentials are never returned. */
|
|
5
|
+
export type WebhookDestination = {
|
|
6
|
+
type: 'https';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'aws_eventbridge';
|
|
9
|
+
region: string;
|
|
10
|
+
event_bus_name: string;
|
|
11
|
+
source?: string;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'gcp_pubsub';
|
|
14
|
+
project_id: string;
|
|
15
|
+
topic_id: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'cloudflare_queue';
|
|
18
|
+
account_id: string;
|
|
19
|
+
queue_id: string;
|
|
20
|
+
};
|
|
21
|
+
/** Your own credentials for an event destination (stored encrypted, write-only). */
|
|
22
|
+
export type WebhookDestinationCredentials = {
|
|
23
|
+
access_key_id: string;
|
|
24
|
+
secret_access_key: string;
|
|
25
|
+
session_token?: string;
|
|
26
|
+
} | {
|
|
27
|
+
service_account_json: string | Record<string, unknown>;
|
|
28
|
+
} | {
|
|
29
|
+
api_token: string;
|
|
30
|
+
};
|
|
31
|
+
export interface WebhookLastFailure {
|
|
32
|
+
at: number;
|
|
33
|
+
status: number | null;
|
|
34
|
+
error: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface WebhookAutoDisableRule {
|
|
37
|
+
after_failing_ms: number;
|
|
38
|
+
after_consecutive_failures: number;
|
|
39
|
+
consecutive_failures_min_failing_ms: number;
|
|
40
|
+
description: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WebhookRetention {
|
|
43
|
+
events_days: number;
|
|
44
|
+
delivery_log_days: number;
|
|
45
|
+
replay_window_days: number;
|
|
46
|
+
}
|
|
47
|
+
export interface WebhookEndpoint extends ProvisioningFields {
|
|
3
48
|
object: 'webhook_endpoint';
|
|
4
49
|
id: string;
|
|
50
|
+
/** The HTTPS receiver, or a descriptor such as `aws-eventbridge://us-east-1/default`. */
|
|
5
51
|
url: string;
|
|
52
|
+
description?: string | null;
|
|
6
53
|
enabled_events: string[];
|
|
54
|
+
/** Which names `*` delivers under. */
|
|
55
|
+
event_naming?: 'canonical' | 'legacy';
|
|
7
56
|
active: boolean;
|
|
57
|
+
/** A third-party receiver: preflight does not flag its host. */
|
|
58
|
+
external?: boolean;
|
|
59
|
+
signature_versions?: Array<'v1' | 'v2'>;
|
|
60
|
+
destination?: WebhookDestination & {
|
|
61
|
+
credentials_set?: boolean;
|
|
62
|
+
};
|
|
63
|
+
health?: 'healthy' | 'failing' | 'disabled';
|
|
8
64
|
/** Start of the current failure streak (epoch ms), or null when the last delivery succeeded. */
|
|
9
65
|
failing_since?: number | null;
|
|
66
|
+
/** Start of the streak that preceded the last re-enable (epoch ms); what `since: 'failing_since'` resolves to once the live streak is cleared. */
|
|
67
|
+
last_failing_since?: number | null;
|
|
10
68
|
disabled_at: number | null;
|
|
69
|
+
last_success_at?: number | null;
|
|
70
|
+
last_failure?: WebhookLastFailure | null;
|
|
71
|
+
consecutive_failures?: number;
|
|
72
|
+
/** Share of attempts in the last 24 hours that succeeded (0–1), null with none. */
|
|
73
|
+
success_rate_24h?: number | null;
|
|
74
|
+
attempts_24h?: {
|
|
75
|
+
succeeded: number;
|
|
76
|
+
failed: number;
|
|
77
|
+
};
|
|
78
|
+
/** Who is emailed when it fails; null = the account's owners. */
|
|
79
|
+
alert_contacts?: string[] | null;
|
|
80
|
+
alerts_sent?: {
|
|
81
|
+
first_sent_at: number | null;
|
|
82
|
+
second_sent_at: number | null;
|
|
83
|
+
disabled_sent_at: number | null;
|
|
84
|
+
};
|
|
85
|
+
auto_disable?: WebhookAutoDisableRule;
|
|
86
|
+
/** On an update that re-enabled the endpoint: the replay that re-sends what it missed. */
|
|
87
|
+
replay?: {
|
|
88
|
+
since: number;
|
|
89
|
+
method: 'POST';
|
|
90
|
+
path: string;
|
|
91
|
+
note: string;
|
|
92
|
+
} | null;
|
|
93
|
+
/** On create / upsert: whether this call created it. */
|
|
94
|
+
created?: boolean;
|
|
95
|
+
updated_at?: number;
|
|
11
96
|
/**
|
|
12
97
|
* While a secret rotation overlap is open: when the previous secret stops
|
|
13
98
|
* signing deliveries (epoch ms). Until then every delivery carries two
|
|
@@ -24,8 +109,9 @@ export interface WebhookDelivery {
|
|
|
24
109
|
object: 'webhook_delivery';
|
|
25
110
|
id: string;
|
|
26
111
|
event_id: string;
|
|
27
|
-
/** The event
|
|
112
|
+
/** The name the event was delivered as, or null once the event has passed its retention. */
|
|
28
113
|
event_type?: string | null;
|
|
114
|
+
latency_ms?: number | null;
|
|
29
115
|
attempt_number: number;
|
|
30
116
|
max_attempts?: number;
|
|
31
117
|
/** The payload that was sent (null once the event has passed its retention). */
|
|
@@ -45,16 +131,95 @@ export interface WebhookDelivery {
|
|
|
45
131
|
delivered_at: number | null;
|
|
46
132
|
created_at: number;
|
|
47
133
|
}
|
|
48
|
-
export interface
|
|
49
|
-
|
|
50
|
-
/** Each entry is `"*"` or a known event name. */
|
|
134
|
+
export interface WebhookEndpointSettings {
|
|
135
|
+
/** Each entry is `"*"` or an event name (canonical or a deprecated spelling). */
|
|
51
136
|
enabled_events?: string[];
|
|
137
|
+
event_naming?: 'canonical' | 'legacy';
|
|
138
|
+
external?: boolean;
|
|
139
|
+
signature_versions?: Array<'v1' | 'v2'>;
|
|
140
|
+
/** Up to 20 addresses; null = the account's owners. */
|
|
141
|
+
alert_contacts?: string[] | null;
|
|
142
|
+
description?: string | null;
|
|
143
|
+
/** An event destination instead of an HTTPS url. */
|
|
144
|
+
destination?: WebhookDestination;
|
|
145
|
+
destination_credentials?: WebhookDestinationCredentials;
|
|
146
|
+
}
|
|
147
|
+
export interface CreateWebhookEndpointBody extends WebhookEndpointSettings, ProvisioningInput {
|
|
148
|
+
/** Required unless `destination` is an event destination. */
|
|
149
|
+
url?: string;
|
|
52
150
|
}
|
|
53
151
|
/** Change an endpoint in place. The signing secret is kept. */
|
|
54
|
-
export interface UpdateWebhookEndpointBody {
|
|
152
|
+
export interface UpdateWebhookEndpointBody extends WebhookEndpointSettings {
|
|
55
153
|
url?: string;
|
|
56
|
-
enabled_events?: string[];
|
|
57
154
|
active?: boolean;
|
|
155
|
+
/** Replaces the provisioning metadata. */
|
|
156
|
+
metadata?: ProvisioningMetadata;
|
|
157
|
+
}
|
|
158
|
+
/** Find-or-create by url. */
|
|
159
|
+
export interface UpsertWebhookEndpointBody extends WebhookEndpointSettings {
|
|
160
|
+
url: string;
|
|
161
|
+
}
|
|
162
|
+
/** The inline result of `test(id, { wait })`. */
|
|
163
|
+
export interface WebhookTestResult {
|
|
164
|
+
object: 'webhook_test_result';
|
|
165
|
+
delivery_id: string;
|
|
166
|
+
event_id: string;
|
|
167
|
+
status: 'success' | 'failed';
|
|
168
|
+
http_status: number | null;
|
|
169
|
+
latency_ms: number | null;
|
|
170
|
+
response_snippet: string | null;
|
|
171
|
+
error: string | null;
|
|
172
|
+
signature_header_sent: string | null;
|
|
173
|
+
will_retry: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface WebhookWindow {
|
|
176
|
+
/** Epoch ms or ISO 8601 (at most 90 days ago), or the keyword `'failing_since'` for the endpoint's own failure streak. */
|
|
177
|
+
since?: number | string;
|
|
178
|
+
until?: number | string;
|
|
179
|
+
}
|
|
180
|
+
export interface WebhookBulkResult {
|
|
181
|
+
object: 'webhook_redelivery' | 'webhook_replay';
|
|
182
|
+
endpoint_id: string;
|
|
183
|
+
queued: number;
|
|
184
|
+
events_considered?: number;
|
|
185
|
+
has_more: boolean;
|
|
186
|
+
/** Pass as `since` to continue. */
|
|
187
|
+
next_since: number | null;
|
|
188
|
+
retention: WebhookRetention;
|
|
189
|
+
}
|
|
190
|
+
export interface EgressIps {
|
|
191
|
+
object: 'egress_ips';
|
|
192
|
+
/** false: this deployment does not send from fixed addresses. */
|
|
193
|
+
static: boolean;
|
|
194
|
+
ipv4: string[];
|
|
195
|
+
ipv6: string[];
|
|
196
|
+
applies_to: string[];
|
|
197
|
+
note: string;
|
|
198
|
+
}
|
|
199
|
+
export type DeliveryTargetKind = 'webhook_endpoint' | 'referral_connection' | 'backchannel_receiver' | 'integration';
|
|
200
|
+
export interface DeliveryHealth {
|
|
201
|
+
object: 'delivery_health';
|
|
202
|
+
kind: DeliveryTargetKind;
|
|
203
|
+
target_id: string;
|
|
204
|
+
url: string | null;
|
|
205
|
+
label: string | null;
|
|
206
|
+
state: 'healthy' | 'failing' | 'disabled';
|
|
207
|
+
failing_since: number | null;
|
|
208
|
+
disabled_at: number | null;
|
|
209
|
+
last_success_at: number | null;
|
|
210
|
+
last_failure: WebhookLastFailure | null;
|
|
211
|
+
consecutive_failures: number;
|
|
212
|
+
success_rate_24h: number | null;
|
|
213
|
+
attempts_24h: {
|
|
214
|
+
succeeded: number;
|
|
215
|
+
failed: number;
|
|
216
|
+
};
|
|
217
|
+
alert_contacts: string[] | null;
|
|
218
|
+
alerts: {
|
|
219
|
+
first_sent_at: number | null;
|
|
220
|
+
second_sent_at: number | null;
|
|
221
|
+
disabled_sent_at: number | null;
|
|
222
|
+
};
|
|
58
223
|
}
|
|
59
224
|
/** One subscribable event, described. */
|
|
60
225
|
export interface WebhookEventCatalogEntry {
|
|
@@ -62,8 +227,18 @@ export interface WebhookEventCatalogEntry {
|
|
|
62
227
|
description: string;
|
|
63
228
|
/** Who should act on it, e.g. `rp_sessions`, `rp_accounts`, `dsar`. Empty: no relying party needs it. */
|
|
64
229
|
relevant_for: string[];
|
|
65
|
-
/** Set on a
|
|
230
|
+
/** Set on a deprecated spelling: subscribe to this canonical event instead. */
|
|
66
231
|
deprecated_alias_of?: string;
|
|
232
|
+
/** `rename`: sent whenever the canonical event is; `companion`: only for some occurrences. */
|
|
233
|
+
alias_kind?: 'rename' | 'companion';
|
|
234
|
+
deprecated_at?: string;
|
|
235
|
+
/** After this the deprecated spelling is no longer sent (ISO 8601). */
|
|
236
|
+
sunset_at?: string;
|
|
237
|
+
/** JSON pointer to this event's payload schema in the OpenAPI document (`components.schemas.WebhookEvent.<name>`). */
|
|
238
|
+
payload_schema?: string;
|
|
239
|
+
version?: number;
|
|
240
|
+
/** When the event became available (YYYY-MM-DD). */
|
|
241
|
+
since?: string;
|
|
67
242
|
}
|
|
68
243
|
/** The endpoint list plus the delivery settings that apply to every endpoint. */
|
|
69
244
|
export interface WebhookEndpointList {
|
|
@@ -81,6 +256,15 @@ export interface WebhookEndpointList {
|
|
|
81
256
|
retry_schedule_ms?: number[];
|
|
82
257
|
/** Delivery attempts per event before it is marked failed. */
|
|
83
258
|
max_attempts?: number;
|
|
259
|
+
auto_disable?: WebhookAutoDisableRule;
|
|
260
|
+
retention?: WebhookRetention;
|
|
261
|
+
signature_versions?: string[];
|
|
262
|
+
destination_types?: Array<{
|
|
263
|
+
type: WebhookDestinationType;
|
|
264
|
+
name: string;
|
|
265
|
+
config: string[];
|
|
266
|
+
credentials: string[];
|
|
267
|
+
}>;
|
|
84
268
|
}
|
|
85
269
|
export interface WebhookSigningSecret {
|
|
86
270
|
object: 'webhook_secret';
|
|
@@ -110,12 +294,33 @@ export interface WebhookDeliveryQueued {
|
|
|
110
294
|
note: string;
|
|
111
295
|
}
|
|
112
296
|
export interface ListWebhookDeliveriesParams {
|
|
113
|
-
/** How many deliveries to return (1–
|
|
297
|
+
/** How many deliveries to return (1–1000, default 50). */
|
|
114
298
|
limit?: number;
|
|
299
|
+
starting_after?: string;
|
|
300
|
+
status?: 'pending' | 'success' | 'failed';
|
|
301
|
+
/** Comma-separated event names. */
|
|
302
|
+
event_type?: string;
|
|
303
|
+
/** Epoch ms or ISO 8601. */
|
|
304
|
+
since?: number | string;
|
|
305
|
+
until?: number | string;
|
|
115
306
|
}
|
|
116
307
|
export declare function webhooksResource(request: RequestFn): {
|
|
117
308
|
endpoints: {
|
|
118
|
-
|
|
309
|
+
/** `includeDeprecated` adds the deprecated event spellings to the catalogue. */
|
|
310
|
+
/** `metadata` filters on provisioning tags (`?metadata[key]=value`). */
|
|
311
|
+
list(opts?: {
|
|
312
|
+
includeDeprecated?: boolean;
|
|
313
|
+
metadata?: ProvisioningMetadata;
|
|
314
|
+
}): Promise<WebhookEndpointList>;
|
|
315
|
+
get(id: string): Promise<WebhookEndpoint>;
|
|
316
|
+
/**
|
|
317
|
+
* Find-or-create by url: updates the endpoint with this url to `body`, or
|
|
318
|
+
* creates it (then `secret` is in the result, once). Safe to run on every deploy.
|
|
319
|
+
*/
|
|
320
|
+
upsertByUrl(body: UpsertWebhookEndpointBody, idempotencyKey?: string): Promise<WebhookEndpoint & {
|
|
321
|
+
secret?: string;
|
|
322
|
+
created: boolean;
|
|
323
|
+
}>;
|
|
119
324
|
/** Update url, enabled_events or active. The signing secret is kept. */
|
|
120
325
|
update(id: string, body: UpdateWebhookEndpointBody): Promise<WebhookEndpoint>;
|
|
121
326
|
/** Show the current signing secret again. Audited. */
|
|
@@ -126,8 +331,23 @@ export declare function webhooksResource(request: RequestFn): {
|
|
|
126
331
|
* every delivery is signed with both, so a verifier holding either passes.
|
|
127
332
|
*/
|
|
128
333
|
rotateSecret(id: string, body?: RotateWebhookSecretBody): Promise<WebhookSigningSecret>;
|
|
129
|
-
/** Send a synthetic `webhook.test` event to this endpoint only. */
|
|
334
|
+
/** Send a synthetic `webhook.test` event to this endpoint only (queued for the worker). */
|
|
130
335
|
test(id: string): Promise<WebhookDeliveryQueued>;
|
|
336
|
+
/**
|
|
337
|
+
* Send `webhook.test` now and return the result: status, HTTP status,
|
|
338
|
+
* latency, response snippet, error and the signature header sent.
|
|
339
|
+
* `wait` is at most 10 s (`'10s'`, `'5000ms'`).
|
|
340
|
+
*/
|
|
341
|
+
testNow(id: string, wait?: string): Promise<WebhookTestResult>;
|
|
342
|
+
/** Bulk redeliver every event whose latest attempt in the window has `status` (default failed). */
|
|
343
|
+
redeliverWindow(id: string, body?: WebhookWindow & {
|
|
344
|
+
status?: "failed" | "success";
|
|
345
|
+
}, idempotencyKey?: string): Promise<WebhookBulkResult>;
|
|
346
|
+
/** Re-send everything since `since` the endpoint subscribes to and has not received. */
|
|
347
|
+
replay(id: string, body: WebhookWindow & {
|
|
348
|
+
since: number | string;
|
|
349
|
+
event_type?: string;
|
|
350
|
+
}, idempotencyKey?: string): Promise<WebhookBulkResult>;
|
|
131
351
|
/** Redeliver a past event as a fresh attempt (409 once past its retention). */
|
|
132
352
|
redeliver(id: string, deliveryId: string): Promise<WebhookDeliveryQueued>;
|
|
133
353
|
create(body: CreateWebhookEndpointBody, idempotencyKey?: string): Promise<WebhookEndpointWithSecret>;
|
|
@@ -143,6 +363,19 @@ export declare function webhooksResource(request: RequestFn): {
|
|
|
143
363
|
has_more: boolean;
|
|
144
364
|
next_cursor?: string | null;
|
|
145
365
|
}>;
|
|
366
|
+
/** The addresses deliveries leave from (public). */
|
|
367
|
+
egressIps(): Promise<EgressIps>;
|
|
368
|
+
/** Delivery health of every outbound target (webhooks, referral connection, back-channel receivers, integrations). */
|
|
369
|
+
health(params?: {
|
|
370
|
+
kind?: DeliveryTargetKind;
|
|
371
|
+
state?: "unhealthy" | "all";
|
|
372
|
+
}): Promise<{
|
|
373
|
+
data: DeliveryHealth[];
|
|
374
|
+
has_more: boolean;
|
|
375
|
+
unhealthy_count: number;
|
|
376
|
+
}>;
|
|
377
|
+
/** Set who is emailed when a target fails (null = the account's owners). */
|
|
378
|
+
setAlertContacts(kind: DeliveryTargetKind, targetId: string, alertContacts: string[] | null): Promise<DeliveryHealth>;
|
|
146
379
|
/** Redeliver a past event (same as `endpoints.redeliver`). */
|
|
147
380
|
redeliver(endpointId: string, deliveryId: string): Promise<WebhookDeliveryQueued>;
|
|
148
381
|
};
|
package/dist/client/webhooks.js
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.webhooksResource = webhooksResource;
|
|
4
|
+
const compliance_1 = require("./compliance");
|
|
4
5
|
const request_1 = require("./request");
|
|
5
6
|
function webhooksResource(request) {
|
|
6
7
|
return {
|
|
7
8
|
endpoints: {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/** `includeDeprecated` adds the deprecated event spellings to the catalogue. */
|
|
10
|
+
/** `metadata` filters on provisioning tags (`?metadata[key]=value`). */
|
|
11
|
+
list(opts = {}) {
|
|
12
|
+
return request({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
path: '/v1/webhook_endpoints',
|
|
15
|
+
query: { ...(opts.includeDeprecated ? { include_deprecated: 'true' } : {}), ...(0, compliance_1.metadataQuery)(opts.metadata) },
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
get(id) {
|
|
19
|
+
return request({ method: 'GET', path: `/v1/webhook_endpoints/${(0, request_1.enc)(id)}` });
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* Find-or-create by url: updates the endpoint with this url to `body`, or
|
|
23
|
+
* creates it (then `secret` is in the result, once). Safe to run on every deploy.
|
|
24
|
+
*/
|
|
25
|
+
upsertByUrl(body, idempotencyKey) {
|
|
26
|
+
return request({ method: 'PUT', path: '/v1/webhook_endpoints/by_url', body, idempotencyKey });
|
|
10
27
|
},
|
|
11
28
|
/** Update url, enabled_events or active. The signing secret is kept. */
|
|
12
29
|
update(id, body) {
|
|
@@ -24,10 +41,26 @@ function webhooksResource(request) {
|
|
|
24
41
|
rotateSecret(id, body) {
|
|
25
42
|
return request({ method: 'POST', path: `/v1/webhook_endpoints/${(0, request_1.enc)(id)}/rotate_secret`, body });
|
|
26
43
|
},
|
|
27
|
-
/** Send a synthetic `webhook.test` event to this endpoint only. */
|
|
44
|
+
/** Send a synthetic `webhook.test` event to this endpoint only (queued for the worker). */
|
|
28
45
|
test(id) {
|
|
29
46
|
return request({ method: 'POST', path: `/v1/webhook_endpoints/${(0, request_1.enc)(id)}/test` });
|
|
30
47
|
},
|
|
48
|
+
/**
|
|
49
|
+
* Send `webhook.test` now and return the result: status, HTTP status,
|
|
50
|
+
* latency, response snippet, error and the signature header sent.
|
|
51
|
+
* `wait` is at most 10 s (`'10s'`, `'5000ms'`).
|
|
52
|
+
*/
|
|
53
|
+
testNow(id, wait = '10s') {
|
|
54
|
+
return request({ method: 'POST', path: `/v1/webhook_endpoints/${(0, request_1.enc)(id)}/test`, query: { wait } });
|
|
55
|
+
},
|
|
56
|
+
/** Bulk redeliver every event whose latest attempt in the window has `status` (default failed). */
|
|
57
|
+
redeliverWindow(id, body = {}, idempotencyKey) {
|
|
58
|
+
return request({ method: 'POST', path: `/v1/webhook_endpoints/${(0, request_1.enc)(id)}/redeliver`, body, idempotencyKey });
|
|
59
|
+
},
|
|
60
|
+
/** Re-send everything since `since` the endpoint subscribes to and has not received. */
|
|
61
|
+
replay(id, body, idempotencyKey) {
|
|
62
|
+
return request({ method: 'POST', path: `/v1/webhook_endpoints/${(0, request_1.enc)(id)}/replay`, body, idempotencyKey });
|
|
63
|
+
},
|
|
31
64
|
/** Redeliver a past event as a fresh attempt (409 once past its retention). */
|
|
32
65
|
redeliver(id, deliveryId) {
|
|
33
66
|
return request({
|
|
@@ -50,6 +83,22 @@ function webhooksResource(request) {
|
|
|
50
83
|
query: { ...params },
|
|
51
84
|
});
|
|
52
85
|
},
|
|
86
|
+
/** The addresses deliveries leave from (public). */
|
|
87
|
+
egressIps() {
|
|
88
|
+
return request({ method: 'GET', path: '/v1/meta/egress_ips' });
|
|
89
|
+
},
|
|
90
|
+
/** Delivery health of every outbound target (webhooks, referral connection, back-channel receivers, integrations). */
|
|
91
|
+
health(params = {}) {
|
|
92
|
+
return request({ method: 'GET', path: '/v1/delivery_health', query: { ...params } });
|
|
93
|
+
},
|
|
94
|
+
/** Set who is emailed when a target fails (null = the account's owners). */
|
|
95
|
+
setAlertContacts(kind, targetId, alertContacts) {
|
|
96
|
+
return request({
|
|
97
|
+
method: 'PUT',
|
|
98
|
+
path: `/v1/delivery_health/${(0, request_1.enc)(kind)}/${(0, request_1.enc)(targetId)}/alert_contacts`,
|
|
99
|
+
body: { alert_contacts: alertContacts },
|
|
100
|
+
});
|
|
101
|
+
},
|
|
53
102
|
/** Redeliver a past event (same as `endpoints.redeliver`). */
|
|
54
103
|
redeliver(endpointId, deliveryId) {
|
|
55
104
|
return request({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/client/webhooks.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/client/webhooks.ts"],"names":[],"mappings":";;AAkSA,4CA+HC;AAjaD,6CAAyH;AACzH,uCAAgD;AAiShD,SAAgB,gBAAgB,CAAC,OAAkB;IACjD,OAAO;QACL,SAAS,EAAE;YACT,gFAAgF;YAChF,wEAAwE;YACxE,IAAI,CAAC,OAAyE,EAAE;gBAC9E,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,uBAAuB;oBAC7B,KAAK,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAA,0BAAa,EAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;iBAC9G,CAAC,CAAC;YACL,CAAC;YACD,GAAG,CAAC,EAAU;gBACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9E,CAAC;YACD;;;eAGG;YACH,WAAW,CACT,IAA+B,EAC/B,cAAuB;gBAEvB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;YAChG,CAAC;YACD,wEAAwE;YACxE,MAAM,CAAC,EAAU,EAAE,IAA+B;gBAChD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;YACtF,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AE,aAA8B;YACzF,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,uBAAuB,IAAA,aAAG,EAAC,IAAI,CAAC,IAAI,IAAA,aAAG,EAAC,QAAQ,CAAC,iBAAiB;gBACxE,IAAI,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE;aACxC,CAAC,CAAC;QACL,CAAC;QACD,8DAA8D;QAC9D,SAAS,CAAC,UAAkB,EAAE,UAAkB;YAC9C,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,yBAAyB,IAAA,aAAG,EAAC,UAAU,CAAC,eAAe,IAAA,aAAG,EAAC,UAAU,CAAC,YAAY;aACzF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,18 +8,21 @@ export { BETTER_AUTH_JWT_ALGS, peekIssuer } from './legacy-issuers';
|
|
|
8
8
|
export type { LegacyIssuer } from './legacy-issuers';
|
|
9
9
|
export { BACKCHANNEL_LOGOUT_EVENT, LOGOUT_TOKEN_CLOCK_SKEW_SECONDS, LOGOUT_TOKEN_MAX_AGE_SECONDS, LogoutTokenVerifier, memoryLogoutReplayStore, verifyLogoutToken, } from './logout-token';
|
|
10
10
|
export type { LogoutReplayStore, LogoutTokenCheckOptions, LogoutTokenClaims, LogoutTokenResult, LogoutTokenVerifierOptions, } from './logout-token';
|
|
11
|
-
export {
|
|
12
|
-
export type {
|
|
11
|
+
export { expressBackchannelLogout, fastifyBackchannelLogout, fastifyBackchannelLogoutPlugin, fetchBackchannelLogout, handleBackchannelLogout, nextBackchannelLogout, readLogoutToken, } from './backchannel-handlers';
|
|
12
|
+
export type { BackchannelLogoutOptions, BackchannelLogoutResponse } from './backchannel-handlers';
|
|
13
|
+
export { AtlasOidcError, OIDC_FLOW_COOKIE, OIDC_FLOW_MAX_AGE_SECONDS, oidc, oidcCallback, oidcClearCookie, oidcLogoutUrl, oidcStart, oidcVerifyIdToken, oidcOrganizationOf, oidcOrganizationsOf, oidcSsoOf, resetOidcCaches, } from './oidc';
|
|
14
|
+
export type { AtlasIdTokenClaims, AtlasOidc, AtlasOidcErrorCode, OidcOrganization, OidcOrganizationMembership, OidcSsoContext, OidcCallbackOptions, OidcClientAuth, OidcIdentity, OidcLogoutUrlOptions, OidcStartOptions, OidcStartResult, VerifyIdTokenOptions, } from './oidc';
|
|
13
15
|
export * from './webhooks';
|
|
14
16
|
export * from './referrals';
|
|
17
|
+
export * from './policy-source';
|
|
15
18
|
export * from './botid';
|
|
16
19
|
export { createAtlasClient } from './client';
|
|
17
20
|
export type { AtlasClient } from './client';
|
|
18
21
|
export * from './client';
|
|
19
|
-
export { createTestIssuer, TEST_TOKEN_TAMPERS } from './testing';
|
|
20
|
-
export type { TestIssuer, CreateTestIssuerOptions, MintIdTokenOptions, TestAuthorizeOptions, TestAuthorizeResult, TestTokenTamper, } from './testing';
|
|
21
|
-
export { signAtlasReferralCall,
|
|
22
|
-
export type { AtlasReferralCallOptions,
|
|
22
|
+
export { createTestIssuer, TEST_TOKEN_TAMPERS, testTenantClaims } from './testing';
|
|
23
|
+
export type { TestIssuer, TestTenantContext, CreateTestIssuerOptions, MintIdTokenOptions, TestAuthorizeOptions, TestAuthorizeResult, TestTokenTamper, } from './testing';
|
|
24
|
+
export { signAtlasReferralCall, signReferalliCall, signReferralUpdatedEvent, referalliSignature, referalliSignatureV2, referralEmailHash, REFERALLI_API_VERSION, } from './referral-test-calls';
|
|
25
|
+
export type { AtlasReferralCallOptions, ReferalliCallOptions, ReferalliCallOp, ReferralUpdatedEvent, ReferralUpdatedEventOptions, SignedReferralCall, } from './referral-test-calls';
|
|
23
26
|
export { verifyPCActn } from './pca/verify';
|
|
24
27
|
export type { PcaVerdict, PcaContext, VerifyPCActnOptions } from './pca/verify';
|
|
25
28
|
export { requirePCA, defaultExtract, memoryPcaStore } from './pca/require-pca';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.buildWwwAuthenticate = exports.DPOP_PROOF_MAX_AGE_SECONDS = exports.ACCESS_TOKEN_CLOCK_SKEW_SECONDS = exports.memoryPcaStore = exports.defaultExtract = exports.requirePCA = exports.verifyPCActn = exports.REFERALLI_API_VERSION = exports.referralEmailHash = exports.referalliSignatureV2 = exports.referalliSignature = exports.signReferralUpdatedEvent = exports.signReferalliCall = exports.signAtlasReferralCall = exports.testTenantClaims = exports.TEST_TOKEN_TAMPERS = exports.createTestIssuer = exports.createAtlasClient = exports.resetOidcCaches = exports.oidcSsoOf = exports.oidcOrganizationsOf = exports.oidcOrganizationOf = exports.oidcVerifyIdToken = exports.oidcStart = exports.oidcLogoutUrl = exports.oidcClearCookie = exports.oidcCallback = exports.oidc = exports.OIDC_FLOW_MAX_AGE_SECONDS = exports.OIDC_FLOW_COOKIE = exports.AtlasOidcError = exports.readLogoutToken = exports.nextBackchannelLogout = exports.handleBackchannelLogout = exports.fetchBackchannelLogout = exports.fastifyBackchannelLogoutPlugin = exports.fastifyBackchannelLogout = exports.expressBackchannelLogout = exports.verifyLogoutToken = exports.memoryLogoutReplayStore = exports.LogoutTokenVerifier = exports.LOGOUT_TOKEN_MAX_AGE_SECONDS = exports.LOGOUT_TOKEN_CLOCK_SKEW_SECONDS = exports.BACKCHANNEL_LOGOUT_EVENT = exports.peekIssuer = exports.BETTER_AUTH_JWT_ALGS = exports.instanceIdFromPublishableKey = exports.discoveryUrlFor = exports.JwksDiscovery = exports.DiscoveryError = void 0;
|
|
18
|
+
exports.verifyAccessToken = exports.protectedResourceMetadataPath = exports.protectedResourceMetadata = exports.memoryDpopReplayStore = exports.memoryDpopNonceSource = exports.hmacDpopNonceSource = exports.createIntrospector = exports.createAccessTokenVerifier = void 0;
|
|
18
19
|
// §7.3 token verification — the original surface, unchanged.
|
|
19
20
|
__exportStar(require("./jwks-cache"), exports);
|
|
20
21
|
// OIDC discovery of the JWKS URL when only `issuer` is configured.
|
|
@@ -39,6 +40,15 @@ Object.defineProperty(exports, "LOGOUT_TOKEN_MAX_AGE_SECONDS", { enumerable: tru
|
|
|
39
40
|
Object.defineProperty(exports, "LogoutTokenVerifier", { enumerable: true, get: function () { return logout_token_1.LogoutTokenVerifier; } });
|
|
40
41
|
Object.defineProperty(exports, "memoryLogoutReplayStore", { enumerable: true, get: function () { return logout_token_1.memoryLogoutReplayStore; } });
|
|
41
42
|
Object.defineProperty(exports, "verifyLogoutToken", { enumerable: true, get: function () { return logout_token_1.verifyLogoutToken; } });
|
|
43
|
+
// Ready-made back-channel logout receivers: Express, Fastify, Next.js / Fetch.
|
|
44
|
+
var backchannel_handlers_1 = require("./backchannel-handlers");
|
|
45
|
+
Object.defineProperty(exports, "expressBackchannelLogout", { enumerable: true, get: function () { return backchannel_handlers_1.expressBackchannelLogout; } });
|
|
46
|
+
Object.defineProperty(exports, "fastifyBackchannelLogout", { enumerable: true, get: function () { return backchannel_handlers_1.fastifyBackchannelLogout; } });
|
|
47
|
+
Object.defineProperty(exports, "fastifyBackchannelLogoutPlugin", { enumerable: true, get: function () { return backchannel_handlers_1.fastifyBackchannelLogoutPlugin; } });
|
|
48
|
+
Object.defineProperty(exports, "fetchBackchannelLogout", { enumerable: true, get: function () { return backchannel_handlers_1.fetchBackchannelLogout; } });
|
|
49
|
+
Object.defineProperty(exports, "handleBackchannelLogout", { enumerable: true, get: function () { return backchannel_handlers_1.handleBackchannelLogout; } });
|
|
50
|
+
Object.defineProperty(exports, "nextBackchannelLogout", { enumerable: true, get: function () { return backchannel_handlers_1.nextBackchannelLogout; } });
|
|
51
|
+
Object.defineProperty(exports, "readLogoutToken", { enumerable: true, get: function () { return backchannel_handlers_1.readLogoutToken; } });
|
|
42
52
|
// Server-side OIDC relying party for the hosted-redirect integration:
|
|
43
53
|
// state + nonce + PKCE flow cookie, code exchange, RS256-pinned ID-token checks.
|
|
44
54
|
var oidc_1 = require("./oidc");
|
|
@@ -51,11 +61,15 @@ Object.defineProperty(exports, "oidcClearCookie", { enumerable: true, get: funct
|
|
|
51
61
|
Object.defineProperty(exports, "oidcLogoutUrl", { enumerable: true, get: function () { return oidc_1.oidcLogoutUrl; } });
|
|
52
62
|
Object.defineProperty(exports, "oidcStart", { enumerable: true, get: function () { return oidc_1.oidcStart; } });
|
|
53
63
|
Object.defineProperty(exports, "oidcVerifyIdToken", { enumerable: true, get: function () { return oidc_1.oidcVerifyIdToken; } });
|
|
64
|
+
Object.defineProperty(exports, "oidcOrganizationOf", { enumerable: true, get: function () { return oidc_1.oidcOrganizationOf; } });
|
|
65
|
+
Object.defineProperty(exports, "oidcOrganizationsOf", { enumerable: true, get: function () { return oidc_1.oidcOrganizationsOf; } });
|
|
66
|
+
Object.defineProperty(exports, "oidcSsoOf", { enumerable: true, get: function () { return oidc_1.oidcSsoOf; } });
|
|
54
67
|
Object.defineProperty(exports, "resetOidcCaches", { enumerable: true, get: function () { return oidc_1.resetOidcCaches; } });
|
|
55
68
|
// §12.2 inbound webhook verification for consumers.
|
|
56
69
|
__exportStar(require("./webhooks"), exports);
|
|
57
70
|
// The Atlas referral protocol, for a referral platform receiving Atlas's signed calls.
|
|
58
71
|
__exportStar(require("./referrals"), exports);
|
|
72
|
+
__exportStar(require("./policy-source"), exports);
|
|
59
73
|
// Vercel BotID: sign checkBotId() verdicts on your Vercel route for Atlas's captcha gate.
|
|
60
74
|
__exportStar(require("./botid"), exports);
|
|
61
75
|
// The typed management client for the secret-key Backend API.
|
|
@@ -68,13 +82,15 @@ __exportStar(require("./client"), exports);
|
|
|
68
82
|
var testing_1 = require("./testing");
|
|
69
83
|
Object.defineProperty(exports, "createTestIssuer", { enumerable: true, get: function () { return testing_1.createTestIssuer; } });
|
|
70
84
|
Object.defineProperty(exports, "TEST_TOKEN_TAMPERS", { enumerable: true, get: function () { return testing_1.TEST_TOKEN_TAMPERS; } });
|
|
85
|
+
Object.defineProperty(exports, "testTenantClaims", { enumerable: true, get: function () { return testing_1.testTenantClaims; } });
|
|
71
86
|
var referral_test_calls_1 = require("./referral-test-calls");
|
|
72
87
|
Object.defineProperty(exports, "signAtlasReferralCall", { enumerable: true, get: function () { return referral_test_calls_1.signAtlasReferralCall; } });
|
|
73
|
-
Object.defineProperty(exports, "
|
|
88
|
+
Object.defineProperty(exports, "signReferalliCall", { enumerable: true, get: function () { return referral_test_calls_1.signReferalliCall; } });
|
|
74
89
|
Object.defineProperty(exports, "signReferralUpdatedEvent", { enumerable: true, get: function () { return referral_test_calls_1.signReferralUpdatedEvent; } });
|
|
75
|
-
Object.defineProperty(exports, "
|
|
90
|
+
Object.defineProperty(exports, "referalliSignature", { enumerable: true, get: function () { return referral_test_calls_1.referalliSignature; } });
|
|
91
|
+
Object.defineProperty(exports, "referalliSignatureV2", { enumerable: true, get: function () { return referral_test_calls_1.referalliSignatureV2; } });
|
|
76
92
|
Object.defineProperty(exports, "referralEmailHash", { enumerable: true, get: function () { return referral_test_calls_1.referralEmailHash; } });
|
|
77
|
-
Object.defineProperty(exports, "
|
|
93
|
+
Object.defineProperty(exports, "REFERALLI_API_VERSION", { enumerable: true, get: function () { return referral_test_calls_1.REFERALLI_API_VERSION; } });
|
|
78
94
|
// Proof-Carrying Authority (agentic auth): offline verifier + framework-agnostic guard,
|
|
79
95
|
// beside the session-token verifier above.
|
|
80
96
|
var verify_1 = require("./pca/verify");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,6DAA6D;AAC7D,+CAA6B;AAC7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