@canopy-io/node 0.26.2 → 0.27.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/CHANGELOG.md +7 -0
- package/README.md +31 -10
- package/dist/index.cjs +14 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -13
- package/dist/index.d.ts +59 -13
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3048,7 +3048,7 @@ interface paths {
|
|
|
3048
3048
|
};
|
|
3049
3049
|
/**
|
|
3050
3050
|
* List the hosted pages and emails a preview can render
|
|
3051
|
-
* @description Lists every hosted page and every customer email the branding preview can render, in the order to show them: each with its `id`, its `kind` (`page` or `email`), the `group` it sits in, its `title`, and its states. Each state has an `id`, a `label` and `sample`: `false` for `YourPage`, the first state of the sign-in and sign-up pages, which shows the page as the Environment serves it, with the sign-in methods, social providers, self sign-up and CAPTCHA it has on, and single sign-on when a connection is linked to one of its OAuth clients, or to the one `client_id` names, and `true` for every other state, which shows sample data, the same in every Environment. An email has one state, `default`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3051
|
+
* @description Lists every hosted page, the embedded sign-in form's email verification code screen (`form-verify`, which no route serves), and every customer email the branding preview can render, in the order to show them: each with its `id`, its `kind` (`page` or `email`), the `group` it sits in, its `title`, and its states. Each state has an `id`, a `label` and `sample`: `false` for `YourPage`, the first state of the sign-in and sign-up pages, which shows the page as the Environment serves it, with the sign-in methods, social providers, self sign-up and CAPTCHA it has on, and single sign-on when a connection is linked to one of its OAuth clients, or to the one `client_id` names, and `true` for every other state, which shows sample data, the same in every Environment. An email has one state, `default`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3052
3052
|
*/
|
|
3053
3053
|
get: operations["ApiBrandingController_getPreviewPages"];
|
|
3054
3054
|
put?: never;
|
|
@@ -3088,7 +3088,7 @@ interface paths {
|
|
|
3088
3088
|
};
|
|
3089
3089
|
/**
|
|
3090
3090
|
* List the hosted page and email texts whose wording can be changed
|
|
3091
|
-
* @description Lists the texts on hosted pages and in emails that `text_overrides` can reword: the headings, labels, button labels and helper text of the sign-in, sign-up, account recovery, email verification, invitation, multi-factor challenge and sign-out pages, and the subject, heading, main sentence and button of the verification, password reset, sign-in code, two-step verification code, change confirmation and invitation emails. Each entry has the `key` an override names it by, its `locale`, the `page` or email it shows on, by the preview list's `id`, with its title and a `preview_state` that shows it, a plain `name`, its `kind`, its `default` wording, the `placeholders` an override must keep, and its `max_length`. Wording that tells a person what happened to their account (errors, refusals, expiry notices, warnings, and the security notice emails) is not listed and cannot be changed. Read this list before writing `text_overrides`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3091
|
+
* @description Lists the texts on hosted pages and in emails that `text_overrides` can reword: the headings, labels, button labels and helper text of the sign-in, sign-up, account recovery, email verification, invitation, multi-factor challenge and sign-out pages and of the embedded sign-in form's email verification code screen, and the subject, heading, main sentence and button of the verification, password reset, sign-in code, two-step verification code, change confirmation and invitation emails. Each entry has the `key` an override names it by, its `locale`, the `page` or email it shows on, by the preview list's `id`, with its title and a `preview_state` that shows it, a plain `name`, its `kind`, its `default` wording, the `placeholders` an override must keep, and its `max_length`. Wording that tells a person what happened to their account (errors, refusals, expiry notices, warnings, and the security notice emails) is not listed and cannot be changed. Read this list before writing `text_overrides`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3092
3092
|
*/
|
|
3093
3093
|
get: operations["ApiBrandingController_getTextKeys"];
|
|
3094
3094
|
put?: never;
|
|
@@ -3346,7 +3346,7 @@ interface paths {
|
|
|
3346
3346
|
head?: never;
|
|
3347
3347
|
/**
|
|
3348
3348
|
* Change an Environment's sign-in settings
|
|
3349
|
-
* @description Updates the sign-in settings of the request's Environment, applying any supplied fields (`mfa`, `allow_self_signup`, `self_signup_require_captcha`, `login_require_captcha`, `password_login_enabled`, `email_otp_login_enabled`, `passkey_login_enabled`, `languages`, `default_language`, `self_signup_daily_cap`, `access_token_ttl_seconds`, `refresh_token_ttl_days`, `public_refresh_token_ttl_days`, `allowed_web_origins`, `sso_return_urls`, `auth_links_base_url`); omitted fields are left unchanged, `allowed_web_origins` are normalized and de-duplicated on save, and `auth_links_base_url` is canonicalized to a bare origin (send `null` to clear it). While `auth_links_base_url` is set, verification, password-reset and invitation emails link to that origin at `/verify-email`, `/reset-password` and `/accept-invite` instead of Canopy's hosted pages. Send the Environment's `version` (returned by the GET) in `If-Match` to refuse a stale save: a mismatch answers `409 version_mismatch`, and without the header the check is skipped. Emits an `environment.auth_settings_updated` audit event naming the settings whose value changed.
|
|
3349
|
+
* @description Updates the sign-in settings of the request's Environment, applying any supplied fields (`mfa`, `allow_self_signup`, `self_signup_require_captcha`, `login_require_captcha`, `password_login_enabled`, `email_otp_login_enabled`, `passkey_login_enabled`, `languages`, `default_language`, `self_signup_daily_cap`, `access_token_ttl_seconds`, `refresh_token_ttl_days`, `public_refresh_token_ttl_days`, `direct_api_permissions_claim_enabled`, `allowed_web_origins`, `sso_return_urls`, `auth_links_base_url`); omitted fields are left unchanged, `allowed_web_origins` are normalized and de-duplicated on save, and `auth_links_base_url` is canonicalized to a bare origin (send `null` to clear it). While `auth_links_base_url` is set, verification, password-reset and invitation emails link to that origin at `/verify-email`, `/reset-password` and `/accept-invite` instead of Canopy's hosted pages. Send the Environment's `version` (returned by the GET) in `If-Match` to refuse a stale save: a mismatch answers `409 version_mismatch`, and without the header the check is skipped. Emits an `environment.auth_settings_updated` audit event naming the settings whose value changed.
|
|
3350
3350
|
*/
|
|
3351
3351
|
patch: operations["ApiAuthSettingsController_update"];
|
|
3352
3352
|
trace?: never;
|
|
@@ -3716,7 +3716,7 @@ interface paths {
|
|
|
3716
3716
|
};
|
|
3717
3717
|
/**
|
|
3718
3718
|
* List Environments reachable by SSO
|
|
3719
|
-
* @description Returns
|
|
3719
|
+
* @description Returns every Environment with a usable end-user SSO sign-in path: one owning an active OAuth client linked to an `active`, `end_user` SSO connection in the Account (the hosted sign-in), or one bound to such a connection itself (a sign-in by publishable key). Active-but-unlinked connections and inactive clients make nothing reachable. Each item carries `environment_id` and `apps_without_sso`, the Environment's active web clients (`id`, `client_id`, `name`, oldest first) with no active end-user connection linked: the hosted sign-in offers SSO only through the client's own links, so with password, emailed code, passkey and social sign-in all off nobody can sign in through those apps. Machine clients are never listed. Drives the dashboard "no usable sign-in method" warning. The response is an unpaginated `{ items }` array.
|
|
3720
3720
|
*/
|
|
3721
3721
|
get: operations["ApiSsoController_signInCoverage"];
|
|
3722
3722
|
put?: never;
|
|
@@ -7285,6 +7285,10 @@ interface components {
|
|
|
7285
7285
|
logo_dark_url: string | null;
|
|
7286
7286
|
/** @enum {string|null} */
|
|
7287
7287
|
logo_kind: "full" | "icon" | null;
|
|
7288
|
+
/** @enum {string|null} */
|
|
7289
|
+
hosted_product_name: "show" | "hide" | null;
|
|
7290
|
+
/** @enum {string|null} */
|
|
7291
|
+
hosted_logo: "show" | "hide" | null;
|
|
7288
7292
|
favicon_url: string | null;
|
|
7289
7293
|
/** @enum {string|null} */
|
|
7290
7294
|
color_scheme: "light" | "dark" | "system" | null;
|
|
@@ -7360,6 +7364,16 @@ interface components {
|
|
|
7360
7364
|
* @enum {string}
|
|
7361
7365
|
*/
|
|
7362
7366
|
logo_kind: "full" | "icon";
|
|
7367
|
+
/**
|
|
7368
|
+
* @description Whether the hosted pages show the product name above the heading: `show` or `hide`. Hidden there, the name still shows in the browser tab, the organization admin portal and the emails.
|
|
7369
|
+
* @enum {string}
|
|
7370
|
+
*/
|
|
7371
|
+
hosted_product_name: "show" | "hide";
|
|
7372
|
+
/**
|
|
7373
|
+
* @description Whether the hosted pages show the logo above the heading: `show` or `hide`. Hidden there, the logo still shows in the organization admin portal and the emails.
|
|
7374
|
+
* @enum {string}
|
|
7375
|
+
*/
|
|
7376
|
+
hosted_logo: "show" | "hide";
|
|
7363
7377
|
favicon_url: string | null;
|
|
7364
7378
|
/**
|
|
7365
7379
|
* @description Which look hosted pages wear: `light`, `dark`, or `system` for whichever the visitor's device asks for. `light` when unset, and on a plan without hosted page customization.
|
|
@@ -7504,6 +7518,16 @@ interface components {
|
|
|
7504
7518
|
* @enum {string|null}
|
|
7505
7519
|
*/
|
|
7506
7520
|
logo_kind?: "full" | "icon" | null;
|
|
7521
|
+
/**
|
|
7522
|
+
* @description Whether hosted pages show the product name above the heading. `hide` leaves it off the pages and keeps it set: the browser tab, the organization admin portal and the emails still show it. Null returns to `show`.
|
|
7523
|
+
* @enum {string|null}
|
|
7524
|
+
*/
|
|
7525
|
+
hosted_product_name?: "show" | "hide" | null;
|
|
7526
|
+
/**
|
|
7527
|
+
* @description Whether hosted pages show the logo above the heading. `hide` leaves it off the pages and keeps it set: the organization admin portal and the emails still show it. Null returns to `show`.
|
|
7528
|
+
* @enum {string|null}
|
|
7529
|
+
*/
|
|
7530
|
+
hosted_logo?: "show" | "hide" | null;
|
|
7507
7531
|
/**
|
|
7508
7532
|
* @description The browser-tab icon on hosted pages. The address `POST /api/v1/branding/images` answered for an image with `slot` `favicon`; any other value is refused. Null clears it.
|
|
7509
7533
|
* @example https://auth.canopy-io.com/branding-images/3f9a1c0e8b7d6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f-64x64.png
|
|
@@ -8070,6 +8094,8 @@ interface components {
|
|
|
8070
8094
|
refresh_token_ttl_days?: number;
|
|
8071
8095
|
/** @description Lifetime in days of a public client's session (a single-page or mobile app with no client secret), counted from sign-in and never extended by a refresh: when it ends the person signs in again. Defaults to 30. Confidential clients keep `refresh_token_ttl_days`, which slides forward on each refresh. Persisted under `env.settings.public_refresh_token_ttl_days`; applies to sessions signed in after the change. */
|
|
8072
8096
|
public_refresh_token_ttl_days?: number;
|
|
8097
|
+
/** @description Put what the person holds on every Direct API access token this Environment issues, at sign-in and on each refresh: `permissions` (the Environment-wide keys) and, for a session in an organization, `org_permissions` (the keys held at it), each capped at 200 with `permissions_overflow` or `org_permissions_overflow` set past the cap, as on a Hosted Login token minted with the `permissions` scope. Off by default; persisted under `env.settings.direct_api_permissions_claim_enabled`. Each sign-in and refresh then resolves them afresh; applies to tokens minted after the change. */
|
|
8098
|
+
direct_api_permissions_claim_enabled?: boolean;
|
|
8073
8099
|
/** @description Lifetime in seconds of the access tokens a machine client obtains with `client_credentials`. Defaults to 300 (5 minutes). A machine token has no refresh, so this is how long a client keeps acting after its secret is rotated or it is disabled. Persisted under `env.settings.m2m_access_token_ttl_seconds`; applies to tokens minted after the change. */
|
|
8074
8100
|
m2m_access_token_ttl_seconds?: number;
|
|
8075
8101
|
/** @description Create an organization for every self-signup through `POST /v1/identity/auth/register` and add the new identity as its first member. Off by default; persisted under `env.settings.organizations_create_on_signup`. The organization starts with roles copied from the Environment's organization role templates, and the new identity holds its copy of the default admin template. Requires the organizations container and a default admin template; refused with `400 role_template.default_admin_missing` while there is none. */
|
|
@@ -8173,6 +8199,8 @@ interface components {
|
|
|
8173
8199
|
refresh_token_ttl_days?: number;
|
|
8174
8200
|
/** @description Lifetime in days of a public client's session, fixed from sign-in. Absent when unset (the default is 30). */
|
|
8175
8201
|
public_refresh_token_ttl_days?: number;
|
|
8202
|
+
/** @description Whether the Direct API access tokens this Environment issues carry `permissions` and, in an organization, `org_permissions`. */
|
|
8203
|
+
direct_api_permissions_claim_enabled: boolean;
|
|
8176
8204
|
/** @description Lifetime in seconds of a machine client's `client_credentials` token. Absent when unset (the default is 300). */
|
|
8177
8205
|
m2m_access_token_ttl_seconds?: number;
|
|
8178
8206
|
/** @description The audience a machine client's token names when its request names none. Absent when unset. */
|
|
@@ -8267,6 +8295,8 @@ interface components {
|
|
|
8267
8295
|
refresh_token_ttl_days?: number;
|
|
8268
8296
|
/** @description Lifetime in days of a public client's session (a single-page or mobile app with no client secret), counted from sign-in and never extended by a refresh: when it ends the person signs in again. Defaults to 30. Confidential clients keep `refresh_token_ttl_days`, which slides forward on each refresh. Persisted under `env.settings.public_refresh_token_ttl_days`; applies to sessions signed in after the change. */
|
|
8269
8297
|
public_refresh_token_ttl_days?: number;
|
|
8298
|
+
/** @description Put what the person holds on every Direct API access token this Environment issues, at sign-in and on each refresh: `permissions` (the Environment-wide keys) and, for a session in an organization, `org_permissions` (the keys held at it), each capped at 200 with `permissions_overflow` or `org_permissions_overflow` set past the cap, as on a Hosted Login token minted with the `permissions` scope. Off by default; persisted under `env.settings.direct_api_permissions_claim_enabled`. Each sign-in and refresh then resolves them afresh; applies to tokens minted after the change. */
|
|
8299
|
+
direct_api_permissions_claim_enabled?: boolean;
|
|
8270
8300
|
/** @description Lifetime in seconds of the access tokens a machine client obtains with `client_credentials`. Defaults to 300 (5 minutes). A machine token has no refresh, so this is how long a client keeps acting after its secret is rotated or it is disabled. Persisted under `env.settings.m2m_access_token_ttl_seconds`; applies to tokens minted after the change. */
|
|
8271
8301
|
m2m_access_token_ttl_seconds?: number;
|
|
8272
8302
|
/**
|
|
@@ -8562,6 +8592,19 @@ interface components {
|
|
|
8562
8592
|
/** @description Role assigned to a JIT'd identity at the resolved node. */
|
|
8563
8593
|
default_role_id?: string | null;
|
|
8564
8594
|
};
|
|
8595
|
+
SsoSignInCoverageAppResponseDto: {
|
|
8596
|
+
/** @description The OAuth client's row id. */
|
|
8597
|
+
id: string;
|
|
8598
|
+
/** @description The OAuth client's public `client_id`. */
|
|
8599
|
+
client_id: string;
|
|
8600
|
+
/** @description The OAuth client's name. */
|
|
8601
|
+
name: string;
|
|
8602
|
+
};
|
|
8603
|
+
SsoSignInCoverageResponseDto: {
|
|
8604
|
+
environment_id: string;
|
|
8605
|
+
/** @description The Environment's active web clients with no active end-user SSO connection linked to them, oldest first. Their hosted sign-in offers no SSO, so with every other sign-in method off nobody can sign in through them. Machine clients are never listed. */
|
|
8606
|
+
apps_without_sso: components["schemas"]["SsoSignInCoverageAppResponseDto"][];
|
|
8607
|
+
};
|
|
8565
8608
|
EnvironmentSsoLinkResponseDto: {
|
|
8566
8609
|
environment_id: string;
|
|
8567
8610
|
sso_connection_id: string;
|
|
@@ -38446,14 +38489,14 @@ interface operations {
|
|
|
38446
38489
|
};
|
|
38447
38490
|
requestBody?: never;
|
|
38448
38491
|
responses: {
|
|
38449
|
-
/** @description
|
|
38492
|
+
/** @description Every Environment people can sign in to through SSO (one with an active OAuth client linked to an active end-user SSO connection, or one bound to such a connection itself), each with `apps_without_sso`: its active web clients with no active end-user connection linked, whose hosted sign-in offers no SSO. Lets the dashboard tell, per Environment and per app, whether SSO is a usable sign-in method when every other method is off. */
|
|
38450
38493
|
200: {
|
|
38451
38494
|
headers: {
|
|
38452
38495
|
[name: string]: unknown;
|
|
38453
38496
|
};
|
|
38454
38497
|
content: {
|
|
38455
38498
|
"application/json": {
|
|
38456
|
-
items:
|
|
38499
|
+
items: components["schemas"]["SsoSignInCoverageResponseDto"][];
|
|
38457
38500
|
};
|
|
38458
38501
|
};
|
|
38459
38502
|
};
|
|
@@ -49368,14 +49411,17 @@ interface TokenVerifierOptions {
|
|
|
49368
49411
|
*/
|
|
49369
49412
|
issuer?: string;
|
|
49370
49413
|
/**
|
|
49371
|
-
*
|
|
49414
|
+
* The audience, or audiences, a person's token must name in `aud`. A token
|
|
49415
|
+
* is accepted when its `aud` includes any of them.
|
|
49372
49416
|
*
|
|
49373
|
-
* Hosted Login
|
|
49374
|
-
*
|
|
49375
|
-
*
|
|
49376
|
-
*
|
|
49417
|
+
* A Hosted Login token names your OAuth client id, and a Direct API token
|
|
49418
|
+
* the id of the Environment that issued it. A backend that accepts both
|
|
49419
|
+
* lists both: `[clientId, environmentId]`. Verifying a token that carries
|
|
49420
|
+
* `aud` without setting this throws rather than ignoring the claim, because
|
|
49421
|
+
* `aud` is what stops a token minted for one client being replayed at
|
|
49422
|
+
* another.
|
|
49377
49423
|
*/
|
|
49378
|
-
audience?: string;
|
|
49424
|
+
audience?: string | readonly string[];
|
|
49379
49425
|
/**
|
|
49380
49426
|
* The audience a machine client's token must name, `service` or
|
|
49381
49427
|
* `delegated`: the identifier your API answers to
|
|
@@ -49613,7 +49659,7 @@ interface CanopyDelegation {
|
|
|
49613
49659
|
declare function delegation(claims: CanopyTokenClaims): CanopyDelegation | null;
|
|
49614
49660
|
declare class TokenVerifier {
|
|
49615
49661
|
private readonly issuer;
|
|
49616
|
-
private readonly
|
|
49662
|
+
private readonly audiences;
|
|
49617
49663
|
private readonly serviceAudience;
|
|
49618
49664
|
private readonly jwksUri;
|
|
49619
49665
|
private readonly jwksCacheMaxAgeMs;
|
package/dist/index.d.ts
CHANGED
|
@@ -3048,7 +3048,7 @@ interface paths {
|
|
|
3048
3048
|
};
|
|
3049
3049
|
/**
|
|
3050
3050
|
* List the hosted pages and emails a preview can render
|
|
3051
|
-
* @description Lists every hosted page and every customer email the branding preview can render, in the order to show them: each with its `id`, its `kind` (`page` or `email`), the `group` it sits in, its `title`, and its states. Each state has an `id`, a `label` and `sample`: `false` for `YourPage`, the first state of the sign-in and sign-up pages, which shows the page as the Environment serves it, with the sign-in methods, social providers, self sign-up and CAPTCHA it has on, and single sign-on when a connection is linked to one of its OAuth clients, or to the one `client_id` names, and `true` for every other state, which shows sample data, the same in every Environment. An email has one state, `default`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3051
|
+
* @description Lists every hosted page, the embedded sign-in form's email verification code screen (`form-verify`, which no route serves), and every customer email the branding preview can render, in the order to show them: each with its `id`, its `kind` (`page` or `email`), the `group` it sits in, its `title`, and its states. Each state has an `id`, a `label` and `sample`: `false` for `YourPage`, the first state of the sign-in and sign-up pages, which shows the page as the Environment serves it, with the sign-in methods, social providers, self sign-up and CAPTCHA it has on, and single sign-on when a connection is linked to one of its OAuth clients, or to the one `client_id` names, and `true` for every other state, which shows sample data, the same in every Environment. An email has one state, `default`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3052
3052
|
*/
|
|
3053
3053
|
get: operations["ApiBrandingController_getPreviewPages"];
|
|
3054
3054
|
put?: never;
|
|
@@ -3088,7 +3088,7 @@ interface paths {
|
|
|
3088
3088
|
};
|
|
3089
3089
|
/**
|
|
3090
3090
|
* List the hosted page and email texts whose wording can be changed
|
|
3091
|
-
* @description Lists the texts on hosted pages and in emails that `text_overrides` can reword: the headings, labels, button labels and helper text of the sign-in, sign-up, account recovery, email verification, invitation, multi-factor challenge and sign-out pages, and the subject, heading, main sentence and button of the verification, password reset, sign-in code, two-step verification code, change confirmation and invitation emails. Each entry has the `key` an override names it by, its `locale`, the `page` or email it shows on, by the preview list's `id`, with its title and a `preview_state` that shows it, a plain `name`, its `kind`, its `default` wording, the `placeholders` an override must keep, and its `max_length`. Wording that tells a person what happened to their account (errors, refusals, expiry notices, warnings, and the security notice emails) is not listed and cannot be changed. Read this list before writing `text_overrides`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3091
|
+
* @description Lists the texts on hosted pages and in emails that `text_overrides` can reword: the headings, labels, button labels and helper text of the sign-in, sign-up, account recovery, email verification, invitation, multi-factor challenge and sign-out pages and of the embedded sign-in form's email verification code screen, and the subject, heading, main sentence and button of the verification, password reset, sign-in code, two-step verification code, change confirmation and invitation emails. Each entry has the `key` an override names it by, its `locale`, the `page` or email it shows on, by the preview list's `id`, with its title and a `preview_state` that shows it, a plain `name`, its `kind`, its `default` wording, the `placeholders` an override must keep, and its `max_length`. Wording that tells a person what happened to their account (errors, refusals, expiry notices, warnings, and the security notice emails) is not listed and cannot be changed. Read this list before writing `text_overrides`. Returns `403` (`plan_feature_unavailable`) when the Account's plan does not include hosted page customization.
|
|
3092
3092
|
*/
|
|
3093
3093
|
get: operations["ApiBrandingController_getTextKeys"];
|
|
3094
3094
|
put?: never;
|
|
@@ -3346,7 +3346,7 @@ interface paths {
|
|
|
3346
3346
|
head?: never;
|
|
3347
3347
|
/**
|
|
3348
3348
|
* Change an Environment's sign-in settings
|
|
3349
|
-
* @description Updates the sign-in settings of the request's Environment, applying any supplied fields (`mfa`, `allow_self_signup`, `self_signup_require_captcha`, `login_require_captcha`, `password_login_enabled`, `email_otp_login_enabled`, `passkey_login_enabled`, `languages`, `default_language`, `self_signup_daily_cap`, `access_token_ttl_seconds`, `refresh_token_ttl_days`, `public_refresh_token_ttl_days`, `allowed_web_origins`, `sso_return_urls`, `auth_links_base_url`); omitted fields are left unchanged, `allowed_web_origins` are normalized and de-duplicated on save, and `auth_links_base_url` is canonicalized to a bare origin (send `null` to clear it). While `auth_links_base_url` is set, verification, password-reset and invitation emails link to that origin at `/verify-email`, `/reset-password` and `/accept-invite` instead of Canopy's hosted pages. Send the Environment's `version` (returned by the GET) in `If-Match` to refuse a stale save: a mismatch answers `409 version_mismatch`, and without the header the check is skipped. Emits an `environment.auth_settings_updated` audit event naming the settings whose value changed.
|
|
3349
|
+
* @description Updates the sign-in settings of the request's Environment, applying any supplied fields (`mfa`, `allow_self_signup`, `self_signup_require_captcha`, `login_require_captcha`, `password_login_enabled`, `email_otp_login_enabled`, `passkey_login_enabled`, `languages`, `default_language`, `self_signup_daily_cap`, `access_token_ttl_seconds`, `refresh_token_ttl_days`, `public_refresh_token_ttl_days`, `direct_api_permissions_claim_enabled`, `allowed_web_origins`, `sso_return_urls`, `auth_links_base_url`); omitted fields are left unchanged, `allowed_web_origins` are normalized and de-duplicated on save, and `auth_links_base_url` is canonicalized to a bare origin (send `null` to clear it). While `auth_links_base_url` is set, verification, password-reset and invitation emails link to that origin at `/verify-email`, `/reset-password` and `/accept-invite` instead of Canopy's hosted pages. Send the Environment's `version` (returned by the GET) in `If-Match` to refuse a stale save: a mismatch answers `409 version_mismatch`, and without the header the check is skipped. Emits an `environment.auth_settings_updated` audit event naming the settings whose value changed.
|
|
3350
3350
|
*/
|
|
3351
3351
|
patch: operations["ApiAuthSettingsController_update"];
|
|
3352
3352
|
trace?: never;
|
|
@@ -3716,7 +3716,7 @@ interface paths {
|
|
|
3716
3716
|
};
|
|
3717
3717
|
/**
|
|
3718
3718
|
* List Environments reachable by SSO
|
|
3719
|
-
* @description Returns
|
|
3719
|
+
* @description Returns every Environment with a usable end-user SSO sign-in path: one owning an active OAuth client linked to an `active`, `end_user` SSO connection in the Account (the hosted sign-in), or one bound to such a connection itself (a sign-in by publishable key). Active-but-unlinked connections and inactive clients make nothing reachable. Each item carries `environment_id` and `apps_without_sso`, the Environment's active web clients (`id`, `client_id`, `name`, oldest first) with no active end-user connection linked: the hosted sign-in offers SSO only through the client's own links, so with password, emailed code, passkey and social sign-in all off nobody can sign in through those apps. Machine clients are never listed. Drives the dashboard "no usable sign-in method" warning. The response is an unpaginated `{ items }` array.
|
|
3720
3720
|
*/
|
|
3721
3721
|
get: operations["ApiSsoController_signInCoverage"];
|
|
3722
3722
|
put?: never;
|
|
@@ -7285,6 +7285,10 @@ interface components {
|
|
|
7285
7285
|
logo_dark_url: string | null;
|
|
7286
7286
|
/** @enum {string|null} */
|
|
7287
7287
|
logo_kind: "full" | "icon" | null;
|
|
7288
|
+
/** @enum {string|null} */
|
|
7289
|
+
hosted_product_name: "show" | "hide" | null;
|
|
7290
|
+
/** @enum {string|null} */
|
|
7291
|
+
hosted_logo: "show" | "hide" | null;
|
|
7288
7292
|
favicon_url: string | null;
|
|
7289
7293
|
/** @enum {string|null} */
|
|
7290
7294
|
color_scheme: "light" | "dark" | "system" | null;
|
|
@@ -7360,6 +7364,16 @@ interface components {
|
|
|
7360
7364
|
* @enum {string}
|
|
7361
7365
|
*/
|
|
7362
7366
|
logo_kind: "full" | "icon";
|
|
7367
|
+
/**
|
|
7368
|
+
* @description Whether the hosted pages show the product name above the heading: `show` or `hide`. Hidden there, the name still shows in the browser tab, the organization admin portal and the emails.
|
|
7369
|
+
* @enum {string}
|
|
7370
|
+
*/
|
|
7371
|
+
hosted_product_name: "show" | "hide";
|
|
7372
|
+
/**
|
|
7373
|
+
* @description Whether the hosted pages show the logo above the heading: `show` or `hide`. Hidden there, the logo still shows in the organization admin portal and the emails.
|
|
7374
|
+
* @enum {string}
|
|
7375
|
+
*/
|
|
7376
|
+
hosted_logo: "show" | "hide";
|
|
7363
7377
|
favicon_url: string | null;
|
|
7364
7378
|
/**
|
|
7365
7379
|
* @description Which look hosted pages wear: `light`, `dark`, or `system` for whichever the visitor's device asks for. `light` when unset, and on a plan without hosted page customization.
|
|
@@ -7504,6 +7518,16 @@ interface components {
|
|
|
7504
7518
|
* @enum {string|null}
|
|
7505
7519
|
*/
|
|
7506
7520
|
logo_kind?: "full" | "icon" | null;
|
|
7521
|
+
/**
|
|
7522
|
+
* @description Whether hosted pages show the product name above the heading. `hide` leaves it off the pages and keeps it set: the browser tab, the organization admin portal and the emails still show it. Null returns to `show`.
|
|
7523
|
+
* @enum {string|null}
|
|
7524
|
+
*/
|
|
7525
|
+
hosted_product_name?: "show" | "hide" | null;
|
|
7526
|
+
/**
|
|
7527
|
+
* @description Whether hosted pages show the logo above the heading. `hide` leaves it off the pages and keeps it set: the organization admin portal and the emails still show it. Null returns to `show`.
|
|
7528
|
+
* @enum {string|null}
|
|
7529
|
+
*/
|
|
7530
|
+
hosted_logo?: "show" | "hide" | null;
|
|
7507
7531
|
/**
|
|
7508
7532
|
* @description The browser-tab icon on hosted pages. The address `POST /api/v1/branding/images` answered for an image with `slot` `favicon`; any other value is refused. Null clears it.
|
|
7509
7533
|
* @example https://auth.canopy-io.com/branding-images/3f9a1c0e8b7d6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f-64x64.png
|
|
@@ -8070,6 +8094,8 @@ interface components {
|
|
|
8070
8094
|
refresh_token_ttl_days?: number;
|
|
8071
8095
|
/** @description Lifetime in days of a public client's session (a single-page or mobile app with no client secret), counted from sign-in and never extended by a refresh: when it ends the person signs in again. Defaults to 30. Confidential clients keep `refresh_token_ttl_days`, which slides forward on each refresh. Persisted under `env.settings.public_refresh_token_ttl_days`; applies to sessions signed in after the change. */
|
|
8072
8096
|
public_refresh_token_ttl_days?: number;
|
|
8097
|
+
/** @description Put what the person holds on every Direct API access token this Environment issues, at sign-in and on each refresh: `permissions` (the Environment-wide keys) and, for a session in an organization, `org_permissions` (the keys held at it), each capped at 200 with `permissions_overflow` or `org_permissions_overflow` set past the cap, as on a Hosted Login token minted with the `permissions` scope. Off by default; persisted under `env.settings.direct_api_permissions_claim_enabled`. Each sign-in and refresh then resolves them afresh; applies to tokens minted after the change. */
|
|
8098
|
+
direct_api_permissions_claim_enabled?: boolean;
|
|
8073
8099
|
/** @description Lifetime in seconds of the access tokens a machine client obtains with `client_credentials`. Defaults to 300 (5 minutes). A machine token has no refresh, so this is how long a client keeps acting after its secret is rotated or it is disabled. Persisted under `env.settings.m2m_access_token_ttl_seconds`; applies to tokens minted after the change. */
|
|
8074
8100
|
m2m_access_token_ttl_seconds?: number;
|
|
8075
8101
|
/** @description Create an organization for every self-signup through `POST /v1/identity/auth/register` and add the new identity as its first member. Off by default; persisted under `env.settings.organizations_create_on_signup`. The organization starts with roles copied from the Environment's organization role templates, and the new identity holds its copy of the default admin template. Requires the organizations container and a default admin template; refused with `400 role_template.default_admin_missing` while there is none. */
|
|
@@ -8173,6 +8199,8 @@ interface components {
|
|
|
8173
8199
|
refresh_token_ttl_days?: number;
|
|
8174
8200
|
/** @description Lifetime in days of a public client's session, fixed from sign-in. Absent when unset (the default is 30). */
|
|
8175
8201
|
public_refresh_token_ttl_days?: number;
|
|
8202
|
+
/** @description Whether the Direct API access tokens this Environment issues carry `permissions` and, in an organization, `org_permissions`. */
|
|
8203
|
+
direct_api_permissions_claim_enabled: boolean;
|
|
8176
8204
|
/** @description Lifetime in seconds of a machine client's `client_credentials` token. Absent when unset (the default is 300). */
|
|
8177
8205
|
m2m_access_token_ttl_seconds?: number;
|
|
8178
8206
|
/** @description The audience a machine client's token names when its request names none. Absent when unset. */
|
|
@@ -8267,6 +8295,8 @@ interface components {
|
|
|
8267
8295
|
refresh_token_ttl_days?: number;
|
|
8268
8296
|
/** @description Lifetime in days of a public client's session (a single-page or mobile app with no client secret), counted from sign-in and never extended by a refresh: when it ends the person signs in again. Defaults to 30. Confidential clients keep `refresh_token_ttl_days`, which slides forward on each refresh. Persisted under `env.settings.public_refresh_token_ttl_days`; applies to sessions signed in after the change. */
|
|
8269
8297
|
public_refresh_token_ttl_days?: number;
|
|
8298
|
+
/** @description Put what the person holds on every Direct API access token this Environment issues, at sign-in and on each refresh: `permissions` (the Environment-wide keys) and, for a session in an organization, `org_permissions` (the keys held at it), each capped at 200 with `permissions_overflow` or `org_permissions_overflow` set past the cap, as on a Hosted Login token minted with the `permissions` scope. Off by default; persisted under `env.settings.direct_api_permissions_claim_enabled`. Each sign-in and refresh then resolves them afresh; applies to tokens minted after the change. */
|
|
8299
|
+
direct_api_permissions_claim_enabled?: boolean;
|
|
8270
8300
|
/** @description Lifetime in seconds of the access tokens a machine client obtains with `client_credentials`. Defaults to 300 (5 minutes). A machine token has no refresh, so this is how long a client keeps acting after its secret is rotated or it is disabled. Persisted under `env.settings.m2m_access_token_ttl_seconds`; applies to tokens minted after the change. */
|
|
8271
8301
|
m2m_access_token_ttl_seconds?: number;
|
|
8272
8302
|
/**
|
|
@@ -8562,6 +8592,19 @@ interface components {
|
|
|
8562
8592
|
/** @description Role assigned to a JIT'd identity at the resolved node. */
|
|
8563
8593
|
default_role_id?: string | null;
|
|
8564
8594
|
};
|
|
8595
|
+
SsoSignInCoverageAppResponseDto: {
|
|
8596
|
+
/** @description The OAuth client's row id. */
|
|
8597
|
+
id: string;
|
|
8598
|
+
/** @description The OAuth client's public `client_id`. */
|
|
8599
|
+
client_id: string;
|
|
8600
|
+
/** @description The OAuth client's name. */
|
|
8601
|
+
name: string;
|
|
8602
|
+
};
|
|
8603
|
+
SsoSignInCoverageResponseDto: {
|
|
8604
|
+
environment_id: string;
|
|
8605
|
+
/** @description The Environment's active web clients with no active end-user SSO connection linked to them, oldest first. Their hosted sign-in offers no SSO, so with every other sign-in method off nobody can sign in through them. Machine clients are never listed. */
|
|
8606
|
+
apps_without_sso: components["schemas"]["SsoSignInCoverageAppResponseDto"][];
|
|
8607
|
+
};
|
|
8565
8608
|
EnvironmentSsoLinkResponseDto: {
|
|
8566
8609
|
environment_id: string;
|
|
8567
8610
|
sso_connection_id: string;
|
|
@@ -38446,14 +38489,14 @@ interface operations {
|
|
|
38446
38489
|
};
|
|
38447
38490
|
requestBody?: never;
|
|
38448
38491
|
responses: {
|
|
38449
|
-
/** @description
|
|
38492
|
+
/** @description Every Environment people can sign in to through SSO (one with an active OAuth client linked to an active end-user SSO connection, or one bound to such a connection itself), each with `apps_without_sso`: its active web clients with no active end-user connection linked, whose hosted sign-in offers no SSO. Lets the dashboard tell, per Environment and per app, whether SSO is a usable sign-in method when every other method is off. */
|
|
38450
38493
|
200: {
|
|
38451
38494
|
headers: {
|
|
38452
38495
|
[name: string]: unknown;
|
|
38453
38496
|
};
|
|
38454
38497
|
content: {
|
|
38455
38498
|
"application/json": {
|
|
38456
|
-
items:
|
|
38499
|
+
items: components["schemas"]["SsoSignInCoverageResponseDto"][];
|
|
38457
38500
|
};
|
|
38458
38501
|
};
|
|
38459
38502
|
};
|
|
@@ -49368,14 +49411,17 @@ interface TokenVerifierOptions {
|
|
|
49368
49411
|
*/
|
|
49369
49412
|
issuer?: string;
|
|
49370
49413
|
/**
|
|
49371
|
-
*
|
|
49414
|
+
* The audience, or audiences, a person's token must name in `aud`. A token
|
|
49415
|
+
* is accepted when its `aud` includes any of them.
|
|
49372
49416
|
*
|
|
49373
|
-
* Hosted Login
|
|
49374
|
-
*
|
|
49375
|
-
*
|
|
49376
|
-
*
|
|
49417
|
+
* A Hosted Login token names your OAuth client id, and a Direct API token
|
|
49418
|
+
* the id of the Environment that issued it. A backend that accepts both
|
|
49419
|
+
* lists both: `[clientId, environmentId]`. Verifying a token that carries
|
|
49420
|
+
* `aud` without setting this throws rather than ignoring the claim, because
|
|
49421
|
+
* `aud` is what stops a token minted for one client being replayed at
|
|
49422
|
+
* another.
|
|
49377
49423
|
*/
|
|
49378
|
-
audience?: string;
|
|
49424
|
+
audience?: string | readonly string[];
|
|
49379
49425
|
/**
|
|
49380
49426
|
* The audience a machine client's token must name, `service` or
|
|
49381
49427
|
* `delegated`: the identifier your API answers to
|
|
@@ -49613,7 +49659,7 @@ interface CanopyDelegation {
|
|
|
49613
49659
|
declare function delegation(claims: CanopyTokenClaims): CanopyDelegation | null;
|
|
49614
49660
|
declare class TokenVerifier {
|
|
49615
49661
|
private readonly issuer;
|
|
49616
|
-
private readonly
|
|
49662
|
+
private readonly audiences;
|
|
49617
49663
|
private readonly serviceAudience;
|
|
49618
49664
|
private readonly jwksUri;
|
|
49619
49665
|
private readonly jwksCacheMaxAgeMs;
|
package/dist/index.js
CHANGED
|
@@ -2465,9 +2465,16 @@ function decodeJsonSegment(segment, what) {
|
|
|
2465
2465
|
);
|
|
2466
2466
|
}
|
|
2467
2467
|
}
|
|
2468
|
+
function audienceList(audience) {
|
|
2469
|
+
if (audience === void 0) {
|
|
2470
|
+
return void 0;
|
|
2471
|
+
}
|
|
2472
|
+
const list = typeof audience === "string" ? [audience] : [...audience];
|
|
2473
|
+
return list.length > 0 ? list : void 0;
|
|
2474
|
+
}
|
|
2468
2475
|
var TokenVerifier = class {
|
|
2469
2476
|
issuer;
|
|
2470
|
-
|
|
2477
|
+
audiences;
|
|
2471
2478
|
serviceAudience;
|
|
2472
2479
|
jwksUri;
|
|
2473
2480
|
jwksCacheMaxAgeMs;
|
|
@@ -2487,7 +2494,7 @@ var TokenVerifier = class {
|
|
|
2487
2494
|
inFlight = null;
|
|
2488
2495
|
constructor(options = {}) {
|
|
2489
2496
|
this.issuer = resolveIssuer(options);
|
|
2490
|
-
this.
|
|
2497
|
+
this.audiences = audienceList(options.audience);
|
|
2491
2498
|
this.serviceAudience = options.serviceAudience;
|
|
2492
2499
|
this.jwksUri = options.jwksUri ?? `${this.issuer}/.well-known/jwks.json`;
|
|
2493
2500
|
this.jwksCacheMaxAgeMs = options.jwksCacheMaxAgeMs ?? DEFAULT_JWKS_CACHE_MAX_AGE_MS;
|
|
@@ -2657,19 +2664,20 @@ var TokenVerifier = class {
|
|
|
2657
2664
|
}
|
|
2658
2665
|
return;
|
|
2659
2666
|
}
|
|
2660
|
-
if (this.
|
|
2667
|
+
if (this.audiences === void 0) {
|
|
2661
2668
|
if (audiences.length > 0) {
|
|
2662
2669
|
throw new CanopyTokenError(
|
|
2663
2670
|
"token.audience_unverified",
|
|
2664
|
-
"Token carries an `aud` claim but the verifier has no `audience` configured. Set `audience` to your OAuth client id
|
|
2671
|
+
"Token carries an `aud` claim but the verifier has no `audience` configured. Set `audience` to your OAuth client id for Hosted Login tokens, to your Environment id for Direct API tokens, or to both, as a list, to accept either."
|
|
2665
2672
|
);
|
|
2666
2673
|
}
|
|
2667
2674
|
return;
|
|
2668
2675
|
}
|
|
2669
|
-
|
|
2676
|
+
const expected = this.audiences;
|
|
2677
|
+
if (!audiences.some((audience) => expected.includes(audience))) {
|
|
2670
2678
|
throw new CanopyTokenError(
|
|
2671
2679
|
"token.audience_mismatch",
|
|
2672
|
-
`Token audience does not include
|
|
2680
|
+
`Token audience does not include ${expected.map((audience) => `"${audience}"`).join(" or ")}.`
|
|
2673
2681
|
);
|
|
2674
2682
|
}
|
|
2675
2683
|
}
|