@meshery/schemas 1.3.119 → 1.3.121

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.
@@ -1,4 +1,4 @@
1
1
  'use strict';var e={openapi:"3.0.0",info:{title:"token",description:"Documentation for Meshery Cloud REST APIs for user tokens and sessions",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"},version:"v1beta3"},servers:[{url:"https://cloud.meshery.io",description:"Meshery Cloud production server URL"},{url:"https://staging-cloud.meshery.io",description:"Meshery Cloud staging server URL"},{url:"http://localhost:9876",description:"Meshery Cloud development server URL"}],security:[{jwt:[]}],tags:[{name:"tokens",description:"Operations related to user tokens and sessions"}],paths:{"/api/identity/tokens":{get:{"x-internal":["cloud"],tags:["tokens"],summary:"Get tokens",operationId:"getUserTokens",description:"Retrieves tokens associated with the authenticated user.",parameters:[{name:"isOauth",in:"query",description:"Whether to retrieve OAuth-backed sessions instead of API tokens.",schema:{type:"boolean"}},{name:"purpose",in:"query",description:"Token purpose. Tokens are minted with this purpose on generate. On list, only tokens whose purpose is exactly this value (case-sensitive, not a substring match) are returned; omit it to list every purpose.",schema:{type:"string",maxLength:500}},{name:"page",in:"query",description:"Get responses by page",schema:{type:"integer",minimum:0}},{name:"pageSize",in:"query",description:"Number of responses to return per page. Canonical camelCase pagination parameter; prefer this over the deprecated all-lowercase `pagesize`.",schema:{type:"integer",minimum:1}},{name:"pagesize",in:"query",description:"Get responses by pagesize. Deprecated alias of pageSize.",deprecated:true,schema:{type:"integer"}},{name:"search",in:"query",description:"Get responses that match search param value",schema:{type:"string"}},{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}}],responses:{200:{description:"Tokens response",content:{"application/json":{schema:{type:"object",description:"A paginated list of tokens.",required:["tokens","totalCount","page","pageSize"],properties:{tokens:{type:"array",items:{"x-go-type":"UserToken",type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}},"x-order":1,description:"Tokens returned on the current page."},totalCount:{type:"integer",description:"Total number of tokens across all pages.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":2,"x-oapi-codegen-extra-tags":{json:"totalCount"}},page:{type:"integer",description:"Current page number (zero-based).",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":3},pageSize:{type:"integer",description:"Number of tokens per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-order":4,"x-oapi-codegen-extra-tags":{json:"pageSize"}}}}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}},post:{"x-internal":["cloud"],tags:["tokens"],summary:"Generate token",operationId:"generateToken",description:"Generates a token for the authenticated user. `name` and `purpose` are query parameters, as before. The optional body (`TokenCreatePayload`) limits the token: `keychainIds` restricts it to the keys of those keychains, and `expiresAt` ends its life. Omit the body, or both fields, for an unrestricted token that never expires. An unknown keychain ID, an explicit empty `keychainIds`, an `expiresAt` in the past, or a keychain the caller cannot see is refused with 400. A request authenticated with a keychain-scoped token (`keychainScoped` true, or a non-empty `keychainIds`) answers 403 and mints nothing, whatever the body. A session or unrestricted token is unchanged. See docs/token-scoping-contract.md.",parameters:[{name:"name",in:"query",description:"Name of the token.",required:true,schema:{type:"string",minLength:1,maxLength:255}},{name:"purpose",in:"query",description:"Token purpose. Tokens are minted with this purpose on generate. On list, only tokens whose purpose is exactly this value (case-sensitive, not a substring match) are returned; omit it to list every purpose.",schema:{type:"string",maxLength:500}}],requestBody:{required:false,content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Client-settable limits for a token created with generateToken. Every field is optional; an empty body creates an unrestricted token that never expires. The token's name and purpose are query parameters of the operation, and its id, owner and timestamps are server-generated.",properties:{keychainIds:{type:"array",description:"IDs of the keychains the token is limited to. A non-empty list limits the token to the keys of those keychains, intersected with the owner's keys in the request's organization. An absent list creates an unrestricted token. An explicit empty list is refused with 400, so a selection that ends up empty never mints a full-access token. The server records keychainScoped from this list; clients do not set it.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},minItems:1,maxItems:100,uniqueItems:true,"x-order":1},expiresAt:{type:"string",format:"date-time",nullable:true,description:"Time after which the token is no longer accepted. Absent or null means it never expires.","x-order":2}}}}}},responses:{201:{description:"Token generated",content:{"application/json":{schema:{type:"object",description:"A paginated list of tokens.",required:["tokens","totalCount","page","pageSize"],properties:{tokens:{type:"array",items:{"x-go-type":"UserToken",type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}},"x-order":1,description:"Tokens returned on the current page."},totalCount:{type:"integer",description:"Total number of tokens across all pages.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":2,"x-oapi-codegen-extra-tags":{json:"totalCount"}},page:{type:"integer",description:"Current page number (zero-based).",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":3},pageSize:{type:"integer",description:"Number of tokens per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-order":4,"x-oapi-codegen-extra-tags":{json:"pageSize"}}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"Forbidden",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}},delete:{"x-internal":["cloud"],tags:["tokens"],summary:"Delete token",operationId:"deleteUserToken",description:"Deletes a specific token for the authenticated user.",parameters:[{name:"tokenId",in:"query",description:"ID of the token to delete.",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}],responses:{200:{description:"Token deleted",content:{"application/json":{schema:{type:"object",description:"A paginated list of tokens.",required:["tokens","totalCount","page","pageSize"],properties:{tokens:{type:"array",items:{"x-go-type":"UserToken",type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}},"x-order":1,description:"Tokens returned on the current page."},totalCount:{type:"integer",description:"Total number of tokens across all pages.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":2,"x-oapi-codegen-extra-tags":{json:"totalCount"}},page:{type:"integer",description:"Current page number (zero-based).",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":3},pageSize:{type:"integer",description:"Number of tokens per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-order":4,"x-oapi-codegen-extra-tags":{json:"pageSize"}}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/identity/tokens/{tokenId}":{get:{"x-internal":["cloud"],tags:["tokens"],summary:"Download token",operationId:"downloadToken",description:"Downloads a specific token by its ID for use as a local credential file (e.g. a CLI auth file). Gated by the Download Token permission and recorded as a distinct audit event from viewing or listing tokens.",parameters:[{name:"tokenId",in:"path",description:"Token ID",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}],responses:{200:{description:"Token response",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/identity/tokens/infinite":{get:{"x-internal":["cloud"],tags:["tokens"],summary:"Issue indefinite lifetime token",operationId:"issueIndefiniteLifetimeToken",description:"Creates a non-expiring user token for provider admin use cases. A request authenticated with a keychain-scoped token (`keychainScoped` true, or a non-empty `keychainIds`) answers 403 and mints nothing, whatever the query. A session or unrestricted token is unchanged. See docs/token-scoping-contract.md.",parameters:[{name:"userId",in:"query",description:"UUID of the user to issue the indefinite token for.",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},{name:"provider",in:"query",description:"Authentication provider to associate with the indefinite token.",required:true,schema:{type:"string",maxLength:500}}],responses:{200:{description:"Token generated",content:{"application/json":{schema:{type:"object",description:"A paginated list of tokens.",required:["tokens","totalCount","page","pageSize"],properties:{tokens:{type:"array",items:{"x-go-type":"UserToken",type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}},"x-order":1,description:"Tokens returned on the current page."},totalCount:{type:"integer",description:"Total number of tokens across all pages.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":2,"x-oapi-codegen-extra-tags":{json:"totalCount"}},page:{type:"integer",description:"Current page number (zero-based).",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":3},pageSize:{type:"integer",description:"Number of tokens per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-order":4,"x-oapi-codegen-extra-tags":{json:"pageSize"}}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"Forbidden",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/identity/native/authorize":{get:{"x-internal":["cloud"],tags:["tokens"],summary:"Authorize native client sign-in",operationId:"getNativeClientAuthorization",description:"Browser-facing step of the native client sign-in flow (RFC 8252 loopback redirect with RFC 7636 PKCE). Requires the session cookie of a signed-in user and the Create Token permission. Validates the request. When the request names the client application (`client`) and its version (`clientVersion`) and that version is below the provider minimum, it renders the update page with status 426 and issues nothing. Otherwise it stores a single-use authorization code that expires after 60 seconds, bound to the user, the client name and the PKCE code challenge, and redirects the browser to http://127.0.0.1:{port}/callback with code and state query parameters. Only the 127.0.0.1 loopback IP literal is ever used; no token or cookie is placed in the redirect; no consent page is shown. A request authenticated with a keychain-scoped token (`keychainScoped` true, or a non-empty `keychainIds`) answers 403 and mints nothing, including no authorization code, whatever the query. A session or unrestricted token is unchanged. See docs/token-scoping-contract.md.",parameters:[{name:"clientName",in:"query",description:"Display name of the native client asking to sign in. Used as the name and purpose of the minted token.",required:true,schema:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9 ._-]{0,62}$"}},{name:"client",in:"query",description:"Identifier of the client application, as in the capabilities `client` parameter. Selects the minimum version checked against `clientVersion`.",required:false,schema:{type:"string",description:`Identifier of a client application, for example the product name of a desktop app, lowercase. It is a value chosen by the client; the provider keys its minimum client versions by it.
2
- `,minLength:1,maxLength:64,pattern:"^[a-z0-9][a-z0-9-]*$"}},{name:"clientVersion",in:"query",description:"Version of the client application, for example `v1.25.0`.",required:false,schema:{type:"string",maxLength:64}},{name:"port",in:"query",description:"Port on 127.0.0.1 where the native client listens for the callback.",required:true,schema:{type:"integer",minimum:1024,maximum:65535}},{name:"codeChallenge",in:"query",description:"PKCE code challenge, BASE64URL(SHA256(codeVerifier)) without padding.",required:true,schema:{type:"string",pattern:"^[A-Za-z0-9_-]{43}$"}},{name:"codeChallengeMethod",in:"query",description:"PKCE challenge method. Only S256 is accepted.",required:true,schema:{type:"string",enum:["S256"]}},{name:"state",in:"query",description:"Opaque value from the native client, returned unchanged on the callback.",required:true,schema:{type:"string",minLength:8,maxLength:512}}],responses:{302:{description:"Redirect to the loopback callback carrying code and state. The callback's query parameters are described by NativeAuthorizationCallback.",headers:{Location:{required:true,description:"http://127.0.0.1:{port}/callback?code=...&state=..., whose query is a NativeAuthorizationCallback.",schema:{type:"string"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"Forbidden",content:{"text/plain":{schema:{type:"string"}}}},426:{description:"Update page; the client's version is below the provider's minimum for that client.",content:{"text/html":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/identity/native/token":{post:{"x-internal":["cloud"],tags:["tokens"],summary:"Exchange native client authorization code",operationId:"exchangeNativeAuthorizationCode",description:"Redeems a single-use authorization code from the native client sign-in flow. The caller proves possession of the PKCE code verifier (BASE64URL(SHA256(codeVerifier)) must equal the stored S256 challenge). The code is consumed on the first redemption attempt, whether or not the verifier matches. On success an API token is minted for the user with name and purpose set to the client name. This call is authenticated by the code and verifier, not by a session.",security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Redeems a native client authorization code with its PKCE verifier.",required:["code","codeVerifier"],properties:{code:{type:"string",description:"Single-use authorization code from the loopback callback.",minLength:1,maxLength:128,"x-order":1},codeVerifier:{type:"string",description:"PKCE code verifier (RFC 7636, 43 to 128 unreserved characters).",pattern:"^[A-Za-z0-9._~-]{43,128}$","x-order":2}}}}}},responses:{201:{description:"API token minted for the native client",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/revoke":{post:{"x-internal":["cloud"],tags:["tokens"],summary:"Revoke token",operationId:"revokeToken",description:`Revokes an OAuth access or refresh token issued by the identity provider, for example when an OAuth client signs out, or a user-created API token (the token envelope that generateToken returns, or the bare JWT inside it). Possessing the token is the credential, so no session or bearer token is required. The server first checks whether \`token\` is a user-created API token whose signature verifies. If it is, the server retires it locally, scoped to the owner named in the token, exactly as deleteUserToken does, and evicts cached introspection results so the token stops authenticating immediately. A token issued to a third-party OAuth client (any client other than the server's own) ends that user's whole grant to that client, revoking every access and refresh token it minted. Any other token is forwarded to the OAuth2 server's RFC 7009 revocation endpoint with the server's own client credentials, which revokes that token and the tokens issued alongside it from the same authorization. On every path an unknown, anonymous or already-revoked token is a no-op that still answers 200, so the answer reveals nothing about validity. The server trims whitespace from \`token\`. The server reads only the first 1 MiB (1048576 bytes) of the body and ignores the rest; JSON that does not complete within it fails to decode (400). A 400 body is one of "Error reading token payload", "Error decoding token" or "missing token". A 503 body is "token revocation status is temporarily unavailable" when signing keys (JWKS) or the token store cannot be read, or when the OAuth2 server cannot be asked who the token belongs to; the token was not revoked and the caller should retry. A 500 body is "Error revoking token at the moment", answered when the revocation call itself fails: the OAuth2 server's revocation returns an error response or cannot be reached.`,security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Carries the token that revokeToken revokes.",required:["token"],properties:{token:{type:"string",description:"The token. Surrounding whitespace is trimmed; a value that is empty after trimming is rejected.",pattern:"[^\\x09-\\x0D\\x20\\x85\\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]","x-order":1}}}}}},responses:{200:{description:"Token revoked, or unknown or already revoked (no-op). The body is empty and the session cookie is cleared.",headers:{"Set-Cookie":{description:"Clears the session cookie (session_cookie=; Path=/; Max-Age=0; HttpOnly).",schema:{type:"string"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}},503:{description:'Signing keys (JWKS) or the token store could not be read, or the OAuth2 server could not be asked who the token belongs to, so the token was not revoked. The body is "token revocation status is temporarily unavailable"; the caller should retry.',content:{"text/plain":{schema:{type:"string"}}}}}}},"/introspect":{post:{"x-internal":["cloud"],tags:["tokens"],summary:"Introspect access token",operationId:"introspectToken",description:'Reports whether an access token (a JWT) is authentic, unexpired, not revoked and issued for a protected resource, and on success describes it. Possessing the token is the credential, so no session or bearer token is required. `resource` names the protected resource asking (an RFC 8707 resource identifier, as published in that resource\'s RFC 9728 protected resource metadata); omitted, it is the REST API. The server is the single decider: a token the server issued to its own first-party clients (a personal API token, a native sign-in token, a first-party sign-in session) is valid for every protected resource the server issues tokens for; a token issued to a third-party OAuth client is valid only for a resource its `aud` names. An inactive or refused token is answered with a 401, not with RFC 7662 section 2.2\'s 200 and `active: false`: this is the server\'s status API, and existing callers read only the status. The server trims whitespace from `token`. The server reads only the first 1 MiB (1048576 bytes) of the body and ignores the rest; JSON that does not complete within it fails to decode (400). A 400 body is "Error reading token payload" or "Error decoding token" (also answered when `token` is missing or empty), or "invalid_target" when `resource` is not a protected resource this server issues tokens for. A 401 body is "invalid access token" when the signature or expiry check fails, "revoked access token used" when the token has been revoked, or "token audience does not include the requested resource". A caller that sends `resource` takes the 200 as the server\'s decision for that resource - `aud` is [] for a first-party token that is valid everywhere, so a caller must not re-derive the decision from it - and must refuse the token when the 200 carries no body: a server that predates `resource` ignores it and answers 200 with an empty body for any valid token.',security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Carries the token that introspectToken checks, and the protected resource asking.",required:["token"],properties:{token:{type:"string",description:"The token. Surrounding whitespace is trimmed; a value that is empty after trimming is rejected.",pattern:"[^\\x09-\\x0D\\x20\\x85\\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]","x-order":1},resource:{type:"string",format:"uri",maxLength:2048,description:'RFC 8707 resource identifier of the protected resource asking, as published in its RFC 9728 protected resource metadata. Omitted, the REST API. A value that is not a protected resource this server issues tokens for is rejected with 400 "invalid_target".',"x-order":2}}}}}},responses:{200:{description:"The token is authentic, unexpired, not revoked and valid for the requested resource. The body describes it.",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Describes an access token introspectToken accepted, using the RFC 7662 member names where they are single words and their camelCase form where they are not (clientId, tokenType).",required:["active","aud"],properties:{active:{type:"boolean",description:"Always true; a token that is not active is answered with 401 instead.","x-order":1},aud:{type:"array",description:"The resources the token is bound to (RFC 8707 resource identifiers). Always a JSON array, never null or absent: [] for a token the server issued to its own first-party clients, which is valid for every protected resource the server issues tokens for.",items:{type:"string"},"x-order":2},sub:{type:"string",description:"The subject the token was issued for.","x-order":3},clientId:{type:"string",description:"The OAuth client the token was issued to.","x-order":4},scope:{type:"string",description:"Space-separated scopes granted to the token.","x-order":5},exp:{type:"integer",format:"int64",description:"Expiry, in seconds since the Unix epoch. Absent for a token that does not expire.","x-order":6},iat:{type:"integer",format:"int64",description:"Issue time, in seconds since the Unix epoch.","x-order":7},nbf:{type:"integer",format:"int64",description:"Not-before time, in seconds since the Unix epoch.","x-order":8},iss:{type:"string",description:"The issuer of the token.","x-order":9},tokenType:{type:"string",description:'Always "Bearer".',"x-order":10}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},503:{description:"Signing keys or token revocation status are temporarily unavailable. The token is refused, but the caller should retry rather than sign the user out.",content:{"text/plain":{schema:{type:"string"}}}}}}},"/logout":{get:{"x-internal":["cloud"],tags:["tokens"],summary:"Sign out",operationId:"logoutUser",description:"Browser navigation that signs the user out. The session is identified by the session_cookie and provider_token cookies, not by a bearer token. Ends the identity provider session, revokes the OAuth access and refresh tokens carried by the provider_token cookie, clears every session cookie and redirects to /login. Cookies are cleared on every outcome, including failure. User-created API tokens are not affected; they are revoked with revokeToken or deleteUserToken. On the canonical host a complete sign-out needs both cookies - session_cookie lets the identity provider end its session and provider_token carries the OAuth tokens to revoke. With only session_cookie, the identity provider session ends but no OAuth tokens are revoked, and the answer is the success 303. With only provider_token, the identity provider cannot start its logout flow, so the OAuth tokens are still revoked but the answer is the failure one - 303 for a browser document navigation, an empty 500 otherwise. Cookies are cleared either way. On an organization custom domain the user is identified from provider_token, sign-out is best-effort and it always answers 302.",security:[{sessionCookie:[]},{providerTokenCookie:[]}],responses:{302:{description:"Redirect to /login on an organization custom domain, where sign-out is best-effort. The body is a short HTML link to /login.",headers:{Location:{required:true,description:"/login",schema:{type:"string"}}},content:{"text/html":{schema:{type:"string"}}}},303:{description:"Redirect to /login. Answered when sign-out completes on the canonical host, and also when the identity provider failed but the request is a browser document navigation. The body is a short HTML link to /login.",headers:{Location:{required:true,description:"/login",schema:{type:"string"}}},content:{"text/html":{schema:{type:"string"}}}},500:{description:"The identity provider failed and the request was not a browser document navigation. The body is empty; cookies are still cleared."}}}}},components:{securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"},sessionCookie:{type:"apiKey",in:"cookie",name:"session_cookie",description:"Identity provider session cookie set at sign-in."},providerTokenCookie:{type:"apiKey",in:"cookie",name:"provider_token",description:"Cookie carrying the OAuth access and refresh tokens issued at sign-in."}},responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"Forbidden",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}},503:{description:"Signing keys or token revocation status are temporarily unavailable. The token is refused, but the caller should retry rather than sign the user out.",content:{"text/plain":{schema:{type:"string"}}}}},parameters:{tokenId:{name:"tokenId",in:"path",description:"Token ID",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},tokenIdQuery:{name:"tokenId",in:"query",description:"ID of the token to delete.",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},userIdQuery:{name:"userId",in:"query",description:"UUID of the user to issue the indefinite token for.",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},providerQuery:{name:"provider",in:"query",description:"Authentication provider to associate with the indefinite token.",required:true,schema:{type:"string",maxLength:500}},page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"integer",minimum:0}},pageSize:{name:"pageSize",in:"query",description:"Number of responses to return per page. Canonical camelCase pagination parameter; prefer this over the deprecated all-lowercase `pagesize`.",schema:{type:"integer",minimum:1}},pagesize:{name:"pagesize",in:"query",description:"Get responses by pagesize. Deprecated alias of pageSize.",deprecated:true,schema:{type:"integer"}},search:{name:"search",in:"query",description:"Get responses that match search param value",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},isOauth:{name:"isOauth",in:"query",description:"Whether to retrieve OAuth-backed sessions instead of API tokens.",schema:{type:"boolean"}},name:{name:"name",in:"query",description:"Name of the token.",required:true,schema:{type:"string",minLength:1,maxLength:255}},purpose:{name:"purpose",in:"query",description:"Token purpose. Tokens are minted with this purpose on generate. On list, only tokens whose purpose is exactly this value (case-sensitive, not a substring match) are returned; omit it to list every purpose.",schema:{type:"string",maxLength:500}},nativeClientName:{name:"clientName",in:"query",description:"Display name of the native client asking to sign in. Used as the name and purpose of the minted token.",required:true,schema:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9 ._-]{0,62}$"}},nativeClient:{name:"client",in:"query",description:"Identifier of the client application, as in the capabilities `client` parameter. Selects the minimum version checked against `clientVersion`.",required:false,schema:{type:"string",description:`Identifier of a client application, for example the product name of a desktop app, lowercase. It is a value chosen by the client; the provider keys its minimum client versions by it.
2
+ `,minLength:1,maxLength:64,pattern:"^[a-z0-9][a-z0-9-]*$"}},{name:"clientVersion",in:"query",description:"Version of the client application, for example `v1.25.0`.",required:false,schema:{type:"string",maxLength:64}},{name:"port",in:"query",description:"Port on 127.0.0.1 where the native client listens for the callback.",required:true,schema:{type:"integer",minimum:1024,maximum:65535}},{name:"codeChallenge",in:"query",description:"PKCE code challenge, BASE64URL(SHA256(codeVerifier)) without padding.",required:true,schema:{type:"string",pattern:"^[A-Za-z0-9_-]{43}$"}},{name:"codeChallengeMethod",in:"query",description:"PKCE challenge method. Only S256 is accepted.",required:true,schema:{type:"string",enum:["S256"]}},{name:"state",in:"query",description:"Opaque value from the native client, returned unchanged on the callback.",required:true,schema:{type:"string",minLength:8,maxLength:512}}],responses:{302:{description:"Redirect to the loopback callback carrying code and state. The callback's query parameters are described by NativeAuthorizationCallback.",headers:{Location:{required:true,description:"http://127.0.0.1:{port}/callback?code=...&state=..., whose query is a NativeAuthorizationCallback.",schema:{type:"string"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"Forbidden",content:{"text/plain":{schema:{type:"string"}}}},426:{description:"Update page; the client's version is below the provider's minimum for that client.",content:{"text/html":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/identity/native/token":{post:{"x-internal":["cloud"],tags:["tokens"],summary:"Exchange native client authorization code",operationId:"exchangeNativeAuthorizationCode",description:"Redeems a single-use authorization code from the native client sign-in flow. The caller proves possession of the PKCE code verifier (BASE64URL(SHA256(codeVerifier)) must equal the stored S256 challenge). The code is consumed on the first redemption attempt, whether or not the verifier matches. On success an API token is minted for the user with name and purpose set to the client name. This call is authenticated by the code and verifier, not by a session.",security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Redeems a native client authorization code with its PKCE verifier.",required:["code","codeVerifier"],properties:{code:{type:"string",description:"Single-use authorization code from the loopback callback.",minLength:1,maxLength:128,"x-order":1},codeVerifier:{type:"string",description:"PKCE code verifier (RFC 7636, 43 to 128 unreserved characters).",pattern:"^[A-Za-z0-9._~-]{43,128}$","x-order":2}}}}}},responses:{201:{description:"API token minted for the native client",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/revoke":{post:{"x-internal":["cloud"],tags:["tokens"],summary:"Revoke token",operationId:"revokeToken",description:`Revokes an OAuth access or refresh token issued by the identity provider, for example when an OAuth client signs out, or a user-created API token (the token envelope that generateToken returns, or the bare JWT inside it). Possessing the token is the credential, so no session or bearer token is required. The server first checks whether \`token\` is a user-created API token whose signature verifies. If it is, the server retires it locally, scoped to the owner named in the token, exactly as deleteUserToken does, and evicts cached introspection results so the token stops authenticating immediately. A token issued to a third-party OAuth client (any client other than the server's own) ends that user's whole grant to that client, revoking every access and refresh token it minted. Any other token is forwarded to the OAuth2 server's RFC 7009 revocation endpoint with the server's own client credentials, which revokes that token and the tokens issued alongside it from the same authorization. On every path an unknown, anonymous or already-revoked token is a no-op that still answers 200, so the answer reveals nothing about validity. The server trims whitespace from \`token\`. The server reads only the first 1 MiB (1048576 bytes) of the body and ignores the rest; JSON that does not complete within it fails to decode (400). A 400 body is one of "Error reading token payload", "Error decoding token" or "missing token". A 503 body is "token revocation status is temporarily unavailable" when signing keys (JWKS) or the token store cannot be read, or when the OAuth2 server cannot be asked who the token belongs to; the token was not revoked and the caller should retry. A 500 body is "Error revoking token at the moment", answered when the revocation call itself fails: the OAuth2 server's revocation returns an error response or cannot be reached.`,security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Carries the token that revokeToken revokes.",required:["token"],properties:{token:{type:"string",description:"The token. Surrounding whitespace is trimmed; a value that is empty after trimming is rejected.",pattern:"[^\\x09-\\x0D\\x20\\x85\\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]","x-order":1}}}}}},responses:{200:{description:"Token revoked, or unknown or already revoked (no-op). The body is empty and the session cookie is cleared.",headers:{"Set-Cookie":{description:"Clears the session cookie (session_cookie=; Path=/; Max-Age=0; HttpOnly).",schema:{type:"string"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}},503:{description:'Signing keys (JWKS) or the token store could not be read, or the OAuth2 server could not be asked who the token belongs to, so the token was not revoked. The body is "token revocation status is temporarily unavailable"; the caller should retry.',content:{"text/plain":{schema:{type:"string"}}}}}}},"/introspect":{post:{"x-internal":["cloud"],tags:["tokens"],summary:"Introspect access token",operationId:"introspectToken",description:'Reports whether an access token (a JWT) is authentic, unexpired, not revoked and issued for a protected resource, and on success describes it. Possessing the token is the credential, so no session or bearer token is required. `resource` names the protected resource asking (an RFC 8707 resource identifier, as published in that resource\'s RFC 9728 protected resource metadata); omitted, it is the REST API. The server is the single decider: a token the server issued to its own first-party clients (a personal API token, a native sign-in token, a first-party sign-in session) is valid for every protected resource the server issues tokens for; a token issued to a third-party OAuth client is valid only for a resource its `aud` names. An inactive or refused token is answered with a 401, not with RFC 7662 section 2.2\'s 200 and `active: false`: this is the server\'s status API, and existing callers read only the status. The server trims whitespace from `token`. The server reads only the first 1 MiB (1048576 bytes) of the body and ignores the rest; JSON that does not complete within it fails to decode (400). A 400 body is "Error reading token payload" or "Error decoding token" (also answered when `token` is missing or empty), or "invalid_target" when `resource` is not a protected resource this server issues tokens for. A 401 body is "invalid access token" when the signature or expiry check fails, "revoked access token used" when the token has been revoked, or "token audience does not include the requested resource". A caller that sends `resource` takes the 200 as the server\'s decision for that resource - `aud` is [] for a first-party token that is valid everywhere, so a caller must not re-derive the decision from it - and must refuse the token when the 200 carries no body: a server that predates `resource` ignores it and answers 200 with an empty body for any valid token.',security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Carries the token that introspectToken checks, and the protected resource asking.",required:["token"],properties:{token:{type:"string",description:"The token. Surrounding whitespace is trimmed; a value that is empty after trimming is rejected.",pattern:"[^\\x09-\\x0D\\x20\\x85\\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]","x-order":1},resource:{type:"string",format:"uri",maxLength:2048,description:'RFC 8707 resource identifier of the protected resource asking, as published in its RFC 9728 protected resource metadata. Omitted, the REST API. A value that is not a protected resource this server issues tokens for is rejected with 400 "invalid_target".',"x-order":2}}}}}},responses:{200:{description:"The token is authentic, unexpired, not revoked and valid for the requested resource. The body describes it.",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Describes an access token introspectToken accepted, using the RFC 7662 member names where they are single words and their camelCase form where they are not (clientId, tokenType).",required:["active","aud"],properties:{active:{type:"boolean",description:"Always true; a token that is not active is answered with 401 instead.","x-order":1},aud:{type:"array",description:"The resources the token is bound to (RFC 8707 resource identifiers). Always a JSON array, never null or absent: [] for a token the server issued to its own first-party clients, which is valid for every protected resource the server issues tokens for.",items:{type:"string"},"x-order":2},sub:{type:"string",description:"The subject the token was issued for.","x-order":3},clientId:{type:"string",description:"The OAuth client the token was issued to.","x-order":4},scope:{type:"string",description:"Space-separated scopes granted to the token.","x-order":5},exp:{type:"integer",format:"int64",description:"Expiry, in seconds since the Unix epoch. Absent for a token that does not expire.","x-order":6},iat:{type:"integer",format:"int64",description:"Issue time, in seconds since the Unix epoch.","x-order":7},nbf:{type:"integer",format:"int64",description:"Not-before time, in seconds since the Unix epoch.","x-order":8},iss:{type:"string",description:"The issuer of the token.","x-order":9},tokenType:{type:"string",description:'Always "Bearer".',"x-order":10}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}},503:{description:"Signing keys or token revocation status are temporarily unavailable. The token is refused, but the caller should retry rather than sign the user out.",content:{"text/plain":{schema:{type:"string"}}}}}}},"/logout":{get:{"x-internal":["cloud"],tags:["tokens"],summary:"Sign out",operationId:"logoutUser",description:"Browser navigation that signs the user out. The session is identified by the session_cookie and provider_token cookies, not by a bearer token. Ends the identity provider session, revokes the OAuth access and refresh tokens carried by the provider_token cookie, clears every session cookie and redirects to /login. Cookies are cleared on every outcome, including failure. User-created API tokens are not affected; they are revoked with revokeToken or deleteUserToken. On the canonical host a complete sign-out needs both cookies - session_cookie lets the identity provider end its session and provider_token carries the OAuth tokens to revoke. With only session_cookie, the identity provider session ends but no OAuth tokens are revoked, and the answer is the success 303. With only provider_token, the identity provider cannot start its logout flow, so the OAuth tokens are still revoked but the answer is the failure one - 303 for a browser document navigation, an empty 500 otherwise. Cookies are cleared either way. On an organization custom domain the user is identified from provider_token, sign-out is best-effort and it always answers 302.",security:[{sessionCookie:[]},{providerTokenCookie:[]}],responses:{302:{description:"Redirect to /login on an organization custom domain, where sign-out is best-effort. The body is a short HTML link to /login.",headers:{Location:{required:true,description:"/login",schema:{type:"string"}}},content:{"text/html":{schema:{type:"string"}}}},303:{description:"Redirect to /login. Answered when sign-out completes on the canonical host, and also when the identity provider failed but the request is a browser document navigation. The body is a short HTML link to /login.",headers:{Location:{required:true,description:"/login",schema:{type:"string"}}},content:{"text/html":{schema:{type:"string"}}}},500:{description:"The identity provider failed and the request was not a browser document navigation. The body is empty; cookies are still cleared."}}}}},components:{securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"},sessionCookie:{type:"apiKey",in:"cookie",name:"session_cookie",description:"Identity provider session cookie set at sign-in."},providerTokenCookie:{type:"apiKey",in:"cookie",name:"provider_token",description:"Cookie carrying the OAuth access and refresh tokens issued at sign-in."}},responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},403:{description:"Forbidden",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}},503:{description:"Signing keys or token revocation status are temporarily unavailable. The token is refused, but the caller should retry rather than sign the user out.",content:{"text/plain":{schema:{type:"string"}}}}},parameters:{tokenId:{name:"tokenId",in:"path",description:"Token ID",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},tokenIdQuery:{name:"tokenId",in:"query",description:"ID of the token to delete.",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},userIdQuery:{name:"userId",in:"query",description:"UUID of the user to issue the indefinite token for.",required:true,schema:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},providerQuery:{name:"provider",in:"query",description:"Authentication provider to associate with the indefinite token.",required:true,schema:{type:"string",maxLength:500}},page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"integer",minimum:0}},pageSize:{name:"pageSize",in:"query",description:"Number of responses to return per page. Canonical camelCase pagination parameter; prefer this over the deprecated all-lowercase `pagesize`.",schema:{type:"integer",minimum:1}},pagesize:{name:"pagesize",in:"query",description:"Get responses by pagesize. Deprecated alias of pageSize.",deprecated:true,schema:{type:"integer"}},search:{name:"search",in:"query",description:"Get responses that match search param value",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},isOauth:{name:"isOauth",in:"query",description:"Whether to retrieve OAuth-backed sessions instead of API tokens.",schema:{type:"boolean"}},name:{name:"name",in:"query",description:"Name of the token.",required:true,schema:{type:"string",minLength:1,maxLength:255}},purpose:{name:"purpose",in:"query",description:"Token purpose. Tokens are minted with this purpose on generate. On list, only tokens whose purpose is exactly this value (case-sensitive, not a substring match) are returned; omit it to list every purpose.",schema:{type:"string",maxLength:500}},nativeClientName:{name:"clientName",in:"query",description:"Display name of the native client asking to sign in. Used as the name and purpose of the minted token.",required:true,schema:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9 ._-]{0,62}$"}},nativeClient:{name:"client",in:"query",description:"Identifier of the client application, as in the capabilities `client` parameter. Selects the minimum version checked against `clientVersion`.",required:false,schema:{type:"string",description:`Identifier of a client application, for example the product name of a desktop app, lowercase. It is a value chosen by the client; the provider keys its minimum client versions by it.
3
3
  `,minLength:1,maxLength:64,pattern:"^[a-z0-9][a-z0-9-]*$"}},nativeClientVersion:{name:"clientVersion",in:"query",description:"Version of the client application, for example `v1.25.0`.",required:false,schema:{type:"string",maxLength:64}},nativePort:{name:"port",in:"query",description:"Port on 127.0.0.1 where the native client listens for the callback.",required:true,schema:{type:"integer",minimum:1024,maximum:65535}},nativeCodeChallenge:{name:"codeChallenge",in:"query",description:"PKCE code challenge, BASE64URL(SHA256(codeVerifier)) without padding.",required:true,schema:{type:"string",pattern:"^[A-Za-z0-9_-]{43}$"}},nativeCodeChallengeMethod:{name:"codeChallengeMethod",in:"query",description:"PKCE challenge method. Only S256 is accepted.",required:true,schema:{type:"string",enum:["S256"]}},nativeState:{name:"state",in:"query",description:"Opaque value from the native client, returned unchanged on the callback.",required:true,schema:{type:"string",minLength:8,maxLength:512}}},schemas:{UserToken:{type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}},TokenPayload:{type:"object",additionalProperties:false,description:"Carries the token that revokeToken revokes.",required:["token"],properties:{token:{type:"string",description:"The token. Surrounding whitespace is trimmed; a value that is empty after trimming is rejected.",pattern:"[^\\x09-\\x0D\\x20\\x85\\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]","x-order":1}}},TokenIntrospectionPayload:{type:"object",additionalProperties:false,description:"Carries the token that introspectToken checks, and the protected resource asking.",required:["token"],properties:{token:{type:"string",description:"The token. Surrounding whitespace is trimmed; a value that is empty after trimming is rejected.",pattern:"[^\\x09-\\x0D\\x20\\x85\\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]","x-order":1},resource:{type:"string",format:"uri",maxLength:2048,description:'RFC 8707 resource identifier of the protected resource asking, as published in its RFC 9728 protected resource metadata. Omitted, the REST API. A value that is not a protected resource this server issues tokens for is rejected with 400 "invalid_target".',"x-order":2}}},TokenIntrospection:{type:"object",additionalProperties:false,description:"Describes an access token introspectToken accepted, using the RFC 7662 member names where they are single words and their camelCase form where they are not (clientId, tokenType).",required:["active","aud"],properties:{active:{type:"boolean",description:"Always true; a token that is not active is answered with 401 instead.","x-order":1},aud:{type:"array",description:"The resources the token is bound to (RFC 8707 resource identifiers). Always a JSON array, never null or absent: [] for a token the server issued to its own first-party clients, which is valid for every protected resource the server issues tokens for.",items:{type:"string"},"x-order":2},sub:{type:"string",description:"The subject the token was issued for.","x-order":3},clientId:{type:"string",description:"The OAuth client the token was issued to.","x-order":4},scope:{type:"string",description:"Space-separated scopes granted to the token.","x-order":5},exp:{type:"integer",format:"int64",description:"Expiry, in seconds since the Unix epoch. Absent for a token that does not expire.","x-order":6},iat:{type:"integer",format:"int64",description:"Issue time, in seconds since the Unix epoch.","x-order":7},nbf:{type:"integer",format:"int64",description:"Not-before time, in seconds since the Unix epoch.","x-order":8},iss:{type:"string",description:"The issuer of the token.","x-order":9},tokenType:{type:"string",description:'Always "Bearer".',"x-order":10}}},TokenCreatePayload:{type:"object",additionalProperties:false,description:"Client-settable limits for a token created with generateToken. Every field is optional; an empty body creates an unrestricted token that never expires. The token's name and purpose are query parameters of the operation, and its id, owner and timestamps are server-generated.",properties:{keychainIds:{type:"array",description:"IDs of the keychains the token is limited to. A non-empty list limits the token to the keys of those keychains, intersected with the owner's keys in the request's organization. An absent list creates an unrestricted token. An explicit empty list is refused with 400, so a selection that ends up empty never mints a full-access token. The server records keychainScoped from this list; clients do not set it.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},minItems:1,maxItems:100,uniqueItems:true,"x-order":1},expiresAt:{type:"string",format:"date-time",nullable:true,description:"Time after which the token is no longer accepted. Absent or null means it never expires.","x-order":2}}},TokenStanding:{type:"object",additionalProperties:false,description:"Server-side read result of looking up one presented token by its ID (the token's `jti`) in the token store. It is not a request or response body: the server reads it before any handler runs to decide whether the token is accepted and whether its keys are narrowed to its keychains. The server reports `keychainScoped` true when the stored flag is true or the token has any keychain mapping, so a consumer deciding from this result fails closed. See docs/token-scoping-contract.md.",required:["id","revoked","expired","keychainScoped"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"TokenID","x-oapi-codegen-extra-tags":{db:"id"},"x-order":1},revoked:{type:"boolean",description:"Whether the stored token has been retired (deleted).","x-oapi-codegen-extra-tags":{db:"revoked"},"x-order":2},expired:{type:"boolean",description:"Whether the stored token's `expiresAt` is at or before the time of the lookup, evaluated by the store. A token with no `expiresAt` never expires.","x-oapi-codegen-extra-tags":{db:"expired"},"x-order":3},keychainScoped:{type:"boolean",description:"True when the token's stored `keychainScoped` flag is true or the token has any keychain mapping. When true the token is limited to the keys of its keychains, and holds no keys if every one of them has been deleted. The lookup's `keychain_scoped` result column is a computed alias for this value (the stored flag OR any keychain mapping), so a query-mapping consumer does not read the raw stored flag.","x-oapi-codegen-extra-tags":{db:"keychain_scoped"},"x-order":4}}},NativeAuthorizationPayload:{type:"object",description:"Query fields of GET /api/identity/native/authorize. The signed-in session issues the authorization code from these fields.",required:["clientName","port","codeChallenge","codeChallengeMethod","state"],properties:{clientName:{type:"string",description:"Display name of the native client.",pattern:"^[A-Za-z0-9][A-Za-z0-9 ._-]{0,62}$","x-order":1},port:{type:"integer",description:"Port on 127.0.0.1 for the callback.",minimum:1024,maximum:65535,"x-order":2},codeChallenge:{type:"string",description:"PKCE S256 code challenge.",pattern:"^[A-Za-z0-9_-]{43}$","x-order":3},codeChallengeMethod:{type:"string",description:"PKCE challenge method.",enum:["S256"],"x-order":4},state:{type:"string",description:"Opaque client state returned on the callback.",minLength:8,maxLength:512,"x-order":5}}},NativeCodeExchangePayload:{type:"object",additionalProperties:false,description:"Redeems a native client authorization code with its PKCE verifier.",required:["code","codeVerifier"],properties:{code:{type:"string",description:"Single-use authorization code from the loopback callback.",minLength:1,maxLength:128,"x-order":1},codeVerifier:{type:"string",description:"PKCE code verifier (RFC 7636, 43 to 128 unreserved characters).",pattern:"^[A-Za-z0-9._~-]{43,128}$","x-order":2}}},NativeAuthorizationCallback:{type:"object",description:"Query parameters of the loopback redirect that getNativeClientAuthorization answers with, http://127.0.0.1:{port}/callback?code=...&state=... The code is single-use and expires after 60 seconds; no token is ever placed in the URL. The native client compares state with the one it sent before redeeming the code at /api/identity/native/token.",required:["code","state"],properties:{code:{type:"string",description:"Single-use authorization code, redeemed with the PKCE code verifier.",minLength:1,maxLength:128,"x-order":1},state:{type:"string",description:"The state the native client sent on the authorize request, unchanged.",minLength:8,maxLength:512,"x-order":2}}},TokenPage:{type:"object",description:"A paginated list of tokens.",required:["tokens","totalCount","page","pageSize"],properties:{tokens:{type:"array",items:{"x-go-type":"UserToken",type:"object",additionalProperties:false,description:"Represents a user-owned API token or OAuth session. A token may carry two optional limits. `keychainIds` restricts which keys it may use, and `expiresAt` ends its life. A token with neither is unrestricted and never expires, which is what every token issued before these fields existed is. A token with neither limit set is unrestricted only when keychainScoped is false or absent. `keychainScoped` is the server's stored record of whether the token is limited to its keychains' keys. See the token scoping contract in docs/token-scoping-contract.md.",required:["id","owner","provider","accessToken","name","purpose","isOauth","createdAt","updatedAt"],properties:{id:{description:"Unique identifier for the token.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},"x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},owner:{description:"UUID of the user who owns the token.","x-go-name":"Owner","x-oapi-codegen-extra-tags":{db:"owner",json:"owner"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},provider:{type:"string",description:"Authentication provider associated with the token.","x-oapi-codegen-extra-tags":{db:"provider",json:"provider"},maxLength:500,"x-order":3},accessToken:{type:"string",description:"Access token value.","x-oapi-codegen-extra-tags":{db:"access_token",json:"accessToken"},maxLength:4096,"x-order":4},refreshToken:{type:"string",description:"Refresh token value when applicable.","x-oapi-codegen-extra-tags":{db:"refresh_token",json:"refreshToken"},maxLength:4096,"x-order":5},name:{type:"string",description:"Human-readable token name.","x-oapi-codegen-extra-tags":{db:"name",json:"name"},minLength:1,maxLength:255,"x-order":6},purpose:{type:"string",description:"Purpose for which the token was created.","x-oapi-codegen-extra-tags":{db:"purpose",json:"purpose"},maxLength:500,"x-order":7},isOauth:{type:"boolean",description:"Whether this entry represents an OAuth session.","x-go-name":"IsOAuth","x-oapi-codegen-extra-tags":{db:"is_oauth",json:"isOauth"},"x-order":8},createdAt:{type:"string",format:"date-time",description:"Timestamp when the token was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"},"x-order":9},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the token was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"},"x-order":10},keychainIds:{type:"array",description:"IDs of the keychains this token is limited to. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent, so every token issued before this field existed keeps working unchanged. A non-empty list always makes the token scoped, whatever keychainScoped says. A scoped token may use only keys that belong to these keychains, intersected with the owner's keys in the organization of the request: the effective keys are never more than the user's own. A scoped token with an empty list holds no keys; it is not unrestricted. A server that stores keychainIds always stores keychainScoped true. Unknown keychain IDs are refused when the token is created.",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},maxItems:100,uniqueItems:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"-",json:"keychainIds,omitempty"},"x-order":11},expiresAt:{type:"string",format:"date-time",description:"Time after which the token is no longer accepted. Absent or null means the token never expires, which is the case for every token issued before this field existed. Set when the token is created and not changed afterwards.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"expires_at",json:"expiresAt,omitempty"},"x-order":12},keychainScoped:{type:"boolean",description:"Whether the token is limited to the keys of its keychains. Set by the server at creation: true when the create has a non-empty `keychainIds`. A re-consent that narrows an unrestricted token (false) changes it to true; no other operation changes it, and it is never reset to false. It is read-only to clients. It is stored on the token and never reset, so a scoped token whose keychains have all been deleted stays scoped and holds no keys; a non-empty set of keychain mappings also always means scoped. A token is unrestricted only when keychainScoped is false or absent and keychainIds is empty or absent. A true flag is never unrestricted, even with an empty list.",readOnly:true,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"keychain_scoped",json:"keychainScoped,omitempty"},"x-order":13}}},"x-order":1,description:"Tokens returned on the current page."},totalCount:{type:"integer",description:"Total number of tokens across all pages.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":2,"x-oapi-codegen-extra-tags":{json:"totalCount"}},page:{type:"integer",description:"Current page number (zero-based).",minimum:0,"x-go-type-skip-optional-pointer":true,"x-order":3},pageSize:{type:"integer",description:"Number of tokens per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-order":4,"x-oapi-codegen-extra-tags":{json:"pageSize"}}}}}}},t=e;
4
4
  module.exports=t;