@adonis-agora/authkit-client 0.17.1 → 0.17.3
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.
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
// Side-effect import: pulls the `HttpContext.auth` module augmentation (declared
|
|
2
|
+
// in the package root `types.ts`) into this module's declaration graph, so an app
|
|
3
|
+
// that registers this middleware gets `ctx.auth` typed as AuthKit's `Authenticator`.
|
|
4
|
+
// It lives here — and not in `index.ts` — because this middleware is what actually
|
|
5
|
+
// assigns `ctx.auth`. Apps that instead hand `ctx.auth` to `@adonisjs/auth` via
|
|
6
|
+
// `authkitClientGuard` never register this middleware, so the two owners of
|
|
7
|
+
// `ctx.auth` can never collide. Same pattern as `@adonisjs/auth`, which augments
|
|
8
|
+
// `HttpContext` from its own `initialize_auth_middleware`.
|
|
9
|
+
// It must be a bare side-effect import, not `import type {} from`: the type-only form
|
|
10
|
+
// is erased from the emitted `.d.ts` as well, which would drop the augmentation again.
|
|
11
|
+
// The runtime cost is nil — `build/types.js` is this package's own file and compiles
|
|
12
|
+
// down to `export {}`.
|
|
13
|
+
import '../../types.js';
|
|
1
14
|
export default class AuthkitMiddleware {
|
|
2
15
|
async handle(ctx, next) {
|
|
3
16
|
const manager = await ctx.containerResolver.make('authkit.client');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/authkit-client",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.3",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"exports": {
|
|
37
37
|
".": "./build/index.js",
|
|
38
|
-
"./types": "./build/
|
|
38
|
+
"./types": "./build/types.js",
|
|
39
39
|
"./services/main": "./build/services/main.js",
|
|
40
40
|
"./authkit_client_provider": "./build/providers/authkit_client_provider.js",
|
|
41
41
|
"./auth": "./build/src/host/authkit_client_guard.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@adonisjs/core": "^7.3.3",
|
|
62
62
|
"@adonisjs/session": "^8.1.0",
|
|
63
63
|
"@adonisjs/lucid": "^22.4.2",
|
|
64
|
-
"@adonis-agora/resilience": "
|
|
64
|
+
"@adonis-agora/resilience": ">=0.1.0 <1.0.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@adonisjs/auth": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"ioredis-mock": "8.13.1",
|
|
92
92
|
"@types/node": "25.9.1",
|
|
93
93
|
"typescript": "6.0.3",
|
|
94
|
-
"@adonis-agora/authkit-server": "0.
|
|
94
|
+
"@adonis-agora/authkit-server": "0.58.1"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"build": "tsc && node -e \"require('node:fs').cpSync('stubs','build/stubs',{recursive:true,filter:(s)=>!s.endsWith('.ts')})\"",
|