@adonis-agora/authkit-core 0.8.0 → 0.10.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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export type { Identity, SessionResolver } from './src/types/identity.js';
2
- export { ORG_ID_CLAIMS, deriveOrgId, deriveOrgSlug, deriveOrgRole, } from './src/types/identity.js';
3
- export type { ClientConfig, TtlConfig, JwksConfig, KeystoreStoreConfig, ObservabilityConfig, ResolvedAuthServerConfig, AccessTokenFormat, AccessTokenResourceConfig, AccessTokensConfig, } from './src/types/server_config.js';
4
- export { AUTHKIT_METRICS } from './src/metrics.js';
5
1
  export type { AuthkitMetricName } from './src/metrics.js';
6
- export { InMemorySnapshot, NoopRecorder } from './src/metrics_recorder.js';
2
+ export { AUTHKIT_METRICS } from './src/metrics.js';
7
3
  export type { MetricsRecorder, MetricsSnapshot } from './src/metrics_recorder.js';
4
+ export { InMemorySnapshot, NoopRecorder } from './src/metrics_recorder.js';
5
+ export type { Identity, SessionResolver } from './src/types/identity.js';
6
+ export { deriveOrgId, deriveOrgRole, deriveOrgSlug, ORG_ID_CLAIMS, } from './src/types/identity.js';
7
+ export type { AccessTokenFormat, AccessTokenResourceConfig, AccessTokensConfig, ClientConfig, JwksConfig, KeystoreStoreConfig, ObservabilityConfig, ResolvedAuthServerConfig, TtlConfig, } from './src/types/server_config.js';
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { ORG_ID_CLAIMS, deriveOrgId, deriveOrgSlug, deriveOrgRole, } from './src/types/identity.js';
2
1
  export { AUTHKIT_METRICS } from './src/metrics.js';
3
2
  export { InMemorySnapshot, NoopRecorder } from './src/metrics_recorder.js';
3
+ export { deriveOrgId, deriveOrgRole, deriveOrgSlug, ORG_ID_CLAIMS, } from './src/types/identity.js';
@@ -1,15 +1,15 @@
1
1
  /** Nomes canônicos das métricas OTel emitidas pela lib (usados no Plano 3). */
2
2
  export declare const AUTHKIT_METRICS: {
3
- readonly loginSuccess: "authkit.login.success";
4
- readonly loginFailure: "authkit.login.failure";
5
- readonly tokenIssued: "authkit.token.issued";
6
- readonly refreshRotated: "authkit.refresh.rotated";
7
- readonly grantRevoked: "authkit.grant.revoked";
8
- readonly sessionsActive: "authkit.sessions.active";
9
- readonly passwordHashDuration: "authkit.password.hash.duration";
10
- readonly resolveDuration: "authkit.resolve.duration";
11
- readonly resolveErrors: "authkit.resolve.errors";
12
- readonly jwksRefresh: "authkit.jwks.refresh";
13
- readonly tokenRefresh: "authkit.token.refresh";
3
+ readonly loginSuccess: 'authkit.login.success';
4
+ readonly loginFailure: 'authkit.login.failure';
5
+ readonly tokenIssued: 'authkit.token.issued';
6
+ readonly refreshRotated: 'authkit.refresh.rotated';
7
+ readonly grantRevoked: 'authkit.grant.revoked';
8
+ readonly sessionsActive: 'authkit.sessions.active';
9
+ readonly passwordHashDuration: 'authkit.password.hash.duration';
10
+ readonly resolveDuration: 'authkit.resolve.duration';
11
+ readonly resolveErrors: 'authkit.resolve.errors';
12
+ readonly jwksRefresh: 'authkit.jwks.refresh';
13
+ readonly tokenRefresh: 'authkit.token.refresh';
14
14
  };
15
15
  export type AuthkitMetricName = (typeof AUTHKIT_METRICS)[keyof typeof AUTHKIT_METRICS];
@@ -29,5 +29,5 @@ export declare class NoopRecorder implements MetricsRecorder {
29
29
  record(): void;
30
30
  snapshot(): MetricsSnapshot;
31
31
  }
32
- export { AUTHKIT_METRICS };
33
32
  export type { AuthkitMetricName };
33
+ export { AUTHKIT_METRICS };
@@ -51,7 +51,7 @@ export interface SessionResolver {
51
51
  * nome (`tid` no Entra ID, `organization_id` em vários). Derivar em UM lugar só
52
52
  * evita que cada app — e cada lib do Agora — reescreva essa tabela.
53
53
  */
54
- export declare const ORG_ID_CLAIMS: readonly ["active_organization_id", "org_id", "organization_id", "tenant_id", "tid"];
54
+ export declare const ORG_ID_CLAIMS: readonly ['active_organization_id', 'org_id', 'organization_id', 'tenant_id', 'tid'];
55
55
  /** Deriva a org/tenant ativo das claims cruas. `null` quando ausente. */
56
56
  export declare function deriveOrgId(claims: Record<string, unknown> | undefined): string | null;
57
57
  /** Deriva o slug da org ativa das claims cruas. `null` quando ausente. */
@@ -10,6 +10,16 @@ export interface ClientConfig {
10
10
  grants?: string[];
11
11
  /** 'none' para public clients (SPA com PKCE) */
12
12
  tokenEndpointAuthMethod?: 'client_secret_basic' | 'client_secret_post' | 'none';
13
+ /**
14
+ * Tipo de aplicação (OIDC Registration §2, `application_type`). Default `'web'`.
15
+ *
16
+ * `'native'` (RFC 8252 — OAuth 2.0 for Native Apps) libera os redirects de app
17
+ * mobile/desktop: esquema privado (`com.example.app:/callback`), URL https
18
+ * "claimed" (universal/app links) e loopback `http://127.0.0.1` com qualquer
19
+ * porta. Client nativo é SEMPRE público (sem `clientSecret`,
20
+ * `tokenEndpointAuthMethod: 'none'`) — PKCE já é obrigatório no issuer.
21
+ */
22
+ applicationType?: 'web' | 'native';
13
23
  /**
14
24
  * Endpoint do RP que recebe o POST de OIDC Back-Channel Logout. Quando definido,
15
25
  * o IdP envia um `logout_token` para esta URI ao encerrar a sessão/grant do usuário.
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@adonis-agora/authkit-core",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Shared core types and utilities for AuthKit — the AdonisJS OIDC/OAuth2 server and client toolkits.",
5
5
  "license": "MIT",
6
6
  "author": "dudousxd",
7
- "homepage": "https://github.com/DavideCarvalho/adonis-agora-authkit/tree/main/packages/authkit-core#readme",
8
7
  "repository": {
9
8
  "type": "git",
10
9
  "url": "https://github.com/DavideCarvalho/adonis-agora-authkit.git",
11
10
  "directory": "packages/authkit-core"
12
11
  },
12
+ "homepage": "https://davidecarvalho.github.io/agora/docs/authkit",
13
13
  "bugs": {
14
14
  "url": "https://github.com/DavideCarvalho/adonis-agora-authkit/issues"
15
15
  },
@@ -34,14 +34,17 @@
34
34
  ".": "./build/index.js",
35
35
  "./types": "./build/index.js"
36
36
  },
37
+ "engines": {
38
+ "node": ">=24"
39
+ },
37
40
  "devDependencies": {
38
- "@adonisjs/core": "7.4.0",
41
+ "@adonisjs/core": "7.5.0",
39
42
  "@adonisjs/tsconfig": "2.0.0",
40
43
  "@japa/assert": "4.2.0",
41
44
  "@japa/runner": "5.3.0",
42
45
  "@poppinss/ts-exec": "1.4.4",
43
- "@types/node": "25.9.1",
44
- "typescript": "6.0.3"
46
+ "@types/node": "26.5.1",
47
+ "typescript": "7.0.2"
45
48
  },
46
49
  "scripts": {
47
50
  "build": "tsc",