@authyon/server 0.2.0-beta.31 → 0.2.0-beta.33
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/dist/{authorization-Cc-xr0ay.d.ts → authorization-059M8_N2.d.ts} +1 -1
- package/dist/{authorization-CALNd7HI.d.cts → authorization-Crx47kOt.d.cts} +1 -1
- package/dist/{authyonServerClient-mwY55kc9.d.cts → authyonServerClient-Cpyey7He.d.cts} +27 -2
- package/dist/{authyonServerClient-mwY55kc9.d.ts → authyonServerClient-Cpyey7He.d.ts} +27 -2
- package/dist/bff.d.cts +1 -1
- package/dist/bff.d.ts +1 -1
- package/dist/index.cjs +38 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +38 -2
- package/dist/next.d.cts +2 -2
- package/dist/next.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-
|
|
1
|
+
import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.js';
|
|
2
2
|
|
|
3
3
|
type AbilitySubject = string | Record<string, unknown>;
|
|
4
4
|
type AbilityConditions = Record<string, unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-
|
|
1
|
+
import { J as JwksTokenVerifier, A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.cjs';
|
|
2
2
|
|
|
3
3
|
type AbilitySubject = string | Record<string, unknown>;
|
|
4
4
|
type AbilityConditions = Record<string, unknown>;
|
|
@@ -209,11 +209,31 @@ type TenantOrder = TenantOrderField | {
|
|
|
209
209
|
* There is no `status`: only active sub-tenants are listed, since everything
|
|
210
210
|
* below a disabled one is closed to reads from above.
|
|
211
211
|
*/
|
|
212
|
-
interface SubTenantListOptions extends PaginationOptions {
|
|
212
|
+
interface SubTenantListOptions extends PaginationOptions, PermissionFilterOptions {
|
|
213
213
|
search?: string;
|
|
214
214
|
filter?: string[];
|
|
215
215
|
orderBy?: TenantOrder;
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Keep only the tenants where the user holds these permissions.
|
|
219
|
+
*
|
|
220
|
+
* - `permission`: up to 10 concrete values (no wildcards). Custom permissions
|
|
221
|
+
* count as well as Authyon's own.
|
|
222
|
+
* - `permissionMatch`: `"all"` (the default) needs every value; `"any"` needs
|
|
223
|
+
* one.
|
|
224
|
+
*
|
|
225
|
+
* On a tenant the user belongs to, it is what that membership grants. On one
|
|
226
|
+
* reached from above, it is what switching into it would grant (the nearest
|
|
227
|
+
* ancestor membership holding `subtenants:tree:switch`) plus the
|
|
228
|
+
* `subtenants:tree:*` values held above — the same rules the routes apply, so
|
|
229
|
+
* the filter never offers an action that would then be refused. A grant of
|
|
230
|
+
* `tenants:**` holds `tenants:members:invite`. Needs the Authyon API of
|
|
231
|
+
* 2026-11-27 or newer; an older one ignores it.
|
|
232
|
+
*/
|
|
233
|
+
interface PermissionFilterOptions {
|
|
234
|
+
permission?: string[];
|
|
235
|
+
permissionMatch?: "all" | "any";
|
|
236
|
+
}
|
|
217
237
|
/** The tenant another one hangs from: enough to name it in a breadcrumb. */
|
|
218
238
|
interface TenantParent {
|
|
219
239
|
id: string;
|
|
@@ -1031,6 +1051,11 @@ declare class UserScopedClient {
|
|
|
1031
1051
|
members: {
|
|
1032
1052
|
/** Newest first; `search` matches email, username or name (at most 100 characters). */
|
|
1033
1053
|
list: (tenantId: string, options?: MemberListOptions) => Promise<TenantMemberPage>;
|
|
1054
|
+
/**
|
|
1055
|
+
* One member, in the shape of a `list` row. A user who is not a direct
|
|
1056
|
+
* member fails with `tenant.member.not_found` (404).
|
|
1057
|
+
*/
|
|
1058
|
+
get: (tenantId: string, userId: string) => Promise<TenantMember>;
|
|
1034
1059
|
/** Adds an existing environment user by email; does not send an invitation email. */
|
|
1035
1060
|
invite: (tenantId: string, input: InviteTenantMemberInput) => Promise<TenantMember>;
|
|
1036
1061
|
remove: (tenantId: string, userId: string) => Promise<void>;
|
|
@@ -1706,4 +1731,4 @@ declare class TenantScopedClient {
|
|
|
1706
1731
|
/** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
|
|
1707
1732
|
declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
|
|
1708
1733
|
|
|
1709
|
-
export { type PasswordResetIssued as $, AuthyonServerClient as A, type BuiltInPermission as B, CLIENT_IP_HEADER as C, type CredentialListOptions as D, type CredentialPermissionsInput as E, type EnvironmentUser as F, FetchHttpAdapter as G, type HttpAdapter as H, type HttpAdapterRequest as I, JwksTokenVerifier as J, type HttpLogEvent as K, type HttpLogger as L, type IntrospectResult as M, type InviteTenantMemberInput as N, type IssuePasswordResetInput as O, type JsonWebKeySet as P, type JwksTokenVerifierOptions as Q, LoggingHttpAdapter as R, type LoginActivity as S, type MemberListOptions as T, type MyTenant as U, type OpenIdConfiguration as V, type Organization as W, type OtpCheckResult as X, type Paged as Y, type PaginationOptions as Z, type PasswordResetCompleted as _, type HttpLoggerOptions as a, type PasswordResetPreview as a0, type Permission as a1, type
|
|
1734
|
+
export { type PasswordResetIssued as $, AuthyonServerClient as A, type BuiltInPermission as B, CLIENT_IP_HEADER as C, type CredentialListOptions as D, type CredentialPermissionsInput as E, type EnvironmentUser as F, FetchHttpAdapter as G, type HttpAdapter as H, type HttpAdapterRequest as I, JwksTokenVerifier as J, type HttpLogEvent as K, type HttpLogger as L, type IntrospectResult as M, type InviteTenantMemberInput as N, type IssuePasswordResetInput as O, type JsonWebKeySet as P, type JwksTokenVerifierOptions as Q, LoggingHttpAdapter as R, type LoginActivity as S, type MemberListOptions as T, type MyTenant as U, type OpenIdConfiguration as V, type Organization as W, type OtpCheckResult as X, type Paged as Y, type PaginationOptions as Z, type PasswordResetCompleted as _, type HttpLoggerOptions as a, type PasswordResetPreview as a0, type Permission as a1, type PermissionFilterOptions as a2, type PermissionsByRole as a3, type ReservedPermissions as a4, type Role as a5, type RoleGrant as a6, type RoleInput as a7, type RoleList as a8, type RolePermissions as a9, type TenantMembership as aA, type TenantOrder as aB, type TenantOrderField as aC, type TenantParent as aD, TenantScopedClient as aE, type TokenResult as aF, TokenVerificationError as aG, type TokenVerificationErrorCode as aH, type UpdateOrganizationInput as aI, type UpdateTenantInput as aJ, type User as aK, UserScopedClient as aL, type ValidateResult as aM, type VerifiedAccessToken as aN, createClient as aO, normalizeClientIp as aP, tenantFilter as aQ, type SafeJwtAlgorithm as aa, type SecurityMethods as ab, type SubTenant as ac, type SubTenantListOptions as ad, type SubjectApprovals as ae, type SubjectSecurity as af, TENANT_FILTER_MAX_DEPTH as ag, TENANT_FILTER_MAX_VALUES as ah, TENANT_FILTER_MAX_VALUE_LENGTH as ai, type Tenant as aj, type TenantAncestor as ak, type TenantClientValidationResult as al, type TenantCredentialIssued as am, type TenantCredentialSummary as an, type TenantFilterExpression as ao, type TenantFilterValue as ap, type TenantInvite as aq, type TenantInviteAccepted as ar, type TenantInviteInput as as, type TenantInviteIssued as at, type TenantInviteListOptions as au, type TenantInvitePreview as av, type TenantInviteStatus as aw, type TenantListOptions as ax, type TenantMember as ay, type TenantMemberPage as az, type AcceptTenantInviteInput as b, type AccessTokenSource as c, type Approval as d, type ApprovalAssurance as e, type ApprovalPayload as f, type ApprovalStatus as g, type ApprovalWebAuthnOptions as h, type AuditEvent as i, type AuthyonJwksDiscoveryOptions as j, type AuthyonJwtClaims as k, type AuthyonServerClientOptions as l, type AuthyonTenantClaim as m, type ClientCredentials as n, type ClientRequestContext as o, type ConfirmApprovalInput as p, type ConsumedApproval as q, type CreateApprovalInput as r, type CreateCredentialInput as s, type CreateOrganizationInput as t, type CreatePermissionInput as u, type CreateTenantCredentialInput as v, type CreateTenantInput as w, type CreateUserInput as x, type CredentialCreator as y, type CredentialDetail as z };
|
|
@@ -209,11 +209,31 @@ type TenantOrder = TenantOrderField | {
|
|
|
209
209
|
* There is no `status`: only active sub-tenants are listed, since everything
|
|
210
210
|
* below a disabled one is closed to reads from above.
|
|
211
211
|
*/
|
|
212
|
-
interface SubTenantListOptions extends PaginationOptions {
|
|
212
|
+
interface SubTenantListOptions extends PaginationOptions, PermissionFilterOptions {
|
|
213
213
|
search?: string;
|
|
214
214
|
filter?: string[];
|
|
215
215
|
orderBy?: TenantOrder;
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Keep only the tenants where the user holds these permissions.
|
|
219
|
+
*
|
|
220
|
+
* - `permission`: up to 10 concrete values (no wildcards). Custom permissions
|
|
221
|
+
* count as well as Authyon's own.
|
|
222
|
+
* - `permissionMatch`: `"all"` (the default) needs every value; `"any"` needs
|
|
223
|
+
* one.
|
|
224
|
+
*
|
|
225
|
+
* On a tenant the user belongs to, it is what that membership grants. On one
|
|
226
|
+
* reached from above, it is what switching into it would grant (the nearest
|
|
227
|
+
* ancestor membership holding `subtenants:tree:switch`) plus the
|
|
228
|
+
* `subtenants:tree:*` values held above — the same rules the routes apply, so
|
|
229
|
+
* the filter never offers an action that would then be refused. A grant of
|
|
230
|
+
* `tenants:**` holds `tenants:members:invite`. Needs the Authyon API of
|
|
231
|
+
* 2026-11-27 or newer; an older one ignores it.
|
|
232
|
+
*/
|
|
233
|
+
interface PermissionFilterOptions {
|
|
234
|
+
permission?: string[];
|
|
235
|
+
permissionMatch?: "all" | "any";
|
|
236
|
+
}
|
|
217
237
|
/** The tenant another one hangs from: enough to name it in a breadcrumb. */
|
|
218
238
|
interface TenantParent {
|
|
219
239
|
id: string;
|
|
@@ -1031,6 +1051,11 @@ declare class UserScopedClient {
|
|
|
1031
1051
|
members: {
|
|
1032
1052
|
/** Newest first; `search` matches email, username or name (at most 100 characters). */
|
|
1033
1053
|
list: (tenantId: string, options?: MemberListOptions) => Promise<TenantMemberPage>;
|
|
1054
|
+
/**
|
|
1055
|
+
* One member, in the shape of a `list` row. A user who is not a direct
|
|
1056
|
+
* member fails with `tenant.member.not_found` (404).
|
|
1057
|
+
*/
|
|
1058
|
+
get: (tenantId: string, userId: string) => Promise<TenantMember>;
|
|
1034
1059
|
/** Adds an existing environment user by email; does not send an invitation email. */
|
|
1035
1060
|
invite: (tenantId: string, input: InviteTenantMemberInput) => Promise<TenantMember>;
|
|
1036
1061
|
remove: (tenantId: string, userId: string) => Promise<void>;
|
|
@@ -1706,4 +1731,4 @@ declare class TenantScopedClient {
|
|
|
1706
1731
|
/** Convenience factory: `const authyon = createClient({ clientId, clientSecret })`. */
|
|
1707
1732
|
declare function createClient(options?: AuthyonServerClientOptions): AuthyonServerClient;
|
|
1708
1733
|
|
|
1709
|
-
export { type PasswordResetIssued as $, AuthyonServerClient as A, type BuiltInPermission as B, CLIENT_IP_HEADER as C, type CredentialListOptions as D, type CredentialPermissionsInput as E, type EnvironmentUser as F, FetchHttpAdapter as G, type HttpAdapter as H, type HttpAdapterRequest as I, JwksTokenVerifier as J, type HttpLogEvent as K, type HttpLogger as L, type IntrospectResult as M, type InviteTenantMemberInput as N, type IssuePasswordResetInput as O, type JsonWebKeySet as P, type JwksTokenVerifierOptions as Q, LoggingHttpAdapter as R, type LoginActivity as S, type MemberListOptions as T, type MyTenant as U, type OpenIdConfiguration as V, type Organization as W, type OtpCheckResult as X, type Paged as Y, type PaginationOptions as Z, type PasswordResetCompleted as _, type HttpLoggerOptions as a, type PasswordResetPreview as a0, type Permission as a1, type
|
|
1734
|
+
export { type PasswordResetIssued as $, AuthyonServerClient as A, type BuiltInPermission as B, CLIENT_IP_HEADER as C, type CredentialListOptions as D, type CredentialPermissionsInput as E, type EnvironmentUser as F, FetchHttpAdapter as G, type HttpAdapter as H, type HttpAdapterRequest as I, JwksTokenVerifier as J, type HttpLogEvent as K, type HttpLogger as L, type IntrospectResult as M, type InviteTenantMemberInput as N, type IssuePasswordResetInput as O, type JsonWebKeySet as P, type JwksTokenVerifierOptions as Q, LoggingHttpAdapter as R, type LoginActivity as S, type MemberListOptions as T, type MyTenant as U, type OpenIdConfiguration as V, type Organization as W, type OtpCheckResult as X, type Paged as Y, type PaginationOptions as Z, type PasswordResetCompleted as _, type HttpLoggerOptions as a, type PasswordResetPreview as a0, type Permission as a1, type PermissionFilterOptions as a2, type PermissionsByRole as a3, type ReservedPermissions as a4, type Role as a5, type RoleGrant as a6, type RoleInput as a7, type RoleList as a8, type RolePermissions as a9, type TenantMembership as aA, type TenantOrder as aB, type TenantOrderField as aC, type TenantParent as aD, TenantScopedClient as aE, type TokenResult as aF, TokenVerificationError as aG, type TokenVerificationErrorCode as aH, type UpdateOrganizationInput as aI, type UpdateTenantInput as aJ, type User as aK, UserScopedClient as aL, type ValidateResult as aM, type VerifiedAccessToken as aN, createClient as aO, normalizeClientIp as aP, tenantFilter as aQ, type SafeJwtAlgorithm as aa, type SecurityMethods as ab, type SubTenant as ac, type SubTenantListOptions as ad, type SubjectApprovals as ae, type SubjectSecurity as af, TENANT_FILTER_MAX_DEPTH as ag, TENANT_FILTER_MAX_VALUES as ah, TENANT_FILTER_MAX_VALUE_LENGTH as ai, type Tenant as aj, type TenantAncestor as ak, type TenantClientValidationResult as al, type TenantCredentialIssued as am, type TenantCredentialSummary as an, type TenantFilterExpression as ao, type TenantFilterValue as ap, type TenantInvite as aq, type TenantInviteAccepted as ar, type TenantInviteInput as as, type TenantInviteIssued as at, type TenantInviteListOptions as au, type TenantInvitePreview as av, type TenantInviteStatus as aw, type TenantListOptions as ax, type TenantMember as ay, type TenantMemberPage as az, type AcceptTenantInviteInput as b, type AccessTokenSource as c, type Approval as d, type ApprovalAssurance as e, type ApprovalPayload as f, type ApprovalStatus as g, type ApprovalWebAuthnOptions as h, type AuditEvent as i, type AuthyonJwksDiscoveryOptions as j, type AuthyonJwtClaims as k, type AuthyonServerClientOptions as l, type AuthyonTenantClaim as m, type ClientCredentials as n, type ClientRequestContext as o, type ConfirmApprovalInput as p, type ConsumedApproval as q, type CreateApprovalInput as r, type CreateCredentialInput as s, type CreateOrganizationInput as t, type CreatePermissionInput as u, type CreateTenantCredentialInput as v, type CreateTenantInput as w, type CreateUserInput as x, type CredentialCreator as y, type CredentialDetail as z };
|
package/dist/bff.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-
|
|
1
|
+
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.cjs';
|
|
2
2
|
import 'jose';
|
|
3
3
|
|
|
4
4
|
interface BffLoginInput {
|
package/dist/bff.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-
|
|
1
|
+
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.js';
|
|
2
2
|
import 'jose';
|
|
3
3
|
|
|
4
4
|
interface BffLoginInput {
|
package/dist/index.cjs
CHANGED
|
@@ -211,6 +211,34 @@ function memberQuery(options = {}) {
|
|
|
211
211
|
var ORDER_FIELDS = ["name", "createdAt", "updatedAt"];
|
|
212
212
|
var MAX_FILTERS = 10;
|
|
213
213
|
var MAX_FILTER_LENGTH = 512;
|
|
214
|
+
var MAX_PERMISSIONS = 10;
|
|
215
|
+
var MAX_PERMISSION_LENGTH = 256;
|
|
216
|
+
function permissionQuery(options = {}) {
|
|
217
|
+
const { permission, permissionMatch } = options;
|
|
218
|
+
const query = {};
|
|
219
|
+
if (permissionMatch !== void 0) {
|
|
220
|
+
if (permissionMatch !== "all" && permissionMatch !== "any")
|
|
221
|
+
throw new RangeError('Authyon: permissionMatch must be "all" or "any".');
|
|
222
|
+
query.permissionMatch = permissionMatch;
|
|
223
|
+
}
|
|
224
|
+
if (permission === void 0) return query;
|
|
225
|
+
if (!Array.isArray(permission)) throw new RangeError("Authyon: permission must be an array.");
|
|
226
|
+
const values = permission.map((p) => typeof p === "string" ? p.trim() : "");
|
|
227
|
+
if (values.some((p) => p.length === 0))
|
|
228
|
+
throw new RangeError("Authyon: a permission value may not be empty.");
|
|
229
|
+
if (values.length > MAX_PERMISSIONS)
|
|
230
|
+
throw new RangeError(`Authyon: at most ${MAX_PERMISSIONS} permission values per request.`);
|
|
231
|
+
for (const p of values) {
|
|
232
|
+
if (p.length > MAX_PERMISSION_LENGTH)
|
|
233
|
+
throw new RangeError(
|
|
234
|
+
`Authyon: a permission holds at most ${MAX_PERMISSION_LENGTH} characters.`
|
|
235
|
+
);
|
|
236
|
+
if (p.includes("*"))
|
|
237
|
+
throw new RangeError(`Authyon: name a concrete permission, not a wildcard (got "${p}").`);
|
|
238
|
+
}
|
|
239
|
+
if (values.length > 0) query.permission = values;
|
|
240
|
+
return query;
|
|
241
|
+
}
|
|
214
242
|
function orderByParam(order) {
|
|
215
243
|
if (order === void 0) return void 0;
|
|
216
244
|
const field = typeof order === "string" ? order : order?.field;
|
|
@@ -222,8 +250,11 @@ function orderByParam(order) {
|
|
|
222
250
|
return `${field}:${direction}`;
|
|
223
251
|
}
|
|
224
252
|
function subTenantQuery(options = {}) {
|
|
225
|
-
const { filter, orderBy, ...page } = options;
|
|
226
|
-
const query = {
|
|
253
|
+
const { filter, orderBy, permission, permissionMatch, ...page } = options;
|
|
254
|
+
const query = {
|
|
255
|
+
...memberQuery(page),
|
|
256
|
+
...permissionQuery({ permission, permissionMatch })
|
|
257
|
+
};
|
|
227
258
|
if (filter !== void 0) {
|
|
228
259
|
if (!Array.isArray(filter)) throw new RangeError("Authyon: filter must be an array.");
|
|
229
260
|
const present = filter.filter((f) => typeof f === "string" && f.trim().length > 0);
|
|
@@ -346,6 +377,11 @@ var UserScopedClient = class {
|
|
|
346
377
|
list: (tenantId, options = {}) => __privateGet(this, _request).call(this, `/auth/tenants/${segment(tenantId)}/members`, {
|
|
347
378
|
query: memberQuery(options)
|
|
348
379
|
}),
|
|
380
|
+
/**
|
|
381
|
+
* One member, in the shape of a `list` row. A user who is not a direct
|
|
382
|
+
* member fails with `tenant.member.not_found` (404).
|
|
383
|
+
*/
|
|
384
|
+
get: (tenantId, userId) => __privateGet(this, _request).call(this, `/auth/tenants/${segment(tenantId)}/members/${segment(userId)}`),
|
|
349
385
|
/** Adds an existing environment user by email; does not send an invitation email. */
|
|
350
386
|
invite: (tenantId, input) => __privateGet(this, _request).call(this, `/auth/tenants/${segment(tenantId)}/members`, {
|
|
351
387
|
method: "POST",
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-
|
|
2
|
-
export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, B as BuiltInPermission, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateTenantInput, x as CreateUserInput, y as CredentialCreator, z as CredentialDetail, D as CredentialListOptions, E as CredentialPermissionsInput, F as EnvironmentUser, G as FetchHttpAdapter, I as HttpAdapterRequest, K as HttpLogEvent, L as HttpLogger, M as IntrospectResult, N as InviteTenantMemberInput, O as IssuePasswordResetInput, P as JsonWebKeySet, J as JwksTokenVerifier, Q as JwksTokenVerifierOptions, R as LoggingHttpAdapter, S as LoginActivity, T as MemberListOptions, U as MyTenant, V as OpenIdConfiguration, W as Organization, X as OtpCheckResult, Y as Paged, Z as PaginationOptions, _ as PasswordResetCompleted, $ as PasswordResetIssued, a0 as PasswordResetPreview, a1 as Permission, a2 as
|
|
3
|
-
export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-
|
|
1
|
+
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.cjs';
|
|
2
|
+
export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, B as BuiltInPermission, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateTenantInput, x as CreateUserInput, y as CredentialCreator, z as CredentialDetail, D as CredentialListOptions, E as CredentialPermissionsInput, F as EnvironmentUser, G as FetchHttpAdapter, I as HttpAdapterRequest, K as HttpLogEvent, L as HttpLogger, M as IntrospectResult, N as InviteTenantMemberInput, O as IssuePasswordResetInput, P as JsonWebKeySet, J as JwksTokenVerifier, Q as JwksTokenVerifierOptions, R as LoggingHttpAdapter, S as LoginActivity, T as MemberListOptions, U as MyTenant, V as OpenIdConfiguration, W as Organization, X as OtpCheckResult, Y as Paged, Z as PaginationOptions, _ as PasswordResetCompleted, $ as PasswordResetIssued, a0 as PasswordResetPreview, a1 as Permission, a2 as PermissionFilterOptions, a3 as PermissionsByRole, a4 as ReservedPermissions, a5 as Role, a6 as RoleGrant, a7 as RoleInput, a8 as RoleList, a9 as RolePermissions, aa as SafeJwtAlgorithm, ab as SecurityMethods, ac as SubTenant, ad as SubTenantListOptions, ae as SubjectApprovals, af as SubjectSecurity, ag as TENANT_FILTER_MAX_DEPTH, ah as TENANT_FILTER_MAX_VALUES, ai as TENANT_FILTER_MAX_VALUE_LENGTH, aj as Tenant, ak as TenantAncestor, al as TenantClientValidationResult, am as TenantCredentialIssued, an as TenantCredentialSummary, ao as TenantFilterExpression, ap as TenantFilterValue, aq as TenantInvite, ar as TenantInviteAccepted, as as TenantInviteInput, at as TenantInviteIssued, au as TenantInviteListOptions, av as TenantInvitePreview, aw as TenantInviteStatus, ax as TenantListOptions, ay as TenantMember, az as TenantMemberPage, aA as TenantMembership, aB as TenantOrder, aC as TenantOrderField, aD as TenantParent, aE as TenantScopedClient, aF as TokenResult, aG as TokenVerificationError, aH as TokenVerificationErrorCode, aI as UpdateOrganizationInput, aJ as UpdateTenantInput, aK as User, aL as UserScopedClient, aM as ValidateResult, aN as VerifiedAccessToken, aO as createClient, aP as normalizeClientIp, aQ as tenantFilter } from './authyonServerClient-Cpyey7He.cjs';
|
|
3
|
+
export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-Crx47kOt.cjs';
|
|
4
4
|
import 'jose';
|
|
5
5
|
|
|
6
6
|
declare const ErrorCodes: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-
|
|
2
|
-
export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, B as BuiltInPermission, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateTenantInput, x as CreateUserInput, y as CredentialCreator, z as CredentialDetail, D as CredentialListOptions, E as CredentialPermissionsInput, F as EnvironmentUser, G as FetchHttpAdapter, I as HttpAdapterRequest, K as HttpLogEvent, L as HttpLogger, M as IntrospectResult, N as InviteTenantMemberInput, O as IssuePasswordResetInput, P as JsonWebKeySet, J as JwksTokenVerifier, Q as JwksTokenVerifierOptions, R as LoggingHttpAdapter, S as LoginActivity, T as MemberListOptions, U as MyTenant, V as OpenIdConfiguration, W as Organization, X as OtpCheckResult, Y as Paged, Z as PaginationOptions, _ as PasswordResetCompleted, $ as PasswordResetIssued, a0 as PasswordResetPreview, a1 as Permission, a2 as
|
|
3
|
-
export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-
|
|
1
|
+
import { H as HttpAdapter, a as HttpLoggerOptions, A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.js';
|
|
2
|
+
export { b as AcceptTenantInviteInput, c as AccessTokenSource, d as Approval, e as ApprovalAssurance, f as ApprovalPayload, g as ApprovalStatus, h as ApprovalWebAuthnOptions, i as AuditEvent, j as AuthyonJwksDiscoveryOptions, k as AuthyonJwtClaims, l as AuthyonServerClientOptions, m as AuthyonTenantClaim, B as BuiltInPermission, C as CLIENT_IP_HEADER, n as ClientCredentials, o as ClientRequestContext, p as ConfirmApprovalInput, q as ConsumedApproval, r as CreateApprovalInput, s as CreateCredentialInput, t as CreateOrganizationInput, u as CreatePermissionInput, v as CreateTenantCredentialInput, w as CreateTenantInput, x as CreateUserInput, y as CredentialCreator, z as CredentialDetail, D as CredentialListOptions, E as CredentialPermissionsInput, F as EnvironmentUser, G as FetchHttpAdapter, I as HttpAdapterRequest, K as HttpLogEvent, L as HttpLogger, M as IntrospectResult, N as InviteTenantMemberInput, O as IssuePasswordResetInput, P as JsonWebKeySet, J as JwksTokenVerifier, Q as JwksTokenVerifierOptions, R as LoggingHttpAdapter, S as LoginActivity, T as MemberListOptions, U as MyTenant, V as OpenIdConfiguration, W as Organization, X as OtpCheckResult, Y as Paged, Z as PaginationOptions, _ as PasswordResetCompleted, $ as PasswordResetIssued, a0 as PasswordResetPreview, a1 as Permission, a2 as PermissionFilterOptions, a3 as PermissionsByRole, a4 as ReservedPermissions, a5 as Role, a6 as RoleGrant, a7 as RoleInput, a8 as RoleList, a9 as RolePermissions, aa as SafeJwtAlgorithm, ab as SecurityMethods, ac as SubTenant, ad as SubTenantListOptions, ae as SubjectApprovals, af as SubjectSecurity, ag as TENANT_FILTER_MAX_DEPTH, ah as TENANT_FILTER_MAX_VALUES, ai as TENANT_FILTER_MAX_VALUE_LENGTH, aj as Tenant, ak as TenantAncestor, al as TenantClientValidationResult, am as TenantCredentialIssued, an as TenantCredentialSummary, ao as TenantFilterExpression, ap as TenantFilterValue, aq as TenantInvite, ar as TenantInviteAccepted, as as TenantInviteInput, at as TenantInviteIssued, au as TenantInviteListOptions, av as TenantInvitePreview, aw as TenantInviteStatus, ax as TenantListOptions, ay as TenantMember, az as TenantMemberPage, aA as TenantMembership, aB as TenantOrder, aC as TenantOrderField, aD as TenantParent, aE as TenantScopedClient, aF as TokenResult, aG as TokenVerificationError, aH as TokenVerificationErrorCode, aI as UpdateOrganizationInput, aJ as UpdateTenantInput, aK as User, aL as UserScopedClient, aM as ValidateResult, aN as VerifiedAccessToken, aO as createClient, aP as normalizeClientIp, aQ as tenantFilter } from './authyonServerClient-Cpyey7He.js';
|
|
3
|
+
export { b as AbilityConditions, c as AbilityEvent, d as AbilityListener, e as AbilityRequirement, f as AbilityRule, A as AbilitySubject, g as AuthorizationContext, a as AuthorizationError, h as AuthorizationOptions, i as AuthyonAbility, j as AuthyonAbilityBuilder, k as AuthyonAbilityOptions, l as AuthyonPermissionSource, E as ExpressAuthorizationMiddlewareOptions, m as ExpressNext, n as ExpressRequestLike, o as ExpressResponseLike, P as PermissionGroup, R as RequestAuthorizationOptions, p as authorizeRequest, q as authorizeToken, r as createAuthorizationErrorResponse, s as createAuthyonAbility, t as createAuthyonRules, u as createExpressAuthorizationMiddleware, v as hasPermission, w as hasPermissionGroup } from './authorization-059M8_N2.js';
|
|
4
4
|
import 'jose';
|
|
5
5
|
|
|
6
6
|
declare const ErrorCodes: {
|
package/dist/index.js
CHANGED
|
@@ -183,6 +183,34 @@ function memberQuery(options = {}) {
|
|
|
183
183
|
var ORDER_FIELDS = ["name", "createdAt", "updatedAt"];
|
|
184
184
|
var MAX_FILTERS = 10;
|
|
185
185
|
var MAX_FILTER_LENGTH = 512;
|
|
186
|
+
var MAX_PERMISSIONS = 10;
|
|
187
|
+
var MAX_PERMISSION_LENGTH = 256;
|
|
188
|
+
function permissionQuery(options = {}) {
|
|
189
|
+
const { permission, permissionMatch } = options;
|
|
190
|
+
const query = {};
|
|
191
|
+
if (permissionMatch !== void 0) {
|
|
192
|
+
if (permissionMatch !== "all" && permissionMatch !== "any")
|
|
193
|
+
throw new RangeError('Authyon: permissionMatch must be "all" or "any".');
|
|
194
|
+
query.permissionMatch = permissionMatch;
|
|
195
|
+
}
|
|
196
|
+
if (permission === void 0) return query;
|
|
197
|
+
if (!Array.isArray(permission)) throw new RangeError("Authyon: permission must be an array.");
|
|
198
|
+
const values = permission.map((p) => typeof p === "string" ? p.trim() : "");
|
|
199
|
+
if (values.some((p) => p.length === 0))
|
|
200
|
+
throw new RangeError("Authyon: a permission value may not be empty.");
|
|
201
|
+
if (values.length > MAX_PERMISSIONS)
|
|
202
|
+
throw new RangeError(`Authyon: at most ${MAX_PERMISSIONS} permission values per request.`);
|
|
203
|
+
for (const p of values) {
|
|
204
|
+
if (p.length > MAX_PERMISSION_LENGTH)
|
|
205
|
+
throw new RangeError(
|
|
206
|
+
`Authyon: a permission holds at most ${MAX_PERMISSION_LENGTH} characters.`
|
|
207
|
+
);
|
|
208
|
+
if (p.includes("*"))
|
|
209
|
+
throw new RangeError(`Authyon: name a concrete permission, not a wildcard (got "${p}").`);
|
|
210
|
+
}
|
|
211
|
+
if (values.length > 0) query.permission = values;
|
|
212
|
+
return query;
|
|
213
|
+
}
|
|
186
214
|
function orderByParam(order) {
|
|
187
215
|
if (order === void 0) return void 0;
|
|
188
216
|
const field = typeof order === "string" ? order : order?.field;
|
|
@@ -194,8 +222,11 @@ function orderByParam(order) {
|
|
|
194
222
|
return `${field}:${direction}`;
|
|
195
223
|
}
|
|
196
224
|
function subTenantQuery(options = {}) {
|
|
197
|
-
const { filter, orderBy, ...page } = options;
|
|
198
|
-
const query = {
|
|
225
|
+
const { filter, orderBy, permission, permissionMatch, ...page } = options;
|
|
226
|
+
const query = {
|
|
227
|
+
...memberQuery(page),
|
|
228
|
+
...permissionQuery({ permission, permissionMatch })
|
|
229
|
+
};
|
|
199
230
|
if (filter !== void 0) {
|
|
200
231
|
if (!Array.isArray(filter)) throw new RangeError("Authyon: filter must be an array.");
|
|
201
232
|
const present = filter.filter((f) => typeof f === "string" && f.trim().length > 0);
|
|
@@ -318,6 +349,11 @@ var UserScopedClient = class {
|
|
|
318
349
|
list: (tenantId, options = {}) => __privateGet(this, _request).call(this, `/auth/tenants/${segment(tenantId)}/members`, {
|
|
319
350
|
query: memberQuery(options)
|
|
320
351
|
}),
|
|
352
|
+
/**
|
|
353
|
+
* One member, in the shape of a `list` row. A user who is not a direct
|
|
354
|
+
* member fails with `tenant.member.not_found` (404).
|
|
355
|
+
*/
|
|
356
|
+
get: (tenantId, userId) => __privateGet(this, _request).call(this, `/auth/tenants/${segment(tenantId)}/members/${segment(userId)}`),
|
|
321
357
|
/** Adds an existing environment user by email; does not send an invitation email. */
|
|
322
358
|
invite: (tenantId, input) => __privateGet(this, _request).call(this, `/auth/tenants/${segment(tenantId)}/members`, {
|
|
323
359
|
method: "POST",
|
package/dist/next.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-
|
|
3
|
-
import { A as AuthyonServerClient } from './authyonServerClient-
|
|
2
|
+
import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-Crx47kOt.cjs';
|
|
3
|
+
import { A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.cjs';
|
|
4
4
|
import 'jose';
|
|
5
5
|
|
|
6
6
|
interface ServerPermissionGuardFallbackContext {
|
package/dist/next.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-
|
|
3
|
-
import { A as AuthyonServerClient } from './authyonServerClient-
|
|
2
|
+
import { R as RequestAuthorizationOptions, A as AbilitySubject, a as AuthorizationError } from './authorization-059M8_N2.js';
|
|
3
|
+
import { A as AuthyonServerClient } from './authyonServerClient-Cpyey7He.js';
|
|
4
4
|
import 'jose';
|
|
5
5
|
|
|
6
6
|
interface ServerPermissionGuardFallbackContext {
|
package/package.json
CHANGED