/* tslint:disable */ /* eslint-disable */ /** * Boundary controller HTTP API * Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently. * * The version of the OpenAPI document: 0.19.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; import type { ControllerApiResourcesTargetsV1SessionCredential } from './ControllerApiResourcesTargetsV1SessionCredential'; import { ControllerApiResourcesTargetsV1SessionCredentialFromJSON, ControllerApiResourcesTargetsV1SessionCredentialFromJSONTyped, ControllerApiResourcesTargetsV1SessionCredentialToJSON, ControllerApiResourcesTargetsV1SessionCredentialToJSONTyped, } from './ControllerApiResourcesTargetsV1SessionCredential'; import type { ControllerApiResourcesScopesV1ScopeInfo } from './ControllerApiResourcesScopesV1ScopeInfo'; import { ControllerApiResourcesScopesV1ScopeInfoFromJSON, ControllerApiResourcesScopesV1ScopeInfoFromJSONTyped, ControllerApiResourcesScopesV1ScopeInfoToJSON, ControllerApiResourcesScopesV1ScopeInfoToJSONTyped, } from './ControllerApiResourcesScopesV1ScopeInfo'; /** * SessionAuthorization contains all fields related to authorization for a Session. It's in the Targets package because it's returned by a Target's authorize action. * @export * @interface ControllerApiResourcesTargetsV1SessionAuthorization */ export interface ControllerApiResourcesTargetsV1SessionAuthorization { /** * Output only. The ID of the Session. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly sessionId?: string; /** * Output only. The ID of the Target authorizing this Session. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly targetId?: string; /** * * @type {ControllerApiResourcesScopesV1ScopeInfo} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ scope?: ControllerApiResourcesScopesV1ScopeInfo; /** * Output only. The time this resource was created. * @type {Date} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly createdTime?: Date; /** * Output only. The User for which this Session was authorized. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly userId?: string; /** * Output only. The Host Set containing the Host being used for this Session. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly hostSetId?: string; /** * Output only. The Host whose address is being used as the endpoint for this Session. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly hostId?: string; /** * Output only. Type of the Session (e.g. tcp, ssh, etc.). * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly type?: string; /** * Output only. The marshaled SessionAuthorizationData message containing all information that the proxy needs. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly authorizationToken?: string; /** * Output only. The connection limit being applied to this session. -1 means unlimited. This is not actually enforced on the client side but it provides for better listener handling by including it. * @type {number} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly connectionLimit?: number; /** * Output only. The endpoint address that the worker will connect to, useful for setting TLS parameters. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly endpoint?: string; /** * Output only. The endpoint port that will be connected to, either from a * port directly on the target or from a service definition. * @type {number} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly endpointPort?: number; /** * Output only. The expiration time of the session. * @type {Date} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly expiration?: Date; /** * Output only. The credentials for this session. * @type {Array} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly credentials?: Array; /** * Output only. The ID of the Session Recording. * @type {string} * @memberof ControllerApiResourcesTargetsV1SessionAuthorization */ readonly sessionRecordingId?: string; } /** * Check if a given object implements the ControllerApiResourcesTargetsV1SessionAuthorization interface. */ export function instanceOfControllerApiResourcesTargetsV1SessionAuthorization(value: object): value is ControllerApiResourcesTargetsV1SessionAuthorization { return true; } export function ControllerApiResourcesTargetsV1SessionAuthorizationFromJSON(json: any): ControllerApiResourcesTargetsV1SessionAuthorization { return ControllerApiResourcesTargetsV1SessionAuthorizationFromJSONTyped(json, false); } export function ControllerApiResourcesTargetsV1SessionAuthorizationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ControllerApiResourcesTargetsV1SessionAuthorization { if (json == null) { return json; } return { 'sessionId': json['session_id'] == null ? undefined : json['session_id'], 'targetId': json['target_id'] == null ? undefined : json['target_id'], 'scope': json['scope'] == null ? undefined : ControllerApiResourcesScopesV1ScopeInfoFromJSON(json['scope']), 'createdTime': json['created_time'] == null ? undefined : (new Date(json['created_time'])), 'userId': json['user_id'] == null ? undefined : json['user_id'], 'hostSetId': json['host_set_id'] == null ? undefined : json['host_set_id'], 'hostId': json['host_id'] == null ? undefined : json['host_id'], 'type': json['type'] == null ? undefined : json['type'], 'authorizationToken': json['authorization_token'] == null ? undefined : json['authorization_token'], 'connectionLimit': json['connection_limit'] == null ? undefined : json['connection_limit'], 'endpoint': json['endpoint'] == null ? undefined : json['endpoint'], 'endpointPort': json['endpoint_port'] == null ? undefined : json['endpoint_port'], 'expiration': json['expiration'] == null ? undefined : (new Date(json['expiration'])), 'credentials': json['credentials'] == null ? undefined : ((json['credentials'] as Array).map(ControllerApiResourcesTargetsV1SessionCredentialFromJSON)), 'sessionRecordingId': json['session_recording_id'] == null ? undefined : json['session_recording_id'], }; } export function ControllerApiResourcesTargetsV1SessionAuthorizationToJSON(json: any): ControllerApiResourcesTargetsV1SessionAuthorization { return ControllerApiResourcesTargetsV1SessionAuthorizationToJSONTyped(json, false); } export function ControllerApiResourcesTargetsV1SessionAuthorizationToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'scope': ControllerApiResourcesScopesV1ScopeInfoToJSON(value['scope']), }; }