@adonis-agora/authkit-server 0.38.1 → 0.39.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.
@@ -0,0 +1,17 @@
1
+ import type { OidcService } from "../src/provider/oidc_service.js";
2
+ /**
3
+ * Acessor singleton do {@link OidcService}, seguindo a convenção `services/main` do
4
+ * AdonisJS (igual `@adonisjs/lucid/services/db`, `@adonisjs/drive/services/main` e
5
+ * `@adonisjs/lock/services/main`). Permite que um app escreva
6
+ * `import authkit from "@adonis-agora/authkit-server/services/main"` e leia
7
+ * `authkit.config` / chame `authkit.provider` etc., em vez de resolver na mão a
8
+ * binding string-keyed `"authkit.server"` pelo container.
9
+ *
10
+ * Roda `await app.booted()` no top-level, então SÓ funciona dentro de um app
11
+ * booted — por isso `scripts/import-smoke.mjs` pula o diretório `services`.
12
+ *
13
+ * Dentro da própria lib continuamos resolvendo via `ctx.containerResolver.make("authkit.server")`,
14
+ * que é o idioma das libs first-party (ver `@adonisjs/auth`, `initialize_auth_middleware`).
15
+ */
16
+ declare let service: OidcService;
17
+ export { service as default };
@@ -0,0 +1,20 @@
1
+ import app from "@adonisjs/core/services/app";
2
+ /**
3
+ * Acessor singleton do {@link OidcService}, seguindo a convenção `services/main` do
4
+ * AdonisJS (igual `@adonisjs/lucid/services/db`, `@adonisjs/drive/services/main` e
5
+ * `@adonisjs/lock/services/main`). Permite que um app escreva
6
+ * `import authkit from "@adonis-agora/authkit-server/services/main"` e leia
7
+ * `authkit.config` / chame `authkit.provider` etc., em vez de resolver na mão a
8
+ * binding string-keyed `"authkit.server"` pelo container.
9
+ *
10
+ * Roda `await app.booted()` no top-level, então SÓ funciona dentro de um app
11
+ * booted — por isso `scripts/import-smoke.mjs` pula o diretório `services`.
12
+ *
13
+ * Dentro da própria lib continuamos resolvendo via `ctx.containerResolver.make("authkit.server")`,
14
+ * que é o idioma das libs first-party (ver `@adonisjs/auth`, `initialize_auth_middleware`).
15
+ */
16
+ let service;
17
+ await app.booted(async () => {
18
+ service = await app.container.make("authkit.server");
19
+ });
20
+ export { service as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonis-agora/authkit-server",
3
- "version": "0.38.1",
3
+ "version": "0.39.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",
@@ -38,6 +38,7 @@
38
38
  "exports": {
39
39
  ".": "./build/index.js",
40
40
  "./types": "./build/index.js",
41
+ "./services/main": "./build/services/main.js",
41
42
  "./durable": "./build/src/host/durable/index.js",
42
43
  "./telescope": "./build/src/observability/telescope/index.js",
43
44
  "./authkit_server_provider": "./build/providers/authkit_server_provider.js",