@atlasauth/backend 0.25.0 → 0.26.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 +32 -1
- package/dist/client/abac.d.ts +389 -0
- package/dist/client/abac.js +98 -0
- package/dist/client/abac.js.map +1 -1
- package/dist/client/analytics-reports.d.ts +1 -1
- package/dist/client/authz-decisions.d.ts +108 -0
- package/dist/client/authz-decisions.js +40 -0
- package/dist/client/authz-decisions.js.map +1 -0
- package/dist/client/connections.d.ts +507 -0
- package/dist/client/connections.js +164 -0
- package/dist/client/connections.js.map +1 -0
- package/dist/client/custom-oauth-providers.d.ts +15 -0
- package/dist/client/custom-oauth-providers.js.map +1 -1
- package/dist/client/desktop-mfa.d.ts +104 -0
- package/dist/client/desktop-mfa.js +44 -0
- package/dist/client/desktop-mfa.js.map +1 -0
- package/dist/client/email-templates.d.ts +1 -1
- package/dist/client/email-templates.js.map +1 -1
- package/dist/client/fga.d.ts +125 -4
- package/dist/client/fga.js +40 -0
- package/dist/client/fga.js.map +1 -1
- package/dist/client/iga.d.ts +436 -0
- package/dist/client/iga.js +82 -0
- package/dist/client/iga.js.map +1 -0
- package/dist/client/index.d.ts +490 -2
- package/dist/client/index.js +23 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/least-privilege.d.ts +95 -0
- package/dist/client/least-privilege.js +28 -0
- package/dist/client/least-privilege.js.map +1 -0
- package/dist/client/managed-grants.d.ts +52 -0
- package/dist/client/managed-grants.js +28 -0
- package/dist/client/managed-grants.js.map +1 -0
- package/dist/client/mcp-gateways.d.ts +72 -0
- package/dist/client/mcp-gateways.js +22 -0
- package/dist/client/mcp-gateways.js.map +1 -1
- package/dist/client/oauth-clients.d.ts +4 -0
- package/dist/client/oauth-clients.js.map +1 -1
- package/dist/client/openfga.d.ts +90 -3
- package/dist/client/openfga.js +27 -1
- package/dist/client/openfga.js.map +1 -1
- package/dist/client/policy-bundles.d.ts +105 -0
- package/dist/client/policy-bundles.js +38 -0
- package/dist/client/policy-bundles.js.map +1 -0
- package/dist/client/resources.d.ts +1 -0
- package/dist/client/resources.js.map +1 -1
- package/dist/client/ssf.d.ts +2 -1
- package/dist/client/ssf.js.map +1 -1
- package/dist/client/vc.d.ts +8 -0
- package/dist/client/vc.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/policy-bundle.d.ts +110 -0
- package/dist/policy-bundle.js +289 -0
- package/dist/policy-bundle.js.map +1 -0
- package/dist/uma.d.ts +77 -0
- package/dist/uma.js +95 -0
- package/dist/uma.js.map +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
# @atlasauth/backend changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.26.0 — 2026-10-27
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `iga` client resource: identity governance (access catalog, access requests and approvals, grants, delegations, separation-of-duties rules, joiner/mover/leaver lifecycle, certification campaigns).
|
|
8
|
+
- `desktopMfa` client resource: the desktop login MFA policy, enrolment codes and enrolled devices (`getPolicy`, `updatePolicy`, `createEnrolmentCode`, `listDevices`, `getDevice`, `revokeDevice`, `revokeOfflineCache`, `deleteDevice`).
|
|
9
|
+
- `managedGrants` client resource (`list`, `get`, `narrow`, `revoke`): the OpenID Grant Management grants each OAuth client holds for each user.
|
|
10
|
+
- `leastPrivilege` client resource (`report`, `get`, `exportCsv`, and applying the narrower grants with a `dryRun` preview): what each secret key, OAuth client, MCP gateway and agent holds against what it used.
|
|
11
|
+
- `mcpGateways` gains `abac` (policy checks on every tool call) and `budgets` (`list`, `create`, `get`, `update`, `delete`, `usage`).
|
|
12
|
+
- `fga.settings.get` / `fga.settings.update`: the instance's FGA result-cache lifetime, default consistency mode and tuple change-log retention.
|
|
13
|
+
|
|
14
|
+
- `connections.token` now caches per client until shortly before `expires_at` and takes `minTtlSeconds`; new `connections.refreshToken` (force-refresh after a provider 401, with `staleAccessToken`), `connections.tokens` (batch read of up to 100), `connections.importConnections` and `connections.exportConnections` (sealed to your public key); `connections.delete(id, { revoke: true })`. `Connection` gains `refresh_failures`, `next_refresh_at` and a typed `last_error` with the provider's code and HTTP status.
|
|
15
|
+
- `connections.revoke` returns `provider_revoked`, `provider_status`, `provider_error` and `local_cleared`.
|
|
16
|
+
- Webhook event types `connection.refresh_failed`, `connection.reauthorization_required`, `connection.revoked`, `connection.scopes_changed`, `connection.recovered`.
|
|
17
|
+
- Connections: `setCredentials`, `rotateCredentials`, `secretVersions`, `secret` (scope `connections:secret_read`), `oauth1Sign`, `webhooks.verify` and `webhooks.*Endpoint`; `token()` takes `subject` for delegated tokens; `Connection` reports `secret_expires_at`, `previous_valid_until` and `allowed_methods`.
|
|
18
|
+
- `connections` client resource: `create`, `list`, `get`, `update` (including `owner` to transfer), `delete`, `connect`, `revoke`, `token` (needs the `connections:token` scope) and `oauthClients` (`set`, `list`, `get`, `delete`), with `host_params`, `environment` and the captured token fields typed.
|
|
19
|
+
- ABAC data filtering: `abac.partialEvaluate` (the policies as a filter over an unknown resource or principal, with relationship conditions resolved and optional SQL or Prisma output) and `abac.accessibleResources` (the resources a principal may act on, paged). The filter helpers `evalFilter`, `filterToSql`, `filterToPrisma` and `filterToDrizzle` are exported.
|
|
20
|
+
- AuthZEN 1.0 search: `abac.authzenSearchSubject`, `authzenSearchResource` and `authzenSearchAction`.
|
|
21
|
+
- ABAC authoring: `abac.templates`, `abac.links`, `abac.schema` (`get`, `set`, `delete`, `validate`), `abac.diff` and `abac.diffSources`; `abac.test` results carry `coverage`.
|
|
22
|
+
- `fga.listObjects` and the resource-role `accessible` call take `limit` and `starting_after`; `listObjects` returns `has_more` and `next_cursor`.
|
|
23
|
+
- `authzDecisions` client resource (`list`, `iterate`, `get`, `stats`, `settings.get/update`): the authorization decision log and its capture settings.
|
|
24
|
+
- `policyBundles` client resource (`export`, `list`, `current`, `get`, `verify`, `import` with `dry_run` / `prune`) and `verifyPolicyBundle`, which verifies a signed policy bundle offline against your instance JWKS and returns its policies and FGA models.
|
|
25
|
+
- `fga.listUsers` / `fga.listAllUsers` and `openfga.listUsers` / `openfga.listAllUsers`: who has a relation on an object (users, usersets, the `type:*` wildcard with `excluded_users`), paged.
|
|
26
|
+
- `fga.readChanges` and `openfga.readChanges`: the tuple change log, resumable with `continuation_token`.
|
|
27
|
+
- Tuple conditions: `condition` on tuple keys and `context` on `check`, `batchCheck` items, `listObjects` and `listUsers`.
|
|
28
|
+
- `consistency` / `consistency_token` on queries; writes and queries return a `consistency_token`.
|
|
29
|
+
- Desktop login MFA passkeys: `DesktopPasskey` and the policy fields `passkey_scope`, `passkey_rp_id` and `passkey_require_uv`.
|
|
30
|
+
- Connections: `token_family` on connections and `split_tenants` on connect, so one grant covering several accounts (Xero organisations) becomes one connection per account sharing one token set.
|
|
31
|
+
- Custom OAuth providers: `revocation_endpoint`, `host_params_schema` and `data_only` (connect-time host templates for data-only providers).
|
|
32
|
+
- OAuth clients: `claims_redirect_uris` for UMA 2.0 claims gathering.
|
|
33
|
+
- Shared Signals receivers: the `sync_posture` action records device posture without touching sessions.
|
|
34
|
+
- Verifiable credentials: mdoc issuer revocation checks (`revocation_policy`: off, best_effort or required).
|
|
4
35
|
|
|
5
36
|
## 0.25.0 — 2026-10-26
|
|
6
37
|
|
package/dist/client/abac.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RequestFn } from './request';
|
|
2
2
|
import type { ListPage } from './types';
|
|
3
|
+
import type { Filter, SqlColumn, SqlDialect } from '@atlasauth/authz';
|
|
3
4
|
export interface AbacPolicyTestCase {
|
|
4
5
|
name: string;
|
|
5
6
|
/** principal, action, resource, context and optional entities. */
|
|
@@ -64,6 +65,38 @@ export interface AbacDecision {
|
|
|
64
65
|
reasons: string[];
|
|
65
66
|
errors: string[];
|
|
66
67
|
}
|
|
68
|
+
export interface AbacCoverageClause {
|
|
69
|
+
kind: 'when' | 'unless';
|
|
70
|
+
index: number;
|
|
71
|
+
line: number | null;
|
|
72
|
+
true: number;
|
|
73
|
+
false: number;
|
|
74
|
+
error: number;
|
|
75
|
+
}
|
|
76
|
+
/** Which rules and `when`/`unless` clauses the test cases exercised. */
|
|
77
|
+
export interface AbacCoverage {
|
|
78
|
+
object: 'abac_coverage';
|
|
79
|
+
tests: number;
|
|
80
|
+
rules: Array<{
|
|
81
|
+
rule: number;
|
|
82
|
+
effect: 'permit' | 'forbid';
|
|
83
|
+
line: number | null;
|
|
84
|
+
in_scope: number;
|
|
85
|
+
matched: number;
|
|
86
|
+
status: 'covered' | 'partial' | 'untouched';
|
|
87
|
+
clauses: AbacCoverageClause[];
|
|
88
|
+
}>;
|
|
89
|
+
summary: {
|
|
90
|
+
rules: number;
|
|
91
|
+
reached: number;
|
|
92
|
+
matched: number;
|
|
93
|
+
clauses: number;
|
|
94
|
+
clauses_both_ways: number;
|
|
95
|
+
percent: number;
|
|
96
|
+
};
|
|
97
|
+
/** What to add a test for, one sentence each. */
|
|
98
|
+
gaps: string[];
|
|
99
|
+
}
|
|
67
100
|
export interface AbacTestRun {
|
|
68
101
|
object: 'abac_policy_test_run';
|
|
69
102
|
passed: boolean;
|
|
@@ -73,6 +106,169 @@ export interface AbacTestRun {
|
|
|
73
106
|
actual: 'allow' | 'deny';
|
|
74
107
|
passed: boolean;
|
|
75
108
|
}>;
|
|
109
|
+
coverage: AbacCoverage;
|
|
110
|
+
}
|
|
111
|
+
export interface AbacEntityRef {
|
|
112
|
+
type: string;
|
|
113
|
+
id: string;
|
|
114
|
+
}
|
|
115
|
+
/** A policy template: source with `?principal` / `?resource` slots, filled by links. */
|
|
116
|
+
export interface AbacPolicyTemplate {
|
|
117
|
+
object: 'abac_policy_template';
|
|
118
|
+
id: string;
|
|
119
|
+
name: string;
|
|
120
|
+
description: string | null;
|
|
121
|
+
source: string;
|
|
122
|
+
version: number;
|
|
123
|
+
slots: Array<'?principal' | '?resource'>;
|
|
124
|
+
fga_store_id: string | null;
|
|
125
|
+
link_count: number;
|
|
126
|
+
/** On an update that changed `source`: the links that now evaluate the new source. */
|
|
127
|
+
links_updated?: number;
|
|
128
|
+
created_at: number;
|
|
129
|
+
updated_at: number;
|
|
130
|
+
}
|
|
131
|
+
export interface CreateAbacTemplateBody {
|
|
132
|
+
name: string;
|
|
133
|
+
source: string;
|
|
134
|
+
description?: string | null;
|
|
135
|
+
fga_store_id?: string | null;
|
|
136
|
+
}
|
|
137
|
+
export interface AbacPolicyLink {
|
|
138
|
+
object: 'abac_policy_link';
|
|
139
|
+
id: string;
|
|
140
|
+
name: string;
|
|
141
|
+
template_id: string;
|
|
142
|
+
template_name: string | null;
|
|
143
|
+
/** The template version the link follows (always the latest). */
|
|
144
|
+
template_version: number | null;
|
|
145
|
+
principal: AbacEntityRef | null;
|
|
146
|
+
resource: AbacEntityRef | null;
|
|
147
|
+
enabled: boolean;
|
|
148
|
+
/** The policy source the link evaluates: the template with its slots filled. */
|
|
149
|
+
source: string;
|
|
150
|
+
created_at: number;
|
|
151
|
+
updated_at: number;
|
|
152
|
+
}
|
|
153
|
+
export interface CreateAbacLinkBody {
|
|
154
|
+
template_id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
principal?: AbacEntityRef | null;
|
|
157
|
+
resource?: AbacEntityRef | null;
|
|
158
|
+
enabled?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export type AbacSchemaType = {
|
|
161
|
+
type: 'boolean' | 'long' | 'string';
|
|
162
|
+
} | {
|
|
163
|
+
type: 'set';
|
|
164
|
+
element: AbacSchemaType;
|
|
165
|
+
} | {
|
|
166
|
+
type: 'entity';
|
|
167
|
+
name: string;
|
|
168
|
+
} | {
|
|
169
|
+
type: 'record';
|
|
170
|
+
attributes: Record<string, AbacSchemaType & {
|
|
171
|
+
required?: boolean;
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
/** The entity schema policies are type-checked against when saved. */
|
|
175
|
+
export interface AbacSchemaDocument {
|
|
176
|
+
entity_types: Record<string, {
|
|
177
|
+
attributes?: Record<string, AbacSchemaType & {
|
|
178
|
+
required?: boolean;
|
|
179
|
+
}>;
|
|
180
|
+
member_of?: string[];
|
|
181
|
+
}>;
|
|
182
|
+
actions?: Record<string, {
|
|
183
|
+
applies_to?: {
|
|
184
|
+
principal_types: string[];
|
|
185
|
+
resource_types: string[];
|
|
186
|
+
context?: Record<string, AbacSchemaType & {
|
|
187
|
+
required?: boolean;
|
|
188
|
+
}>;
|
|
189
|
+
};
|
|
190
|
+
member_of?: string[];
|
|
191
|
+
}>;
|
|
192
|
+
}
|
|
193
|
+
export interface AbacPolicyIssue {
|
|
194
|
+
severity: 'error' | 'warning';
|
|
195
|
+
/** 1-based position of the policy in the source (0 for a syntax error). */
|
|
196
|
+
policy: number;
|
|
197
|
+
rule: 'permit' | 'forbid';
|
|
198
|
+
clause?: {
|
|
199
|
+
kind: 'when' | 'unless';
|
|
200
|
+
index: number;
|
|
201
|
+
};
|
|
202
|
+
message: string;
|
|
203
|
+
offset?: number;
|
|
204
|
+
line?: number;
|
|
205
|
+
column?: number;
|
|
206
|
+
source_name?: string;
|
|
207
|
+
}
|
|
208
|
+
export interface AbacSchemaState {
|
|
209
|
+
object: 'abac_schema';
|
|
210
|
+
schema: AbacSchemaDocument | null;
|
|
211
|
+
version: number;
|
|
212
|
+
updated_at: number | null;
|
|
213
|
+
/** On a save: the errors the schema would give the policies and links already stored. */
|
|
214
|
+
policy_issues?: AbacPolicyIssue[];
|
|
215
|
+
}
|
|
216
|
+
export interface AbacValidation {
|
|
217
|
+
object: 'abac_validation';
|
|
218
|
+
valid: boolean;
|
|
219
|
+
schema_checked: boolean;
|
|
220
|
+
issues: AbacPolicyIssue[];
|
|
221
|
+
}
|
|
222
|
+
export interface AbacDiffChange {
|
|
223
|
+
request: Record<string, unknown>;
|
|
224
|
+
before: 'allow' | 'deny';
|
|
225
|
+
after: 'allow' | 'deny';
|
|
226
|
+
/** Present when a version uses `fga.check`: the assumption the change holds under. */
|
|
227
|
+
assuming?: {
|
|
228
|
+
fga_check: boolean;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
export interface AbacPolicyDiff {
|
|
232
|
+
object: 'abac_policy_diff';
|
|
233
|
+
policy_id?: string;
|
|
234
|
+
from?: number;
|
|
235
|
+
to?: number;
|
|
236
|
+
text: {
|
|
237
|
+
identical: boolean;
|
|
238
|
+
added: number;
|
|
239
|
+
removed: number;
|
|
240
|
+
lines: Array<{
|
|
241
|
+
type: 'context' | 'add' | 'remove';
|
|
242
|
+
text: string;
|
|
243
|
+
before_line?: number;
|
|
244
|
+
after_line?: number;
|
|
245
|
+
}>;
|
|
246
|
+
};
|
|
247
|
+
/** The requests whose decision changes; null when `semantic` was false. */
|
|
248
|
+
semantic: {
|
|
249
|
+
enumerated: number;
|
|
250
|
+
space: number;
|
|
251
|
+
exhaustive: boolean;
|
|
252
|
+
changed: number;
|
|
253
|
+
newly_allowed: number;
|
|
254
|
+
newly_denied: number;
|
|
255
|
+
by_action: Record<string, {
|
|
256
|
+
newly_allowed: number;
|
|
257
|
+
newly_denied: number;
|
|
258
|
+
}>;
|
|
259
|
+
changes: AbacDiffChange[];
|
|
260
|
+
truncated: boolean;
|
|
261
|
+
} | null;
|
|
262
|
+
}
|
|
263
|
+
export interface AbacDiffOptions {
|
|
264
|
+
from?: number;
|
|
265
|
+
to?: number;
|
|
266
|
+
/** false returns only the text diff. */
|
|
267
|
+
semantic?: boolean;
|
|
268
|
+
/** Requests to compare; the space is sampled beyond this. Default 5000. */
|
|
269
|
+
max_requests?: number;
|
|
270
|
+
/** Changed requests to list. Default 50. */
|
|
271
|
+
max_changes?: number;
|
|
76
272
|
}
|
|
77
273
|
export interface AuthzenEvaluation {
|
|
78
274
|
subject?: {
|
|
@@ -91,6 +287,111 @@ export interface AuthzenEvaluation {
|
|
|
91
287
|
};
|
|
92
288
|
context?: Record<string, unknown>;
|
|
93
289
|
}
|
|
290
|
+
/** An entity for partial evaluation: an unknown one needs only its `type`. */
|
|
291
|
+
export interface AbacPartialEntity {
|
|
292
|
+
type: string;
|
|
293
|
+
id?: string;
|
|
294
|
+
attributes?: Record<string, unknown>;
|
|
295
|
+
parents?: string[];
|
|
296
|
+
}
|
|
297
|
+
export interface AbacPartialBody {
|
|
298
|
+
principal: AbacPartialEntity;
|
|
299
|
+
action: string;
|
|
300
|
+
resource: AbacPartialEntity;
|
|
301
|
+
context?: Record<string, unknown>;
|
|
302
|
+
entities?: AbacEntity[];
|
|
303
|
+
policy_ids?: string[];
|
|
304
|
+
/** Which entity's attributes are unknown. Default `['resource']`. */
|
|
305
|
+
unknowns?: Array<'principal' | 'resource'>;
|
|
306
|
+
/** Replace relationship (`fga.check`) conditions with the ids the FGA store returns. Default true. */
|
|
307
|
+
resolve_relations?: boolean;
|
|
308
|
+
/** Ask for a ready-made query: parameterised SQL (field-to-column map) and/or a Prisma where object. */
|
|
309
|
+
output?: {
|
|
310
|
+
sql?: {
|
|
311
|
+
columns: Record<string, SqlColumn>;
|
|
312
|
+
dialect?: SqlDialect;
|
|
313
|
+
param_offset?: number;
|
|
314
|
+
};
|
|
315
|
+
prisma?: {
|
|
316
|
+
fields: Record<string, string>;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
export interface AbacResidual {
|
|
321
|
+
object: 'abac_residual';
|
|
322
|
+
/** `allow` / `deny` when the filter is constant, else `conditional`. */
|
|
323
|
+
decision: 'allow' | 'deny' | 'conditional';
|
|
324
|
+
/** The condition on the unknown entity under which the request is allowed. */
|
|
325
|
+
filter: Filter;
|
|
326
|
+
permit: Filter;
|
|
327
|
+
forbid: Filter;
|
|
328
|
+
unknowns: Array<'principal' | 'resource'>;
|
|
329
|
+
relations_resolved: boolean;
|
|
330
|
+
sql?: {
|
|
331
|
+
text: string;
|
|
332
|
+
params: unknown[];
|
|
333
|
+
};
|
|
334
|
+
prisma?: Record<string, unknown>;
|
|
335
|
+
}
|
|
336
|
+
export interface AbacAccessibleBody {
|
|
337
|
+
principal: AbacPartialEntity;
|
|
338
|
+
action: string;
|
|
339
|
+
/** The Atlas resource type key; policies see its PascalCase form. */
|
|
340
|
+
resource_type: string;
|
|
341
|
+
context?: Record<string, unknown>;
|
|
342
|
+
entities?: AbacEntity[];
|
|
343
|
+
/** Resources to filter instead of the Atlas ones. */
|
|
344
|
+
candidates?: Array<{
|
|
345
|
+
id: string;
|
|
346
|
+
attributes?: Record<string, unknown>;
|
|
347
|
+
parents?: string[];
|
|
348
|
+
}>;
|
|
349
|
+
policy_ids?: string[];
|
|
350
|
+
limit?: number;
|
|
351
|
+
starting_after?: string;
|
|
352
|
+
}
|
|
353
|
+
export interface AbacAccessibleList {
|
|
354
|
+
object: 'list';
|
|
355
|
+
data: Array<{
|
|
356
|
+
object: 'abac_resource';
|
|
357
|
+
type: string;
|
|
358
|
+
id: string;
|
|
359
|
+
}>;
|
|
360
|
+
has_more: boolean;
|
|
361
|
+
next_cursor: string | null;
|
|
362
|
+
total: number;
|
|
363
|
+
evaluated: number;
|
|
364
|
+
/** `residual` when one filter was applied to every candidate; `per_resource` when each had to be evaluated. */
|
|
365
|
+
method: 'residual' | 'per_resource';
|
|
366
|
+
}
|
|
367
|
+
/** AuthZEN 1.0 search request: leave the `id` out of the entity you are looking for. */
|
|
368
|
+
export interface AuthzenSearchRequest {
|
|
369
|
+
subject?: {
|
|
370
|
+
type: string;
|
|
371
|
+
id?: string;
|
|
372
|
+
properties?: Record<string, unknown>;
|
|
373
|
+
};
|
|
374
|
+
resource?: {
|
|
375
|
+
type: string;
|
|
376
|
+
id?: string;
|
|
377
|
+
properties?: Record<string, unknown>;
|
|
378
|
+
};
|
|
379
|
+
action?: {
|
|
380
|
+
name: string;
|
|
381
|
+
properties?: Record<string, unknown>;
|
|
382
|
+
};
|
|
383
|
+
context?: Record<string, unknown>;
|
|
384
|
+
page?: {
|
|
385
|
+
limit?: number;
|
|
386
|
+
token?: string;
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
export interface AuthzenSearchPage {
|
|
390
|
+
/** Empty on the last page. */
|
|
391
|
+
next_token: string;
|
|
392
|
+
count: number;
|
|
393
|
+
total: number;
|
|
394
|
+
}
|
|
94
395
|
/** ABAC policies and the policy decision point (including the AuthZEN endpoints). */
|
|
95
396
|
export declare function abacResource(request: RequestFn): {
|
|
96
397
|
list(): Promise<ListPage<AbacPolicy>>;
|
|
@@ -111,6 +412,93 @@ export declare function abacResource(request: RequestFn): {
|
|
|
111
412
|
}): Promise<AbacTestRun>;
|
|
112
413
|
/** May `principal` perform `action` on `resource`? */
|
|
113
414
|
evaluate(body: AbacEvaluateBody): Promise<AbacDecision>;
|
|
415
|
+
/**
|
|
416
|
+
* Partial evaluation (data filtering): the condition under which the request is allowed when
|
|
417
|
+
* an entity is unknown, as a filter AST and, on request, parameterised SQL or a Prisma object.
|
|
418
|
+
*/
|
|
419
|
+
partialEvaluate(body: AbacPartialBody): Promise<AbacResidual>;
|
|
420
|
+
/** The resources of a type a principal may perform an action on, one page at a time. */
|
|
421
|
+
accessibleResources(body: AbacAccessibleBody): Promise<AbacAccessibleList>;
|
|
422
|
+
/** Policy templates: policy source with `?principal` / `?resource` slots that links fill with entities. */
|
|
423
|
+
templates: {
|
|
424
|
+
list(): Promise<ListPage<AbacPolicyTemplate>>;
|
|
425
|
+
get(id: string): Promise<AbacPolicyTemplate>;
|
|
426
|
+
create(body: CreateAbacTemplateBody, idempotencyKey?: string): Promise<AbacPolicyTemplate>;
|
|
427
|
+
/** A new `source` reaches every link at once; it is refused if a link could no longer be filled in or would fail the schema. */
|
|
428
|
+
update(id: string, body: Partial<CreateAbacTemplateBody>): Promise<AbacPolicyTemplate>;
|
|
429
|
+
/** A template with links is refused unless `force` (which deletes the links too). */
|
|
430
|
+
delete(id: string, opts?: {
|
|
431
|
+
force?: boolean;
|
|
432
|
+
}): Promise<{
|
|
433
|
+
object: "abac_policy_template";
|
|
434
|
+
id: string;
|
|
435
|
+
deleted: true;
|
|
436
|
+
links_deleted: number;
|
|
437
|
+
}>;
|
|
438
|
+
};
|
|
439
|
+
/** Links: a template with its slots filled by entities. A link is evaluated from the template's current source. */
|
|
440
|
+
links: {
|
|
441
|
+
list(query?: {
|
|
442
|
+
template_id?: string;
|
|
443
|
+
}): Promise<ListPage<AbacPolicyLink>>;
|
|
444
|
+
get(id: string): Promise<AbacPolicyLink>;
|
|
445
|
+
create(body: CreateAbacLinkBody, idempotencyKey?: string): Promise<AbacPolicyLink>;
|
|
446
|
+
update(id: string, body: Partial<Omit<CreateAbacLinkBody, "template_id">>): Promise<AbacPolicyLink>;
|
|
447
|
+
delete(id: string): Promise<{
|
|
448
|
+
object: "abac_policy_link";
|
|
449
|
+
id: string;
|
|
450
|
+
deleted: true;
|
|
451
|
+
}>;
|
|
452
|
+
};
|
|
453
|
+
/** The entity schema: once set, policies and templates are type-checked when saved. */
|
|
454
|
+
schema: {
|
|
455
|
+
get(): Promise<AbacSchemaState>;
|
|
456
|
+
/** Saves the schema and reports the errors it would give the policies already stored (`policy_issues`). */
|
|
457
|
+
set(schema: AbacSchemaDocument): Promise<AbacSchemaState>;
|
|
458
|
+
delete(): Promise<{
|
|
459
|
+
object: "abac_schema";
|
|
460
|
+
deleted: true;
|
|
461
|
+
}>;
|
|
462
|
+
/** Type-check draft source against the saved schema (or `schema`) without saving anything. */
|
|
463
|
+
validate(body: {
|
|
464
|
+
source: string;
|
|
465
|
+
schema?: AbacSchemaDocument;
|
|
466
|
+
template?: boolean;
|
|
467
|
+
}): Promise<AbacValidation>;
|
|
468
|
+
};
|
|
469
|
+
/** Compare two versions of a policy: the text, and the requests whose decision changes. */
|
|
470
|
+
diff(id: string, opts?: AbacDiffOptions): Promise<AbacPolicyDiff>;
|
|
471
|
+
/** The same comparison for two sources you send, without saving. */
|
|
472
|
+
diffSources(body: {
|
|
473
|
+
before: string;
|
|
474
|
+
after: string;
|
|
475
|
+
semantic?: boolean;
|
|
476
|
+
max_requests?: number;
|
|
477
|
+
max_changes?: number;
|
|
478
|
+
}): Promise<AbacPolicyDiff>;
|
|
479
|
+
/** AuthZEN 1.0 Subject Search: the subjects of a type that may perform the action on the resource. */
|
|
480
|
+
authzenSearchSubject(body: AuthzenSearchRequest): Promise<{
|
|
481
|
+
results: Array<{
|
|
482
|
+
type: string;
|
|
483
|
+
id: string;
|
|
484
|
+
}>;
|
|
485
|
+
page: AuthzenSearchPage;
|
|
486
|
+
}>;
|
|
487
|
+
/** AuthZEN 1.0 Resource Search: the resources of a type the subject may perform the action on. */
|
|
488
|
+
authzenSearchResource(body: AuthzenSearchRequest): Promise<{
|
|
489
|
+
results: Array<{
|
|
490
|
+
type: string;
|
|
491
|
+
id: string;
|
|
492
|
+
}>;
|
|
493
|
+
page: AuthzenSearchPage;
|
|
494
|
+
}>;
|
|
495
|
+
/** AuthZEN 1.0 Action Search: the actions the subject may perform on the resource. */
|
|
496
|
+
authzenSearchAction(body: AuthzenSearchRequest): Promise<{
|
|
497
|
+
results: Array<{
|
|
498
|
+
name: string;
|
|
499
|
+
}>;
|
|
500
|
+
page: AuthzenSearchPage;
|
|
501
|
+
}>;
|
|
114
502
|
/** Convenience: the boolean answer to {@link evaluate}. */
|
|
115
503
|
isAllowed(body: AbacEvaluateBody): Promise<boolean>;
|
|
116
504
|
/** AuthZEN 1.0 Access Evaluation. */
|
|
@@ -130,3 +518,4 @@ export declare function abacResource(request: RequestFn): {
|
|
|
130
518
|
}>;
|
|
131
519
|
}>;
|
|
132
520
|
};
|
|
521
|
+
export { FilterCompileError, evalFilter, filterToDrizzle, filterToPrisma, filterToSql, type DrizzleOps, type DrizzleOptions, type Filter, type FilterRows, type PrismaOptions, type SqlColumn, type SqlDialect, type SqlFragment, type SqlOptions, } from '@atlasauth/authz';
|
package/dist/client/abac.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterToSql = exports.filterToPrisma = exports.filterToDrizzle = exports.evalFilter = exports.FilterCompileError = void 0;
|
|
3
4
|
exports.abacResource = abacResource;
|
|
4
5
|
const request_1 = require("./request");
|
|
5
6
|
/** ABAC policies and the policy decision point (including the AuthZEN endpoints). */
|
|
@@ -31,6 +32,96 @@ function abacResource(request) {
|
|
|
31
32
|
evaluate(body) {
|
|
32
33
|
return request({ method: 'POST', path: '/v1/abac/evaluate', body });
|
|
33
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* Partial evaluation (data filtering): the condition under which the request is allowed when
|
|
37
|
+
* an entity is unknown, as a filter AST and, on request, parameterised SQL or a Prisma object.
|
|
38
|
+
*/
|
|
39
|
+
partialEvaluate(body) {
|
|
40
|
+
return request({ method: 'POST', path: '/v1/abac/partial_evaluate', body });
|
|
41
|
+
},
|
|
42
|
+
/** The resources of a type a principal may perform an action on, one page at a time. */
|
|
43
|
+
accessibleResources(body) {
|
|
44
|
+
return request({ method: 'POST', path: '/v1/abac/accessible_resources', body });
|
|
45
|
+
},
|
|
46
|
+
/** Policy templates: policy source with `?principal` / `?resource` slots that links fill with entities. */
|
|
47
|
+
templates: {
|
|
48
|
+
list() {
|
|
49
|
+
return request({ method: 'GET', path: '/v1/abac_templates' });
|
|
50
|
+
},
|
|
51
|
+
get(id) {
|
|
52
|
+
return request({ method: 'GET', path: `/v1/abac_templates/${(0, request_1.enc)(id)}` });
|
|
53
|
+
},
|
|
54
|
+
create(body, idempotencyKey) {
|
|
55
|
+
return request({ method: 'POST', path: '/v1/abac_templates', body, idempotencyKey });
|
|
56
|
+
},
|
|
57
|
+
/** A new `source` reaches every link at once; it is refused if a link could no longer be filled in or would fail the schema. */
|
|
58
|
+
update(id, body) {
|
|
59
|
+
return request({ method: 'PATCH', path: `/v1/abac_templates/${(0, request_1.enc)(id)}`, body });
|
|
60
|
+
},
|
|
61
|
+
/** A template with links is refused unless `force` (which deletes the links too). */
|
|
62
|
+
delete(id, opts = {}) {
|
|
63
|
+
return request({ method: 'DELETE', path: `/v1/abac_templates/${(0, request_1.enc)(id)}${opts.force ? '?force=true' : ''}` });
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
/** Links: a template with its slots filled by entities. A link is evaluated from the template's current source. */
|
|
67
|
+
links: {
|
|
68
|
+
list(query = {}) {
|
|
69
|
+
return request({ method: 'GET', path: `/v1/abac_policy_links${query.template_id ? `?template_id=${(0, request_1.enc)(query.template_id)}` : ''}` });
|
|
70
|
+
},
|
|
71
|
+
get(id) {
|
|
72
|
+
return request({ method: 'GET', path: `/v1/abac_policy_links/${(0, request_1.enc)(id)}` });
|
|
73
|
+
},
|
|
74
|
+
create(body, idempotencyKey) {
|
|
75
|
+
return request({ method: 'POST', path: '/v1/abac_policy_links', body, idempotencyKey });
|
|
76
|
+
},
|
|
77
|
+
update(id, body) {
|
|
78
|
+
return request({ method: 'PATCH', path: `/v1/abac_policy_links/${(0, request_1.enc)(id)}`, body });
|
|
79
|
+
},
|
|
80
|
+
delete(id) {
|
|
81
|
+
return request({ method: 'DELETE', path: `/v1/abac_policy_links/${(0, request_1.enc)(id)}` });
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
/** The entity schema: once set, policies and templates are type-checked when saved. */
|
|
85
|
+
schema: {
|
|
86
|
+
get() {
|
|
87
|
+
return request({ method: 'GET', path: '/v1/abac_schema' });
|
|
88
|
+
},
|
|
89
|
+
/** Saves the schema and reports the errors it would give the policies already stored (`policy_issues`). */
|
|
90
|
+
set(schema) {
|
|
91
|
+
return request({ method: 'PUT', path: '/v1/abac_schema', body: { schema } });
|
|
92
|
+
},
|
|
93
|
+
delete() {
|
|
94
|
+
return request({ method: 'DELETE', path: '/v1/abac_schema' });
|
|
95
|
+
},
|
|
96
|
+
/** Type-check draft source against the saved schema (or `schema`) without saving anything. */
|
|
97
|
+
validate(body) {
|
|
98
|
+
return request({ method: 'POST', path: '/v1/abac_schema/validate', body });
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
/** Compare two versions of a policy: the text, and the requests whose decision changes. */
|
|
102
|
+
diff(id, opts = {}) {
|
|
103
|
+
const qs = Object.entries(opts)
|
|
104
|
+
.filter(([, v]) => v !== undefined)
|
|
105
|
+
.map(([k, v]) => `${k}=${encodeURIComponent(String(v))}`)
|
|
106
|
+
.join('&');
|
|
107
|
+
return request({ method: 'GET', path: `/v1/abac_policies/${(0, request_1.enc)(id)}/diff${qs ? `?${qs}` : ''}` });
|
|
108
|
+
},
|
|
109
|
+
/** The same comparison for two sources you send, without saving. */
|
|
110
|
+
diffSources(body) {
|
|
111
|
+
return request({ method: 'POST', path: '/v1/abac/diff', body });
|
|
112
|
+
},
|
|
113
|
+
/** AuthZEN 1.0 Subject Search: the subjects of a type that may perform the action on the resource. */
|
|
114
|
+
authzenSearchSubject(body) {
|
|
115
|
+
return request({ method: 'POST', path: '/v1/authzen/access/v1/search/subject', body });
|
|
116
|
+
},
|
|
117
|
+
/** AuthZEN 1.0 Resource Search: the resources of a type the subject may perform the action on. */
|
|
118
|
+
authzenSearchResource(body) {
|
|
119
|
+
return request({ method: 'POST', path: '/v1/authzen/access/v1/search/resource', body });
|
|
120
|
+
},
|
|
121
|
+
/** AuthZEN 1.0 Action Search: the actions the subject may perform on the resource. */
|
|
122
|
+
authzenSearchAction(body) {
|
|
123
|
+
return request({ method: 'POST', path: '/v1/authzen/access/v1/search/action', body });
|
|
124
|
+
},
|
|
34
125
|
/** Convenience: the boolean answer to {@link evaluate}. */
|
|
35
126
|
async isAllowed(body) {
|
|
36
127
|
return (await request({ method: 'POST', path: '/v1/abac/evaluate', body })).decision === 'allow';
|
|
@@ -45,4 +136,11 @@ function abacResource(request) {
|
|
|
45
136
|
},
|
|
46
137
|
};
|
|
47
138
|
}
|
|
139
|
+
// The residual-filter helpers: evaluate a filter in memory, or compile it for SQL, Prisma or Drizzle.
|
|
140
|
+
var authz_1 = require("@atlasauth/authz");
|
|
141
|
+
Object.defineProperty(exports, "FilterCompileError", { enumerable: true, get: function () { return authz_1.FilterCompileError; } });
|
|
142
|
+
Object.defineProperty(exports, "evalFilter", { enumerable: true, get: function () { return authz_1.evalFilter; } });
|
|
143
|
+
Object.defineProperty(exports, "filterToDrizzle", { enumerable: true, get: function () { return authz_1.filterToDrizzle; } });
|
|
144
|
+
Object.defineProperty(exports, "filterToPrisma", { enumerable: true, get: function () { return authz_1.filterToPrisma; } });
|
|
145
|
+
Object.defineProperty(exports, "filterToSql", { enumerable: true, get: function () { return authz_1.filterToSql; } });
|
|
48
146
|
//# sourceMappingURL=abac.js.map
|
package/dist/client/abac.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abac.js","sourceRoot":"","sources":["../../src/client/abac.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abac.js","sourceRoot":"","sources":["../../src/client/abac.ts"],"names":[],"mappings":";;;AA2UA,oCAqIC;AAhdD,uCAAgD;AA0UhD,qFAAqF;AACrF,SAAgB,YAAY,CAAC,OAAkB;IAC7C,OAAO;QACL,IAAI;YACF,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,CAAC,IAA0B,EAAE,cAAuB;YACxD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,CAAC,EAAU,EAAE,IAA0B;YAC3C,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,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AAO,CAAe,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC;QACjH,CAAC;QACD,qCAAqC;QACrC,iBAAiB,CAAC,IAAuB;YACvC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kCAAkC,EAAE,IAAI,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,8CAA8C;QAC9C,kBAAkB,CAChB,IAAqK;YAErK,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mCAAmC,EAAE,IAAI,EAAE,CAAC,CAAC;QACtF,CAAC;KACF,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,0CAe0B;AAdxB,2GAAA,kBAAkB,OAAA;AAClB,mGAAA,UAAU,OAAA;AACV,wGAAA,eAAe,OAAA;AACf,uGAAA,cAAc,OAAA;AACd,oGAAA,WAAW,OAAA"}
|
|
@@ -82,7 +82,7 @@ export interface AccessByAppRow {
|
|
|
82
82
|
active_grants: number;
|
|
83
83
|
users_in_window: number;
|
|
84
84
|
}
|
|
85
|
-
export type AlertMetric = 'sign_in_success_rate' | 'failed_passkey_ratio' | 'failed_sign_ins' | 'sign_in_p95_seconds' | 'api_usage_spike';
|
|
85
|
+
export type AlertMetric = 'sign_in_success_rate' | 'failed_passkey_ratio' | 'failed_sign_ins' | 'sign_in_p95_seconds' | 'api_usage_spike' | 'unused_permissions';
|
|
86
86
|
export type UsageSubjectType = 'api_key' | 'end_user_api_key' | 'organization';
|
|
87
87
|
/** One key's or organization's API usage against its 7-day hourly baseline. */
|
|
88
88
|
export interface ApiUsageSubject {
|