@canopy-io/node 0.3.11 → 0.3.12
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 +8 -0
- package/dist/index.cjs +35 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +274 -1
- package/dist/index.d.ts +274 -1
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -619,6 +619,46 @@ interface paths {
|
|
|
619
619
|
patch?: never;
|
|
620
620
|
trace?: never;
|
|
621
621
|
};
|
|
622
|
+
"/api/v1/identities/{id}/sessions": {
|
|
623
|
+
parameters: {
|
|
624
|
+
query?: never;
|
|
625
|
+
header?: never;
|
|
626
|
+
path?: never;
|
|
627
|
+
cookie?: never;
|
|
628
|
+
};
|
|
629
|
+
/**
|
|
630
|
+
* List an identity's active sessions (admin)
|
|
631
|
+
* @description Lists an identity's active sessions (server-to-server admin): the rows a customer reads to confirm from its own side that a sign-out took, or to show a person where they are signed in. Each row is a session's current refresh token, so `id` changes on every refresh. Returns `404` when the identity has no membership in this Environment.
|
|
632
|
+
*/
|
|
633
|
+
get: operations["ApiIdentitiesController_listIdentitySessions"];
|
|
634
|
+
put?: never;
|
|
635
|
+
post?: never;
|
|
636
|
+
delete?: never;
|
|
637
|
+
options?: never;
|
|
638
|
+
head?: never;
|
|
639
|
+
patch?: never;
|
|
640
|
+
trace?: never;
|
|
641
|
+
};
|
|
642
|
+
"/api/v1/identities/{id}/sessions/{sessionId}": {
|
|
643
|
+
parameters: {
|
|
644
|
+
query?: never;
|
|
645
|
+
header?: never;
|
|
646
|
+
path?: never;
|
|
647
|
+
cookie?: never;
|
|
648
|
+
};
|
|
649
|
+
get?: never;
|
|
650
|
+
put?: never;
|
|
651
|
+
post?: never;
|
|
652
|
+
/**
|
|
653
|
+
* Revoke one of an identity's sessions (admin)
|
|
654
|
+
* @description Revokes one of an identity's sessions (server-to-server admin) by marking its refresh token revoked, so the next refresh from that device returns `401` while every other session carries on. Audited as `identity.session.revoked`, the same row the person's own per-session sign-out writes. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment, or when the session is not the identity's or is already revoked.
|
|
655
|
+
*/
|
|
656
|
+
delete: operations["ApiIdentitiesController_revokeIdentitySession"];
|
|
657
|
+
options?: never;
|
|
658
|
+
head?: never;
|
|
659
|
+
patch?: never;
|
|
660
|
+
trace?: never;
|
|
661
|
+
};
|
|
622
662
|
"/api/v1/identities/{id}/sessions/revoke": {
|
|
623
663
|
parameters: {
|
|
624
664
|
query?: never;
|
|
@@ -2561,6 +2601,20 @@ interface components {
|
|
|
2561
2601
|
/** @description New password. 8-64 characters. No composition rules — NIST SP 800-63B aligned. A HaveIBeenPwned breach check runs server-side. The effective policy is published on `GET /v1/identity/auth/config`, so a client can state the rules before submit rather than after. */
|
|
2562
2602
|
password: string;
|
|
2563
2603
|
};
|
|
2604
|
+
IdentitySessionResponseDto: {
|
|
2605
|
+
/** @description The session's current refresh token id: what `DELETE /identities/:id/sessions/:sessionId` takes. It changes on every refresh. */
|
|
2606
|
+
id: string;
|
|
2607
|
+
/** Format: date-time */
|
|
2608
|
+
created_at: string;
|
|
2609
|
+
/** Format: date-time */
|
|
2610
|
+
expires_at: string;
|
|
2611
|
+
/** @description The address the session was signed in from: the browser's for a hosted sign-in, or the one a trusted backend forwarded in `X-Canopy-Client-IP`. */
|
|
2612
|
+
ip_address?: string | null;
|
|
2613
|
+
/** @description The user agent the session was signed in from: the browser's for a hosted sign-in, or the one a trusted backend forwarded in `X-Canopy-Client-User-Agent`. */
|
|
2614
|
+
user_agent?: string | null;
|
|
2615
|
+
/** @description The organization the session is acting in, the source of its tokens' `org_id` claim. Null when the Environment's organizations container is off or the identity belongs to none. */
|
|
2616
|
+
active_org_node_id?: string | null;
|
|
2617
|
+
};
|
|
2564
2618
|
MfaFactorResponseDto: {
|
|
2565
2619
|
/** Format: uuid */
|
|
2566
2620
|
id: string;
|
|
@@ -3014,6 +3068,17 @@ interface components {
|
|
|
3014
3068
|
* @enum {string|null}
|
|
3015
3069
|
*/
|
|
3016
3070
|
domain_outcome: "accepted" | "no_boundary" | "unbound" | "not_listed" | "not_verified" | "unknown" | null;
|
|
3071
|
+
/** @description The required fields the provider's response did not satisfy (`email`, `federated_subject_id`); empty on a pass. */
|
|
3072
|
+
missing_fields: string[];
|
|
3073
|
+
/** @description The attribute names the response carried, sorted. Names only, never values. */
|
|
3074
|
+
received_attributes: string[];
|
|
3075
|
+
/** @description The SAML Name ID format's last segment (`unspecified`, `emailAddress`, `persistent`); null for OIDC or when none came. */
|
|
3076
|
+
name_id_format: string | null;
|
|
3077
|
+
/**
|
|
3078
|
+
* @description The one thing to change, when the test can name it: the provider's Name ID format should be the email address (`set_name_id_email`), an email attribute or scope has to be added (`add_email_attribute`), or a stable subject has to be sent (`send_name_id`). Null when the report of names is the guidance.
|
|
3079
|
+
* @enum {string|null}
|
|
3080
|
+
*/
|
|
3081
|
+
hint: "set_name_id_email" | "add_email_attribute" | "send_name_id" | null;
|
|
3017
3082
|
/** Format: date-time */
|
|
3018
3083
|
completed_at: string | null;
|
|
3019
3084
|
};
|
|
@@ -3733,6 +3798,11 @@ interface components {
|
|
|
3733
3798
|
is_active: boolean;
|
|
3734
3799
|
/** Format: date-time */
|
|
3735
3800
|
created_at: string;
|
|
3801
|
+
/**
|
|
3802
|
+
* Format: date-time
|
|
3803
|
+
* @description While a rotation window is open, when the secret the rotation replaced stops verifying; `null` once only the current secret signs.
|
|
3804
|
+
*/
|
|
3805
|
+
previous_secret_expires_at?: string | null;
|
|
3736
3806
|
/** @description HMAC secret — only shown once on creation */
|
|
3737
3807
|
secret: string;
|
|
3738
3808
|
};
|
|
@@ -3751,6 +3821,11 @@ interface components {
|
|
|
3751
3821
|
is_active: boolean;
|
|
3752
3822
|
/** Format: date-time */
|
|
3753
3823
|
created_at: string;
|
|
3824
|
+
/**
|
|
3825
|
+
* Format: date-time
|
|
3826
|
+
* @description While a rotation window is open, when the secret the rotation replaced stops verifying; `null` once only the current secret signs.
|
|
3827
|
+
*/
|
|
3828
|
+
previous_secret_expires_at?: string | null;
|
|
3754
3829
|
};
|
|
3755
3830
|
WebhookEventTypeDto: {
|
|
3756
3831
|
event_type: string;
|
|
@@ -4668,6 +4743,11 @@ interface components {
|
|
|
4668
4743
|
slug: string;
|
|
4669
4744
|
/** @description Your own identifier for the organization, when you set one. */
|
|
4670
4745
|
external_id: string | null;
|
|
4746
|
+
/**
|
|
4747
|
+
* @description How the organization came to be, when it was not created through the API: a self-signup on an Environment that creates one for every new identity.
|
|
4748
|
+
* @enum {string}
|
|
4749
|
+
*/
|
|
4750
|
+
source?: "self_signup";
|
|
4671
4751
|
};
|
|
4672
4752
|
};
|
|
4673
4753
|
};
|
|
@@ -6848,6 +6928,177 @@ interface operations {
|
|
|
6848
6928
|
};
|
|
6849
6929
|
};
|
|
6850
6930
|
};
|
|
6931
|
+
ApiIdentitiesController_listIdentitySessions: {
|
|
6932
|
+
parameters: {
|
|
6933
|
+
query?: never;
|
|
6934
|
+
header?: never;
|
|
6935
|
+
path: {
|
|
6936
|
+
id: string;
|
|
6937
|
+
};
|
|
6938
|
+
cookie?: never;
|
|
6939
|
+
};
|
|
6940
|
+
requestBody?: never;
|
|
6941
|
+
responses: {
|
|
6942
|
+
/** @description Every session the identity holds that is neither revoked nor expired, newest first: the session's current refresh token id (what the per-session revoke takes), when it was signed in and when it expires, the browser's address and user agent, and the organization it is acting in. */
|
|
6943
|
+
200: {
|
|
6944
|
+
headers: {
|
|
6945
|
+
[name: string]: unknown;
|
|
6946
|
+
};
|
|
6947
|
+
content: {
|
|
6948
|
+
"application/json": {
|
|
6949
|
+
items: components["schemas"]["IdentitySessionResponseDto"][];
|
|
6950
|
+
};
|
|
6951
|
+
};
|
|
6952
|
+
};
|
|
6953
|
+
/** @description Invalid or expired token */
|
|
6954
|
+
401: {
|
|
6955
|
+
headers: {
|
|
6956
|
+
[name: string]: unknown;
|
|
6957
|
+
};
|
|
6958
|
+
content: {
|
|
6959
|
+
/**
|
|
6960
|
+
* @example {
|
|
6961
|
+
* "error": {
|
|
6962
|
+
* "statusCode": 401,
|
|
6963
|
+
* "code": null,
|
|
6964
|
+
* "message": "Invalid or expired token",
|
|
6965
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
6966
|
+
* "path": "/api/v1/identities",
|
|
6967
|
+
* "method": "GET"
|
|
6968
|
+
* }
|
|
6969
|
+
* }
|
|
6970
|
+
*/
|
|
6971
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6972
|
+
};
|
|
6973
|
+
};
|
|
6974
|
+
/** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
|
|
6975
|
+
403: {
|
|
6976
|
+
headers: {
|
|
6977
|
+
[name: string]: unknown;
|
|
6978
|
+
};
|
|
6979
|
+
content: {
|
|
6980
|
+
/**
|
|
6981
|
+
* @example {
|
|
6982
|
+
* "error": {
|
|
6983
|
+
* "statusCode": 403,
|
|
6984
|
+
* "code": null,
|
|
6985
|
+
* "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
|
|
6986
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
6987
|
+
* "path": "/api/v1/identities",
|
|
6988
|
+
* "method": "GET"
|
|
6989
|
+
* }
|
|
6990
|
+
* }
|
|
6991
|
+
*/
|
|
6992
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6993
|
+
};
|
|
6994
|
+
};
|
|
6995
|
+
/** @description Identity not found */
|
|
6996
|
+
404: {
|
|
6997
|
+
headers: {
|
|
6998
|
+
[name: string]: unknown;
|
|
6999
|
+
};
|
|
7000
|
+
content: {
|
|
7001
|
+
/**
|
|
7002
|
+
* @example {
|
|
7003
|
+
* "error": {
|
|
7004
|
+
* "statusCode": 404,
|
|
7005
|
+
* "code": null,
|
|
7006
|
+
* "message": "Identity not found",
|
|
7007
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7008
|
+
* "path": "/api/v1/identities/{id}/sessions",
|
|
7009
|
+
* "method": "GET"
|
|
7010
|
+
* }
|
|
7011
|
+
* }
|
|
7012
|
+
*/
|
|
7013
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7014
|
+
};
|
|
7015
|
+
};
|
|
7016
|
+
};
|
|
7017
|
+
};
|
|
7018
|
+
ApiIdentitiesController_revokeIdentitySession: {
|
|
7019
|
+
parameters: {
|
|
7020
|
+
query?: never;
|
|
7021
|
+
header?: never;
|
|
7022
|
+
path: {
|
|
7023
|
+
id: string;
|
|
7024
|
+
sessionId: string;
|
|
7025
|
+
};
|
|
7026
|
+
cookie?: never;
|
|
7027
|
+
};
|
|
7028
|
+
requestBody?: never;
|
|
7029
|
+
responses: {
|
|
7030
|
+
/** @description The session's refresh token is revoked, so its next refresh returns 401 while the identity's other sessions carry on. In-flight access tokens keep working until their short TTL expires. */
|
|
7031
|
+
204: {
|
|
7032
|
+
headers: {
|
|
7033
|
+
[name: string]: unknown;
|
|
7034
|
+
};
|
|
7035
|
+
content?: never;
|
|
7036
|
+
};
|
|
7037
|
+
/** @description Invalid or expired token */
|
|
7038
|
+
401: {
|
|
7039
|
+
headers: {
|
|
7040
|
+
[name: string]: unknown;
|
|
7041
|
+
};
|
|
7042
|
+
content: {
|
|
7043
|
+
/**
|
|
7044
|
+
* @example {
|
|
7045
|
+
* "error": {
|
|
7046
|
+
* "statusCode": 401,
|
|
7047
|
+
* "code": null,
|
|
7048
|
+
* "message": "Invalid or expired token",
|
|
7049
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7050
|
+
* "path": "/api/v1/identities",
|
|
7051
|
+
* "method": "GET"
|
|
7052
|
+
* }
|
|
7053
|
+
* }
|
|
7054
|
+
*/
|
|
7055
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7056
|
+
};
|
|
7057
|
+
};
|
|
7058
|
+
/** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
|
|
7059
|
+
403: {
|
|
7060
|
+
headers: {
|
|
7061
|
+
[name: string]: unknown;
|
|
7062
|
+
};
|
|
7063
|
+
content: {
|
|
7064
|
+
/**
|
|
7065
|
+
* @example {
|
|
7066
|
+
* "error": {
|
|
7067
|
+
* "statusCode": 403,
|
|
7068
|
+
* "code": null,
|
|
7069
|
+
* "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
|
|
7070
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7071
|
+
* "path": "/api/v1/identities",
|
|
7072
|
+
* "method": "GET"
|
|
7073
|
+
* }
|
|
7074
|
+
* }
|
|
7075
|
+
*/
|
|
7076
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7077
|
+
};
|
|
7078
|
+
};
|
|
7079
|
+
/** @description The session does not belong to this identity, or is already revoked */
|
|
7080
|
+
404: {
|
|
7081
|
+
headers: {
|
|
7082
|
+
[name: string]: unknown;
|
|
7083
|
+
};
|
|
7084
|
+
content: {
|
|
7085
|
+
/**
|
|
7086
|
+
* @example {
|
|
7087
|
+
* "error": {
|
|
7088
|
+
* "statusCode": 404,
|
|
7089
|
+
* "code": null,
|
|
7090
|
+
* "message": "The session does not belong to this identity, or is already revoked",
|
|
7091
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7092
|
+
* "path": "/api/v1/identities/{id}/sessions/{sessionId}",
|
|
7093
|
+
* "method": "DELETE"
|
|
7094
|
+
* }
|
|
7095
|
+
* }
|
|
7096
|
+
*/
|
|
7097
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7098
|
+
};
|
|
7099
|
+
};
|
|
7100
|
+
};
|
|
7101
|
+
};
|
|
6851
7102
|
ApiIdentitiesController_revokeIdentitySessions: {
|
|
6852
7103
|
parameters: {
|
|
6853
7104
|
query?: never;
|
|
@@ -17645,8 +17896,30 @@ declare class Identities {
|
|
|
17645
17896
|
* someone can do.
|
|
17646
17897
|
*/
|
|
17647
17898
|
permissions(id: string): Promise<ResponseBody<"ApiIdentitiesController_getIdentityPermissions">>;
|
|
17899
|
+
/**
|
|
17900
|
+
* Every session the identity holds that is neither revoked nor expired,
|
|
17901
|
+
* newest first: when and where it was signed in, when it expires, and the
|
|
17902
|
+
* organization it is acting in. Read it back after a revoke to confirm,
|
|
17903
|
+
* from your own side, that a sign-out took.
|
|
17904
|
+
*/
|
|
17905
|
+
sessions(id: string): Promise<ResponseBody<"ApiIdentitiesController_listIdentitySessions">>;
|
|
17906
|
+
/**
|
|
17907
|
+
* Ends one session and leaves the identity's others signed in. `sessionId`
|
|
17908
|
+
* is the session's `id` from `sessions`: its current refresh token, which
|
|
17909
|
+
* changes on every refresh, so read it shortly before revoking.
|
|
17910
|
+
*/
|
|
17911
|
+
revokeSession(id: string, sessionId: string): Promise<void>;
|
|
17912
|
+
/**
|
|
17913
|
+
* Ends every session the identity holds, so the next refresh on any device
|
|
17914
|
+
* fails and the person signs in again. Access tokens already issued keep
|
|
17915
|
+
* working until their short lifetime runs out. For a suspected compromise;
|
|
17916
|
+
* `deactivate` also refuses the next sign-in.
|
|
17917
|
+
*/
|
|
17918
|
+
revokeSessions(id: string): Promise<void>;
|
|
17648
17919
|
}
|
|
17649
17920
|
type IdentityItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_listIdentities">>;
|
|
17921
|
+
/** One live session from an identity's sessions. */
|
|
17922
|
+
type IdentitySessionItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_listIdentitySessions">>;
|
|
17650
17923
|
/** One role grant from an identity's assignments collection. */
|
|
17651
17924
|
type IdentityAssignmentItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_getIdentityAssignments">>;
|
|
17652
17925
|
type ItemOf$3<T> = T extends {
|
|
@@ -18380,4 +18653,4 @@ type WebhookEventData<Name extends WebhookEventName> = WebhookEvent<Name>["data"
|
|
|
18380
18653
|
*/
|
|
18381
18654
|
declare function isWebhookEvent<Name extends WebhookEventName>(delivery: WebhookDelivery, name: Name): delivery is WebhookEvent<Name>;
|
|
18382
18655
|
|
|
18383
|
-
export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyOrgContext, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type OrganizationInviteItem, type OrganizationItem, type OrganizationMemberItem, Organizations, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type WebhookDelivery, type WebhookEvent, type WebhookEventData, type WebhookEventName, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, isWebhookEvent, type operations, orgContext, paginate, type paths, withConcurrency };
|
|
18656
|
+
export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyOrgContext, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type IdentitySessionItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type OrganizationInviteItem, type OrganizationItem, type OrganizationMemberItem, Organizations, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type WebhookDelivery, type WebhookEvent, type WebhookEventData, type WebhookEventName, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, isWebhookEvent, type operations, orgContext, paginate, type paths, withConcurrency };
|
package/dist/index.d.ts
CHANGED
|
@@ -619,6 +619,46 @@ interface paths {
|
|
|
619
619
|
patch?: never;
|
|
620
620
|
trace?: never;
|
|
621
621
|
};
|
|
622
|
+
"/api/v1/identities/{id}/sessions": {
|
|
623
|
+
parameters: {
|
|
624
|
+
query?: never;
|
|
625
|
+
header?: never;
|
|
626
|
+
path?: never;
|
|
627
|
+
cookie?: never;
|
|
628
|
+
};
|
|
629
|
+
/**
|
|
630
|
+
* List an identity's active sessions (admin)
|
|
631
|
+
* @description Lists an identity's active sessions (server-to-server admin): the rows a customer reads to confirm from its own side that a sign-out took, or to show a person where they are signed in. Each row is a session's current refresh token, so `id` changes on every refresh. Returns `404` when the identity has no membership in this Environment.
|
|
632
|
+
*/
|
|
633
|
+
get: operations["ApiIdentitiesController_listIdentitySessions"];
|
|
634
|
+
put?: never;
|
|
635
|
+
post?: never;
|
|
636
|
+
delete?: never;
|
|
637
|
+
options?: never;
|
|
638
|
+
head?: never;
|
|
639
|
+
patch?: never;
|
|
640
|
+
trace?: never;
|
|
641
|
+
};
|
|
642
|
+
"/api/v1/identities/{id}/sessions/{sessionId}": {
|
|
643
|
+
parameters: {
|
|
644
|
+
query?: never;
|
|
645
|
+
header?: never;
|
|
646
|
+
path?: never;
|
|
647
|
+
cookie?: never;
|
|
648
|
+
};
|
|
649
|
+
get?: never;
|
|
650
|
+
put?: never;
|
|
651
|
+
post?: never;
|
|
652
|
+
/**
|
|
653
|
+
* Revoke one of an identity's sessions (admin)
|
|
654
|
+
* @description Revokes one of an identity's sessions (server-to-server admin) by marking its refresh token revoked, so the next refresh from that device returns `401` while every other session carries on. Audited as `identity.session.revoked`, the same row the person's own per-session sign-out writes. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment, or when the session is not the identity's or is already revoked.
|
|
655
|
+
*/
|
|
656
|
+
delete: operations["ApiIdentitiesController_revokeIdentitySession"];
|
|
657
|
+
options?: never;
|
|
658
|
+
head?: never;
|
|
659
|
+
patch?: never;
|
|
660
|
+
trace?: never;
|
|
661
|
+
};
|
|
622
662
|
"/api/v1/identities/{id}/sessions/revoke": {
|
|
623
663
|
parameters: {
|
|
624
664
|
query?: never;
|
|
@@ -2561,6 +2601,20 @@ interface components {
|
|
|
2561
2601
|
/** @description New password. 8-64 characters. No composition rules — NIST SP 800-63B aligned. A HaveIBeenPwned breach check runs server-side. The effective policy is published on `GET /v1/identity/auth/config`, so a client can state the rules before submit rather than after. */
|
|
2562
2602
|
password: string;
|
|
2563
2603
|
};
|
|
2604
|
+
IdentitySessionResponseDto: {
|
|
2605
|
+
/** @description The session's current refresh token id: what `DELETE /identities/:id/sessions/:sessionId` takes. It changes on every refresh. */
|
|
2606
|
+
id: string;
|
|
2607
|
+
/** Format: date-time */
|
|
2608
|
+
created_at: string;
|
|
2609
|
+
/** Format: date-time */
|
|
2610
|
+
expires_at: string;
|
|
2611
|
+
/** @description The address the session was signed in from: the browser's for a hosted sign-in, or the one a trusted backend forwarded in `X-Canopy-Client-IP`. */
|
|
2612
|
+
ip_address?: string | null;
|
|
2613
|
+
/** @description The user agent the session was signed in from: the browser's for a hosted sign-in, or the one a trusted backend forwarded in `X-Canopy-Client-User-Agent`. */
|
|
2614
|
+
user_agent?: string | null;
|
|
2615
|
+
/** @description The organization the session is acting in, the source of its tokens' `org_id` claim. Null when the Environment's organizations container is off or the identity belongs to none. */
|
|
2616
|
+
active_org_node_id?: string | null;
|
|
2617
|
+
};
|
|
2564
2618
|
MfaFactorResponseDto: {
|
|
2565
2619
|
/** Format: uuid */
|
|
2566
2620
|
id: string;
|
|
@@ -3014,6 +3068,17 @@ interface components {
|
|
|
3014
3068
|
* @enum {string|null}
|
|
3015
3069
|
*/
|
|
3016
3070
|
domain_outcome: "accepted" | "no_boundary" | "unbound" | "not_listed" | "not_verified" | "unknown" | null;
|
|
3071
|
+
/** @description The required fields the provider's response did not satisfy (`email`, `federated_subject_id`); empty on a pass. */
|
|
3072
|
+
missing_fields: string[];
|
|
3073
|
+
/** @description The attribute names the response carried, sorted. Names only, never values. */
|
|
3074
|
+
received_attributes: string[];
|
|
3075
|
+
/** @description The SAML Name ID format's last segment (`unspecified`, `emailAddress`, `persistent`); null for OIDC or when none came. */
|
|
3076
|
+
name_id_format: string | null;
|
|
3077
|
+
/**
|
|
3078
|
+
* @description The one thing to change, when the test can name it: the provider's Name ID format should be the email address (`set_name_id_email`), an email attribute or scope has to be added (`add_email_attribute`), or a stable subject has to be sent (`send_name_id`). Null when the report of names is the guidance.
|
|
3079
|
+
* @enum {string|null}
|
|
3080
|
+
*/
|
|
3081
|
+
hint: "set_name_id_email" | "add_email_attribute" | "send_name_id" | null;
|
|
3017
3082
|
/** Format: date-time */
|
|
3018
3083
|
completed_at: string | null;
|
|
3019
3084
|
};
|
|
@@ -3733,6 +3798,11 @@ interface components {
|
|
|
3733
3798
|
is_active: boolean;
|
|
3734
3799
|
/** Format: date-time */
|
|
3735
3800
|
created_at: string;
|
|
3801
|
+
/**
|
|
3802
|
+
* Format: date-time
|
|
3803
|
+
* @description While a rotation window is open, when the secret the rotation replaced stops verifying; `null` once only the current secret signs.
|
|
3804
|
+
*/
|
|
3805
|
+
previous_secret_expires_at?: string | null;
|
|
3736
3806
|
/** @description HMAC secret — only shown once on creation */
|
|
3737
3807
|
secret: string;
|
|
3738
3808
|
};
|
|
@@ -3751,6 +3821,11 @@ interface components {
|
|
|
3751
3821
|
is_active: boolean;
|
|
3752
3822
|
/** Format: date-time */
|
|
3753
3823
|
created_at: string;
|
|
3824
|
+
/**
|
|
3825
|
+
* Format: date-time
|
|
3826
|
+
* @description While a rotation window is open, when the secret the rotation replaced stops verifying; `null` once only the current secret signs.
|
|
3827
|
+
*/
|
|
3828
|
+
previous_secret_expires_at?: string | null;
|
|
3754
3829
|
};
|
|
3755
3830
|
WebhookEventTypeDto: {
|
|
3756
3831
|
event_type: string;
|
|
@@ -4668,6 +4743,11 @@ interface components {
|
|
|
4668
4743
|
slug: string;
|
|
4669
4744
|
/** @description Your own identifier for the organization, when you set one. */
|
|
4670
4745
|
external_id: string | null;
|
|
4746
|
+
/**
|
|
4747
|
+
* @description How the organization came to be, when it was not created through the API: a self-signup on an Environment that creates one for every new identity.
|
|
4748
|
+
* @enum {string}
|
|
4749
|
+
*/
|
|
4750
|
+
source?: "self_signup";
|
|
4671
4751
|
};
|
|
4672
4752
|
};
|
|
4673
4753
|
};
|
|
@@ -6848,6 +6928,177 @@ interface operations {
|
|
|
6848
6928
|
};
|
|
6849
6929
|
};
|
|
6850
6930
|
};
|
|
6931
|
+
ApiIdentitiesController_listIdentitySessions: {
|
|
6932
|
+
parameters: {
|
|
6933
|
+
query?: never;
|
|
6934
|
+
header?: never;
|
|
6935
|
+
path: {
|
|
6936
|
+
id: string;
|
|
6937
|
+
};
|
|
6938
|
+
cookie?: never;
|
|
6939
|
+
};
|
|
6940
|
+
requestBody?: never;
|
|
6941
|
+
responses: {
|
|
6942
|
+
/** @description Every session the identity holds that is neither revoked nor expired, newest first: the session's current refresh token id (what the per-session revoke takes), when it was signed in and when it expires, the browser's address and user agent, and the organization it is acting in. */
|
|
6943
|
+
200: {
|
|
6944
|
+
headers: {
|
|
6945
|
+
[name: string]: unknown;
|
|
6946
|
+
};
|
|
6947
|
+
content: {
|
|
6948
|
+
"application/json": {
|
|
6949
|
+
items: components["schemas"]["IdentitySessionResponseDto"][];
|
|
6950
|
+
};
|
|
6951
|
+
};
|
|
6952
|
+
};
|
|
6953
|
+
/** @description Invalid or expired token */
|
|
6954
|
+
401: {
|
|
6955
|
+
headers: {
|
|
6956
|
+
[name: string]: unknown;
|
|
6957
|
+
};
|
|
6958
|
+
content: {
|
|
6959
|
+
/**
|
|
6960
|
+
* @example {
|
|
6961
|
+
* "error": {
|
|
6962
|
+
* "statusCode": 401,
|
|
6963
|
+
* "code": null,
|
|
6964
|
+
* "message": "Invalid or expired token",
|
|
6965
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
6966
|
+
* "path": "/api/v1/identities",
|
|
6967
|
+
* "method": "GET"
|
|
6968
|
+
* }
|
|
6969
|
+
* }
|
|
6970
|
+
*/
|
|
6971
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6972
|
+
};
|
|
6973
|
+
};
|
|
6974
|
+
/** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
|
|
6975
|
+
403: {
|
|
6976
|
+
headers: {
|
|
6977
|
+
[name: string]: unknown;
|
|
6978
|
+
};
|
|
6979
|
+
content: {
|
|
6980
|
+
/**
|
|
6981
|
+
* @example {
|
|
6982
|
+
* "error": {
|
|
6983
|
+
* "statusCode": 403,
|
|
6984
|
+
* "code": null,
|
|
6985
|
+
* "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
|
|
6986
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
6987
|
+
* "path": "/api/v1/identities",
|
|
6988
|
+
* "method": "GET"
|
|
6989
|
+
* }
|
|
6990
|
+
* }
|
|
6991
|
+
*/
|
|
6992
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
6993
|
+
};
|
|
6994
|
+
};
|
|
6995
|
+
/** @description Identity not found */
|
|
6996
|
+
404: {
|
|
6997
|
+
headers: {
|
|
6998
|
+
[name: string]: unknown;
|
|
6999
|
+
};
|
|
7000
|
+
content: {
|
|
7001
|
+
/**
|
|
7002
|
+
* @example {
|
|
7003
|
+
* "error": {
|
|
7004
|
+
* "statusCode": 404,
|
|
7005
|
+
* "code": null,
|
|
7006
|
+
* "message": "Identity not found",
|
|
7007
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7008
|
+
* "path": "/api/v1/identities/{id}/sessions",
|
|
7009
|
+
* "method": "GET"
|
|
7010
|
+
* }
|
|
7011
|
+
* }
|
|
7012
|
+
*/
|
|
7013
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7014
|
+
};
|
|
7015
|
+
};
|
|
7016
|
+
};
|
|
7017
|
+
};
|
|
7018
|
+
ApiIdentitiesController_revokeIdentitySession: {
|
|
7019
|
+
parameters: {
|
|
7020
|
+
query?: never;
|
|
7021
|
+
header?: never;
|
|
7022
|
+
path: {
|
|
7023
|
+
id: string;
|
|
7024
|
+
sessionId: string;
|
|
7025
|
+
};
|
|
7026
|
+
cookie?: never;
|
|
7027
|
+
};
|
|
7028
|
+
requestBody?: never;
|
|
7029
|
+
responses: {
|
|
7030
|
+
/** @description The session's refresh token is revoked, so its next refresh returns 401 while the identity's other sessions carry on. In-flight access tokens keep working until their short TTL expires. */
|
|
7031
|
+
204: {
|
|
7032
|
+
headers: {
|
|
7033
|
+
[name: string]: unknown;
|
|
7034
|
+
};
|
|
7035
|
+
content?: never;
|
|
7036
|
+
};
|
|
7037
|
+
/** @description Invalid or expired token */
|
|
7038
|
+
401: {
|
|
7039
|
+
headers: {
|
|
7040
|
+
[name: string]: unknown;
|
|
7041
|
+
};
|
|
7042
|
+
content: {
|
|
7043
|
+
/**
|
|
7044
|
+
* @example {
|
|
7045
|
+
* "error": {
|
|
7046
|
+
* "statusCode": 401,
|
|
7047
|
+
* "code": null,
|
|
7048
|
+
* "message": "Invalid or expired token",
|
|
7049
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7050
|
+
* "path": "/api/v1/identities",
|
|
7051
|
+
* "method": "GET"
|
|
7052
|
+
* }
|
|
7053
|
+
* }
|
|
7054
|
+
*/
|
|
7055
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7056
|
+
};
|
|
7057
|
+
};
|
|
7058
|
+
/** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
|
|
7059
|
+
403: {
|
|
7060
|
+
headers: {
|
|
7061
|
+
[name: string]: unknown;
|
|
7062
|
+
};
|
|
7063
|
+
content: {
|
|
7064
|
+
/**
|
|
7065
|
+
* @example {
|
|
7066
|
+
* "error": {
|
|
7067
|
+
* "statusCode": 403,
|
|
7068
|
+
* "code": null,
|
|
7069
|
+
* "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
|
|
7070
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7071
|
+
* "path": "/api/v1/identities",
|
|
7072
|
+
* "method": "GET"
|
|
7073
|
+
* }
|
|
7074
|
+
* }
|
|
7075
|
+
*/
|
|
7076
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7077
|
+
};
|
|
7078
|
+
};
|
|
7079
|
+
/** @description The session does not belong to this identity, or is already revoked */
|
|
7080
|
+
404: {
|
|
7081
|
+
headers: {
|
|
7082
|
+
[name: string]: unknown;
|
|
7083
|
+
};
|
|
7084
|
+
content: {
|
|
7085
|
+
/**
|
|
7086
|
+
* @example {
|
|
7087
|
+
* "error": {
|
|
7088
|
+
* "statusCode": 404,
|
|
7089
|
+
* "code": null,
|
|
7090
|
+
* "message": "The session does not belong to this identity, or is already revoked",
|
|
7091
|
+
* "timestamp": "2026-04-20T12:00:00.000Z",
|
|
7092
|
+
* "path": "/api/v1/identities/{id}/sessions/{sessionId}",
|
|
7093
|
+
* "method": "DELETE"
|
|
7094
|
+
* }
|
|
7095
|
+
* }
|
|
7096
|
+
*/
|
|
7097
|
+
"application/json": components["schemas"]["ErrorResponseDto"];
|
|
7098
|
+
};
|
|
7099
|
+
};
|
|
7100
|
+
};
|
|
7101
|
+
};
|
|
6851
7102
|
ApiIdentitiesController_revokeIdentitySessions: {
|
|
6852
7103
|
parameters: {
|
|
6853
7104
|
query?: never;
|
|
@@ -17645,8 +17896,30 @@ declare class Identities {
|
|
|
17645
17896
|
* someone can do.
|
|
17646
17897
|
*/
|
|
17647
17898
|
permissions(id: string): Promise<ResponseBody<"ApiIdentitiesController_getIdentityPermissions">>;
|
|
17899
|
+
/**
|
|
17900
|
+
* Every session the identity holds that is neither revoked nor expired,
|
|
17901
|
+
* newest first: when and where it was signed in, when it expires, and the
|
|
17902
|
+
* organization it is acting in. Read it back after a revoke to confirm,
|
|
17903
|
+
* from your own side, that a sign-out took.
|
|
17904
|
+
*/
|
|
17905
|
+
sessions(id: string): Promise<ResponseBody<"ApiIdentitiesController_listIdentitySessions">>;
|
|
17906
|
+
/**
|
|
17907
|
+
* Ends one session and leaves the identity's others signed in. `sessionId`
|
|
17908
|
+
* is the session's `id` from `sessions`: its current refresh token, which
|
|
17909
|
+
* changes on every refresh, so read it shortly before revoking.
|
|
17910
|
+
*/
|
|
17911
|
+
revokeSession(id: string, sessionId: string): Promise<void>;
|
|
17912
|
+
/**
|
|
17913
|
+
* Ends every session the identity holds, so the next refresh on any device
|
|
17914
|
+
* fails and the person signs in again. Access tokens already issued keep
|
|
17915
|
+
* working until their short lifetime runs out. For a suspected compromise;
|
|
17916
|
+
* `deactivate` also refuses the next sign-in.
|
|
17917
|
+
*/
|
|
17918
|
+
revokeSessions(id: string): Promise<void>;
|
|
17648
17919
|
}
|
|
17649
17920
|
type IdentityItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_listIdentities">>;
|
|
17921
|
+
/** One live session from an identity's sessions. */
|
|
17922
|
+
type IdentitySessionItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_listIdentitySessions">>;
|
|
17650
17923
|
/** One role grant from an identity's assignments collection. */
|
|
17651
17924
|
type IdentityAssignmentItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_getIdentityAssignments">>;
|
|
17652
17925
|
type ItemOf$3<T> = T extends {
|
|
@@ -18380,4 +18653,4 @@ type WebhookEventData<Name extends WebhookEventName> = WebhookEvent<Name>["data"
|
|
|
18380
18653
|
*/
|
|
18381
18654
|
declare function isWebhookEvent<Name extends WebhookEventName>(delivery: WebhookDelivery, name: Name): delivery is WebhookEvent<Name>;
|
|
18382
18655
|
|
|
18383
|
-
export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyOrgContext, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type OrganizationInviteItem, type OrganizationItem, type OrganizationMemberItem, Organizations, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type WebhookDelivery, type WebhookEvent, type WebhookEventData, type WebhookEventName, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, isWebhookEvent, type operations, orgContext, paginate, type paths, withConcurrency };
|
|
18656
|
+
export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyOrgContext, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type IdentitySessionItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type OrganizationInviteItem, type OrganizationItem, type OrganizationMemberItem, Organizations, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type WebhookDelivery, type WebhookEvent, type WebhookEventData, type WebhookEventName, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, isWebhookEvent, type operations, orgContext, paginate, type paths, withConcurrency };
|