Files
Andrew MartinezandGitHub 2a12985526 Fix.openziti.ziti.3356.www.authenticate.headers (#169)
* for openziti/ziti#3356 add www-authenticate headers

- adds www-authenticate headers to all responses
- moves to swagger 0.33.1
- updates readme
- updates version checking in powershell and bash
2026-02-12 13:41:23 -05:00

542 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 authenticator
// 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"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// New creates a new authenticator API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new authenticator API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new authenticator API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for authenticator API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
CreateAuthenticator(params *CreateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthenticatorCreated, error)
DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthenticatorOK, error)
DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthenticatorOK, error)
ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthenticatorsOK, error)
PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthenticatorOK, error)
ReEnrollAuthenticator(params *ReEnrollAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollAuthenticatorCreated, error)
RequestExtendAllCertAuthenticators(params *RequestExtendAllCertAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RequestExtendAllCertAuthenticatorsOK, error)
RequestExtendAuthenticator(params *RequestExtendAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RequestExtendAuthenticatorOK, error)
UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthenticatorOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
CreateAuthenticator creates an authenticator
Creates an authenticator for a specific identity. Requires admin access.
*/
func (a *Client) CreateAuthenticator(params *CreateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthenticatorCreated, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewCreateAuthenticatorParams()
}
op := &runtime.ClientOperation{
ID: "createAuthenticator",
Method: "POST",
PathPattern: "/authenticators",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &CreateAuthenticatorReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*CreateAuthenticatorCreated)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteAuthenticator deletes an authenticator
Delete an authenticator by id. Deleting all authenticators for an identity will make it impossible to log in.
Requires admin access.
*/
func (a *Client) DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthenticatorOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewDeleteAuthenticatorParams()
}
op := &runtime.ClientOperation{
ID: "deleteAuthenticator",
Method: "DELETE",
PathPattern: "/authenticators/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &DeleteAuthenticatorReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*DeleteAuthenticatorOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DetailAuthenticator retrieves a single authenticator
Retrieves a single authenticator by id. Requires admin access.
*/
func (a *Client) DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthenticatorOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewDetailAuthenticatorParams()
}
op := &runtime.ClientOperation{
ID: "detailAuthenticator",
Method: "GET",
PathPattern: "/authenticators/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &DetailAuthenticatorReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*DetailAuthenticatorOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for detailAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListAuthenticators lists authenticators
Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated.
This endpoint requires admin access.
*/
func (a *Client) ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthenticatorsOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewListAuthenticatorsParams()
}
op := &runtime.ClientOperation{
ID: "listAuthenticators",
Method: "GET",
PathPattern: "/authenticators",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &ListAuthenticatorsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*ListAuthenticatorsOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listAuthenticators: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PatchAuthenticator updates the supplied fields on an authenticator
Update the supplied fields on an authenticator by id. Requires admin access.
*/
func (a *Client) PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthenticatorOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewPatchAuthenticatorParams()
}
op := &runtime.ClientOperation{
ID: "patchAuthenticator",
Method: "PATCH",
PathPattern: "/authenticators/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &PatchAuthenticatorReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*PatchAuthenticatorOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for patchAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ReEnrollAuthenticator reverts an authenticator to an enrollment
Allows an authenticator to be reverted to an enrollment and allows re-enrollment to occur. On success the
created enrollment record response is provided and the source authenticator record will be deleted. The
enrollment created depends on the authenticator. UPDB authenticators result in UPDB enrollments, CERT
authenticators result in OTT enrollments, CERT + CA authenticators result in OTTCA enrollments.
*/
func (a *Client) ReEnrollAuthenticator(params *ReEnrollAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollAuthenticatorCreated, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewReEnrollAuthenticatorParams()
}
op := &runtime.ClientOperation{
ID: "reEnrollAuthenticator",
Method: "POST",
PathPattern: "/authenticators/{id}/re-enroll",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &ReEnrollAuthenticatorReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*ReEnrollAuthenticatorCreated)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for reEnrollAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RequestExtendAllCertAuthenticators indicates all certificate authenticators for the identity should be extended and optionally key rolled on next authentication
Allows all certificate authenticators on an identity to be flagged for early extension and optionally private
key rolling. Connecting clients will receive flags in their API Session indicating that an early extension is
request and a hint on whether private keys should be rolled. Clients that do not support extension or cannot
roll keys may ignore one or both flags.
If this request is made against an identity with zero certificate authenticators, a 403 will be returned.
*/
func (a *Client) RequestExtendAllCertAuthenticators(params *RequestExtendAllCertAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RequestExtendAllCertAuthenticatorsOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewRequestExtendAllCertAuthenticatorsParams()
}
op := &runtime.ClientOperation{
ID: "requestExtendAllCertAuthenticators",
Method: "POST",
PathPattern: "/identities/{id}/request-extend",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &RequestExtendAllCertAuthenticatorsReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*RequestExtendAllCertAuthenticatorsOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for requestExtendAllCertAuthenticators: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RequestExtendAuthenticator indicates a certificate authenticator should be extended and optionally key rolled on next authentication
Allows a certificate authenticator to be flagged for early extension and optionally private key rolling.
Connecting clients will receive flags in their API Session indicating that an early extension is request and
a hint on whether private keys should be rolled. Clients that do not support extension or cannot roll keys
may ignore one or both flags.
If this request is made against a non-certificate based authenticator, it will return a 403-forbidden error.
*/
func (a *Client) RequestExtendAuthenticator(params *RequestExtendAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RequestExtendAuthenticatorOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewRequestExtendAuthenticatorParams()
}
op := &runtime.ClientOperation{
ID: "requestExtendAuthenticator",
Method: "POST",
PathPattern: "/authenticators/{id}/request-extend",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &RequestExtendAuthenticatorReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*RequestExtendAuthenticatorOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for requestExtendAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateAuthenticator updates all fields on an authenticator
Update all fields on an authenticator by id. Requires admin access.
*/
func (a *Client) UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthenticatorOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewUpdateAuthenticatorParams()
}
op := &runtime.ClientOperation{
ID: "updateAuthenticator",
Method: "PUT",
PathPattern: "/authenticators/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &UpdateAuthenticatorReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
// only one success response has to be checked
success, ok := result.(*UpdateAuthenticatorOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateAuthenticator: 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
}