@adonis-agora/authkit-client 0.14.0 → 0.16.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/build/commands/configure.js +5 -3
- package/build/index.d.ts +32 -28
- package/build/index.js +18 -15
- package/build/providers/authkit_client_provider.d.ts +66 -8
- package/build/providers/authkit_client_provider.js +130 -21
- package/build/services/main.d.ts +1 -1
- package/build/services/main.js +2 -2
- package/build/src/authenticator.d.ts +3 -3
- package/build/src/authenticator.js +4 -4
- package/build/src/define_config.d.ts +5 -5
- package/build/src/define_config.js +5 -5
- package/build/src/discovery.d.ts +1 -1
- package/build/src/discovery.js +5 -5
- package/build/src/dpop.js +1 -1
- package/build/src/host/authkit_client_guard.d.ts +100 -0
- package/build/src/host/authkit_client_guard.js +153 -0
- package/build/src/host/request_authenticator.d.ts +31 -0
- package/build/src/host/request_authenticator.js +24 -0
- package/build/src/middleware/authkit_context_middleware.d.ts +28 -0
- package/build/src/middleware/authkit_context_middleware.js +30 -0
- package/build/src/middleware/backchannel_revocation_middleware.js +3 -4
- package/build/src/observability/context_bridge.d.ts +1 -1
- package/build/src/observability/context_bridge.js +8 -8
- package/build/src/oidc_login.d.ts +2 -2
- package/build/src/oidc_login.js +29 -31
- package/build/src/register_oidc_client.d.ts +1 -1
- package/build/src/register_oidc_client.js +7 -4
- package/build/src/resolvers/factory.js +2 -2
- package/build/src/resolvers/jwt_resolver.d.ts +1 -1
- package/build/src/resolvers/jwt_resolver.js +12 -1
- package/build/src/resolvers/opaque_resolver.d.ts +1 -1
- package/build/src/resolvers/pat_resolver.d.ts +1 -1
- package/build/src/revocation/revocation_store.js +0 -0
- package/build/src/types.d.ts +9 -0
- package/build/types.d.ts +1 -1
- package/package.json +10 -3
- package/stubs/main.ts +2 -2
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { createRemoteJWKSet, jwtVerify } from 'jose';
|
|
2
2
|
import { buildIdentityFromClaims } from './identity.js';
|
|
3
|
-
const DEFAULT_ALGS = [
|
|
3
|
+
const DEFAULT_ALGS = [
|
|
4
|
+
'RS256',
|
|
5
|
+
'RS384',
|
|
6
|
+
'RS512',
|
|
7
|
+
'PS256',
|
|
8
|
+
'PS384',
|
|
9
|
+
'PS512',
|
|
10
|
+
'ES256',
|
|
11
|
+
'ES384',
|
|
12
|
+
'ES512',
|
|
13
|
+
'EdDSA',
|
|
14
|
+
];
|
|
4
15
|
export class JwtResolver {
|
|
5
16
|
config;
|
|
6
17
|
#jwks;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HttpContext } from '@adonisjs/core/http';
|
|
2
1
|
import type { Identity, SessionResolver } from '@adonis-agora/authkit-core';
|
|
2
|
+
import type { HttpContext } from '@adonisjs/core/http';
|
|
3
3
|
import { type TokenSource } from '../token_source.js';
|
|
4
4
|
type FetchImpl = (url: string, init: any) => Promise<{
|
|
5
5
|
ok: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HttpContext } from '@adonisjs/core/http';
|
|
2
1
|
import type { Identity, SessionResolver } from '@adonis-agora/authkit-core';
|
|
2
|
+
import type { HttpContext } from '@adonisjs/core/http';
|
|
3
3
|
type FetchImpl = (url: string, init: any) => Promise<{
|
|
4
4
|
ok: boolean;
|
|
5
5
|
json: () => Promise<any>;
|
|
Binary file
|
package/build/src/types.d.ts
CHANGED
|
@@ -3,4 +3,13 @@ export interface TokenSet {
|
|
|
3
3
|
accessToken: string;
|
|
4
4
|
refreshToken?: string;
|
|
5
5
|
expiresAt?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Nonce opaco que amarra ESTE token set à credencial de impersonação parqueada
|
|
8
|
+
* em `${sessionKey}_impersonator`. Escrito só por `impersonate()`; preservado
|
|
9
|
+
* pelo `maybeRefresh`; conferido pelo `stopImpersonating()`. Qualquer outra
|
|
10
|
+
* escrita no slot da sessão (login novo, logout+login) nasce sem ele — que é
|
|
11
|
+
* exatamente o sinal de que a sessão deixou de ser aquela p/ a qual a
|
|
12
|
+
* credencial foi guardada. Não é segredo de autenticação: é um vínculo.
|
|
13
|
+
*/
|
|
14
|
+
impersonationBinding?: string;
|
|
6
15
|
}
|
package/build/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Authenticator } from './src/authenticator.js';
|
|
2
1
|
import type { AuthkitClientManager } from './providers/authkit_client_provider.js';
|
|
2
|
+
import type { Authenticator } from './src/authenticator.js';
|
|
3
3
|
declare module '@adonisjs/core/http' {
|
|
4
4
|
interface HttpContext {
|
|
5
5
|
auth: Authenticator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/authkit-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "AdonisJS OIDC/OAuth2 relying-party (client) toolkit: session-based authentication against an OpenID Connect identity provider, with JWT/PAT user resolvers and OpenTelemetry metrics.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "dudousxd",
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"./types": "./build/index.js",
|
|
39
39
|
"./services/main": "./build/services/main.js",
|
|
40
40
|
"./authkit_client_provider": "./build/providers/authkit_client_provider.js",
|
|
41
|
+
"./auth": "./build/src/host/authkit_client_guard.js",
|
|
41
42
|
"./authkit_middleware": "./build/src/middleware/authkit_middleware.js",
|
|
43
|
+
"./authkit_context_middleware": "./build/src/middleware/authkit_context_middleware.js",
|
|
42
44
|
"./backchannel_revocation_middleware": "./build/src/middleware/backchannel_revocation_middleware.js",
|
|
43
45
|
"./auth_middleware": "./build/src/middleware/auth_middleware.js",
|
|
44
46
|
"./silent_auth_middleware": "./build/src/middleware/silent_auth_middleware.js",
|
|
@@ -54,12 +56,16 @@
|
|
|
54
56
|
]
|
|
55
57
|
},
|
|
56
58
|
"peerDependencies": {
|
|
59
|
+
"@adonisjs/auth": "^10.1.0",
|
|
57
60
|
"@adonisjs/core": "^7.3.3",
|
|
58
61
|
"@adonisjs/session": "^8.1.0",
|
|
59
62
|
"@adonisjs/lucid": "^22.4.2",
|
|
60
63
|
"@adonis-agora/resilience": "^0.1.0"
|
|
61
64
|
},
|
|
62
65
|
"peerDependenciesMeta": {
|
|
66
|
+
"@adonisjs/auth": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
63
69
|
"@adonisjs/lucid": {
|
|
64
70
|
"optional": true
|
|
65
71
|
},
|
|
@@ -72,6 +78,7 @@
|
|
|
72
78
|
"@adonis-agora/authkit-core": "0.7.0"
|
|
73
79
|
},
|
|
74
80
|
"devDependencies": {
|
|
81
|
+
"@adonisjs/auth": "10.1.0",
|
|
75
82
|
"@adonisjs/core": "7.3.5",
|
|
76
83
|
"@adonis-agora/resilience": "^0.1.0",
|
|
77
84
|
"@adonisjs/session": "8.1.0",
|
|
@@ -83,11 +90,11 @@
|
|
|
83
90
|
"ioredis-mock": "^8.9.0",
|
|
84
91
|
"@types/node": "25.9.1",
|
|
85
92
|
"typescript": "6.0.3",
|
|
86
|
-
"@adonis-agora/authkit-server": "0.
|
|
93
|
+
"@adonis-agora/authkit-server": "0.55.0"
|
|
87
94
|
},
|
|
88
95
|
"scripts": {
|
|
89
96
|
"build": "tsc && node -e \"require('node:fs').cpSync('stubs','build/stubs',{recursive:true,filter:(s)=>!s.endsWith('.ts')})\"",
|
|
90
|
-
"typecheck": "tsc --noEmit",
|
|
97
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.tests.json",
|
|
91
98
|
"test": "node --import=@poppinss/ts-exec bin/test.ts"
|
|
92
99
|
}
|
|
93
100
|
}
|
package/stubs/main.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url'
|
|
2
|
-
export const stubsRoot = fileURLToPath(new URL('./', import.meta.url))
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
export const stubsRoot = fileURLToPath(new URL('./', import.meta.url));
|