authhero 9.16.0 → 9.17.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/dist/authhero.cjs +141 -141
- package/dist/authhero.d.ts +144 -144
- package/dist/authhero.mjs +11926 -11904
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/passwordless.d.ts +3 -3
- package/dist/types/helpers/reserved-claims.d.ts +2 -2
- package/dist/types/helpers/scopes-permissions.d.ts +51 -12
- package/dist/types/index.d.ts +144 -144
- package/dist/types/middlewares/authentication.d.ts +1 -0
- package/dist/types/routes/auth-api/index.d.ts +21 -21
- package/dist/types/routes/auth-api/passwordless.d.ts +18 -18
- package/dist/types/routes/auth-api/register/index.d.ts +2 -2
- package/dist/types/routes/auth-api/well-known.d.ts +1 -1
- package/dist/types/routes/management-api/action-executions.d.ts +1 -1
- package/dist/types/routes/management-api/actions.d.ts +1 -1
- package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
- package/dist/types/routes/management-api/branding.d.ts +1 -1
- package/dist/types/routes/management-api/client-grants.d.ts +9 -9
- package/dist/types/routes/management-api/clients.d.ts +8 -8
- package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
- package/dist/types/routes/management-api/email-templates.d.ts +18 -18
- package/dist/types/routes/management-api/failed-events.d.ts +1 -1
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/index.d.ts +118 -118
- package/dist/types/routes/management-api/keys.d.ts +8 -8
- package/dist/types/routes/management-api/logs.d.ts +4 -4
- package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
- package/dist/types/routes/management-api/organizations.d.ts +3 -3
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/tenant-operations.d.ts +5 -5
- package/dist/types/routes/management-api/tenants.d.ts +4 -4
- package/dist/types/routes/management-api/token-exchange-profiles.d.ts +6 -6
- package/dist/types/routes/management-api/users.d.ts +42 -42
- package/dist/types/routes/universal-login/common.d.ts +2 -2
- package/dist/types/routes/universal-login/flow-api.d.ts +4 -4
- package/dist/types/routes/universal-login/screens/connect-authz.d.ts +16 -0
- package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
- package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
- package/dist/types/utils/jwks.d.ts +2 -2
- package/package.json +3 -3
|
@@ -475,7 +475,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
475
475
|
custom_login_page_preview?: string | undefined;
|
|
476
476
|
form_template?: string | undefined;
|
|
477
477
|
addons?: Record<string, any> | undefined;
|
|
478
|
-
token_endpoint_auth_method?: "
|
|
478
|
+
token_endpoint_auth_method?: "none" | "client_secret_post" | "client_secret_basic" | "client_secret_jwt" | "private_key_jwt" | undefined;
|
|
479
479
|
client_metadata?: Record<string, string> | undefined;
|
|
480
480
|
hide_sign_up_disabled_error?: boolean | undefined;
|
|
481
481
|
mobile?: Record<string, any> | undefined;
|
|
@@ -561,8 +561,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
561
561
|
} | undefined;
|
|
562
562
|
authenticated_at?: string | undefined;
|
|
563
563
|
};
|
|
564
|
-
connectionType: "email" | "
|
|
565
|
-
authConnection: "email" | "
|
|
564
|
+
connectionType: "email" | "sms" | "username";
|
|
565
|
+
authConnection: "email" | "sms" | "username";
|
|
566
566
|
session_id: string | undefined;
|
|
567
567
|
authParams: {
|
|
568
568
|
audience?: string | undefined;
|
|
@@ -14,9 +14,9 @@ export declare const USERINFO_RESERVED_CLAIMS: readonly ["iss", "sub", "aud", "e
|
|
|
14
14
|
* vendor/tenant for downstream APIs while `sub` stays `auth-service`.
|
|
15
15
|
* Client-bound mints keep `azp` locked (see below).
|
|
16
16
|
*/
|
|
17
|
-
export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "
|
|
17
|
+
export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "org_name" | "sid" | "permissions" | "scope" | "sub" | "auth_time" | "iss" | "aud" | "exp" | "nbf" | "iat" | "jti" | "acr" | "amr" | "act" | "org_id" | "requested_userinfo_claims" | "gty")[];
|
|
18
18
|
/** Client-bound mints: `azp` must stay the registered client id. */
|
|
19
|
-
export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "
|
|
19
|
+
export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "org_name" | "sid" | "permissions" | "scope" | "sub" | "auth_time" | "iss" | "aud" | "exp" | "nbf" | "iat" | "jti" | "azp" | "acr" | "amr" | "act" | "org_id" | "requested_userinfo_claims" | "gty")[];
|
|
20
20
|
export type AccessTokenReservedClaim = (typeof ACCESS_TOKEN_RESERVED_CLAIMS)[number];
|
|
21
21
|
export type IdTokenReservedClaim = (typeof ID_TOKEN_RESERVED_CLAIMS)[number];
|
|
22
22
|
/**
|
|
@@ -24,23 +24,62 @@ export interface ScopesAndPermissionsResult {
|
|
|
24
24
|
token_lifetime_for_web: number;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* Management API permission that lets a user act on any organization without
|
|
28
|
+
* being a member. Doubles as a tenant-admin permission on the multi-tenancy
|
|
29
|
+
* `/tenants` routes, and only bypasses org membership when the tenant has the
|
|
30
|
+
* `inherit_global_permissions_in_organizations` flag.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ADMIN_ORGANIZATIONS_PERMISSION = "admin:organizations";
|
|
33
|
+
/**
|
|
34
|
+
* Management API permission that lets a user get org-scoped tokens for (and
|
|
35
|
+
* list) every organization without being a member. Unlike
|
|
36
|
+
* `admin:organizations` it carries no tenant-admin rights and needs no tenant
|
|
37
|
+
* flag: holding the permission is the opt-in.
|
|
38
|
+
*/
|
|
39
|
+
export declare const ACCESS_ALL_ORGANIZATIONS_PERMISSION = "access:all_organizations";
|
|
40
|
+
/**
|
|
41
|
+
* True when the user holds `permissionName` at global scope on the Management
|
|
42
|
+
* API audience, directly or through a role.
|
|
43
|
+
*/
|
|
44
|
+
export declare function userHasGlobalManagementPermission(ctx: Context<{
|
|
45
|
+
Bindings: Bindings;
|
|
46
|
+
Variables: Variables;
|
|
47
|
+
}>, tenantId: string, userId: string, permissionName: string): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Single rule for "may this user get an org-scoped token for an organization
|
|
50
|
+
* they are not a member of?". Used by every org-membership gate
|
|
51
|
+
* (calculateScopesAndPermissions, token exchange, refresh token) so they can
|
|
52
|
+
* never disagree.
|
|
31
53
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
54
|
+
* True when the user holds, at global scope on the Management API audience:
|
|
55
|
+
* - `access:all_organizations` (no tenant flag needed), or
|
|
56
|
+
* - `admin:organizations` AND the tenant has
|
|
57
|
+
* `inherit_global_permissions_in_organizations` (legacy behaviour).
|
|
35
58
|
*
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
59
|
+
* Pass `tenant` when the caller already loaded it to skip a second fetch.
|
|
60
|
+
*/
|
|
61
|
+
export declare function userCanAccessAllOrganizations(ctx: Context<{
|
|
62
|
+
Bindings: Bindings;
|
|
63
|
+
Variables: Variables;
|
|
64
|
+
}>, tenantId: string, userId: string, tenant?: {
|
|
65
|
+
flags?: {
|
|
66
|
+
inherit_global_permissions_in_organizations?: boolean;
|
|
67
|
+
};
|
|
68
|
+
} | null): Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* True when the user may get an org-scoped token for `organizationId`: either
|
|
71
|
+
* they may access every organization (see `userCanAccessAllOrganizations`) or
|
|
72
|
+
* they are a member of it. Every org gate (login, silent auth, token grants)
|
|
73
|
+
* goes through here so they apply the same rule.
|
|
39
74
|
*/
|
|
40
|
-
export declare function
|
|
75
|
+
export declare function userCanAccessOrganization(ctx: Context<{
|
|
41
76
|
Bindings: Bindings;
|
|
42
77
|
Variables: Variables;
|
|
43
|
-
}>, tenantId: string, userId: string
|
|
78
|
+
}>, tenantId: string, userId: string, organizationId: string, tenant?: {
|
|
79
|
+
flags?: {
|
|
80
|
+
inherit_global_permissions_in_organizations?: boolean;
|
|
81
|
+
};
|
|
82
|
+
} | null): Promise<boolean>;
|
|
44
83
|
/**
|
|
45
84
|
* Returns the subset of `scopes` that the resource server matching `audience`
|
|
46
85
|
* does not define — the scopes that would silently vanish from an issued token.
|