@authrim/setup 0.1.140 → 0.1.142
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/dist/__tests__/keys.test.js +73 -2
- package/dist/__tests__/keys.test.js.map +1 -1
- package/dist/__tests__/migrate.test.js +4 -4
- package/dist/__tests__/migrate.test.js.map +1 -1
- package/dist/__tests__/paths.test.js +163 -1
- package/dist/__tests__/paths.test.js.map +1 -1
- package/dist/__tests__/source-context.test.d.ts +2 -0
- package/dist/__tests__/source-context.test.d.ts.map +1 -0
- package/dist/__tests__/source-context.test.js +72 -0
- package/dist/__tests__/source-context.test.js.map +1 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/commands/deploy.js +65 -37
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +277 -198
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/core/admin.d.ts +6 -1
- package/dist/core/admin.d.ts.map +1 -1
- package/dist/core/admin.js +45 -20
- package/dist/core/admin.js.map +1 -1
- package/dist/core/cloudflare.d.ts +38 -1
- package/dist/core/cloudflare.d.ts.map +1 -1
- package/dist/core/cloudflare.js +729 -115
- package/dist/core/cloudflare.js.map +1 -1
- package/dist/core/config.d.ts +164 -34
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +72 -18
- package/dist/core/config.js.map +1 -1
- package/dist/core/deploy.d.ts +18 -0
- package/dist/core/deploy.d.ts.map +1 -1
- package/dist/core/deploy.js +126 -25
- package/dist/core/deploy.js.map +1 -1
- package/dist/core/keys.d.ts +20 -4
- package/dist/core/keys.d.ts.map +1 -1
- package/dist/core/keys.js +77 -17
- package/dist/core/keys.js.map +1 -1
- package/dist/core/login-ui-client.d.ts +42 -0
- package/dist/core/login-ui-client.d.ts.map +1 -0
- package/dist/core/login-ui-client.js +173 -0
- package/dist/core/login-ui-client.js.map +1 -0
- package/dist/core/migrate.d.ts +37 -0
- package/dist/core/migrate.d.ts.map +1 -1
- package/dist/core/migrate.js +92 -2
- package/dist/core/migrate.js.map +1 -1
- package/dist/core/paths.d.ts +78 -13
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +135 -17
- package/dist/core/paths.js.map +1 -1
- package/dist/core/source-context.d.ts +22 -0
- package/dist/core/source-context.d.ts.map +1 -0
- package/dist/core/source-context.js +46 -0
- package/dist/core/source-context.js.map +1 -0
- package/dist/core/tenant-mode.d.ts +4 -0
- package/dist/core/tenant-mode.d.ts.map +1 -0
- package/dist/core/tenant-mode.js +17 -0
- package/dist/core/tenant-mode.js.map +1 -0
- package/dist/core/ui-deployment.d.ts +21 -0
- package/dist/core/ui-deployment.d.ts.map +1 -0
- package/dist/core/ui-deployment.js +90 -0
- package/dist/core/ui-deployment.js.map +1 -0
- package/dist/core/ui-env.d.ts +28 -0
- package/dist/core/ui-env.d.ts.map +1 -1
- package/dist/core/ui-env.js +16 -0
- package/dist/core/ui-env.js.map +1 -1
- package/dist/core/url-config.d.ts +16 -0
- package/dist/core/url-config.d.ts.map +1 -0
- package/dist/core/url-config.js +46 -0
- package/dist/core/url-config.js.map +1 -0
- package/dist/core/wrangler.d.ts +50 -1
- package/dist/core/wrangler.d.ts.map +1 -1
- package/dist/core/wrangler.js +171 -57
- package/dist/core/wrangler.js.map +1 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +38 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +38 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +38 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +38 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/id.d.ts.map +1 -1
- package/dist/i18n/locales/id.js +38 -1
- package/dist/i18n/locales/id.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +38 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/ko.d.ts.map +1 -1
- package/dist/i18n/locales/ko.js +38 -1
- package/dist/i18n/locales/ko.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +38 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +38 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN.js +38 -1
- package/dist/i18n/locales/zh-CN.js.map +1 -1
- package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/i18n/locales/zh-TW.js +38 -1
- package/dist/i18n/locales/zh-TW.js.map +1 -1
- package/dist/i18n/types.d.ts +8 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -30
- package/dist/index.js.map +1 -1
- package/dist/web/api.d.ts.map +1 -1
- package/dist/web/api.js +243 -116
- package/dist/web/api.js.map +1 -1
- package/dist/web/ui.d.ts.map +1 -1
- package/dist/web/ui.js +513 -115
- package/dist/web/ui.js.map +1 -1
- package/migrations/000_fresh_schema.sql +229 -10
- package/migrations/admin/007_admin_role_inheritance.sql +32 -0
- package/migrations/admin/008_admin_rebac_definitions.sql +117 -0
- package/migrations/admin/009_optimize_admin_audit_indexes.sql +15 -0
- package/package.json +5 -5
package/dist/web/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,eAAe,CAC7B,Y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|
@@ -198,6 +198,23 @@ CREATE TABLE "ciba_requests" (
|
|
|
198
198
|
FOREIGN KEY (user_id) REFERENCES users_core(id) ON DELETE CASCADE
|
|
199
199
|
);
|
|
200
200
|
|
|
201
|
+
CREATE TABLE client_consent_overrides (
|
|
202
|
+
id TEXT PRIMARY KEY,
|
|
203
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
204
|
+
client_id TEXT NOT NULL,
|
|
205
|
+
statement_id TEXT NOT NULL,
|
|
206
|
+
requirement TEXT NOT NULL DEFAULT 'inherit', -- 'required'|'optional'|'hidden'|'inherit'
|
|
207
|
+
min_version TEXT, -- null = use tenant default
|
|
208
|
+
enforcement TEXT, -- null = use tenant default
|
|
209
|
+
conditional_rules_json TEXT, -- null = use tenant default
|
|
210
|
+
display_order INTEGER,
|
|
211
|
+
created_at INTEGER NOT NULL,
|
|
212
|
+
updated_at INTEGER NOT NULL,
|
|
213
|
+
FOREIGN KEY (client_id) REFERENCES oauth_clients(client_id) ON DELETE CASCADE,
|
|
214
|
+
FOREIGN KEY (statement_id) REFERENCES consent_statements(id) ON DELETE CASCADE,
|
|
215
|
+
UNIQUE (tenant_id, client_id, statement_id)
|
|
216
|
+
);
|
|
217
|
+
|
|
201
218
|
CREATE TABLE compliance_reports (
|
|
202
219
|
id TEXT PRIMARY KEY,
|
|
203
220
|
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -230,6 +247,24 @@ CREATE TABLE consent_history (
|
|
|
230
247
|
FOREIGN KEY (user_id) REFERENCES users_core(id) ON DELETE CASCADE
|
|
231
248
|
);
|
|
232
249
|
|
|
250
|
+
CREATE TABLE consent_item_history (
|
|
251
|
+
id TEXT PRIMARY KEY,
|
|
252
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
253
|
+
user_id TEXT NOT NULL,
|
|
254
|
+
statement_id TEXT NOT NULL,
|
|
255
|
+
action TEXT NOT NULL, -- 'granted'|'denied'|'withdrawn'|'version_upgraded'|'expired'
|
|
256
|
+
version_before TEXT,
|
|
257
|
+
version_after TEXT,
|
|
258
|
+
status_before TEXT,
|
|
259
|
+
status_after TEXT,
|
|
260
|
+
ip_address_hash TEXT,
|
|
261
|
+
user_agent TEXT,
|
|
262
|
+
client_id TEXT,
|
|
263
|
+
metadata_json TEXT,
|
|
264
|
+
created_at INTEGER NOT NULL,
|
|
265
|
+
FOREIGN KEY (user_id) REFERENCES users_core(id) ON DELETE CASCADE
|
|
266
|
+
);
|
|
267
|
+
|
|
233
268
|
CREATE TABLE consent_policy_versions (
|
|
234
269
|
id TEXT PRIMARY KEY,
|
|
235
270
|
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -242,6 +277,51 @@ CREATE TABLE consent_policy_versions (
|
|
|
242
277
|
UNIQUE (tenant_id, policy_type, version)
|
|
243
278
|
);
|
|
244
279
|
|
|
280
|
+
CREATE TABLE consent_statement_localizations (
|
|
281
|
+
id TEXT PRIMARY KEY,
|
|
282
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
283
|
+
version_id TEXT NOT NULL,
|
|
284
|
+
language TEXT NOT NULL, -- BCP 47: 'en', 'ja', 'de'
|
|
285
|
+
title TEXT NOT NULL,
|
|
286
|
+
description TEXT NOT NULL,
|
|
287
|
+
document_url TEXT, -- External document URL (content_type='url')
|
|
288
|
+
inline_content TEXT, -- Inline text (content_type='inline')
|
|
289
|
+
created_at INTEGER NOT NULL,
|
|
290
|
+
updated_at INTEGER NOT NULL,
|
|
291
|
+
FOREIGN KEY (version_id) REFERENCES consent_statement_versions(id) ON DELETE CASCADE,
|
|
292
|
+
UNIQUE (version_id, language)
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
CREATE TABLE consent_statement_versions (
|
|
296
|
+
id TEXT PRIMARY KEY,
|
|
297
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
298
|
+
statement_id TEXT NOT NULL,
|
|
299
|
+
version TEXT NOT NULL, -- YYYYMMDD fixed: '20250206'
|
|
300
|
+
content_type TEXT NOT NULL DEFAULT 'url', -- 'url' | 'inline'
|
|
301
|
+
effective_at INTEGER NOT NULL,
|
|
302
|
+
content_hash TEXT, -- SHA-256 integrity hash
|
|
303
|
+
is_current INTEGER NOT NULL DEFAULT 0,
|
|
304
|
+
status TEXT NOT NULL DEFAULT 'draft', -- 'draft'|'active'|'archived'
|
|
305
|
+
created_at INTEGER NOT NULL,
|
|
306
|
+
updated_at INTEGER NOT NULL,
|
|
307
|
+
FOREIGN KEY (statement_id) REFERENCES consent_statements(id) ON DELETE CASCADE,
|
|
308
|
+
UNIQUE (tenant_id, statement_id, version)
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
CREATE TABLE consent_statements (
|
|
312
|
+
id TEXT PRIMARY KEY,
|
|
313
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
314
|
+
slug TEXT NOT NULL,
|
|
315
|
+
category TEXT NOT NULL DEFAULT 'custom',
|
|
316
|
+
legal_basis TEXT NOT NULL DEFAULT 'consent',
|
|
317
|
+
processing_purpose TEXT,
|
|
318
|
+
display_order INTEGER NOT NULL DEFAULT 0,
|
|
319
|
+
is_active INTEGER NOT NULL DEFAULT 1,
|
|
320
|
+
created_at INTEGER NOT NULL,
|
|
321
|
+
updated_at INTEGER NOT NULL,
|
|
322
|
+
UNIQUE (tenant_id, slug)
|
|
323
|
+
);
|
|
324
|
+
|
|
245
325
|
CREATE TABLE credential_configurations (
|
|
246
326
|
id TEXT PRIMARY KEY,
|
|
247
327
|
tenant_id TEXT NOT NULL,
|
|
@@ -335,10 +415,13 @@ CREATE TABLE did_document_cache (
|
|
|
335
415
|
CREATE TABLE external_idp_auth_states (
|
|
336
416
|
id TEXT PRIMARY KEY,
|
|
337
417
|
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
418
|
+
client_id TEXT, -- Client ID from the original auth request
|
|
338
419
|
provider_id TEXT NOT NULL, -- References upstream_providers(id)
|
|
339
420
|
state TEXT UNIQUE NOT NULL, -- OAuth state parameter
|
|
340
421
|
nonce TEXT, -- OIDC nonce for ID token validation
|
|
341
|
-
code_verifier TEXT, -- PKCE code verifier
|
|
422
|
+
code_verifier TEXT, -- PKCE code verifier for Authrim ↔ External IdP
|
|
423
|
+
code_challenge TEXT, -- PKCE code challenge from client ↔ Authrim
|
|
424
|
+
flow_id TEXT, -- Flow ID for diagnostic logging correlation
|
|
342
425
|
redirect_uri TEXT NOT NULL, -- Where to redirect after auth
|
|
343
426
|
|
|
344
427
|
-- For linking flow
|
|
@@ -352,6 +435,10 @@ CREATE TABLE external_idp_auth_states (
|
|
|
352
435
|
max_age INTEGER, -- max_age parameter for auth_time validation
|
|
353
436
|
acr_values TEXT, -- acr_values parameter for acr validation
|
|
354
437
|
|
|
438
|
+
-- Silent Auth & SSO control (Phase 1 & 2)
|
|
439
|
+
prompt TEXT, -- OIDC prompt parameter (none, login, consent, select_account)
|
|
440
|
+
enable_sso INTEGER NOT NULL DEFAULT 1, -- 1 = SSO enabled (handoff), 0 = SSO disabled (Direct Auth)
|
|
441
|
+
|
|
355
442
|
-- Timestamps
|
|
356
443
|
expires_at INTEGER NOT NULL,
|
|
357
444
|
created_at INTEGER NOT NULL,
|
|
@@ -504,7 +591,7 @@ CREATE TABLE oauth_clients (
|
|
|
504
591
|
default_audience TEXT, -- Default audience for Client Credentials
|
|
505
592
|
created_at INTEGER NOT NULL,
|
|
506
593
|
updated_at INTEGER NOT NULL
|
|
507
|
-
, is_trusted INTEGER DEFAULT 0, skip_consent INTEGER DEFAULT 0, allow_claims_without_scope INTEGER DEFAULT 0, backchannel_token_delivery_mode TEXT, backchannel_client_notification_endpoint TEXT, backchannel_authentication_request_signing_alg TEXT, backchannel_user_code_parameter INTEGER DEFAULT 0, tenant_id TEXT NOT NULL DEFAULT 'default', jwks TEXT, jwks_uri TEXT, userinfo_signed_response_alg TEXT, post_logout_redirect_uris TEXT, allowed_redirect_origins TEXT, backchannel_logout_uri TEXT, backchannel_logout_session_required INTEGER DEFAULT 0, frontchannel_logout_uri TEXT, frontchannel_logout_session_required INTEGER DEFAULT 0, logout_webhook_uri TEXT, logout_webhook_secret_encrypted TEXT, registration_access_token_hash TEXT, initiate_login_uri TEXT, id_token_signed_response_alg TEXT, request_object_signing_alg TEXT, client_secret_hash TEXT, software_id TEXT, software_version TEXT, requestable_scopes TEXT);
|
|
594
|
+
, is_trusted INTEGER DEFAULT 0, skip_consent INTEGER DEFAULT 0, allow_claims_without_scope INTEGER DEFAULT 0, backchannel_token_delivery_mode TEXT, backchannel_client_notification_endpoint TEXT, backchannel_authentication_request_signing_alg TEXT, backchannel_user_code_parameter INTEGER DEFAULT 0, tenant_id TEXT NOT NULL DEFAULT 'default', jwks TEXT, jwks_uri TEXT, userinfo_signed_response_alg TEXT, post_logout_redirect_uris TEXT, allowed_redirect_origins TEXT, backchannel_logout_uri TEXT, backchannel_logout_session_required INTEGER DEFAULT 0, frontchannel_logout_uri TEXT, frontchannel_logout_session_required INTEGER DEFAULT 0, logout_webhook_uri TEXT, logout_webhook_secret_encrypted TEXT, registration_access_token_hash TEXT, initiate_login_uri TEXT, login_ui_url TEXT, id_token_signed_response_alg TEXT, request_object_signing_alg TEXT, client_secret_hash TEXT, software_id TEXT, software_version TEXT, requestable_scopes TEXT, require_pkce INTEGER DEFAULT 0);
|
|
508
595
|
|
|
509
596
|
CREATE TABLE operational_logs (
|
|
510
597
|
id TEXT PRIMARY KEY,
|
|
@@ -1093,6 +1180,23 @@ CREATE TABLE suspicious_activities (
|
|
|
1093
1180
|
resolved_at TEXT -- When resolved/dismissed
|
|
1094
1181
|
);
|
|
1095
1182
|
|
|
1183
|
+
CREATE TABLE tenant_consent_requirements (
|
|
1184
|
+
id TEXT PRIMARY KEY,
|
|
1185
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
1186
|
+
statement_id TEXT NOT NULL,
|
|
1187
|
+
is_required INTEGER NOT NULL DEFAULT 0,
|
|
1188
|
+
min_version TEXT,
|
|
1189
|
+
enforcement TEXT NOT NULL DEFAULT 'block',
|
|
1190
|
+
show_deletion_link INTEGER NOT NULL DEFAULT 0,
|
|
1191
|
+
deletion_url TEXT,
|
|
1192
|
+
conditional_rules_json TEXT,
|
|
1193
|
+
display_order INTEGER NOT NULL DEFAULT 0,
|
|
1194
|
+
created_at INTEGER NOT NULL,
|
|
1195
|
+
updated_at INTEGER NOT NULL,
|
|
1196
|
+
FOREIGN KEY (statement_id) REFERENCES consent_statements(id) ON DELETE CASCADE,
|
|
1197
|
+
UNIQUE (tenant_id, statement_id)
|
|
1198
|
+
);
|
|
1199
|
+
|
|
1096
1200
|
CREATE TABLE token_claim_rules (
|
|
1097
1201
|
-- Primary key
|
|
1098
1202
|
id TEXT PRIMARY KEY,
|
|
@@ -1187,13 +1291,37 @@ CREATE TABLE upstream_providers (
|
|
|
1187
1291
|
|
|
1188
1292
|
-- UI customization
|
|
1189
1293
|
icon_url TEXT, -- Provider icon for login button
|
|
1190
|
-
button_color TEXT, -- Brand color for login button (hex)
|
|
1294
|
+
button_color TEXT, -- Brand color for login button (hex, light theme)
|
|
1295
|
+
button_color_dark TEXT, -- Brand color for login button (hex, dark theme)
|
|
1191
1296
|
button_text TEXT, -- Custom button text (optional)
|
|
1192
1297
|
|
|
1193
1298
|
-- Metadata
|
|
1194
1299
|
created_at INTEGER NOT NULL,
|
|
1195
1300
|
updated_at INTEGER NOT NULL
|
|
1196
|
-
, slug TEXT, token_endpoint_auth_method TEXT DEFAULT 'client_secret_post', always_fetch_userinfo INTEGER DEFAULT 0, use_request_object INTEGER DEFAULT 0, request_object_signing_alg TEXT, private_key_jwk_encrypted TEXT, public_key_jwk TEXT);
|
|
1301
|
+
, slug TEXT, token_endpoint_auth_method TEXT DEFAULT 'client_secret_post', always_fetch_userinfo INTEGER DEFAULT 0, enable_sso INTEGER NOT NULL DEFAULT 1, use_request_object INTEGER DEFAULT 0, request_object_signing_alg TEXT, private_key_jwk_encrypted TEXT, public_key_jwk TEXT);
|
|
1302
|
+
|
|
1303
|
+
CREATE TABLE user_consent_records (
|
|
1304
|
+
id TEXT PRIMARY KEY,
|
|
1305
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
1306
|
+
user_id TEXT NOT NULL,
|
|
1307
|
+
statement_id TEXT NOT NULL,
|
|
1308
|
+
version_id TEXT NOT NULL,
|
|
1309
|
+
version TEXT NOT NULL,
|
|
1310
|
+
status TEXT NOT NULL DEFAULT 'granted',
|
|
1311
|
+
granted_at INTEGER,
|
|
1312
|
+
withdrawn_at INTEGER,
|
|
1313
|
+
expires_at INTEGER,
|
|
1314
|
+
client_id TEXT,
|
|
1315
|
+
ip_address_hash TEXT,
|
|
1316
|
+
user_agent TEXT,
|
|
1317
|
+
receipt_id TEXT,
|
|
1318
|
+
created_at INTEGER NOT NULL,
|
|
1319
|
+
updated_at INTEGER NOT NULL,
|
|
1320
|
+
FOREIGN KEY (user_id) REFERENCES users_core(id) ON DELETE CASCADE,
|
|
1321
|
+
FOREIGN KEY (statement_id) REFERENCES consent_statements(id),
|
|
1322
|
+
FOREIGN KEY (version_id) REFERENCES consent_statement_versions(id),
|
|
1323
|
+
UNIQUE (tenant_id, user_id, statement_id)
|
|
1324
|
+
);
|
|
1197
1325
|
|
|
1198
1326
|
CREATE TABLE "user_custom_fields" (
|
|
1199
1327
|
user_id TEXT NOT NULL,
|
|
@@ -1474,8 +1602,6 @@ CREATE INDEX idx_audit_log_created_at ON audit_log(created_at);
|
|
|
1474
1602
|
|
|
1475
1603
|
CREATE INDEX idx_audit_log_resource ON audit_log(resource_type, resource_id);
|
|
1476
1604
|
|
|
1477
|
-
CREATE INDEX idx_audit_log_severity ON audit_log(severity);
|
|
1478
|
-
|
|
1479
1605
|
CREATE INDEX idx_audit_log_tenant_id ON audit_log(tenant_id);
|
|
1480
1606
|
|
|
1481
1607
|
CREATE INDEX idx_audit_log_user_id ON audit_log(user_id);
|
|
@@ -1528,6 +1654,14 @@ CREATE INDEX idx_compliance_reports_tenant ON compliance_reports(tenant_id);
|
|
|
1528
1654
|
|
|
1529
1655
|
CREATE INDEX idx_compliance_reports_type ON compliance_reports(tenant_id, type);
|
|
1530
1656
|
|
|
1657
|
+
CREATE INDEX idx_cco_client ON client_consent_overrides(tenant_id, client_id);
|
|
1658
|
+
|
|
1659
|
+
CREATE INDEX idx_cih_statement ON consent_item_history(statement_id, created_at);
|
|
1660
|
+
|
|
1661
|
+
CREATE INDEX idx_cih_tenant ON consent_item_history(tenant_id, created_at);
|
|
1662
|
+
|
|
1663
|
+
CREATE INDEX idx_cih_user ON consent_item_history(user_id, created_at);
|
|
1664
|
+
|
|
1531
1665
|
CREATE INDEX idx_consent_history_action
|
|
1532
1666
|
ON consent_history(action, created_at);
|
|
1533
1667
|
|
|
@@ -1546,6 +1680,16 @@ CREATE INDEX idx_consent_policy_versions_effective
|
|
|
1546
1680
|
CREATE INDEX idx_consent_policy_versions_tenant
|
|
1547
1681
|
ON consent_policy_versions(tenant_id, policy_type);
|
|
1548
1682
|
|
|
1683
|
+
CREATE INDEX idx_consent_statements_tenant ON consent_statements(tenant_id, is_active);
|
|
1684
|
+
|
|
1685
|
+
CREATE INDEX idx_csl_version ON consent_statement_localizations(version_id, language);
|
|
1686
|
+
|
|
1687
|
+
CREATE INDEX idx_csv_effective ON consent_statement_versions(effective_at);
|
|
1688
|
+
|
|
1689
|
+
CREATE INDEX idx_csv_statement ON consent_statement_versions(statement_id, is_current);
|
|
1690
|
+
|
|
1691
|
+
CREATE UNIQUE INDEX idx_csv_unique_current ON consent_statement_versions(tenant_id, statement_id) WHERE is_current = 1;
|
|
1692
|
+
|
|
1549
1693
|
CREATE INDEX idx_consents_client ON oauth_client_consents(client_id);
|
|
1550
1694
|
|
|
1551
1695
|
CREATE INDEX idx_consents_expires_at_active
|
|
@@ -1858,6 +2002,8 @@ CREATE INDEX idx_suspicious_activities_type ON suspicious_activities(tenant_id,
|
|
|
1858
2002
|
|
|
1859
2003
|
CREATE INDEX idx_suspicious_activities_user ON suspicious_activities(tenant_id, user_id);
|
|
1860
2004
|
|
|
2005
|
+
CREATE INDEX idx_tcr_tenant ON tenant_consent_requirements(tenant_id);
|
|
2006
|
+
|
|
1861
2007
|
CREATE INDEX idx_tcr_evaluation ON token_claim_rules(
|
|
1862
2008
|
tenant_id,
|
|
1863
2009
|
token_type,
|
|
@@ -1887,16 +2033,23 @@ CREATE UNIQUE INDEX idx_upstream_providers_tenant_slug
|
|
|
1887
2033
|
ON upstream_providers(tenant_id, slug)
|
|
1888
2034
|
WHERE slug IS NOT NULL;
|
|
1889
2035
|
|
|
2036
|
+
CREATE INDEX idx_upstream_providers_enable_sso
|
|
2037
|
+
ON upstream_providers(tenant_id, enable_sso);
|
|
2038
|
+
|
|
2039
|
+
CREATE INDEX idx_ucr_expires ON user_consent_records(expires_at) WHERE expires_at IS NOT NULL;
|
|
2040
|
+
|
|
2041
|
+
CREATE INDEX idx_ucr_statement ON user_consent_records(tenant_id, statement_id);
|
|
2042
|
+
|
|
2043
|
+
CREATE INDEX idx_ucr_status ON user_consent_records(status);
|
|
2044
|
+
|
|
2045
|
+
CREATE INDEX idx_ucr_user ON user_consent_records(tenant_id, user_id);
|
|
2046
|
+
|
|
1890
2047
|
CREATE INDEX idx_user_verified_attributes_name ON user_verified_attributes(tenant_id, attribute_name);
|
|
1891
2048
|
|
|
1892
2049
|
CREATE INDEX idx_user_verified_attributes_user ON user_verified_attributes(tenant_id, user_id);
|
|
1893
2050
|
|
|
1894
|
-
CREATE INDEX idx_users_core_active ON users_core(is_active);
|
|
1895
|
-
|
|
1896
2051
|
CREATE INDEX idx_users_core_email_domain ON users_core(email_domain_hash);
|
|
1897
2052
|
|
|
1898
|
-
CREATE INDEX idx_users_core_hash_version ON users_core(email_domain_hash_version);
|
|
1899
|
-
|
|
1900
2053
|
CREATE INDEX idx_users_core_partition ON users_core(pii_partition);
|
|
1901
2054
|
|
|
1902
2055
|
CREATE INDEX idx_users_core_pii_status ON users_core(pii_status);
|
|
@@ -1964,3 +2117,69 @@ CREATE INDEX idx_ws_subs_connection
|
|
|
1964
2117
|
CREATE INDEX idx_ws_subs_subject
|
|
1965
2118
|
ON websocket_subscriptions(subject_id, is_active);
|
|
1966
2119
|
|
|
2120
|
+
|
|
2121
|
+
-- =============================================================================
|
|
2122
|
+
-- From 053: Custom Claim Schemas (with registration form fields from 060)
|
|
2123
|
+
-- =============================================================================
|
|
2124
|
+
|
|
2125
|
+
CREATE TABLE custom_claim_schemas (
|
|
2126
|
+
id TEXT PRIMARY KEY,
|
|
2127
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2128
|
+
field_key TEXT NOT NULL,
|
|
2129
|
+
display_label TEXT NOT NULL,
|
|
2130
|
+
field_type TEXT NOT NULL DEFAULT 'string',
|
|
2131
|
+
is_pii INTEGER NOT NULL DEFAULT 0,
|
|
2132
|
+
is_required INTEGER NOT NULL DEFAULT 0,
|
|
2133
|
+
is_active INTEGER NOT NULL DEFAULT 1,
|
|
2134
|
+
validation_rules TEXT CHECK(validation_rules IS NULL OR json_valid(validation_rules)),
|
|
2135
|
+
include_in_id_token INTEGER NOT NULL DEFAULT 0,
|
|
2136
|
+
include_in_userinfo INTEGER NOT NULL DEFAULT 0,
|
|
2137
|
+
include_in_introspection INTEGER NOT NULL DEFAULT 0,
|
|
2138
|
+
required_scopes TEXT CHECK(required_scopes IS NULL OR json_valid(required_scopes)),
|
|
2139
|
+
scope_mode TEXT NOT NULL DEFAULT 'any' CHECK(scope_mode IN ('all', 'any')),
|
|
2140
|
+
is_searchable INTEGER NOT NULL DEFAULT 1,
|
|
2141
|
+
is_exportable INTEGER NOT NULL DEFAULT 1,
|
|
2142
|
+
is_vc_claim INTEGER NOT NULL DEFAULT 0,
|
|
2143
|
+
claim_namespace TEXT,
|
|
2144
|
+
description TEXT,
|
|
2145
|
+
display_order INTEGER NOT NULL DEFAULT 0,
|
|
2146
|
+
schema_version INTEGER NOT NULL DEFAULT 1,
|
|
2147
|
+
operation_status TEXT NOT NULL DEFAULT 'active',
|
|
2148
|
+
operation_detail TEXT,
|
|
2149
|
+
is_system INTEGER NOT NULL DEFAULT 0,
|
|
2150
|
+
created_by TEXT,
|
|
2151
|
+
created_at INTEGER NOT NULL,
|
|
2152
|
+
updated_at INTEGER NOT NULL,
|
|
2153
|
+
show_on_registration INTEGER NOT NULL DEFAULT 0,
|
|
2154
|
+
registration_required INTEGER NOT NULL DEFAULT 0,
|
|
2155
|
+
registration_order INTEGER NOT NULL DEFAULT 0,
|
|
2156
|
+
registration_placeholder TEXT
|
|
2157
|
+
);
|
|
2158
|
+
|
|
2159
|
+
CREATE UNIQUE INDEX uniq_ccs_active_key ON custom_claim_schemas(tenant_id, field_key) WHERE is_active = 1;
|
|
2160
|
+
CREATE INDEX idx_ccs_tenant_active ON custom_claim_schemas(tenant_id, is_active, display_order);
|
|
2161
|
+
CREATE INDEX idx_ccs_tenant_key ON custom_claim_schemas(tenant_id, field_key);
|
|
2162
|
+
CREATE INDEX idx_ccs_operation ON custom_claim_schemas(operation_status) WHERE operation_status != 'active';
|
|
2163
|
+
|
|
2164
|
+
-- =============================================================================
|
|
2165
|
+
-- From 059: Tenant Invitations
|
|
2166
|
+
-- =============================================================================
|
|
2167
|
+
|
|
2168
|
+
CREATE TABLE tenant_invitations (
|
|
2169
|
+
id TEXT PRIMARY KEY,
|
|
2170
|
+
token TEXT NOT NULL UNIQUE,
|
|
2171
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2172
|
+
invited_email TEXT,
|
|
2173
|
+
invited_by TEXT NOT NULL,
|
|
2174
|
+
role_id TEXT,
|
|
2175
|
+
org_id TEXT,
|
|
2176
|
+
max_uses INTEGER NOT NULL DEFAULT 1,
|
|
2177
|
+
use_count INTEGER NOT NULL DEFAULT 0,
|
|
2178
|
+
expires_at INTEGER NOT NULL,
|
|
2179
|
+
created_at INTEGER NOT NULL,
|
|
2180
|
+
updated_at INTEGER NOT NULL
|
|
2181
|
+
);
|
|
2182
|
+
|
|
2183
|
+
CREATE INDEX idx_ti_token ON tenant_invitations(token)
|
|
2184
|
+
WHERE expires_at > unixepoch();
|
|
2185
|
+
CREATE INDEX idx_ti_tenant ON tenant_invitations(tenant_id, created_at DESC);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
-- =============================================================================
|
|
2
|
+
-- Migration: Admin Role Inheritance (D1_ADMIN)
|
|
3
|
+
-- =============================================================================
|
|
4
|
+
-- Created: 2026-02-06
|
|
5
|
+
-- Description: Adds role inheritance support to admin_roles table.
|
|
6
|
+
-- Allows roles to inherit permissions from parent roles.
|
|
7
|
+
--
|
|
8
|
+
-- Changes:
|
|
9
|
+
-- - Add inherits_from column to admin_roles table
|
|
10
|
+
-- - Add index for inheritance lookup
|
|
11
|
+
-- =============================================================================
|
|
12
|
+
|
|
13
|
+
-- =============================================================================
|
|
14
|
+
-- Add inherits_from column to admin_roles
|
|
15
|
+
-- =============================================================================
|
|
16
|
+
|
|
17
|
+
-- Add inherits_from column (nullable, references another role)
|
|
18
|
+
ALTER TABLE admin_roles ADD COLUMN inherits_from TEXT DEFAULT NULL;
|
|
19
|
+
|
|
20
|
+
-- Create index for inheritance lookup
|
|
21
|
+
CREATE INDEX IF NOT EXISTS idx_admin_roles_inherits ON admin_roles(inherits_from);
|
|
22
|
+
|
|
23
|
+
-- =============================================================================
|
|
24
|
+
-- Migration Complete
|
|
25
|
+
-- =============================================================================
|
|
26
|
+
--
|
|
27
|
+
-- admin_roles table now supports role inheritance:
|
|
28
|
+
-- - inherits_from: ID of parent role (NULL if no inheritance)
|
|
29
|
+
-- - Permissions are merged: child role permissions + parent role permissions
|
|
30
|
+
-- - Inheritance chain can be resolved recursively
|
|
31
|
+
--
|
|
32
|
+
-- =============================================================================
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
-- =============================================================================
|
|
2
|
+
-- Migration: Admin ReBAC Definitions (D1_ADMIN)
|
|
3
|
+
-- =============================================================================
|
|
4
|
+
-- Created: 2026-02-06
|
|
5
|
+
-- Description: Adds admin_rebac_definitions table for managing relationship
|
|
6
|
+
-- type definitions. This complements the existing admin_relationships
|
|
7
|
+
-- table which stores relationship instances (tuples).
|
|
8
|
+
--
|
|
9
|
+
-- Architecture:
|
|
10
|
+
-- - admin_rebac_definitions: Relationship type definitions (metadata)
|
|
11
|
+
-- - admin_relationships: Relationship instances (tuples)
|
|
12
|
+
-- =============================================================================
|
|
13
|
+
|
|
14
|
+
-- =============================================================================
|
|
15
|
+
-- admin_rebac_definitions Table
|
|
16
|
+
-- =============================================================================
|
|
17
|
+
-- Defines relationship types that can be used in ReBAC.
|
|
18
|
+
-- Examples: admin_supervises, admin_team_member, admin_escalation_chain
|
|
19
|
+
-- =============================================================================
|
|
20
|
+
|
|
21
|
+
CREATE TABLE IF NOT EXISTS admin_rebac_definitions (
|
|
22
|
+
-- Definition ID (UUID v4)
|
|
23
|
+
id TEXT PRIMARY KEY,
|
|
24
|
+
|
|
25
|
+
-- Multi-tenant support
|
|
26
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
27
|
+
|
|
28
|
+
-- Relationship name (e.g., 'admin_supervises', 'admin_team_member')
|
|
29
|
+
relation_name TEXT NOT NULL,
|
|
30
|
+
|
|
31
|
+
-- Human-readable display name
|
|
32
|
+
display_name TEXT,
|
|
33
|
+
|
|
34
|
+
-- Description of what this relationship means
|
|
35
|
+
description TEXT,
|
|
36
|
+
|
|
37
|
+
-- Priority for evaluation (higher = evaluated first)
|
|
38
|
+
priority INTEGER DEFAULT 0,
|
|
39
|
+
|
|
40
|
+
-- Whether this is a system-defined relationship (cannot be deleted)
|
|
41
|
+
is_system INTEGER DEFAULT 0,
|
|
42
|
+
|
|
43
|
+
-- Lifecycle
|
|
44
|
+
created_at INTEGER NOT NULL,
|
|
45
|
+
updated_at INTEGER NOT NULL,
|
|
46
|
+
|
|
47
|
+
-- Unique constraint for relation name per tenant
|
|
48
|
+
UNIQUE(tenant_id, relation_name)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
-- =============================================================================
|
|
52
|
+
-- Indexes for admin_rebac_definitions
|
|
53
|
+
-- =============================================================================
|
|
54
|
+
|
|
55
|
+
CREATE INDEX IF NOT EXISTS idx_admin_rebac_def_tenant ON admin_rebac_definitions(tenant_id);
|
|
56
|
+
CREATE INDEX IF NOT EXISTS idx_admin_rebac_def_name ON admin_rebac_definitions(tenant_id, relation_name);
|
|
57
|
+
|
|
58
|
+
-- =============================================================================
|
|
59
|
+
-- Default ReBAC Definitions
|
|
60
|
+
-- =============================================================================
|
|
61
|
+
|
|
62
|
+
-- Supervises relationship
|
|
63
|
+
INSERT OR IGNORE INTO admin_rebac_definitions (
|
|
64
|
+
id, tenant_id, relation_name, display_name, description,
|
|
65
|
+
priority, is_system, created_at, updated_at
|
|
66
|
+
) VALUES (
|
|
67
|
+
'rebac_def_supervises',
|
|
68
|
+
'default',
|
|
69
|
+
'admin_supervises',
|
|
70
|
+
'Supervises',
|
|
71
|
+
'Admin user supervises another admin user',
|
|
72
|
+
100,
|
|
73
|
+
1,
|
|
74
|
+
strftime('%s', 'now') * 1000,
|
|
75
|
+
strftime('%s', 'now') * 1000
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
-- Team member relationship
|
|
79
|
+
INSERT OR IGNORE INTO admin_rebac_definitions (
|
|
80
|
+
id, tenant_id, relation_name, display_name, description,
|
|
81
|
+
priority, is_system, created_at, updated_at
|
|
82
|
+
) VALUES (
|
|
83
|
+
'rebac_def_team_member',
|
|
84
|
+
'default',
|
|
85
|
+
'admin_team_member',
|
|
86
|
+
'Team Member',
|
|
87
|
+
'Admin user is a member of a team',
|
|
88
|
+
50,
|
|
89
|
+
1,
|
|
90
|
+
strftime('%s', 'now') * 1000,
|
|
91
|
+
strftime('%s', 'now') * 1000
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
-- Escalation chain relationship
|
|
95
|
+
INSERT OR IGNORE INTO admin_rebac_definitions (
|
|
96
|
+
id, tenant_id, relation_name, display_name, description,
|
|
97
|
+
priority, is_system, created_at, updated_at
|
|
98
|
+
) VALUES (
|
|
99
|
+
'rebac_def_escalation',
|
|
100
|
+
'default',
|
|
101
|
+
'admin_escalation_chain',
|
|
102
|
+
'Escalation Chain',
|
|
103
|
+
'Admin user is in escalation chain for another admin user',
|
|
104
|
+
75,
|
|
105
|
+
1,
|
|
106
|
+
strftime('%s', 'now') * 1000,
|
|
107
|
+
strftime('%s', 'now') * 1000
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
-- =============================================================================
|
|
111
|
+
-- Migration Complete
|
|
112
|
+
-- =============================================================================
|
|
113
|
+
--
|
|
114
|
+
-- admin_rebac_definitions table is now available for managing relationship types.
|
|
115
|
+
-- Use admin_relationships table to create relationship instances (tuples).
|
|
116
|
+
--
|
|
117
|
+
-- =============================================================================
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- D1 Write Amplification Optimization for admin_audit_log
|
|
2
|
+
-- All queries filter by tenant_id, so idx_admin_audit_log_tenant_time covers most cases
|
|
3
|
+
--
|
|
4
|
+
-- Redundant: all queries include tenant_id filter
|
|
5
|
+
-- idx_admin_audit_log_tenant_time(tenant_id, created_at DESC) covers this
|
|
6
|
+
DROP INDEX IF EXISTS idx_admin_audit_log_created_at;
|
|
7
|
+
|
|
8
|
+
-- Never searched alone - always combined with tenant_id (admin-audit-log.ts:218,347)
|
|
9
|
+
DROP INDEX IF EXISTS idx_admin_audit_log_severity;
|
|
10
|
+
|
|
11
|
+
-- Never searched alone - always combined with tenant_id (admin-audit-log.ts:214,322)
|
|
12
|
+
DROP INDEX IF EXISTS idx_admin_audit_log_result;
|
|
13
|
+
|
|
14
|
+
-- Low-frequency optional admin filter, not on critical path (admin-audit-log.ts:222)
|
|
15
|
+
DROP INDEX IF EXISTS idx_admin_audit_log_ip;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authrim/setup",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.142",
|
|
4
4
|
"description": "CLI tool for setting up Authrim OIDC Provider on Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"zod": "^3.24.1",
|
|
32
32
|
"degit": "^2.8.4",
|
|
33
33
|
"execa": "^9.5.2",
|
|
34
|
-
"@hono/node-server": "^1.19.
|
|
35
|
-
"hono": "^4.
|
|
36
|
-
"tar": "^7.
|
|
34
|
+
"@hono/node-server": "^1.19.10",
|
|
35
|
+
"hono": "^4.12.7",
|
|
36
|
+
"tar": "^7.5.10"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.4",
|
|
40
40
|
"@types/tar": "^6.1.13",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
|
-
"vitest": "^
|
|
42
|
+
"vitest": "^4.0.0",
|
|
43
43
|
"tsx": "^4.20.6"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|