mirror of
https://github.com/openziti/ziti.git
synced 2026-09-20 17:43:28 +00:00
308d7f3a10
- add mfa read endpoints - add mfa enroll enpoints - fix mfa library timing issues - adds mfa at tests - adds admin mfa management endpoints - adds admin mfa at tests - improve at tests - fix auth check vs auth query - fix swagger for auth queryies - fix swagger doc - adds more api tests for validation - redo auth query structure - redo mfa endpoints - move mfa verify to authenticate router:wq - add recovery code support and tests - add partial session authentication status
497 lines
20 KiB
Go
497 lines
20 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
//
|
|
// Copyright NetFoundry, Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
//
|
|
// __ __ _
|
|
// \ \ / / (_)
|
|
// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _
|
|
// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` |
|
|
// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it.
|
|
// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, |
|
|
// __/ |
|
|
// |___/
|
|
|
|
package current_api_session
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// New creates a new current api session API client.
|
|
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
|
return &Client{transport: transport, formats: formats}
|
|
}
|
|
|
|
/*
|
|
Client for current api session API
|
|
*/
|
|
type Client struct {
|
|
transport runtime.ClientTransport
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ClientService is the interface for Client methods
|
|
type ClientService interface {
|
|
DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCurrentAPISessionOK, error)
|
|
|
|
CreateCurrentAPISessionCertificate(params *CreateCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*CreateCurrentAPISessionCertificateCreated, error)
|
|
|
|
DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCurrentAPISessionCertificateOK, error)
|
|
|
|
DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCurrentAPISessionCertificateOK, error)
|
|
|
|
DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCurrentIdentityAuthenticatorOK, error)
|
|
|
|
GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentAPISessionOK, error)
|
|
|
|
ListCurrentAPISessionCertificates(params *ListCurrentAPISessionCertificatesParams, authInfo runtime.ClientAuthInfoWriter) (*ListCurrentAPISessionCertificatesOK, error)
|
|
|
|
ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListCurrentIdentityAuthenticatorsOK, error)
|
|
|
|
ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceUpdatesOK, error)
|
|
|
|
PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchCurrentIdentityAuthenticatorOK, error)
|
|
|
|
UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCurrentIdentityAuthenticatorOK, error)
|
|
|
|
SetTransport(transport runtime.ClientTransport)
|
|
}
|
|
|
|
/*
|
|
DeleteCurrentAPISession logouts
|
|
|
|
Terminates the current API session
|
|
*/
|
|
func (a *Client) DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCurrentAPISessionOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewDeleteCurrentAPISessionParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "DeleteCurrentAPISession",
|
|
Method: "DELETE",
|
|
PathPattern: "/current-api-session",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &DeleteCurrentAPISessionReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*DeleteCurrentAPISessionOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for DeleteCurrentAPISession: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
CreateCurrentAPISessionCertificate creates an ephemeral certificate for the current API session
|
|
|
|
Creates an ephemeral certificate for the current API Session. This endpoint expects a PEM encoded CSRs to be provided for fulfillment as a property of a JSON payload. It is up to the client to manage the private key backing the CSR request.
|
|
*/
|
|
func (a *Client) CreateCurrentAPISessionCertificate(params *CreateCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*CreateCurrentAPISessionCertificateCreated, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewCreateCurrentAPISessionCertificateParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "createCurrentApiSessionCertificate",
|
|
Method: "POST",
|
|
PathPattern: "/current-api-session/certificates",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &CreateCurrentAPISessionCertificateReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*CreateCurrentAPISessionCertificateCreated)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for createCurrentApiSessionCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
DeleteCurrentAPISessionCertificate deletes an ephemeral certificate
|
|
|
|
Delete an ephemeral certificateby id
|
|
|
|
*/
|
|
func (a *Client) DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCurrentAPISessionCertificateOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewDeleteCurrentAPISessionCertificateParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "deleteCurrentApiSessionCertificate",
|
|
Method: "DELETE",
|
|
PathPattern: "/current-api-session/certificates/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &DeleteCurrentAPISessionCertificateReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*DeleteCurrentAPISessionCertificateOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for deleteCurrentApiSessionCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
DetailCurrentAPISessionCertificate retrieves an ephemeral certificate
|
|
|
|
Retrieves a single ephemeral certificate by id
|
|
*/
|
|
func (a *Client) DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCurrentAPISessionCertificateOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewDetailCurrentAPISessionCertificateParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "detailCurrentApiSessionCertificate",
|
|
Method: "GET",
|
|
PathPattern: "/current-api-session/certificates/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &DetailCurrentAPISessionCertificateReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*DetailCurrentAPISessionCertificateOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for detailCurrentApiSessionCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
DetailCurrentIdentityAuthenticator retrieves an authenticator for the current identity
|
|
|
|
Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity.
|
|
*/
|
|
func (a *Client) DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*DetailCurrentIdentityAuthenticatorOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewDetailCurrentIdentityAuthenticatorParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "detailCurrentIdentityAuthenticator",
|
|
Method: "GET",
|
|
PathPattern: "/current-identity/authenticators/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &DetailCurrentIdentityAuthenticatorReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*DetailCurrentIdentityAuthenticatorOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for detailCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
GetCurrentAPISession returns the current API session
|
|
|
|
Retrieves the API session that was used to issue the current request
|
|
*/
|
|
func (a *Client) GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter) (*GetCurrentAPISessionOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewGetCurrentAPISessionParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "getCurrentAPISession",
|
|
Method: "GET",
|
|
PathPattern: "/current-api-session",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &GetCurrentAPISessionReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*GetCurrentAPISessionOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for getCurrentAPISession: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListCurrentAPISessionCertificates lists the ephemeral certificates available for the current API session
|
|
|
|
Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination
|
|
*/
|
|
func (a *Client) ListCurrentAPISessionCertificates(params *ListCurrentAPISessionCertificatesParams, authInfo runtime.ClientAuthInfoWriter) (*ListCurrentAPISessionCertificatesOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewListCurrentAPISessionCertificatesParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "listCurrentApiSessionCertificates",
|
|
Method: "GET",
|
|
PathPattern: "/current-api-session/certificates",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListCurrentAPISessionCertificatesReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*ListCurrentAPISessionCertificatesOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for listCurrentApiSessionCertificates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListCurrentIdentityAuthenticators lists authenticators for the current identity
|
|
|
|
Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination.
|
|
*/
|
|
func (a *Client) ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter) (*ListCurrentIdentityAuthenticatorsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewListCurrentIdentityAuthenticatorsParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "listCurrentIdentityAuthenticators",
|
|
Method: "GET",
|
|
PathPattern: "/current-identity/authenticators",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListCurrentIdentityAuthenticatorsReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*ListCurrentIdentityAuthenticatorsOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for listCurrentIdentityAuthenticators: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListServiceUpdates returns data indicating whether a client should updates it service list
|
|
|
|
Retrieves data indicating the last time data relevant to this API Session was altered that would necessitate
|
|
service refreshes.
|
|
|
|
*/
|
|
func (a *Client) ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter) (*ListServiceUpdatesOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewListServiceUpdatesParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "listServiceUpdates",
|
|
Method: "GET",
|
|
PathPattern: "/current-api-session/service-updates",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListServiceUpdatesReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*ListServiceUpdatesOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for listServiceUpdates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
PatchCurrentIdentityAuthenticator updates the supplied fields on an authenticator of this identity
|
|
|
|
Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API
|
|
session's identity.
|
|
|
|
*/
|
|
func (a *Client) PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*PatchCurrentIdentityAuthenticatorOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewPatchCurrentIdentityAuthenticatorParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "patchCurrentIdentityAuthenticator",
|
|
Method: "PATCH",
|
|
PathPattern: "/current-identity/authenticators/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &PatchCurrentIdentityAuthenticatorReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*PatchCurrentIdentityAuthenticatorOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for patchCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
UpdateCurrentIdentityAuthenticator updates all fields on an authenticator of this identity
|
|
|
|
Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's
|
|
identity.
|
|
|
|
*/
|
|
func (a *Client) UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateCurrentIdentityAuthenticatorOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewUpdateCurrentIdentityAuthenticatorParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "updateCurrentIdentityAuthenticator",
|
|
Method: "PUT",
|
|
PathPattern: "/current-identity/authenticators/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &UpdateCurrentIdentityAuthenticatorReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
success, ok := result.(*UpdateCurrentIdentityAuthenticatorOK)
|
|
if ok {
|
|
return success, nil
|
|
}
|
|
// unexpected success response
|
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
|
msg := fmt.Sprintf("unexpected success response for updateCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
// SetTransport changes the transport on the client
|
|
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
|
a.transport = transport
|
|
}
|