@adonis-agora/authkit-server 0.86.0 → 0.88.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/README.md +2 -2
- package/build/host/views/signup.edge +16 -0
- package/build/index.d.ts +1 -2
- package/build/index.js +0 -1
- package/build/src/agents/config.d.ts +1 -1
- package/build/src/agents/delegation_service.js +1 -1
- package/build/src/agents/poppy/client_registry.d.ts +5 -0
- package/build/src/agents/poppy/client_registry.js +35 -1
- package/build/src/agents/poppy/config.d.ts +111 -80
- package/build/src/agents/poppy/config.js +55 -35
- package/build/src/agents/poppy/dpop.d.ts +2 -2
- package/build/src/agents/poppy/dpop.js +3 -3
- package/build/src/agents/poppy/email_code_sign_in.d.ts +4 -4
- package/build/src/agents/poppy/email_code_sign_in.js +5 -5
- package/build/src/agents/poppy/errors.d.ts +7 -2
- package/build/src/agents/poppy/errors.js +5 -2
- package/build/src/agents/poppy/resource.d.ts +30 -25
- package/build/src/agents/poppy/resource.js +24 -20
- package/build/src/agents/poppy/safe_fetch.js +8 -2
- package/build/src/agents/poppy/service.d.ts +69 -62
- package/build/src/agents/poppy/service.js +540 -546
- package/build/src/agents/poppy/session_jwt.d.ts +30 -0
- package/build/src/agents/poppy/session_jwt.js +133 -0
- package/build/src/agents/poppy/store.d.ts +17 -22
- package/build/src/agents/poppy/store.js +22 -30
- package/build/src/agents/poppy/web_session.d.ts +23 -16
- package/build/src/agents/poppy/web_session.js +42 -24
- package/build/src/define_config.d.ts +6 -4
- package/build/src/host/admin_sessions_service.js +3 -3
- package/build/src/host/controllers/account_apps_controller.js +1 -1
- package/build/src/host/controllers/interaction_controller.js +32 -4
- package/build/src/host/controllers/poppy_consent_controller.d.ts +2 -2
- package/build/src/host/controllers/poppy_consent_controller.js +2 -2
- package/build/src/host/controllers/poppy_controller.d.ts +19 -11
- package/build/src/host/controllers/poppy_controller.js +93 -68
- package/build/src/host/controllers/registration_controller.js +30 -7
- package/build/src/host/csrf.d.ts +2 -4
- package/build/src/host/csrf.js +2 -3
- package/build/src/host/register_auth_host.js +10 -5
- package/build/src/host/signup_code.d.ts +41 -0
- package/build/src/host/signup_code.js +56 -0
- package/build/src/schema/ensure.js +14 -9
- package/package.json +3 -3
|
@@ -334,22 +334,23 @@ const TABLES = [
|
|
|
334
334
|
},
|
|
335
335
|
},
|
|
336
336
|
/*
|
|
337
|
-
* Personal Agent Protocol (Poppy). Os
|
|
337
|
+
* Personal Agent Protocol (Poppy). Os refresh tokens são grants de
|
|
338
338
|
* `auth_agent_grants` (prefixo `pgrant_`) com o hash em
|
|
339
|
-
* `auth_agent_refresh_tokens`; aqui ficam Sessions,
|
|
339
|
+
* `auth_agent_refresh_tokens`; aqui ficam Sessions, access tokens, pedidos de
|
|
340
340
|
* sign-in e os `jti` vistos. Mesmas regras de data das tabelas acima.
|
|
341
341
|
*/
|
|
342
342
|
{
|
|
343
343
|
name: 'auth_poppy_sessions',
|
|
344
344
|
/**
|
|
345
|
-
* Uma Session: um usuário do agente (`user_id`, opaco) num agente
|
|
346
|
-
*
|
|
347
|
-
*
|
|
345
|
+
* Uma Session: um usuário do agente (`user_id`, opaco) num agente (`client_id`), com o
|
|
346
|
+
* `agent_id` opcional. `account_id` é a conta que já usou. `grant_id` e `scope` ficaram da
|
|
347
|
+
* Draft 0.1, sem uso (o schema só é aditivo).
|
|
348
348
|
*/
|
|
349
349
|
create: (t) => {
|
|
350
350
|
t.string('id').primary();
|
|
351
351
|
t.string('client_id', 2048).notNullable();
|
|
352
352
|
t.string('user_id').notNullable();
|
|
353
|
+
t.string('agent_id').nullable();
|
|
353
354
|
t.string('account_id').nullable().index();
|
|
354
355
|
t.string('grant_id').nullable().index();
|
|
355
356
|
t.text('scope').notNullable();
|
|
@@ -361,6 +362,7 @@ const TABLES = [
|
|
|
361
362
|
columns: {
|
|
362
363
|
client_id: (t) => t.string('client_id', 2048),
|
|
363
364
|
user_id: (t) => t.string('user_id'),
|
|
365
|
+
agent_id: (t) => t.string('agent_id').nullable(),
|
|
364
366
|
account_id: (t) => t.string('account_id').nullable().index(),
|
|
365
367
|
grant_id: (t) => t.string('grant_id').nullable().index(),
|
|
366
368
|
scope: (t) => t.text('scope'),
|
|
@@ -372,7 +374,10 @@ const TABLES = [
|
|
|
372
374
|
},
|
|
373
375
|
{
|
|
374
376
|
name: 'auth_poppy_tokens',
|
|
375
|
-
/**
|
|
377
|
+
/**
|
|
378
|
+
* Access tokens — só o hash. `jkt` = chave DPoP; `null` = Bearer. `session_id` e `user_id`
|
|
379
|
+
* ficaram da Draft 0.1 e saem vazios: o sign-in não conhece a Session.
|
|
380
|
+
*/
|
|
376
381
|
create: (t) => {
|
|
377
382
|
t.string('token_hash', 64).primary();
|
|
378
383
|
t.string('session_id').notNullable().index();
|
|
@@ -402,8 +407,8 @@ const TABLES = [
|
|
|
402
407
|
{
|
|
403
408
|
name: 'auth_poppy_requests',
|
|
404
409
|
/**
|
|
405
|
-
* Pedidos
|
|
406
|
-
* `
|
|
410
|
+
* Pedidos: `authorize` (Direct — vira código após o consentimento), `device` (RFC 8628),
|
|
411
|
+
* `mediated` (aguardando o código de uso único) e `browser` (entrada de um navegador, §6).
|
|
407
412
|
* Códigos só como hash. Linhas expiradas são apagadas no próximo pedido.
|
|
408
413
|
*/
|
|
409
414
|
create: (t) => {
|
|
@@ -448,7 +453,7 @@ const TABLES = [
|
|
|
448
453
|
},
|
|
449
454
|
{
|
|
450
455
|
name: 'auth_poppy_jtis',
|
|
451
|
-
/** `jti` já aceitos (
|
|
456
|
+
/** `jti` já aceitos (client assertions, Session JWTs, provas DPoP), até expirarem — anti-replay entre instâncias. */
|
|
452
457
|
create: (t) => {
|
|
453
458
|
t.string('key', 100).primary();
|
|
454
459
|
t.dateTime('expires_at', { useTz: true, precision: 3 }).notNullable().index();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/authkit-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "AdonisJS OIDC/OAuth2 provider (Identity Provider) toolkit: ejectable auth server with sessions, rate-limiting, MFA/TOTP, audit log, federated logout and OpenTelemetry metrics.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "dudousxd",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@adonis-agora/authkit-react": "0.26.0",
|
|
120
|
-
"@adonis-agora/durable": "0.
|
|
120
|
+
"@adonis-agora/durable": "0.54.1",
|
|
121
121
|
"@adonis-agora/telescope": "0.23.0",
|
|
122
122
|
"@adonisjs/ally": "6.3.2",
|
|
123
123
|
"@adonisjs/auth": "10.1.0",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"@poppinss/ts-exec": "1.5.1",
|
|
134
134
|
"@tailwindcss/cli": "4.3.3",
|
|
135
135
|
"@tanstack/intent": "0.5.6",
|
|
136
|
-
"@tanstack/react-query": "5.
|
|
136
|
+
"@tanstack/react-query": "5.105.0",
|
|
137
137
|
"@types/better-sqlite3": "9.6.0",
|
|
138
138
|
"@types/ioredis-mock": "8.2.8",
|
|
139
139
|
"@types/koa": "3.0.3",
|