@authyon/server 0.2.0-beta.6 → 0.2.0-beta.8
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 +11 -0
- package/dist/authorization-BZTzR6iu.d.ts +129 -0
- package/dist/authorization-DPlRA9qM.d.cts +129 -0
- package/dist/{authorization-BGURVMFT.d.cts → authyonServerClient-D8r47VSq.d.cts} +12 -116
- package/dist/{authorization-BGURVMFT.d.ts → authyonServerClient-D8r47VSq.d.ts} +12 -116
- package/dist/bff.cjs +1126 -0
- package/dist/bff.d.cts +142 -0
- package/dist/bff.d.ts +142 -0
- package/dist/bff.js +791 -0
- package/dist/chunk-56H66KLG.js +323 -0
- package/dist/chunk-77J4NURK.js +13 -0
- package/dist/{chunk-24IFDJ73.js → chunk-NKWQMYB3.js} +6 -11
- package/dist/index.cjs +19 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +30 -318
- package/dist/next.d.cts +2 -1
- package/dist/next.d.ts +2 -1
- package/dist/next.js +2 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -37,6 +37,17 @@ O client também aceita `httpLogger: { enabled, logger? }`. A configuração é
|
|
|
37
37
|
|
|
38
38
|
`AuthyonError`, `ErrorCodes` e `error.interpret()` também são exportados por este pacote. Use `category`, `action`, `retryable`, `retryAfter` e `requestId` para implementar middleware e observabilidade sem comparar mensagens humanas.
|
|
39
39
|
|
|
40
|
+
## Sessão web no BFF (código ainda não publicado)
|
|
41
|
+
|
|
42
|
+
O novo entrypoint `@authyon/server/bff` oferece login, 2FA, sessão HttpOnly,
|
|
43
|
+
renovação sob demanda, logout e troca de organização. Os tokens ficam no servidor,
|
|
44
|
+
com adaptador Redis cifrado e compare-and-swap para concorrência entre instâncias.
|
|
45
|
+
Reutiliza os endpoints existentes e o cliente de validação server-side.
|
|
46
|
+
|
|
47
|
+
Veja [contrato e integração](../../docs/bff.md) e [análise/plano](../../docs/bff-session-plan.md).
|
|
48
|
+
O entrypoint padrão e `@authyon/server/next` mantêm seu comportamento anterior;
|
|
49
|
+
a adoção do transporte BFF pelo consumidor é explícita.
|
|
50
|
+
|
|
40
51
|
## Validação local com JWKS
|
|
41
52
|
|
|
42
53
|
Para APIs de alto volume, crie uma vez um verificador com discovery automático:
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { x as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-D8r47VSq.js';
|
|
2
|
+
|
|
3
|
+
type AbilitySubject = string | Record<string, unknown>;
|
|
4
|
+
type AbilityConditions = Record<string, unknown>;
|
|
5
|
+
interface AbilityRule {
|
|
6
|
+
action: string | string[];
|
|
7
|
+
subject: string | string[];
|
|
8
|
+
inverted?: boolean;
|
|
9
|
+
conditions?: AbilityConditions;
|
|
10
|
+
fields?: string[];
|
|
11
|
+
reason?: string;
|
|
12
|
+
}
|
|
13
|
+
interface AuthyonPermissionSource {
|
|
14
|
+
permissions?: readonly string[] | null;
|
|
15
|
+
roles?: readonly string[] | null;
|
|
16
|
+
/** OAuth scopes are also accepted and interpreted as Authyon permissions. */
|
|
17
|
+
scope?: string | null;
|
|
18
|
+
}
|
|
19
|
+
/** A declarative group of permissions evaluated against an Authyon permission source. */
|
|
20
|
+
interface PermissionGroup {
|
|
21
|
+
/** Permissions that must all be granted. */
|
|
22
|
+
allOf?: readonly string[];
|
|
23
|
+
/** Permissions where at least one must be granted. */
|
|
24
|
+
anyOf?: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
interface AuthyonAbilityOptions {
|
|
27
|
+
rules?: readonly AbilityRule[];
|
|
28
|
+
/** Rules added when the source contains a matching Authyon role. */
|
|
29
|
+
roleRules?: Readonly<Record<string, readonly AbilityRule[]>>;
|
|
30
|
+
roles?: readonly string[] | null;
|
|
31
|
+
detectSubjectType?: (subject: Record<string, unknown>) => string;
|
|
32
|
+
}
|
|
33
|
+
type AbilityEvent = "updated";
|
|
34
|
+
type AbilityListener = (rules: readonly AbilityRule[]) => void;
|
|
35
|
+
/** Isomorphic, deny-by-default authorization engine backed by Authyon permissions. */
|
|
36
|
+
declare class AuthyonAbility {
|
|
37
|
+
private readonly detectSubjectType;
|
|
38
|
+
private currentRules;
|
|
39
|
+
private readonly listeners;
|
|
40
|
+
constructor(rules?: readonly AbilityRule[], detectSubjectType?: (subject: Record<string, unknown>) => string);
|
|
41
|
+
get rules(): readonly AbilityRule[];
|
|
42
|
+
can(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
43
|
+
cannot(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
44
|
+
rulesFor(action: string, subject: string): readonly AbilityRule[];
|
|
45
|
+
update(rules: readonly AbilityRule[]): void;
|
|
46
|
+
on(event: AbilityEvent, listener: AbilityListener): () => void;
|
|
47
|
+
}
|
|
48
|
+
/** Fluent rule builder with CASL-like `can` and `cannot` methods. */
|
|
49
|
+
declare class AuthyonAbilityBuilder {
|
|
50
|
+
readonly rules: AbilityRule[];
|
|
51
|
+
can(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[]): this;
|
|
52
|
+
cannot(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[], reason?: string): this;
|
|
53
|
+
build(options?: Pick<AuthyonAbilityOptions, "detectSubjectType">): AuthyonAbility;
|
|
54
|
+
}
|
|
55
|
+
/** Creates an ability from Authyon permissions, OAuth scope and optional role rules. */
|
|
56
|
+
declare function createAuthyonAbility(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AuthyonAbility;
|
|
57
|
+
/** Checks an Authyon permission string using the same wildcard rules as an ability. */
|
|
58
|
+
declare function hasPermission(source: AuthyonPermissionSource | readonly string[], requiredPermission: string): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Checks a permission group using Authyon's standard permission and wildcard rules.
|
|
61
|
+
* Empty or omitted groups do not add authorization requirements.
|
|
62
|
+
*/
|
|
63
|
+
declare function hasPermissionGroup(source: AuthyonPermissionSource | readonly string[], group: PermissionGroup): boolean;
|
|
64
|
+
/** Converts Authyon's `subject:action` permission strings to authorization rules. */
|
|
65
|
+
declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
|
|
66
|
+
|
|
67
|
+
interface AbilityRequirement {
|
|
68
|
+
action: string;
|
|
69
|
+
subject: AbilitySubject;
|
|
70
|
+
field?: string;
|
|
71
|
+
}
|
|
72
|
+
interface AuthorizationContext {
|
|
73
|
+
token: string;
|
|
74
|
+
userId?: string;
|
|
75
|
+
ability: AuthyonAbility;
|
|
76
|
+
permissions: readonly string[];
|
|
77
|
+
roles: readonly string[];
|
|
78
|
+
}
|
|
79
|
+
interface AuthorizationOptions extends AuthyonAbilityOptions {
|
|
80
|
+
requirement?: AbilityRequirement;
|
|
81
|
+
/** Uses database-backed validation by default; introspection can be selected when desired. */
|
|
82
|
+
verification?: "validate" | "introspect" | "jwks";
|
|
83
|
+
/** Required for local JWKS verification. Create once and reuse its key cache. */
|
|
84
|
+
jwksVerifier?: JwksTokenVerifier;
|
|
85
|
+
/** Real end-user IP, obtained from trusted application infrastructure. */
|
|
86
|
+
clientIp?: string;
|
|
87
|
+
}
|
|
88
|
+
declare class AuthorizationError extends Error {
|
|
89
|
+
readonly status: 401 | 403 | 503;
|
|
90
|
+
readonly code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable";
|
|
91
|
+
constructor(status: 401 | 403 | 503, code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable", message: string);
|
|
92
|
+
}
|
|
93
|
+
/** Validates a bearer token and creates an Authyon-backed ability for server runtimes. */
|
|
94
|
+
declare function authorizeToken(client: AuthyonServerClient, token: string, options?: AuthorizationOptions): Promise<AuthorizationContext>;
|
|
95
|
+
/** Works with Web Request objects used by Next.js Route Handlers and other Fetch runtimes. */
|
|
96
|
+
declare function authorizeRequest(client: AuthyonServerClient, request: Pick<Request, "headers">, options?: RequestAuthorizationOptions): Promise<AuthorizationContext>;
|
|
97
|
+
interface RequestAuthorizationOptions extends AuthorizationOptions {
|
|
98
|
+
/** Platform-aware resolver. Only read headers that your trusted proxy overwrites. */
|
|
99
|
+
resolveClientIp?: (request: Pick<Request, "headers">) => string | undefined;
|
|
100
|
+
}
|
|
101
|
+
interface ExpressRequestLike {
|
|
102
|
+
headers: Record<string, string | string[] | undefined>;
|
|
103
|
+
ip?: string;
|
|
104
|
+
socket?: {
|
|
105
|
+
remoteAddress?: string;
|
|
106
|
+
};
|
|
107
|
+
authyon?: AuthorizationContext;
|
|
108
|
+
}
|
|
109
|
+
interface ExpressResponseLike {
|
|
110
|
+
status(code: number): ExpressResponseLike;
|
|
111
|
+
json(body: unknown): unknown;
|
|
112
|
+
}
|
|
113
|
+
type ExpressNext = (error?: unknown) => void;
|
|
114
|
+
interface ExpressAuthorizationMiddlewareOptions extends AuthorizationOptions {
|
|
115
|
+
/** Property assigned to the request. Defaults to `authyon`. */
|
|
116
|
+
requestProperty?: string;
|
|
117
|
+
/** Pass authorization errors to Express error middleware instead of writing a JSON response. */
|
|
118
|
+
passErrorsToNext?: boolean;
|
|
119
|
+
/** Trust Express's proxy-aware `request.ip`. Disabled by default. */
|
|
120
|
+
trustProxy?: boolean;
|
|
121
|
+
/** Overrides all built-in IP resolution; return only a trusted, single client IP. */
|
|
122
|
+
resolveClientIp?: (request: ExpressRequestLike) => string | undefined;
|
|
123
|
+
}
|
|
124
|
+
/** Dependency-free middleware compatible with Express and similar Connect frameworks. */
|
|
125
|
+
declare function createExpressAuthorizationMiddleware(client: AuthyonServerClient, options?: ExpressAuthorizationMiddlewareOptions): (request: ExpressRequestLike & Record<string, unknown>, response: ExpressResponseLike, next: ExpressNext) => Promise<void>;
|
|
126
|
+
/** Converts an authorization error into a Fetch Response suitable for Next.js. */
|
|
127
|
+
declare function createAuthorizationErrorResponse(error: unknown): Response;
|
|
128
|
+
|
|
129
|
+
export { type AbilitySubject as A, type ExpressAuthorizationMiddlewareOptions as E, type PermissionGroup as P, type RequestAuthorizationOptions as R, AuthorizationError as a, type AbilityConditions as b, type AbilityEvent as c, type AbilityListener as d, type AbilityRequirement as e, type AbilityRule as f, type AuthorizationContext as g, type AuthorizationOptions as h, AuthyonAbility as i, AuthyonAbilityBuilder as j, type AuthyonAbilityOptions as k, type AuthyonPermissionSource as l, type ExpressNext as m, type ExpressRequestLike as n, type ExpressResponseLike as o, authorizeRequest as p, authorizeToken as q, createAuthorizationErrorResponse as r, createAuthyonAbility as s, createAuthyonRules as t, createExpressAuthorizationMiddleware as u, hasPermission as v, hasPermissionGroup as w };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { x as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-D8r47VSq.cjs';
|
|
2
|
+
|
|
3
|
+
type AbilitySubject = string | Record<string, unknown>;
|
|
4
|
+
type AbilityConditions = Record<string, unknown>;
|
|
5
|
+
interface AbilityRule {
|
|
6
|
+
action: string | string[];
|
|
7
|
+
subject: string | string[];
|
|
8
|
+
inverted?: boolean;
|
|
9
|
+
conditions?: AbilityConditions;
|
|
10
|
+
fields?: string[];
|
|
11
|
+
reason?: string;
|
|
12
|
+
}
|
|
13
|
+
interface AuthyonPermissionSource {
|
|
14
|
+
permissions?: readonly string[] | null;
|
|
15
|
+
roles?: readonly string[] | null;
|
|
16
|
+
/** OAuth scopes are also accepted and interpreted as Authyon permissions. */
|
|
17
|
+
scope?: string | null;
|
|
18
|
+
}
|
|
19
|
+
/** A declarative group of permissions evaluated against an Authyon permission source. */
|
|
20
|
+
interface PermissionGroup {
|
|
21
|
+
/** Permissions that must all be granted. */
|
|
22
|
+
allOf?: readonly string[];
|
|
23
|
+
/** Permissions where at least one must be granted. */
|
|
24
|
+
anyOf?: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
interface AuthyonAbilityOptions {
|
|
27
|
+
rules?: readonly AbilityRule[];
|
|
28
|
+
/** Rules added when the source contains a matching Authyon role. */
|
|
29
|
+
roleRules?: Readonly<Record<string, readonly AbilityRule[]>>;
|
|
30
|
+
roles?: readonly string[] | null;
|
|
31
|
+
detectSubjectType?: (subject: Record<string, unknown>) => string;
|
|
32
|
+
}
|
|
33
|
+
type AbilityEvent = "updated";
|
|
34
|
+
type AbilityListener = (rules: readonly AbilityRule[]) => void;
|
|
35
|
+
/** Isomorphic, deny-by-default authorization engine backed by Authyon permissions. */
|
|
36
|
+
declare class AuthyonAbility {
|
|
37
|
+
private readonly detectSubjectType;
|
|
38
|
+
private currentRules;
|
|
39
|
+
private readonly listeners;
|
|
40
|
+
constructor(rules?: readonly AbilityRule[], detectSubjectType?: (subject: Record<string, unknown>) => string);
|
|
41
|
+
get rules(): readonly AbilityRule[];
|
|
42
|
+
can(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
43
|
+
cannot(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
44
|
+
rulesFor(action: string, subject: string): readonly AbilityRule[];
|
|
45
|
+
update(rules: readonly AbilityRule[]): void;
|
|
46
|
+
on(event: AbilityEvent, listener: AbilityListener): () => void;
|
|
47
|
+
}
|
|
48
|
+
/** Fluent rule builder with CASL-like `can` and `cannot` methods. */
|
|
49
|
+
declare class AuthyonAbilityBuilder {
|
|
50
|
+
readonly rules: AbilityRule[];
|
|
51
|
+
can(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[]): this;
|
|
52
|
+
cannot(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[], reason?: string): this;
|
|
53
|
+
build(options?: Pick<AuthyonAbilityOptions, "detectSubjectType">): AuthyonAbility;
|
|
54
|
+
}
|
|
55
|
+
/** Creates an ability from Authyon permissions, OAuth scope and optional role rules. */
|
|
56
|
+
declare function createAuthyonAbility(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AuthyonAbility;
|
|
57
|
+
/** Checks an Authyon permission string using the same wildcard rules as an ability. */
|
|
58
|
+
declare function hasPermission(source: AuthyonPermissionSource | readonly string[], requiredPermission: string): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Checks a permission group using Authyon's standard permission and wildcard rules.
|
|
61
|
+
* Empty or omitted groups do not add authorization requirements.
|
|
62
|
+
*/
|
|
63
|
+
declare function hasPermissionGroup(source: AuthyonPermissionSource | readonly string[], group: PermissionGroup): boolean;
|
|
64
|
+
/** Converts Authyon's `subject:action` permission strings to authorization rules. */
|
|
65
|
+
declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
|
|
66
|
+
|
|
67
|
+
interface AbilityRequirement {
|
|
68
|
+
action: string;
|
|
69
|
+
subject: AbilitySubject;
|
|
70
|
+
field?: string;
|
|
71
|
+
}
|
|
72
|
+
interface AuthorizationContext {
|
|
73
|
+
token: string;
|
|
74
|
+
userId?: string;
|
|
75
|
+
ability: AuthyonAbility;
|
|
76
|
+
permissions: readonly string[];
|
|
77
|
+
roles: readonly string[];
|
|
78
|
+
}
|
|
79
|
+
interface AuthorizationOptions extends AuthyonAbilityOptions {
|
|
80
|
+
requirement?: AbilityRequirement;
|
|
81
|
+
/** Uses database-backed validation by default; introspection can be selected when desired. */
|
|
82
|
+
verification?: "validate" | "introspect" | "jwks";
|
|
83
|
+
/** Required for local JWKS verification. Create once and reuse its key cache. */
|
|
84
|
+
jwksVerifier?: JwksTokenVerifier;
|
|
85
|
+
/** Real end-user IP, obtained from trusted application infrastructure. */
|
|
86
|
+
clientIp?: string;
|
|
87
|
+
}
|
|
88
|
+
declare class AuthorizationError extends Error {
|
|
89
|
+
readonly status: 401 | 403 | 503;
|
|
90
|
+
readonly code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable";
|
|
91
|
+
constructor(status: 401 | 403 | 503, code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable", message: string);
|
|
92
|
+
}
|
|
93
|
+
/** Validates a bearer token and creates an Authyon-backed ability for server runtimes. */
|
|
94
|
+
declare function authorizeToken(client: AuthyonServerClient, token: string, options?: AuthorizationOptions): Promise<AuthorizationContext>;
|
|
95
|
+
/** Works with Web Request objects used by Next.js Route Handlers and other Fetch runtimes. */
|
|
96
|
+
declare function authorizeRequest(client: AuthyonServerClient, request: Pick<Request, "headers">, options?: RequestAuthorizationOptions): Promise<AuthorizationContext>;
|
|
97
|
+
interface RequestAuthorizationOptions extends AuthorizationOptions {
|
|
98
|
+
/** Platform-aware resolver. Only read headers that your trusted proxy overwrites. */
|
|
99
|
+
resolveClientIp?: (request: Pick<Request, "headers">) => string | undefined;
|
|
100
|
+
}
|
|
101
|
+
interface ExpressRequestLike {
|
|
102
|
+
headers: Record<string, string | string[] | undefined>;
|
|
103
|
+
ip?: string;
|
|
104
|
+
socket?: {
|
|
105
|
+
remoteAddress?: string;
|
|
106
|
+
};
|
|
107
|
+
authyon?: AuthorizationContext;
|
|
108
|
+
}
|
|
109
|
+
interface ExpressResponseLike {
|
|
110
|
+
status(code: number): ExpressResponseLike;
|
|
111
|
+
json(body: unknown): unknown;
|
|
112
|
+
}
|
|
113
|
+
type ExpressNext = (error?: unknown) => void;
|
|
114
|
+
interface ExpressAuthorizationMiddlewareOptions extends AuthorizationOptions {
|
|
115
|
+
/** Property assigned to the request. Defaults to `authyon`. */
|
|
116
|
+
requestProperty?: string;
|
|
117
|
+
/** Pass authorization errors to Express error middleware instead of writing a JSON response. */
|
|
118
|
+
passErrorsToNext?: boolean;
|
|
119
|
+
/** Trust Express's proxy-aware `request.ip`. Disabled by default. */
|
|
120
|
+
trustProxy?: boolean;
|
|
121
|
+
/** Overrides all built-in IP resolution; return only a trusted, single client IP. */
|
|
122
|
+
resolveClientIp?: (request: ExpressRequestLike) => string | undefined;
|
|
123
|
+
}
|
|
124
|
+
/** Dependency-free middleware compatible with Express and similar Connect frameworks. */
|
|
125
|
+
declare function createExpressAuthorizationMiddleware(client: AuthyonServerClient, options?: ExpressAuthorizationMiddlewareOptions): (request: ExpressRequestLike & Record<string, unknown>, response: ExpressResponseLike, next: ExpressNext) => Promise<void>;
|
|
126
|
+
/** Converts an authorization error into a Fetch Response suitable for Next.js. */
|
|
127
|
+
declare function createAuthorizationErrorResponse(error: unknown): Response;
|
|
128
|
+
|
|
129
|
+
export { type AbilitySubject as A, type ExpressAuthorizationMiddlewareOptions as E, type PermissionGroup as P, type RequestAuthorizationOptions as R, AuthorizationError as a, type AbilityConditions as b, type AbilityEvent as c, type AbilityListener as d, type AbilityRequirement as e, type AbilityRule as f, type AuthorizationContext as g, type AuthorizationOptions as h, AuthyonAbility as i, AuthyonAbilityBuilder as j, type AuthyonAbilityOptions as k, type AuthyonPermissionSource as l, type ExpressNext as m, type ExpressRequestLike as n, type ExpressResponseLike as o, authorizeRequest as p, authorizeToken as q, createAuthorizationErrorResponse as r, createAuthyonAbility as s, createAuthyonRules as t, createExpressAuthorizationMiddleware as u, hasPermission as v, hasPermissionGroup as w };
|
|
@@ -97,6 +97,10 @@ interface Organization {
|
|
|
97
97
|
memberCount?: number;
|
|
98
98
|
createdAt?: string;
|
|
99
99
|
updatedAt?: string;
|
|
100
|
+
/** JSON-encoded metadata that may be exposed to tenant members. */
|
|
101
|
+
publicMetadata?: string;
|
|
102
|
+
/** JSON-encoded metadata available only through administrative APIs. */
|
|
103
|
+
privateMetadata?: string;
|
|
100
104
|
}
|
|
101
105
|
/** One of a user's tenant memberships, as embedded in `EnvironmentUser.tenantMemberships`. */
|
|
102
106
|
interface TenantMembership {
|
|
@@ -234,6 +238,8 @@ interface CreateOrganizationInput {
|
|
|
234
238
|
name: string;
|
|
235
239
|
slug: string;
|
|
236
240
|
description?: string;
|
|
241
|
+
publicMetadata?: Record<string, unknown>;
|
|
242
|
+
privateMetadata?: Record<string, unknown>;
|
|
237
243
|
}
|
|
238
244
|
interface UpdateOrganizationInput {
|
|
239
245
|
name: string;
|
|
@@ -741,7 +747,11 @@ declare class AuthyonServerClient {
|
|
|
741
747
|
get: (tenantId: string) => Promise<Organization>;
|
|
742
748
|
/** PUT /env/tenants/{tenantId} — update a tenant. */
|
|
743
749
|
update: (tenantId: string, input: UpdateOrganizationInput) => Promise<Organization>;
|
|
744
|
-
/**
|
|
750
|
+
/** PUT /env/tenants/{tenantId}/metadata - replace public and private metadata. */
|
|
751
|
+
updateMetadata: (tenantId: string, input: Pick<CreateOrganizationInput, "publicMetadata" | "privateMetadata">) => Promise<void>;
|
|
752
|
+
/** POST /env/tenants/{tenantId}/disable — disable without removing tenant data. */
|
|
753
|
+
disable: (tenantId: string) => Promise<void>;
|
|
754
|
+
/** DELETE /env/tenants/{tenantId} — logically delete (disable) a tenant. */
|
|
745
755
|
delete: (tenantId: string) => Promise<void>;
|
|
746
756
|
members: {
|
|
747
757
|
/**
|
|
@@ -881,118 +891,4 @@ declare class TenantScopedClient {
|
|
|
881
891
|
/** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
|
|
882
892
|
declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
|
|
883
893
|
|
|
884
|
-
type
|
|
885
|
-
type AbilityConditions = Record<string, unknown>;
|
|
886
|
-
interface AbilityRule {
|
|
887
|
-
action: string | string[];
|
|
888
|
-
subject: string | string[];
|
|
889
|
-
inverted?: boolean;
|
|
890
|
-
conditions?: AbilityConditions;
|
|
891
|
-
fields?: string[];
|
|
892
|
-
reason?: string;
|
|
893
|
-
}
|
|
894
|
-
interface AuthyonPermissionSource {
|
|
895
|
-
permissions?: readonly string[] | null;
|
|
896
|
-
roles?: readonly string[] | null;
|
|
897
|
-
/** OAuth scopes are also accepted and interpreted as Authyon permissions. */
|
|
898
|
-
scope?: string | null;
|
|
899
|
-
}
|
|
900
|
-
interface AuthyonAbilityOptions {
|
|
901
|
-
rules?: readonly AbilityRule[];
|
|
902
|
-
/** Rules added when the source contains a matching Authyon role. */
|
|
903
|
-
roleRules?: Readonly<Record<string, readonly AbilityRule[]>>;
|
|
904
|
-
roles?: readonly string[] | null;
|
|
905
|
-
detectSubjectType?: (subject: Record<string, unknown>) => string;
|
|
906
|
-
}
|
|
907
|
-
type AbilityEvent = "updated";
|
|
908
|
-
type AbilityListener = (rules: readonly AbilityRule[]) => void;
|
|
909
|
-
/** Isomorphic, deny-by-default authorization engine backed by Authyon permissions. */
|
|
910
|
-
declare class AuthyonAbility {
|
|
911
|
-
private readonly detectSubjectType;
|
|
912
|
-
private currentRules;
|
|
913
|
-
private readonly listeners;
|
|
914
|
-
constructor(rules?: readonly AbilityRule[], detectSubjectType?: (subject: Record<string, unknown>) => string);
|
|
915
|
-
get rules(): readonly AbilityRule[];
|
|
916
|
-
can(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
917
|
-
cannot(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
918
|
-
rulesFor(action: string, subject: string): readonly AbilityRule[];
|
|
919
|
-
update(rules: readonly AbilityRule[]): void;
|
|
920
|
-
on(event: AbilityEvent, listener: AbilityListener): () => void;
|
|
921
|
-
}
|
|
922
|
-
/** Fluent rule builder with CASL-like `can` and `cannot` methods. */
|
|
923
|
-
declare class AuthyonAbilityBuilder {
|
|
924
|
-
readonly rules: AbilityRule[];
|
|
925
|
-
can(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[]): this;
|
|
926
|
-
cannot(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[], reason?: string): this;
|
|
927
|
-
build(options?: Pick<AuthyonAbilityOptions, "detectSubjectType">): AuthyonAbility;
|
|
928
|
-
}
|
|
929
|
-
/** Creates an ability from Authyon permissions, OAuth scope and optional role rules. */
|
|
930
|
-
declare function createAuthyonAbility(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AuthyonAbility;
|
|
931
|
-
/** Checks an Authyon permission string using the same wildcard rules as an ability. */
|
|
932
|
-
declare function hasPermission(source: AuthyonPermissionSource | readonly string[], requiredPermission: string): boolean;
|
|
933
|
-
/** Converts Authyon's `subject:action` permission strings to authorization rules. */
|
|
934
|
-
declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
|
|
935
|
-
|
|
936
|
-
interface AbilityRequirement {
|
|
937
|
-
action: string;
|
|
938
|
-
subject: AbilitySubject;
|
|
939
|
-
field?: string;
|
|
940
|
-
}
|
|
941
|
-
interface AuthorizationContext {
|
|
942
|
-
token: string;
|
|
943
|
-
userId?: string;
|
|
944
|
-
ability: AuthyonAbility;
|
|
945
|
-
permissions: readonly string[];
|
|
946
|
-
roles: readonly string[];
|
|
947
|
-
}
|
|
948
|
-
interface AuthorizationOptions extends AuthyonAbilityOptions {
|
|
949
|
-
requirement?: AbilityRequirement;
|
|
950
|
-
/** Uses database-backed validation by default; introspection can be selected when desired. */
|
|
951
|
-
verification?: "validate" | "introspect" | "jwks";
|
|
952
|
-
/** Required for local JWKS verification. Create once and reuse its key cache. */
|
|
953
|
-
jwksVerifier?: JwksTokenVerifier;
|
|
954
|
-
/** Real end-user IP, obtained from trusted application infrastructure. */
|
|
955
|
-
clientIp?: string;
|
|
956
|
-
}
|
|
957
|
-
declare class AuthorizationError extends Error {
|
|
958
|
-
readonly status: 401 | 403 | 503;
|
|
959
|
-
readonly code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable";
|
|
960
|
-
constructor(status: 401 | 403 | 503, code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable", message: string);
|
|
961
|
-
}
|
|
962
|
-
/** Validates a bearer token and creates an Authyon-backed ability for server runtimes. */
|
|
963
|
-
declare function authorizeToken(client: AuthyonServerClient, token: string, options?: AuthorizationOptions): Promise<AuthorizationContext>;
|
|
964
|
-
/** Works with Web Request objects used by Next.js Route Handlers and other Fetch runtimes. */
|
|
965
|
-
declare function authorizeRequest(client: AuthyonServerClient, request: Pick<Request, "headers">, options?: RequestAuthorizationOptions): Promise<AuthorizationContext>;
|
|
966
|
-
interface RequestAuthorizationOptions extends AuthorizationOptions {
|
|
967
|
-
/** Platform-aware resolver. Only read headers that your trusted proxy overwrites. */
|
|
968
|
-
resolveClientIp?: (request: Pick<Request, "headers">) => string | undefined;
|
|
969
|
-
}
|
|
970
|
-
interface ExpressRequestLike {
|
|
971
|
-
headers: Record<string, string | string[] | undefined>;
|
|
972
|
-
ip?: string;
|
|
973
|
-
socket?: {
|
|
974
|
-
remoteAddress?: string;
|
|
975
|
-
};
|
|
976
|
-
authyon?: AuthorizationContext;
|
|
977
|
-
}
|
|
978
|
-
interface ExpressResponseLike {
|
|
979
|
-
status(code: number): ExpressResponseLike;
|
|
980
|
-
json(body: unknown): unknown;
|
|
981
|
-
}
|
|
982
|
-
type ExpressNext = (error?: unknown) => void;
|
|
983
|
-
interface ExpressAuthorizationMiddlewareOptions extends AuthorizationOptions {
|
|
984
|
-
/** Property assigned to the request. Defaults to `authyon`. */
|
|
985
|
-
requestProperty?: string;
|
|
986
|
-
/** Pass authorization errors to Express error middleware instead of writing a JSON response. */
|
|
987
|
-
passErrorsToNext?: boolean;
|
|
988
|
-
/** Trust Express's proxy-aware `request.ip`. Disabled by default. */
|
|
989
|
-
trustProxy?: boolean;
|
|
990
|
-
/** Overrides all built-in IP resolution; return only a trusted, single client IP. */
|
|
991
|
-
resolveClientIp?: (request: ExpressRequestLike) => string | undefined;
|
|
992
|
-
}
|
|
993
|
-
/** Dependency-free middleware compatible with Express and similar Connect frameworks. */
|
|
994
|
-
declare function createExpressAuthorizationMiddleware(client: AuthyonServerClient, options?: ExpressAuthorizationMiddlewareOptions): (request: ExpressRequestLike & Record<string, unknown>, response: ExpressResponseLike, next: ExpressNext) => Promise<void>;
|
|
995
|
-
/** Converts an authorization error into a Fetch Response suitable for Next.js. */
|
|
996
|
-
declare function createAuthorizationErrorResponse(error: unknown): Response;
|
|
997
|
-
|
|
998
|
-
export { type Organization as $, AuthyonServerClient as A, type CredentialCreator as B, type ClientCredentials as C, type CredentialDetail as D, type CredentialListOptions as E, type CredentialPermissionsInput as F, type CredentialScope as G, type HttpAdapter as H, type EnvironmentUser as I, type ExpressAuthorizationMiddlewareOptions as J, type ExpressNext as K, type ExpressRequestLike as L, type ExpressResponseLike as M, FetchHttpAdapter as N, type HttpAdapterRequest as O, type HttpLogEvent as P, type HttpLogger as Q, type RequestAuthorizationOptions as R, type IntrospectResult as S, type InviteTenantMemberInput as T, type InviteWorkspaceMemberInput as U, type JsonWebKeySet as V, JwksTokenVerifier as W, type JwksTokenVerifierOptions as X, LoggingHttpAdapter as Y, type LoginActivity as Z, type OpenIdConfiguration as _, type AbilitySubject as a, type Paged as a0, type PaginationOptions as a1, type Permission as a2, type PermissionsByRole as a3, PlatformScopedClient as a4, type ReservedPermissions as a5, type Role as a6, type RoleGrant as a7, type RoleInput as a8, type RoleList as a9, authorizeRequest as aA, authorizeToken as aB, createAuthorizationErrorResponse as aC, createAuthyonAbility as aD, createAuthyonRules as aE, createClient as aF, createExpressAuthorizationMiddleware as aG, hasPermission as aH, normalizeClientIp as aI, type RolePermissions as aa, type SafeJwtAlgorithm as ab, type TenantClientValidationResult as ac, type TenantCredentialIssued as ad, type TenantCredentialSummary as ae, type TenantManagementScope as af, type TenantMember as ag, type TenantMemberPage as ah, type TenantMembership as ai, TenantScopedClient as aj, type TokenResult as ak, TokenVerificationError as al, type TokenVerificationErrorCode as am, type UpdateOrganizationInput as an, type User as ao, UserScopedClient as ap, type ValidateResult as aq, type VerifiedAccessToken as ar, type WorkspaceInvite as as, type WorkspaceInviteAccepted as at, type WorkspaceInviteIssued as au, type WorkspaceInvitePreview as av, WorkspaceInvitesClient as aw, type WorkspaceMember as ax, type WorkspaceRole as ay, type WorkspaceTeam as az, AuthorizationError as b, type HttpLoggerOptions as c, type AbilityConditions as d, type AbilityEvent as e, type AbilityListener as f, type AbilityRequirement as g, type AbilityRule as h, type AcceptWorkspaceInviteInput as i, type AccessTokenSource as j, type AuditEvent as k, type AuthorizationContext as l, type AuthorizationOptions as m, AuthyonAbility as n, AuthyonAbilityBuilder as o, type AuthyonAbilityOptions as p, type AuthyonJwksDiscoveryOptions as q, type AuthyonJwtClaims as r, type AuthyonPermissionSource as s, type AuthyonServerClientOptions as t, type ClientRequestContext as u, type CreateCredentialInput as v, type CreateOrganizationInput as w, type CreatePermissionInput as x, type CreateTenantCredentialInput as y, type CreateUserInput as z };
|
|
894
|
+
export { type TenantMemberPage as $, AuthyonServerClient as A, type Organization as B, type ClientCredentials as C, type PaginationOptions as D, type EnvironmentUser as E, FetchHttpAdapter as F, type Permission as G, type HttpAdapter as H, type IntrospectResult as I, type JsonWebKeySet as J, type PermissionsByRole as K, LoggingHttpAdapter as L, PlatformScopedClient as M, type Role as N, type OpenIdConfiguration as O, type Paged as P, type RoleGrant as Q, type ReservedPermissions as R, type RoleInput as S, type RoleList as T, type RolePermissions as U, type SafeJwtAlgorithm as V, type TenantClientValidationResult as W, type TenantCredentialIssued as X, type TenantCredentialSummary as Y, type TenantManagementScope as Z, type TenantMember as _, type HttpLoggerOptions as a, type TenantMembership as a0, TenantScopedClient as a1, type TokenResult as a2, TokenVerificationError as a3, type TokenVerificationErrorCode as a4, type UpdateOrganizationInput as a5, type User as a6, UserScopedClient as a7, type ValidateResult as a8, type VerifiedAccessToken as a9, type WorkspaceInvite as aa, type WorkspaceInviteAccepted as ab, type WorkspaceInviteIssued as ac, type WorkspaceInvitePreview as ad, WorkspaceInvitesClient as ae, type WorkspaceMember as af, type WorkspaceRole as ag, type WorkspaceTeam as ah, createClient as ai, normalizeClientIp as aj, type AcceptWorkspaceInviteInput as b, type AccessTokenSource as c, type AuditEvent as d, type AuthyonJwksDiscoveryOptions as e, type AuthyonJwtClaims as f, type AuthyonServerClientOptions as g, type ClientRequestContext as h, type CreateCredentialInput as i, type CreateOrganizationInput as j, type CreatePermissionInput as k, type CreateTenantCredentialInput as l, type CreateUserInput as m, type CredentialCreator as n, type CredentialDetail as o, type CredentialListOptions as p, type CredentialPermissionsInput as q, type CredentialScope as r, type HttpAdapterRequest as s, type HttpLogEvent as t, type HttpLogger as u, type InviteTenantMemberInput as v, type InviteWorkspaceMemberInput as w, JwksTokenVerifier as x, type JwksTokenVerifierOptions as y, type LoginActivity as z };
|
|
@@ -97,6 +97,10 @@ interface Organization {
|
|
|
97
97
|
memberCount?: number;
|
|
98
98
|
createdAt?: string;
|
|
99
99
|
updatedAt?: string;
|
|
100
|
+
/** JSON-encoded metadata that may be exposed to tenant members. */
|
|
101
|
+
publicMetadata?: string;
|
|
102
|
+
/** JSON-encoded metadata available only through administrative APIs. */
|
|
103
|
+
privateMetadata?: string;
|
|
100
104
|
}
|
|
101
105
|
/** One of a user's tenant memberships, as embedded in `EnvironmentUser.tenantMemberships`. */
|
|
102
106
|
interface TenantMembership {
|
|
@@ -234,6 +238,8 @@ interface CreateOrganizationInput {
|
|
|
234
238
|
name: string;
|
|
235
239
|
slug: string;
|
|
236
240
|
description?: string;
|
|
241
|
+
publicMetadata?: Record<string, unknown>;
|
|
242
|
+
privateMetadata?: Record<string, unknown>;
|
|
237
243
|
}
|
|
238
244
|
interface UpdateOrganizationInput {
|
|
239
245
|
name: string;
|
|
@@ -741,7 +747,11 @@ declare class AuthyonServerClient {
|
|
|
741
747
|
get: (tenantId: string) => Promise<Organization>;
|
|
742
748
|
/** PUT /env/tenants/{tenantId} — update a tenant. */
|
|
743
749
|
update: (tenantId: string, input: UpdateOrganizationInput) => Promise<Organization>;
|
|
744
|
-
/**
|
|
750
|
+
/** PUT /env/tenants/{tenantId}/metadata - replace public and private metadata. */
|
|
751
|
+
updateMetadata: (tenantId: string, input: Pick<CreateOrganizationInput, "publicMetadata" | "privateMetadata">) => Promise<void>;
|
|
752
|
+
/** POST /env/tenants/{tenantId}/disable — disable without removing tenant data. */
|
|
753
|
+
disable: (tenantId: string) => Promise<void>;
|
|
754
|
+
/** DELETE /env/tenants/{tenantId} — logically delete (disable) a tenant. */
|
|
745
755
|
delete: (tenantId: string) => Promise<void>;
|
|
746
756
|
members: {
|
|
747
757
|
/**
|
|
@@ -881,118 +891,4 @@ declare class TenantScopedClient {
|
|
|
881
891
|
/** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
|
|
882
892
|
declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
|
|
883
893
|
|
|
884
|
-
type
|
|
885
|
-
type AbilityConditions = Record<string, unknown>;
|
|
886
|
-
interface AbilityRule {
|
|
887
|
-
action: string | string[];
|
|
888
|
-
subject: string | string[];
|
|
889
|
-
inverted?: boolean;
|
|
890
|
-
conditions?: AbilityConditions;
|
|
891
|
-
fields?: string[];
|
|
892
|
-
reason?: string;
|
|
893
|
-
}
|
|
894
|
-
interface AuthyonPermissionSource {
|
|
895
|
-
permissions?: readonly string[] | null;
|
|
896
|
-
roles?: readonly string[] | null;
|
|
897
|
-
/** OAuth scopes are also accepted and interpreted as Authyon permissions. */
|
|
898
|
-
scope?: string | null;
|
|
899
|
-
}
|
|
900
|
-
interface AuthyonAbilityOptions {
|
|
901
|
-
rules?: readonly AbilityRule[];
|
|
902
|
-
/** Rules added when the source contains a matching Authyon role. */
|
|
903
|
-
roleRules?: Readonly<Record<string, readonly AbilityRule[]>>;
|
|
904
|
-
roles?: readonly string[] | null;
|
|
905
|
-
detectSubjectType?: (subject: Record<string, unknown>) => string;
|
|
906
|
-
}
|
|
907
|
-
type AbilityEvent = "updated";
|
|
908
|
-
type AbilityListener = (rules: readonly AbilityRule[]) => void;
|
|
909
|
-
/** Isomorphic, deny-by-default authorization engine backed by Authyon permissions. */
|
|
910
|
-
declare class AuthyonAbility {
|
|
911
|
-
private readonly detectSubjectType;
|
|
912
|
-
private currentRules;
|
|
913
|
-
private readonly listeners;
|
|
914
|
-
constructor(rules?: readonly AbilityRule[], detectSubjectType?: (subject: Record<string, unknown>) => string);
|
|
915
|
-
get rules(): readonly AbilityRule[];
|
|
916
|
-
can(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
917
|
-
cannot(action: string, subject: AbilitySubject, field?: string): boolean;
|
|
918
|
-
rulesFor(action: string, subject: string): readonly AbilityRule[];
|
|
919
|
-
update(rules: readonly AbilityRule[]): void;
|
|
920
|
-
on(event: AbilityEvent, listener: AbilityListener): () => void;
|
|
921
|
-
}
|
|
922
|
-
/** Fluent rule builder with CASL-like `can` and `cannot` methods. */
|
|
923
|
-
declare class AuthyonAbilityBuilder {
|
|
924
|
-
readonly rules: AbilityRule[];
|
|
925
|
-
can(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[]): this;
|
|
926
|
-
cannot(action: string | string[], subject: string | string[], conditions?: AbilityConditions, fields?: string[], reason?: string): this;
|
|
927
|
-
build(options?: Pick<AuthyonAbilityOptions, "detectSubjectType">): AuthyonAbility;
|
|
928
|
-
}
|
|
929
|
-
/** Creates an ability from Authyon permissions, OAuth scope and optional role rules. */
|
|
930
|
-
declare function createAuthyonAbility(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AuthyonAbility;
|
|
931
|
-
/** Checks an Authyon permission string using the same wildcard rules as an ability. */
|
|
932
|
-
declare function hasPermission(source: AuthyonPermissionSource | readonly string[], requiredPermission: string): boolean;
|
|
933
|
-
/** Converts Authyon's `subject:action` permission strings to authorization rules. */
|
|
934
|
-
declare function createAuthyonRules(source?: AuthyonPermissionSource, options?: AuthyonAbilityOptions): AbilityRule[];
|
|
935
|
-
|
|
936
|
-
interface AbilityRequirement {
|
|
937
|
-
action: string;
|
|
938
|
-
subject: AbilitySubject;
|
|
939
|
-
field?: string;
|
|
940
|
-
}
|
|
941
|
-
interface AuthorizationContext {
|
|
942
|
-
token: string;
|
|
943
|
-
userId?: string;
|
|
944
|
-
ability: AuthyonAbility;
|
|
945
|
-
permissions: readonly string[];
|
|
946
|
-
roles: readonly string[];
|
|
947
|
-
}
|
|
948
|
-
interface AuthorizationOptions extends AuthyonAbilityOptions {
|
|
949
|
-
requirement?: AbilityRequirement;
|
|
950
|
-
/** Uses database-backed validation by default; introspection can be selected when desired. */
|
|
951
|
-
verification?: "validate" | "introspect" | "jwks";
|
|
952
|
-
/** Required for local JWKS verification. Create once and reuse its key cache. */
|
|
953
|
-
jwksVerifier?: JwksTokenVerifier;
|
|
954
|
-
/** Real end-user IP, obtained from trusted application infrastructure. */
|
|
955
|
-
clientIp?: string;
|
|
956
|
-
}
|
|
957
|
-
declare class AuthorizationError extends Error {
|
|
958
|
-
readonly status: 401 | 403 | 503;
|
|
959
|
-
readonly code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable";
|
|
960
|
-
constructor(status: 401 | 403 | 503, code: "authorization.unauthenticated" | "authorization.forbidden" | "authorization.unavailable", message: string);
|
|
961
|
-
}
|
|
962
|
-
/** Validates a bearer token and creates an Authyon-backed ability for server runtimes. */
|
|
963
|
-
declare function authorizeToken(client: AuthyonServerClient, token: string, options?: AuthorizationOptions): Promise<AuthorizationContext>;
|
|
964
|
-
/** Works with Web Request objects used by Next.js Route Handlers and other Fetch runtimes. */
|
|
965
|
-
declare function authorizeRequest(client: AuthyonServerClient, request: Pick<Request, "headers">, options?: RequestAuthorizationOptions): Promise<AuthorizationContext>;
|
|
966
|
-
interface RequestAuthorizationOptions extends AuthorizationOptions {
|
|
967
|
-
/** Platform-aware resolver. Only read headers that your trusted proxy overwrites. */
|
|
968
|
-
resolveClientIp?: (request: Pick<Request, "headers">) => string | undefined;
|
|
969
|
-
}
|
|
970
|
-
interface ExpressRequestLike {
|
|
971
|
-
headers: Record<string, string | string[] | undefined>;
|
|
972
|
-
ip?: string;
|
|
973
|
-
socket?: {
|
|
974
|
-
remoteAddress?: string;
|
|
975
|
-
};
|
|
976
|
-
authyon?: AuthorizationContext;
|
|
977
|
-
}
|
|
978
|
-
interface ExpressResponseLike {
|
|
979
|
-
status(code: number): ExpressResponseLike;
|
|
980
|
-
json(body: unknown): unknown;
|
|
981
|
-
}
|
|
982
|
-
type ExpressNext = (error?: unknown) => void;
|
|
983
|
-
interface ExpressAuthorizationMiddlewareOptions extends AuthorizationOptions {
|
|
984
|
-
/** Property assigned to the request. Defaults to `authyon`. */
|
|
985
|
-
requestProperty?: string;
|
|
986
|
-
/** Pass authorization errors to Express error middleware instead of writing a JSON response. */
|
|
987
|
-
passErrorsToNext?: boolean;
|
|
988
|
-
/** Trust Express's proxy-aware `request.ip`. Disabled by default. */
|
|
989
|
-
trustProxy?: boolean;
|
|
990
|
-
/** Overrides all built-in IP resolution; return only a trusted, single client IP. */
|
|
991
|
-
resolveClientIp?: (request: ExpressRequestLike) => string | undefined;
|
|
992
|
-
}
|
|
993
|
-
/** Dependency-free middleware compatible with Express and similar Connect frameworks. */
|
|
994
|
-
declare function createExpressAuthorizationMiddleware(client: AuthyonServerClient, options?: ExpressAuthorizationMiddlewareOptions): (request: ExpressRequestLike & Record<string, unknown>, response: ExpressResponseLike, next: ExpressNext) => Promise<void>;
|
|
995
|
-
/** Converts an authorization error into a Fetch Response suitable for Next.js. */
|
|
996
|
-
declare function createAuthorizationErrorResponse(error: unknown): Response;
|
|
997
|
-
|
|
998
|
-
export { type Organization as $, AuthyonServerClient as A, type CredentialCreator as B, type ClientCredentials as C, type CredentialDetail as D, type CredentialListOptions as E, type CredentialPermissionsInput as F, type CredentialScope as G, type HttpAdapter as H, type EnvironmentUser as I, type ExpressAuthorizationMiddlewareOptions as J, type ExpressNext as K, type ExpressRequestLike as L, type ExpressResponseLike as M, FetchHttpAdapter as N, type HttpAdapterRequest as O, type HttpLogEvent as P, type HttpLogger as Q, type RequestAuthorizationOptions as R, type IntrospectResult as S, type InviteTenantMemberInput as T, type InviteWorkspaceMemberInput as U, type JsonWebKeySet as V, JwksTokenVerifier as W, type JwksTokenVerifierOptions as X, LoggingHttpAdapter as Y, type LoginActivity as Z, type OpenIdConfiguration as _, type AbilitySubject as a, type Paged as a0, type PaginationOptions as a1, type Permission as a2, type PermissionsByRole as a3, PlatformScopedClient as a4, type ReservedPermissions as a5, type Role as a6, type RoleGrant as a7, type RoleInput as a8, type RoleList as a9, authorizeRequest as aA, authorizeToken as aB, createAuthorizationErrorResponse as aC, createAuthyonAbility as aD, createAuthyonRules as aE, createClient as aF, createExpressAuthorizationMiddleware as aG, hasPermission as aH, normalizeClientIp as aI, type RolePermissions as aa, type SafeJwtAlgorithm as ab, type TenantClientValidationResult as ac, type TenantCredentialIssued as ad, type TenantCredentialSummary as ae, type TenantManagementScope as af, type TenantMember as ag, type TenantMemberPage as ah, type TenantMembership as ai, TenantScopedClient as aj, type TokenResult as ak, TokenVerificationError as al, type TokenVerificationErrorCode as am, type UpdateOrganizationInput as an, type User as ao, UserScopedClient as ap, type ValidateResult as aq, type VerifiedAccessToken as ar, type WorkspaceInvite as as, type WorkspaceInviteAccepted as at, type WorkspaceInviteIssued as au, type WorkspaceInvitePreview as av, WorkspaceInvitesClient as aw, type WorkspaceMember as ax, type WorkspaceRole as ay, type WorkspaceTeam as az, AuthorizationError as b, type HttpLoggerOptions as c, type AbilityConditions as d, type AbilityEvent as e, type AbilityListener as f, type AbilityRequirement as g, type AbilityRule as h, type AcceptWorkspaceInviteInput as i, type AccessTokenSource as j, type AuditEvent as k, type AuthorizationContext as l, type AuthorizationOptions as m, AuthyonAbility as n, AuthyonAbilityBuilder as o, type AuthyonAbilityOptions as p, type AuthyonJwksDiscoveryOptions as q, type AuthyonJwtClaims as r, type AuthyonPermissionSource as s, type AuthyonServerClientOptions as t, type ClientRequestContext as u, type CreateCredentialInput as v, type CreateOrganizationInput as w, type CreatePermissionInput as x, type CreateTenantCredentialInput as y, type CreateUserInput as z };
|
|
894
|
+
export { type TenantMemberPage as $, AuthyonServerClient as A, type Organization as B, type ClientCredentials as C, type PaginationOptions as D, type EnvironmentUser as E, FetchHttpAdapter as F, type Permission as G, type HttpAdapter as H, type IntrospectResult as I, type JsonWebKeySet as J, type PermissionsByRole as K, LoggingHttpAdapter as L, PlatformScopedClient as M, type Role as N, type OpenIdConfiguration as O, type Paged as P, type RoleGrant as Q, type ReservedPermissions as R, type RoleInput as S, type RoleList as T, type RolePermissions as U, type SafeJwtAlgorithm as V, type TenantClientValidationResult as W, type TenantCredentialIssued as X, type TenantCredentialSummary as Y, type TenantManagementScope as Z, type TenantMember as _, type HttpLoggerOptions as a, type TenantMembership as a0, TenantScopedClient as a1, type TokenResult as a2, TokenVerificationError as a3, type TokenVerificationErrorCode as a4, type UpdateOrganizationInput as a5, type User as a6, UserScopedClient as a7, type ValidateResult as a8, type VerifiedAccessToken as a9, type WorkspaceInvite as aa, type WorkspaceInviteAccepted as ab, type WorkspaceInviteIssued as ac, type WorkspaceInvitePreview as ad, WorkspaceInvitesClient as ae, type WorkspaceMember as af, type WorkspaceRole as ag, type WorkspaceTeam as ah, createClient as ai, normalizeClientIp as aj, type AcceptWorkspaceInviteInput as b, type AccessTokenSource as c, type AuditEvent as d, type AuthyonJwksDiscoveryOptions as e, type AuthyonJwtClaims as f, type AuthyonServerClientOptions as g, type ClientRequestContext as h, type CreateCredentialInput as i, type CreateOrganizationInput as j, type CreatePermissionInput as k, type CreateTenantCredentialInput as l, type CreateUserInput as m, type CredentialCreator as n, type CredentialDetail as o, type CredentialListOptions as p, type CredentialPermissionsInput as q, type CredentialScope as r, type HttpAdapterRequest as s, type HttpLogEvent as t, type HttpLogger as u, type InviteTenantMemberInput as v, type InviteWorkspaceMemberInput as w, JwksTokenVerifier as x, type JwksTokenVerifierOptions as y, type LoginActivity as z };
|