mirror of
https://github.com/openziti/ziti.git
synced 2026-10-14 16:19:57 +00:00
3e5f08c99f
- adds endpoint POST /edge/management/v1/authenticator/{id}/extend
- adds endpoint POST /edge/management/v1/authenticator/{id}/extend-verify
- adds endpoint POST /edge/client/v1/authenticator/{id}/extend
- adds endpoint POST /edge/client/v1/authenticator/{id}/extend-verify
- add logic that allows a client endpoint to extend the valid period for
their current certificate authenticator
- requires clients to use their existing client cetificate for extension
- requires clients to verify they have received the new public key
- allows clients to use a new private key if desired
- allows only 1st party certificate authenticators to extend
- adds authenticatorId to apiSession for persistence, model, api model
- add session cert to already authenticated session on extend
- removes empty test stub
1036 lines
57 KiB
Go
1036 lines
57 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 operations
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"net/http"
|
|
"strings"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/loads"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/runtime/middleware"
|
|
"github.com/go-openapi/runtime/security"
|
|
"github.com/go-openapi/spec"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag"
|
|
|
|
"github.com/openziti/edge/rest_client_api_server/operations/authentication"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/current_api_session"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/current_identity"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/enroll"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/informational"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/posture_checks"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/service"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/session"
|
|
"github.com/openziti/edge/rest_client_api_server/operations/well_known"
|
|
)
|
|
|
|
// NewZitiEdgeClientAPI creates a new ZitiEdgeClient instance
|
|
func NewZitiEdgeClientAPI(spec *loads.Document) *ZitiEdgeClientAPI {
|
|
return &ZitiEdgeClientAPI{
|
|
handlers: make(map[string]map[string]http.Handler),
|
|
formats: strfmt.Default,
|
|
defaultConsumes: "application/json",
|
|
defaultProduces: "application/json",
|
|
customConsumers: make(map[string]runtime.Consumer),
|
|
customProducers: make(map[string]runtime.Producer),
|
|
PreServerShutdown: func() {},
|
|
ServerShutdown: func() {},
|
|
spec: spec,
|
|
useSwaggerUI: false,
|
|
ServeError: errors.ServeError,
|
|
BasicAuthenticator: security.BasicAuth,
|
|
APIKeyAuthenticator: security.APIKeyAuth,
|
|
BearerAuthenticator: security.BearerAuth,
|
|
|
|
ApplicationPkcs10Consumer: runtime.ConsumerFunc(func(r io.Reader, target interface{}) error {
|
|
return errors.NotImplemented("applicationPkcs10 consumer has not yet been implemented")
|
|
}),
|
|
ApplicationXPemFileConsumer: runtime.ConsumerFunc(func(r io.Reader, target interface{}) error {
|
|
return errors.NotImplemented("applicationXPemFile consumer has not yet been implemented")
|
|
}),
|
|
JSONConsumer: runtime.JSONConsumer(),
|
|
TxtConsumer: runtime.TextConsumer(),
|
|
|
|
ApplicationPkcs7MimeProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error {
|
|
return errors.NotImplemented("applicationPkcs7Mime producer has not yet been implemented")
|
|
}),
|
|
ApplicationXPemFileProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error {
|
|
return errors.NotImplemented("applicationXPemFile producer has not yet been implemented")
|
|
}),
|
|
ApplicationXX509UserCertProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error {
|
|
return errors.NotImplemented("applicationXX509UserCert producer has not yet been implemented")
|
|
}),
|
|
BinProducer: runtime.ByteStreamProducer(),
|
|
JSONProducer: runtime.JSONProducer(),
|
|
TextYamlProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error {
|
|
return errors.NotImplemented("textYaml producer has not yet been implemented")
|
|
}),
|
|
|
|
CurrentAPISessionDeleteCurrentAPISessionHandler: current_api_session.DeleteCurrentAPISessionHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISession has not yet been implemented")
|
|
}),
|
|
AuthenticationAuthenticateHandler: authentication.AuthenticateHandlerFunc(func(params authentication.AuthenticateParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation authentication.Authenticate has not yet been implemented")
|
|
}),
|
|
AuthenticationAuthenticateMfaHandler: authentication.AuthenticateMfaHandlerFunc(func(params authentication.AuthenticateMfaParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation authentication.AuthenticateMfa has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionCreateCurrentAPISessionCertificateHandler: current_api_session.CreateCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.CreateCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.CreateCurrentAPISessionCertificate has not yet been implemented")
|
|
}),
|
|
CurrentIdentityCreateMfaRecoveryCodesHandler: current_identity.CreateMfaRecoveryCodesHandlerFunc(func(params current_identity.CreateMfaRecoveryCodesParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.CreateMfaRecoveryCodes has not yet been implemented")
|
|
}),
|
|
PostureChecksCreatePostureResponseHandler: posture_checks.CreatePostureResponseHandlerFunc(func(params posture_checks.CreatePostureResponseParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation posture_checks.CreatePostureResponse has not yet been implemented")
|
|
}),
|
|
PostureChecksCreatePostureResponseBulkHandler: posture_checks.CreatePostureResponseBulkHandlerFunc(func(params posture_checks.CreatePostureResponseBulkParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation posture_checks.CreatePostureResponseBulk has not yet been implemented")
|
|
}),
|
|
SessionCreateSessionHandler: session.CreateSessionHandlerFunc(func(params session.CreateSessionParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation session.CreateSession has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionDeleteCurrentAPISessionCertificateHandler: current_api_session.DeleteCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISessionCertificate has not yet been implemented")
|
|
}),
|
|
CurrentIdentityDeleteMfaHandler: current_identity.DeleteMfaHandlerFunc(func(params current_identity.DeleteMfaParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.DeleteMfa has not yet been implemented")
|
|
}),
|
|
ServiceDeleteServiceHandler: service.DeleteServiceHandlerFunc(func(params service.DeleteServiceParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation service.DeleteService has not yet been implemented")
|
|
}),
|
|
SessionDeleteSessionHandler: session.DeleteSessionHandlerFunc(func(params session.DeleteSessionParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation session.DeleteSession has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionDetailCurrentAPISessionCertificateHandler: current_api_session.DetailCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DetailCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.DetailCurrentAPISessionCertificate has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler: current_api_session.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.DetailCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.DetailCurrentIdentityAuthenticator has not yet been implemented")
|
|
}),
|
|
CurrentIdentityDetailMfaHandler: current_identity.DetailMfaHandlerFunc(func(params current_identity.DetailMfaParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.DetailMfa has not yet been implemented")
|
|
}),
|
|
CurrentIdentityDetailMfaQrCodeHandler: current_identity.DetailMfaQrCodeHandlerFunc(func(params current_identity.DetailMfaQrCodeParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.DetailMfaQrCode has not yet been implemented")
|
|
}),
|
|
CurrentIdentityDetailMfaRecoveryCodesHandler: current_identity.DetailMfaRecoveryCodesHandlerFunc(func(params current_identity.DetailMfaRecoveryCodesParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.DetailMfaRecoveryCodes has not yet been implemented")
|
|
}),
|
|
ServiceDetailServiceHandler: service.DetailServiceHandlerFunc(func(params service.DetailServiceParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation service.DetailService has not yet been implemented")
|
|
}),
|
|
SessionDetailSessionHandler: session.DetailSessionHandlerFunc(func(params session.DetailSessionParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation session.DetailSession has not yet been implemented")
|
|
}),
|
|
InformationalDetailSpecHandler: informational.DetailSpecHandlerFunc(func(params informational.DetailSpecParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation informational.DetailSpec has not yet been implemented")
|
|
}),
|
|
InformationalDetailSpecBodyHandler: informational.DetailSpecBodyHandlerFunc(func(params informational.DetailSpecBodyParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation informational.DetailSpecBody has not yet been implemented")
|
|
}),
|
|
EnrollEnrollHandler: enroll.EnrollHandlerFunc(func(params enroll.EnrollParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation enroll.Enroll has not yet been implemented")
|
|
}),
|
|
EnrollEnrollCaHandler: enroll.EnrollCaHandlerFunc(func(params enroll.EnrollCaParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation enroll.EnrollCa has not yet been implemented")
|
|
}),
|
|
EnrollEnrollErOttHandler: enroll.EnrollErOttHandlerFunc(func(params enroll.EnrollErOttParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation enroll.EnrollErOtt has not yet been implemented")
|
|
}),
|
|
CurrentIdentityEnrollMfaHandler: current_identity.EnrollMfaHandlerFunc(func(params current_identity.EnrollMfaParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.EnrollMfa has not yet been implemented")
|
|
}),
|
|
EnrollEnrollOttHandler: enroll.EnrollOttHandlerFunc(func(params enroll.EnrollOttParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation enroll.EnrollOtt has not yet been implemented")
|
|
}),
|
|
EnrollEnrollOttCaHandler: enroll.EnrollOttCaHandlerFunc(func(params enroll.EnrollOttCaParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation enroll.EnrollOttCa has not yet been implemented")
|
|
}),
|
|
EnrollErnollUpdbHandler: enroll.ErnollUpdbHandlerFunc(func(params enroll.ErnollUpdbParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation enroll.ErnollUpdb has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler: current_api_session.ExtendCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.ExtendCurrentIdentityAuthenticator has not yet been implemented")
|
|
}),
|
|
EnrollExtendRouterEnrollmentHandler: enroll.ExtendRouterEnrollmentHandlerFunc(func(params enroll.ExtendRouterEnrollmentParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation enroll.ExtendRouterEnrollment has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler: current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendVerifyCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.ExtendVerifyCurrentIdentityAuthenticator has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionGetCurrentAPISessionHandler: current_api_session.GetCurrentAPISessionHandlerFunc(func(params current_api_session.GetCurrentAPISessionParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.GetCurrentAPISession has not yet been implemented")
|
|
}),
|
|
CurrentIdentityGetCurrentIdentityHandler: current_identity.GetCurrentIdentityHandlerFunc(func(params current_identity.GetCurrentIdentityParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.GetCurrentIdentity has not yet been implemented")
|
|
}),
|
|
CurrentIdentityGetCurrentIdentityEdgeRoutersHandler: current_identity.GetCurrentIdentityEdgeRoutersHandlerFunc(func(params current_identity.GetCurrentIdentityEdgeRoutersParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.GetCurrentIdentityEdgeRouters has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionListCurrentAPISessionCertificatesHandler: current_api_session.ListCurrentAPISessionCertificatesHandlerFunc(func(params current_api_session.ListCurrentAPISessionCertificatesParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.ListCurrentAPISessionCertificates has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionListCurrentIdentityAuthenticatorsHandler: current_api_session.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params current_api_session.ListCurrentIdentityAuthenticatorsParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.ListCurrentIdentityAuthenticators has not yet been implemented")
|
|
}),
|
|
InformationalListProtocolsHandler: informational.ListProtocolsHandlerFunc(func(params informational.ListProtocolsParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation informational.ListProtocols has not yet been implemented")
|
|
}),
|
|
InformationalListRootHandler: informational.ListRootHandlerFunc(func(params informational.ListRootParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation informational.ListRoot has not yet been implemented")
|
|
}),
|
|
ServiceListServiceTerminatorsHandler: service.ListServiceTerminatorsHandlerFunc(func(params service.ListServiceTerminatorsParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation service.ListServiceTerminators has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionListServiceUpdatesHandler: current_api_session.ListServiceUpdatesHandlerFunc(func(params current_api_session.ListServiceUpdatesParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.ListServiceUpdates has not yet been implemented")
|
|
}),
|
|
ServiceListServicesHandler: service.ListServicesHandlerFunc(func(params service.ListServicesParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation service.ListServices has not yet been implemented")
|
|
}),
|
|
SessionListSessionsHandler: session.ListSessionsHandlerFunc(func(params session.ListSessionsParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation session.ListSessions has not yet been implemented")
|
|
}),
|
|
InformationalListSpecsHandler: informational.ListSpecsHandlerFunc(func(params informational.ListSpecsParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation informational.ListSpecs has not yet been implemented")
|
|
}),
|
|
InformationalListVersionHandler: informational.ListVersionHandlerFunc(func(params informational.ListVersionParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation informational.ListVersion has not yet been implemented")
|
|
}),
|
|
WellKnownListWellKnownCasHandler: well_known.ListWellKnownCasHandlerFunc(func(params well_known.ListWellKnownCasParams) middleware.Responder {
|
|
return middleware.NotImplemented("operation well_known.ListWellKnownCas has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler: current_api_session.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.PatchCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.PatchCurrentIdentityAuthenticator has not yet been implemented")
|
|
}),
|
|
ServicePatchServiceHandler: service.PatchServiceHandlerFunc(func(params service.PatchServiceParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation service.PatchService has not yet been implemented")
|
|
}),
|
|
CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler: current_api_session.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.UpdateCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_api_session.UpdateCurrentIdentityAuthenticator has not yet been implemented")
|
|
}),
|
|
ServiceUpdateServiceHandler: service.UpdateServiceHandlerFunc(func(params service.UpdateServiceParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation service.UpdateService has not yet been implemented")
|
|
}),
|
|
CurrentIdentityVerifyMfaHandler: current_identity.VerifyMfaHandlerFunc(func(params current_identity.VerifyMfaParams, principal interface{}) middleware.Responder {
|
|
return middleware.NotImplemented("operation current_identity.VerifyMfa has not yet been implemented")
|
|
}),
|
|
|
|
// Applies when the "zt-session" header is set
|
|
ZtSessionAuth: func(token string) (interface{}, error) {
|
|
return nil, errors.NotImplemented("api key auth (ztSession) zt-session from header param [zt-session] has not yet been implemented")
|
|
},
|
|
// default authorizer is authorized meaning no requests are blocked
|
|
APIAuthorizer: security.Authorized(),
|
|
}
|
|
}
|
|
|
|
/*ZitiEdgeClientAPI the ziti edge client API */
|
|
type ZitiEdgeClientAPI struct {
|
|
spec *loads.Document
|
|
context *middleware.Context
|
|
handlers map[string]map[string]http.Handler
|
|
formats strfmt.Registry
|
|
customConsumers map[string]runtime.Consumer
|
|
customProducers map[string]runtime.Producer
|
|
defaultConsumes string
|
|
defaultProduces string
|
|
Middleware func(middleware.Builder) http.Handler
|
|
useSwaggerUI bool
|
|
|
|
// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
|
|
// It has a default implementation in the security package, however you can replace it for your particular usage.
|
|
BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
|
|
|
|
// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
|
|
// It has a default implementation in the security package, however you can replace it for your particular usage.
|
|
APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
|
|
|
|
// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
|
|
// It has a default implementation in the security package, however you can replace it for your particular usage.
|
|
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
|
|
|
|
// ApplicationPkcs10Consumer registers a consumer for the following mime types:
|
|
// - application/pkcs10
|
|
ApplicationPkcs10Consumer runtime.Consumer
|
|
// ApplicationXPemFileConsumer registers a consumer for the following mime types:
|
|
// - application/x-pem-file
|
|
ApplicationXPemFileConsumer runtime.Consumer
|
|
// JSONConsumer registers a consumer for the following mime types:
|
|
// - application/json
|
|
JSONConsumer runtime.Consumer
|
|
// TxtConsumer registers a consumer for the following mime types:
|
|
// - text/plain
|
|
TxtConsumer runtime.Consumer
|
|
|
|
// ApplicationPkcs7MimeProducer registers a producer for the following mime types:
|
|
// - application/pkcs7-mime
|
|
ApplicationPkcs7MimeProducer runtime.Producer
|
|
// ApplicationXPemFileProducer registers a producer for the following mime types:
|
|
// - application/x-pem-file
|
|
ApplicationXPemFileProducer runtime.Producer
|
|
// ApplicationXX509UserCertProducer registers a producer for the following mime types:
|
|
// - application/x-x509-user-cert
|
|
ApplicationXX509UserCertProducer runtime.Producer
|
|
// BinProducer registers a producer for the following mime types:
|
|
// - image/png
|
|
BinProducer runtime.Producer
|
|
// JSONProducer registers a producer for the following mime types:
|
|
// - application/json
|
|
JSONProducer runtime.Producer
|
|
// TextYamlProducer registers a producer for the following mime types:
|
|
// - text/yaml
|
|
TextYamlProducer runtime.Producer
|
|
|
|
// ZtSessionAuth registers a function that takes a token and returns a principal
|
|
// it performs authentication based on an api key zt-session provided in the header
|
|
ZtSessionAuth func(string) (interface{}, error)
|
|
|
|
// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
|
|
APIAuthorizer runtime.Authorizer
|
|
|
|
// CurrentAPISessionDeleteCurrentAPISessionHandler sets the operation handler for the delete current API session operation
|
|
CurrentAPISessionDeleteCurrentAPISessionHandler current_api_session.DeleteCurrentAPISessionHandler
|
|
// AuthenticationAuthenticateHandler sets the operation handler for the authenticate operation
|
|
AuthenticationAuthenticateHandler authentication.AuthenticateHandler
|
|
// AuthenticationAuthenticateMfaHandler sets the operation handler for the authenticate mfa operation
|
|
AuthenticationAuthenticateMfaHandler authentication.AuthenticateMfaHandler
|
|
// CurrentAPISessionCreateCurrentAPISessionCertificateHandler sets the operation handler for the create current Api session certificate operation
|
|
CurrentAPISessionCreateCurrentAPISessionCertificateHandler current_api_session.CreateCurrentAPISessionCertificateHandler
|
|
// CurrentIdentityCreateMfaRecoveryCodesHandler sets the operation handler for the create mfa recovery codes operation
|
|
CurrentIdentityCreateMfaRecoveryCodesHandler current_identity.CreateMfaRecoveryCodesHandler
|
|
// PostureChecksCreatePostureResponseHandler sets the operation handler for the create posture response operation
|
|
PostureChecksCreatePostureResponseHandler posture_checks.CreatePostureResponseHandler
|
|
// PostureChecksCreatePostureResponseBulkHandler sets the operation handler for the create posture response bulk operation
|
|
PostureChecksCreatePostureResponseBulkHandler posture_checks.CreatePostureResponseBulkHandler
|
|
// SessionCreateSessionHandler sets the operation handler for the create session operation
|
|
SessionCreateSessionHandler session.CreateSessionHandler
|
|
// CurrentAPISessionDeleteCurrentAPISessionCertificateHandler sets the operation handler for the delete current Api session certificate operation
|
|
CurrentAPISessionDeleteCurrentAPISessionCertificateHandler current_api_session.DeleteCurrentAPISessionCertificateHandler
|
|
// CurrentIdentityDeleteMfaHandler sets the operation handler for the delete mfa operation
|
|
CurrentIdentityDeleteMfaHandler current_identity.DeleteMfaHandler
|
|
// ServiceDeleteServiceHandler sets the operation handler for the delete service operation
|
|
ServiceDeleteServiceHandler service.DeleteServiceHandler
|
|
// SessionDeleteSessionHandler sets the operation handler for the delete session operation
|
|
SessionDeleteSessionHandler session.DeleteSessionHandler
|
|
// CurrentAPISessionDetailCurrentAPISessionCertificateHandler sets the operation handler for the detail current Api session certificate operation
|
|
CurrentAPISessionDetailCurrentAPISessionCertificateHandler current_api_session.DetailCurrentAPISessionCertificateHandler
|
|
// CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler sets the operation handler for the detail current identity authenticator operation
|
|
CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler current_api_session.DetailCurrentIdentityAuthenticatorHandler
|
|
// CurrentIdentityDetailMfaHandler sets the operation handler for the detail mfa operation
|
|
CurrentIdentityDetailMfaHandler current_identity.DetailMfaHandler
|
|
// CurrentIdentityDetailMfaQrCodeHandler sets the operation handler for the detail mfa qr code operation
|
|
CurrentIdentityDetailMfaQrCodeHandler current_identity.DetailMfaQrCodeHandler
|
|
// CurrentIdentityDetailMfaRecoveryCodesHandler sets the operation handler for the detail mfa recovery codes operation
|
|
CurrentIdentityDetailMfaRecoveryCodesHandler current_identity.DetailMfaRecoveryCodesHandler
|
|
// ServiceDetailServiceHandler sets the operation handler for the detail service operation
|
|
ServiceDetailServiceHandler service.DetailServiceHandler
|
|
// SessionDetailSessionHandler sets the operation handler for the detail session operation
|
|
SessionDetailSessionHandler session.DetailSessionHandler
|
|
// InformationalDetailSpecHandler sets the operation handler for the detail spec operation
|
|
InformationalDetailSpecHandler informational.DetailSpecHandler
|
|
// InformationalDetailSpecBodyHandler sets the operation handler for the detail spec body operation
|
|
InformationalDetailSpecBodyHandler informational.DetailSpecBodyHandler
|
|
// EnrollEnrollHandler sets the operation handler for the enroll operation
|
|
EnrollEnrollHandler enroll.EnrollHandler
|
|
// EnrollEnrollCaHandler sets the operation handler for the enroll ca operation
|
|
EnrollEnrollCaHandler enroll.EnrollCaHandler
|
|
// EnrollEnrollErOttHandler sets the operation handler for the enroll er ott operation
|
|
EnrollEnrollErOttHandler enroll.EnrollErOttHandler
|
|
// CurrentIdentityEnrollMfaHandler sets the operation handler for the enroll mfa operation
|
|
CurrentIdentityEnrollMfaHandler current_identity.EnrollMfaHandler
|
|
// EnrollEnrollOttHandler sets the operation handler for the enroll ott operation
|
|
EnrollEnrollOttHandler enroll.EnrollOttHandler
|
|
// EnrollEnrollOttCaHandler sets the operation handler for the enroll ott ca operation
|
|
EnrollEnrollOttCaHandler enroll.EnrollOttCaHandler
|
|
// EnrollErnollUpdbHandler sets the operation handler for the ernoll updb operation
|
|
EnrollErnollUpdbHandler enroll.ErnollUpdbHandler
|
|
// CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler sets the operation handler for the extend current identity authenticator operation
|
|
CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler current_api_session.ExtendCurrentIdentityAuthenticatorHandler
|
|
// EnrollExtendRouterEnrollmentHandler sets the operation handler for the extend router enrollment operation
|
|
EnrollExtendRouterEnrollmentHandler enroll.ExtendRouterEnrollmentHandler
|
|
// CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler sets the operation handler for the extend verify current identity authenticator operation
|
|
CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandler
|
|
// CurrentAPISessionGetCurrentAPISessionHandler sets the operation handler for the get current API session operation
|
|
CurrentAPISessionGetCurrentAPISessionHandler current_api_session.GetCurrentAPISessionHandler
|
|
// CurrentIdentityGetCurrentIdentityHandler sets the operation handler for the get current identity operation
|
|
CurrentIdentityGetCurrentIdentityHandler current_identity.GetCurrentIdentityHandler
|
|
// CurrentIdentityGetCurrentIdentityEdgeRoutersHandler sets the operation handler for the get current identity edge routers operation
|
|
CurrentIdentityGetCurrentIdentityEdgeRoutersHandler current_identity.GetCurrentIdentityEdgeRoutersHandler
|
|
// CurrentAPISessionListCurrentAPISessionCertificatesHandler sets the operation handler for the list current Api session certificates operation
|
|
CurrentAPISessionListCurrentAPISessionCertificatesHandler current_api_session.ListCurrentAPISessionCertificatesHandler
|
|
// CurrentAPISessionListCurrentIdentityAuthenticatorsHandler sets the operation handler for the list current identity authenticators operation
|
|
CurrentAPISessionListCurrentIdentityAuthenticatorsHandler current_api_session.ListCurrentIdentityAuthenticatorsHandler
|
|
// InformationalListProtocolsHandler sets the operation handler for the list protocols operation
|
|
InformationalListProtocolsHandler informational.ListProtocolsHandler
|
|
// InformationalListRootHandler sets the operation handler for the list root operation
|
|
InformationalListRootHandler informational.ListRootHandler
|
|
// ServiceListServiceTerminatorsHandler sets the operation handler for the list service terminators operation
|
|
ServiceListServiceTerminatorsHandler service.ListServiceTerminatorsHandler
|
|
// CurrentAPISessionListServiceUpdatesHandler sets the operation handler for the list service updates operation
|
|
CurrentAPISessionListServiceUpdatesHandler current_api_session.ListServiceUpdatesHandler
|
|
// ServiceListServicesHandler sets the operation handler for the list services operation
|
|
ServiceListServicesHandler service.ListServicesHandler
|
|
// SessionListSessionsHandler sets the operation handler for the list sessions operation
|
|
SessionListSessionsHandler session.ListSessionsHandler
|
|
// InformationalListSpecsHandler sets the operation handler for the list specs operation
|
|
InformationalListSpecsHandler informational.ListSpecsHandler
|
|
// InformationalListVersionHandler sets the operation handler for the list version operation
|
|
InformationalListVersionHandler informational.ListVersionHandler
|
|
// WellKnownListWellKnownCasHandler sets the operation handler for the list well known cas operation
|
|
WellKnownListWellKnownCasHandler well_known.ListWellKnownCasHandler
|
|
// CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler sets the operation handler for the patch current identity authenticator operation
|
|
CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler current_api_session.PatchCurrentIdentityAuthenticatorHandler
|
|
// ServicePatchServiceHandler sets the operation handler for the patch service operation
|
|
ServicePatchServiceHandler service.PatchServiceHandler
|
|
// CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler sets the operation handler for the update current identity authenticator operation
|
|
CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler current_api_session.UpdateCurrentIdentityAuthenticatorHandler
|
|
// ServiceUpdateServiceHandler sets the operation handler for the update service operation
|
|
ServiceUpdateServiceHandler service.UpdateServiceHandler
|
|
// CurrentIdentityVerifyMfaHandler sets the operation handler for the verify mfa operation
|
|
CurrentIdentityVerifyMfaHandler current_identity.VerifyMfaHandler
|
|
|
|
// ServeError is called when an error is received, there is a default handler
|
|
// but you can set your own with this
|
|
ServeError func(http.ResponseWriter, *http.Request, error)
|
|
|
|
// PreServerShutdown is called before the HTTP(S) server is shutdown
|
|
// This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic
|
|
PreServerShutdown func()
|
|
|
|
// ServerShutdown is called when the HTTP(S) server is shut down and done
|
|
// handling all active connections and does not accept connections any more
|
|
ServerShutdown func()
|
|
|
|
// Custom command line argument groups with their descriptions
|
|
CommandLineOptionsGroups []swag.CommandLineOptionsGroup
|
|
|
|
// User defined logger function.
|
|
Logger func(string, ...interface{})
|
|
}
|
|
|
|
// UseRedoc for documentation at /docs
|
|
func (o *ZitiEdgeClientAPI) UseRedoc() {
|
|
o.useSwaggerUI = false
|
|
}
|
|
|
|
// UseSwaggerUI for documentation at /docs
|
|
func (o *ZitiEdgeClientAPI) UseSwaggerUI() {
|
|
o.useSwaggerUI = true
|
|
}
|
|
|
|
// SetDefaultProduces sets the default produces media type
|
|
func (o *ZitiEdgeClientAPI) SetDefaultProduces(mediaType string) {
|
|
o.defaultProduces = mediaType
|
|
}
|
|
|
|
// SetDefaultConsumes returns the default consumes media type
|
|
func (o *ZitiEdgeClientAPI) SetDefaultConsumes(mediaType string) {
|
|
o.defaultConsumes = mediaType
|
|
}
|
|
|
|
// SetSpec sets a spec that will be served for the clients.
|
|
func (o *ZitiEdgeClientAPI) SetSpec(spec *loads.Document) {
|
|
o.spec = spec
|
|
}
|
|
|
|
// DefaultProduces returns the default produces media type
|
|
func (o *ZitiEdgeClientAPI) DefaultProduces() string {
|
|
return o.defaultProduces
|
|
}
|
|
|
|
// DefaultConsumes returns the default consumes media type
|
|
func (o *ZitiEdgeClientAPI) DefaultConsumes() string {
|
|
return o.defaultConsumes
|
|
}
|
|
|
|
// Formats returns the registered string formats
|
|
func (o *ZitiEdgeClientAPI) Formats() strfmt.Registry {
|
|
return o.formats
|
|
}
|
|
|
|
// RegisterFormat registers a custom format validator
|
|
func (o *ZitiEdgeClientAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) {
|
|
o.formats.Add(name, format, validator)
|
|
}
|
|
|
|
// Validate validates the registrations in the ZitiEdgeClientAPI
|
|
func (o *ZitiEdgeClientAPI) Validate() error {
|
|
var unregistered []string
|
|
|
|
if o.ApplicationPkcs10Consumer == nil {
|
|
unregistered = append(unregistered, "ApplicationPkcs10Consumer")
|
|
}
|
|
if o.ApplicationXPemFileConsumer == nil {
|
|
unregistered = append(unregistered, "ApplicationXPemFileConsumer")
|
|
}
|
|
if o.JSONConsumer == nil {
|
|
unregistered = append(unregistered, "JSONConsumer")
|
|
}
|
|
if o.TxtConsumer == nil {
|
|
unregistered = append(unregistered, "TxtConsumer")
|
|
}
|
|
|
|
if o.ApplicationPkcs7MimeProducer == nil {
|
|
unregistered = append(unregistered, "ApplicationPkcs7MimeProducer")
|
|
}
|
|
if o.ApplicationXPemFileProducer == nil {
|
|
unregistered = append(unregistered, "ApplicationXPemFileProducer")
|
|
}
|
|
if o.ApplicationXX509UserCertProducer == nil {
|
|
unregistered = append(unregistered, "ApplicationXX509UserCertProducer")
|
|
}
|
|
if o.BinProducer == nil {
|
|
unregistered = append(unregistered, "BinProducer")
|
|
}
|
|
if o.JSONProducer == nil {
|
|
unregistered = append(unregistered, "JSONProducer")
|
|
}
|
|
if o.TextYamlProducer == nil {
|
|
unregistered = append(unregistered, "TextYamlProducer")
|
|
}
|
|
|
|
if o.ZtSessionAuth == nil {
|
|
unregistered = append(unregistered, "ZtSessionAuth")
|
|
}
|
|
|
|
if o.CurrentAPISessionDeleteCurrentAPISessionHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.DeleteCurrentAPISessionHandler")
|
|
}
|
|
if o.AuthenticationAuthenticateHandler == nil {
|
|
unregistered = append(unregistered, "authentication.AuthenticateHandler")
|
|
}
|
|
if o.AuthenticationAuthenticateMfaHandler == nil {
|
|
unregistered = append(unregistered, "authentication.AuthenticateMfaHandler")
|
|
}
|
|
if o.CurrentAPISessionCreateCurrentAPISessionCertificateHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.CreateCurrentAPISessionCertificateHandler")
|
|
}
|
|
if o.CurrentIdentityCreateMfaRecoveryCodesHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.CreateMfaRecoveryCodesHandler")
|
|
}
|
|
if o.PostureChecksCreatePostureResponseHandler == nil {
|
|
unregistered = append(unregistered, "posture_checks.CreatePostureResponseHandler")
|
|
}
|
|
if o.PostureChecksCreatePostureResponseBulkHandler == nil {
|
|
unregistered = append(unregistered, "posture_checks.CreatePostureResponseBulkHandler")
|
|
}
|
|
if o.SessionCreateSessionHandler == nil {
|
|
unregistered = append(unregistered, "session.CreateSessionHandler")
|
|
}
|
|
if o.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.DeleteCurrentAPISessionCertificateHandler")
|
|
}
|
|
if o.CurrentIdentityDeleteMfaHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.DeleteMfaHandler")
|
|
}
|
|
if o.ServiceDeleteServiceHandler == nil {
|
|
unregistered = append(unregistered, "service.DeleteServiceHandler")
|
|
}
|
|
if o.SessionDeleteSessionHandler == nil {
|
|
unregistered = append(unregistered, "session.DeleteSessionHandler")
|
|
}
|
|
if o.CurrentAPISessionDetailCurrentAPISessionCertificateHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.DetailCurrentAPISessionCertificateHandler")
|
|
}
|
|
if o.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.DetailCurrentIdentityAuthenticatorHandler")
|
|
}
|
|
if o.CurrentIdentityDetailMfaHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.DetailMfaHandler")
|
|
}
|
|
if o.CurrentIdentityDetailMfaQrCodeHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.DetailMfaQrCodeHandler")
|
|
}
|
|
if o.CurrentIdentityDetailMfaRecoveryCodesHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.DetailMfaRecoveryCodesHandler")
|
|
}
|
|
if o.ServiceDetailServiceHandler == nil {
|
|
unregistered = append(unregistered, "service.DetailServiceHandler")
|
|
}
|
|
if o.SessionDetailSessionHandler == nil {
|
|
unregistered = append(unregistered, "session.DetailSessionHandler")
|
|
}
|
|
if o.InformationalDetailSpecHandler == nil {
|
|
unregistered = append(unregistered, "informational.DetailSpecHandler")
|
|
}
|
|
if o.InformationalDetailSpecBodyHandler == nil {
|
|
unregistered = append(unregistered, "informational.DetailSpecBodyHandler")
|
|
}
|
|
if o.EnrollEnrollHandler == nil {
|
|
unregistered = append(unregistered, "enroll.EnrollHandler")
|
|
}
|
|
if o.EnrollEnrollCaHandler == nil {
|
|
unregistered = append(unregistered, "enroll.EnrollCaHandler")
|
|
}
|
|
if o.EnrollEnrollErOttHandler == nil {
|
|
unregistered = append(unregistered, "enroll.EnrollErOttHandler")
|
|
}
|
|
if o.CurrentIdentityEnrollMfaHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.EnrollMfaHandler")
|
|
}
|
|
if o.EnrollEnrollOttHandler == nil {
|
|
unregistered = append(unregistered, "enroll.EnrollOttHandler")
|
|
}
|
|
if o.EnrollEnrollOttCaHandler == nil {
|
|
unregistered = append(unregistered, "enroll.EnrollOttCaHandler")
|
|
}
|
|
if o.EnrollErnollUpdbHandler == nil {
|
|
unregistered = append(unregistered, "enroll.ErnollUpdbHandler")
|
|
}
|
|
if o.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.ExtendCurrentIdentityAuthenticatorHandler")
|
|
}
|
|
if o.EnrollExtendRouterEnrollmentHandler == nil {
|
|
unregistered = append(unregistered, "enroll.ExtendRouterEnrollmentHandler")
|
|
}
|
|
if o.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandler")
|
|
}
|
|
if o.CurrentAPISessionGetCurrentAPISessionHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.GetCurrentAPISessionHandler")
|
|
}
|
|
if o.CurrentIdentityGetCurrentIdentityHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.GetCurrentIdentityHandler")
|
|
}
|
|
if o.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.GetCurrentIdentityEdgeRoutersHandler")
|
|
}
|
|
if o.CurrentAPISessionListCurrentAPISessionCertificatesHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.ListCurrentAPISessionCertificatesHandler")
|
|
}
|
|
if o.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.ListCurrentIdentityAuthenticatorsHandler")
|
|
}
|
|
if o.InformationalListProtocolsHandler == nil {
|
|
unregistered = append(unregistered, "informational.ListProtocolsHandler")
|
|
}
|
|
if o.InformationalListRootHandler == nil {
|
|
unregistered = append(unregistered, "informational.ListRootHandler")
|
|
}
|
|
if o.ServiceListServiceTerminatorsHandler == nil {
|
|
unregistered = append(unregistered, "service.ListServiceTerminatorsHandler")
|
|
}
|
|
if o.CurrentAPISessionListServiceUpdatesHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.ListServiceUpdatesHandler")
|
|
}
|
|
if o.ServiceListServicesHandler == nil {
|
|
unregistered = append(unregistered, "service.ListServicesHandler")
|
|
}
|
|
if o.SessionListSessionsHandler == nil {
|
|
unregistered = append(unregistered, "session.ListSessionsHandler")
|
|
}
|
|
if o.InformationalListSpecsHandler == nil {
|
|
unregistered = append(unregistered, "informational.ListSpecsHandler")
|
|
}
|
|
if o.InformationalListVersionHandler == nil {
|
|
unregistered = append(unregistered, "informational.ListVersionHandler")
|
|
}
|
|
if o.WellKnownListWellKnownCasHandler == nil {
|
|
unregistered = append(unregistered, "well_known.ListWellKnownCasHandler")
|
|
}
|
|
if o.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.PatchCurrentIdentityAuthenticatorHandler")
|
|
}
|
|
if o.ServicePatchServiceHandler == nil {
|
|
unregistered = append(unregistered, "service.PatchServiceHandler")
|
|
}
|
|
if o.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler == nil {
|
|
unregistered = append(unregistered, "current_api_session.UpdateCurrentIdentityAuthenticatorHandler")
|
|
}
|
|
if o.ServiceUpdateServiceHandler == nil {
|
|
unregistered = append(unregistered, "service.UpdateServiceHandler")
|
|
}
|
|
if o.CurrentIdentityVerifyMfaHandler == nil {
|
|
unregistered = append(unregistered, "current_identity.VerifyMfaHandler")
|
|
}
|
|
|
|
if len(unregistered) > 0 {
|
|
return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", "))
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ServeErrorFor gets a error handler for a given operation id
|
|
func (o *ZitiEdgeClientAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) {
|
|
return o.ServeError
|
|
}
|
|
|
|
// AuthenticatorsFor gets the authenticators for the specified security schemes
|
|
func (o *ZitiEdgeClientAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator {
|
|
result := make(map[string]runtime.Authenticator)
|
|
for name := range schemes {
|
|
switch name {
|
|
case "ztSession":
|
|
scheme := schemes[name]
|
|
result[name] = o.APIKeyAuthenticator(scheme.Name, scheme.In, o.ZtSessionAuth)
|
|
|
|
}
|
|
}
|
|
return result
|
|
}
|
|
|
|
// Authorizer returns the registered authorizer
|
|
func (o *ZitiEdgeClientAPI) Authorizer() runtime.Authorizer {
|
|
return o.APIAuthorizer
|
|
}
|
|
|
|
// ConsumersFor gets the consumers for the specified media types.
|
|
// MIME type parameters are ignored here.
|
|
func (o *ZitiEdgeClientAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer {
|
|
result := make(map[string]runtime.Consumer, len(mediaTypes))
|
|
for _, mt := range mediaTypes {
|
|
switch mt {
|
|
case "application/pkcs10":
|
|
result["application/pkcs10"] = o.ApplicationPkcs10Consumer
|
|
case "application/x-pem-file":
|
|
result["application/x-pem-file"] = o.ApplicationXPemFileConsumer
|
|
case "application/json":
|
|
result["application/json"] = o.JSONConsumer
|
|
case "text/plain":
|
|
result["text/plain"] = o.TxtConsumer
|
|
}
|
|
|
|
if c, ok := o.customConsumers[mt]; ok {
|
|
result[mt] = c
|
|
}
|
|
}
|
|
return result
|
|
}
|
|
|
|
// ProducersFor gets the producers for the specified media types.
|
|
// MIME type parameters are ignored here.
|
|
func (o *ZitiEdgeClientAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer {
|
|
result := make(map[string]runtime.Producer, len(mediaTypes))
|
|
for _, mt := range mediaTypes {
|
|
switch mt {
|
|
case "application/pkcs7-mime":
|
|
result["application/pkcs7-mime"] = o.ApplicationPkcs7MimeProducer
|
|
case "application/x-pem-file":
|
|
result["application/x-pem-file"] = o.ApplicationXPemFileProducer
|
|
case "application/x-x509-user-cert":
|
|
result["application/x-x509-user-cert"] = o.ApplicationXX509UserCertProducer
|
|
case "image/png":
|
|
result["image/png"] = o.BinProducer
|
|
case "application/json":
|
|
result["application/json"] = o.JSONProducer
|
|
case "text/yaml":
|
|
result["text/yaml"] = o.TextYamlProducer
|
|
}
|
|
|
|
if p, ok := o.customProducers[mt]; ok {
|
|
result[mt] = p
|
|
}
|
|
}
|
|
return result
|
|
}
|
|
|
|
// HandlerFor gets a http.Handler for the provided operation method and path
|
|
func (o *ZitiEdgeClientAPI) HandlerFor(method, path string) (http.Handler, bool) {
|
|
if o.handlers == nil {
|
|
return nil, false
|
|
}
|
|
um := strings.ToUpper(method)
|
|
if _, ok := o.handlers[um]; !ok {
|
|
return nil, false
|
|
}
|
|
if path == "/" {
|
|
path = ""
|
|
}
|
|
h, ok := o.handlers[um][path]
|
|
return h, ok
|
|
}
|
|
|
|
// Context returns the middleware context for the ziti edge client API
|
|
func (o *ZitiEdgeClientAPI) Context() *middleware.Context {
|
|
if o.context == nil {
|
|
o.context = middleware.NewRoutableContext(o.spec, o, nil)
|
|
}
|
|
|
|
return o.context
|
|
}
|
|
|
|
func (o *ZitiEdgeClientAPI) initHandlerCache() {
|
|
o.Context() // don't care about the result, just that the initialization happened
|
|
if o.handlers == nil {
|
|
o.handlers = make(map[string]map[string]http.Handler)
|
|
}
|
|
|
|
if o.handlers["DELETE"] == nil {
|
|
o.handlers["DELETE"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["DELETE"]["/current-api-session"] = current_api_session.NewDeleteCurrentAPISession(o.context, o.CurrentAPISessionDeleteCurrentAPISessionHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/authenticate"] = authentication.NewAuthenticate(o.context, o.AuthenticationAuthenticateHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/authenticate/mfa"] = authentication.NewAuthenticateMfa(o.context, o.AuthenticationAuthenticateMfaHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/current-api-session/certificates"] = current_api_session.NewCreateCurrentAPISessionCertificate(o.context, o.CurrentAPISessionCreateCurrentAPISessionCertificateHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/current-identity/mfa/recovery-codes"] = current_identity.NewCreateMfaRecoveryCodes(o.context, o.CurrentIdentityCreateMfaRecoveryCodesHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/posture-response"] = posture_checks.NewCreatePostureResponse(o.context, o.PostureChecksCreatePostureResponseHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/posture-response-bulk"] = posture_checks.NewCreatePostureResponseBulk(o.context, o.PostureChecksCreatePostureResponseBulkHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/sessions"] = session.NewCreateSession(o.context, o.SessionCreateSessionHandler)
|
|
if o.handlers["DELETE"] == nil {
|
|
o.handlers["DELETE"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["DELETE"]["/current-api-session/certificates/{id}"] = current_api_session.NewDeleteCurrentAPISessionCertificate(o.context, o.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler)
|
|
if o.handlers["DELETE"] == nil {
|
|
o.handlers["DELETE"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["DELETE"]["/current-identity/mfa"] = current_identity.NewDeleteMfa(o.context, o.CurrentIdentityDeleteMfaHandler)
|
|
if o.handlers["DELETE"] == nil {
|
|
o.handlers["DELETE"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["DELETE"]["/services/{id}"] = service.NewDeleteService(o.context, o.ServiceDeleteServiceHandler)
|
|
if o.handlers["DELETE"] == nil {
|
|
o.handlers["DELETE"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["DELETE"]["/sessions/{id}"] = session.NewDeleteSession(o.context, o.SessionDeleteSessionHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-api-session/certificates/{id}"] = current_api_session.NewDetailCurrentAPISessionCertificate(o.context, o.CurrentAPISessionDetailCurrentAPISessionCertificateHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-identity/authenticators/{id}"] = current_api_session.NewDetailCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-identity/mfa"] = current_identity.NewDetailMfa(o.context, o.CurrentIdentityDetailMfaHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-identity/mfa/qr-code"] = current_identity.NewDetailMfaQrCode(o.context, o.CurrentIdentityDetailMfaQrCodeHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-identity/mfa/recovery-codes"] = current_identity.NewDetailMfaRecoveryCodes(o.context, o.CurrentIdentityDetailMfaRecoveryCodesHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/services/{id}"] = service.NewDetailService(o.context, o.ServiceDetailServiceHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/sessions/{id}"] = session.NewDetailSession(o.context, o.SessionDetailSessionHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/specs/{id}"] = informational.NewDetailSpec(o.context, o.InformationalDetailSpecHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/specs/{id}/spec"] = informational.NewDetailSpecBody(o.context, o.InformationalDetailSpecBodyHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/enroll"] = enroll.NewEnroll(o.context, o.EnrollEnrollHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/enroll/ca"] = enroll.NewEnrollCa(o.context, o.EnrollEnrollCaHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/enroll/erott"] = enroll.NewEnrollErOtt(o.context, o.EnrollEnrollErOttHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/current-identity/mfa"] = current_identity.NewEnrollMfa(o.context, o.CurrentIdentityEnrollMfaHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/enroll/ott"] = enroll.NewEnrollOtt(o.context, o.EnrollEnrollOttHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/enroll/ottca"] = enroll.NewEnrollOttCa(o.context, o.EnrollEnrollOttCaHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/enroll/updb"] = enroll.NewErnollUpdb(o.context, o.EnrollErnollUpdbHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/current-identity/authenticators/{id}/extend"] = current_api_session.NewExtendCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/enroll/extend/router"] = enroll.NewExtendRouterEnrollment(o.context, o.EnrollExtendRouterEnrollmentHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/current-identity/authenticators/{id}/extend-verify"] = current_api_session.NewExtendVerifyCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-api-session"] = current_api_session.NewGetCurrentAPISession(o.context, o.CurrentAPISessionGetCurrentAPISessionHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-identity"] = current_identity.NewGetCurrentIdentity(o.context, o.CurrentIdentityGetCurrentIdentityHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-identity/edge-routers"] = current_identity.NewGetCurrentIdentityEdgeRouters(o.context, o.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-api-session/certificates"] = current_api_session.NewListCurrentAPISessionCertificates(o.context, o.CurrentAPISessionListCurrentAPISessionCertificatesHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-identity/authenticators"] = current_api_session.NewListCurrentIdentityAuthenticators(o.context, o.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/protocols"] = informational.NewListProtocols(o.context, o.InformationalListProtocolsHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"][""] = informational.NewListRoot(o.context, o.InformationalListRootHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/services/{id}/terminators"] = service.NewListServiceTerminators(o.context, o.ServiceListServiceTerminatorsHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/current-api-session/service-updates"] = current_api_session.NewListServiceUpdates(o.context, o.CurrentAPISessionListServiceUpdatesHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/services"] = service.NewListServices(o.context, o.ServiceListServicesHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/sessions"] = session.NewListSessions(o.context, o.SessionListSessionsHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/specs"] = informational.NewListSpecs(o.context, o.InformationalListSpecsHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/version"] = informational.NewListVersion(o.context, o.InformationalListVersionHandler)
|
|
if o.handlers["GET"] == nil {
|
|
o.handlers["GET"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["GET"]["/.well-known/est/cacerts"] = well_known.NewListWellKnownCas(o.context, o.WellKnownListWellKnownCasHandler)
|
|
if o.handlers["PATCH"] == nil {
|
|
o.handlers["PATCH"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["PATCH"]["/current-identity/authenticators/{id}"] = current_api_session.NewPatchCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler)
|
|
if o.handlers["PATCH"] == nil {
|
|
o.handlers["PATCH"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["PATCH"]["/services/{id}"] = service.NewPatchService(o.context, o.ServicePatchServiceHandler)
|
|
if o.handlers["PUT"] == nil {
|
|
o.handlers["PUT"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["PUT"]["/current-identity/authenticators/{id}"] = current_api_session.NewUpdateCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler)
|
|
if o.handlers["PUT"] == nil {
|
|
o.handlers["PUT"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["PUT"]["/services/{id}"] = service.NewUpdateService(o.context, o.ServiceUpdateServiceHandler)
|
|
if o.handlers["POST"] == nil {
|
|
o.handlers["POST"] = make(map[string]http.Handler)
|
|
}
|
|
o.handlers["POST"]["/current-identity/mfa/verify"] = current_identity.NewVerifyMfa(o.context, o.CurrentIdentityVerifyMfaHandler)
|
|
}
|
|
|
|
// Serve creates a http handler to serve the API over HTTP
|
|
// can be used directly in http.ListenAndServe(":8000", api.Serve(nil))
|
|
func (o *ZitiEdgeClientAPI) Serve(builder middleware.Builder) http.Handler {
|
|
o.Init()
|
|
|
|
if o.Middleware != nil {
|
|
return o.Middleware(builder)
|
|
}
|
|
if o.useSwaggerUI {
|
|
return o.context.APIHandlerSwaggerUI(builder)
|
|
}
|
|
return o.context.APIHandler(builder)
|
|
}
|
|
|
|
// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
|
|
func (o *ZitiEdgeClientAPI) Init() {
|
|
if len(o.handlers) == 0 {
|
|
o.initHandlerCache()
|
|
}
|
|
}
|
|
|
|
// RegisterConsumer allows you to add (or override) a consumer for a media type.
|
|
func (o *ZitiEdgeClientAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) {
|
|
o.customConsumers[mediaType] = consumer
|
|
}
|
|
|
|
// RegisterProducer allows you to add (or override) a producer for a media type.
|
|
func (o *ZitiEdgeClientAPI) RegisterProducer(mediaType string, producer runtime.Producer) {
|
|
o.customProducers[mediaType] = producer
|
|
}
|
|
|
|
// AddMiddlewareFor adds a http middleware to existing handler
|
|
func (o *ZitiEdgeClientAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) {
|
|
um := strings.ToUpper(method)
|
|
if path == "/" {
|
|
path = ""
|
|
}
|
|
o.Init()
|
|
if h, ok := o.handlers[um][path]; ok {
|
|
o.handlers[method][path] = builder(h)
|
|
}
|
|
}
|