mirror of
https://github.com/hanzozt/edge-api.git
synced 2026-10-30 14:44:05 +00:00
Global rebrand of all OpenZiti references to Hanzo ZT: - Go module paths: github.com/openziti/* → github.com/hanzozt/* - Docker images: openziti/* → hanzozt/* - Java packages: org.openziti.* → org.hanzozt.* - Brand: OpenZiti → Hanzo ZT - URLs: openziti.io → hanzozt.dev
348 lines
10 KiB
Go
348 lines
10 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 authentication
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/swag"
|
|
|
|
"github.com/hanzozt/edge-api/rest_model"
|
|
)
|
|
|
|
// AuthenticateOKCode is the HTTP code returned for type AuthenticateOK
|
|
const AuthenticateOKCode int = 200
|
|
|
|
/*
|
|
AuthenticateOK The API session associated with the session used to issue the request
|
|
|
|
swagger:response authenticateOK
|
|
*/
|
|
type AuthenticateOK struct {
|
|
/*Denotes different type of security token related information
|
|
|
|
*/
|
|
WWWAuthenticate []string `json:"WWW-Authenticate"`
|
|
|
|
/*
|
|
In: Body
|
|
*/
|
|
Payload *rest_model.CurrentAPISessionDetailEnvelope `json:"body,omitempty"`
|
|
}
|
|
|
|
// NewAuthenticateOK creates AuthenticateOK with default headers values
|
|
func NewAuthenticateOK() *AuthenticateOK {
|
|
|
|
return &AuthenticateOK{}
|
|
}
|
|
|
|
// WithWWWAuthenticate adds the wWWAuthenticate to the authenticate o k response
|
|
func (o *AuthenticateOK) WithWWWAuthenticate(wWWAuthenticate []string) *AuthenticateOK {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
return o
|
|
}
|
|
|
|
// SetWWWAuthenticate sets the wWWAuthenticate to the authenticate o k response
|
|
func (o *AuthenticateOK) SetWWWAuthenticate(wWWAuthenticate []string) {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
}
|
|
|
|
// WithPayload adds the payload to the authenticate o k response
|
|
func (o *AuthenticateOK) WithPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) *AuthenticateOK {
|
|
o.Payload = payload
|
|
return o
|
|
}
|
|
|
|
// SetPayload sets the payload to the authenticate o k response
|
|
func (o *AuthenticateOK) SetPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) {
|
|
o.Payload = payload
|
|
}
|
|
|
|
// WriteResponse to the client
|
|
func (o *AuthenticateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
|
|
|
// response header WWW-Authenticate
|
|
|
|
var wWWAuthenticateIR []string
|
|
for _, wWWAuthenticateI := range o.WWWAuthenticate {
|
|
wWWAuthenticateIS := wWWAuthenticateI
|
|
if wWWAuthenticateIS != "" {
|
|
wWWAuthenticateIR = append(wWWAuthenticateIR, wWWAuthenticateIS)
|
|
}
|
|
}
|
|
wWWAuthenticate := swag.JoinByFormat(wWWAuthenticateIR, "")
|
|
if len(wWWAuthenticate) > 0 {
|
|
hv := wWWAuthenticate[0]
|
|
if hv != "" {
|
|
rw.Header().Set("WWW-Authenticate", hv)
|
|
}
|
|
}
|
|
|
|
rw.WriteHeader(200)
|
|
if o.Payload != nil {
|
|
payload := o.Payload
|
|
if err := producer.Produce(rw, payload); err != nil {
|
|
panic(err) // let the recovery middleware deal with this
|
|
}
|
|
}
|
|
}
|
|
|
|
// AuthenticateBadRequestCode is the HTTP code returned for type AuthenticateBadRequest
|
|
const AuthenticateBadRequestCode int = 400
|
|
|
|
/*
|
|
AuthenticateBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information
|
|
|
|
swagger:response authenticateBadRequest
|
|
*/
|
|
type AuthenticateBadRequest struct {
|
|
/*Denotes different type of security token related information
|
|
|
|
*/
|
|
WWWAuthenticate []string `json:"WWW-Authenticate"`
|
|
|
|
/*
|
|
In: Body
|
|
*/
|
|
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
|
|
}
|
|
|
|
// NewAuthenticateBadRequest creates AuthenticateBadRequest with default headers values
|
|
func NewAuthenticateBadRequest() *AuthenticateBadRequest {
|
|
|
|
return &AuthenticateBadRequest{}
|
|
}
|
|
|
|
// WithWWWAuthenticate adds the wWWAuthenticate to the authenticate bad request response
|
|
func (o *AuthenticateBadRequest) WithWWWAuthenticate(wWWAuthenticate []string) *AuthenticateBadRequest {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
return o
|
|
}
|
|
|
|
// SetWWWAuthenticate sets the wWWAuthenticate to the authenticate bad request response
|
|
func (o *AuthenticateBadRequest) SetWWWAuthenticate(wWWAuthenticate []string) {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
}
|
|
|
|
// WithPayload adds the payload to the authenticate bad request response
|
|
func (o *AuthenticateBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *AuthenticateBadRequest {
|
|
o.Payload = payload
|
|
return o
|
|
}
|
|
|
|
// SetPayload sets the payload to the authenticate bad request response
|
|
func (o *AuthenticateBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) {
|
|
o.Payload = payload
|
|
}
|
|
|
|
// WriteResponse to the client
|
|
func (o *AuthenticateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
|
|
|
// response header WWW-Authenticate
|
|
|
|
var wWWAuthenticateIR []string
|
|
for _, wWWAuthenticateI := range o.WWWAuthenticate {
|
|
wWWAuthenticateIS := wWWAuthenticateI
|
|
if wWWAuthenticateIS != "" {
|
|
wWWAuthenticateIR = append(wWWAuthenticateIR, wWWAuthenticateIS)
|
|
}
|
|
}
|
|
wWWAuthenticate := swag.JoinByFormat(wWWAuthenticateIR, "")
|
|
if len(wWWAuthenticate) > 0 {
|
|
hv := wWWAuthenticate[0]
|
|
if hv != "" {
|
|
rw.Header().Set("WWW-Authenticate", hv)
|
|
}
|
|
}
|
|
|
|
rw.WriteHeader(400)
|
|
if o.Payload != nil {
|
|
payload := o.Payload
|
|
if err := producer.Produce(rw, payload); err != nil {
|
|
panic(err) // let the recovery middleware deal with this
|
|
}
|
|
}
|
|
}
|
|
|
|
// AuthenticateUnauthorizedCode is the HTTP code returned for type AuthenticateUnauthorized
|
|
const AuthenticateUnauthorizedCode int = 401
|
|
|
|
/*
|
|
AuthenticateUnauthorized The authentication request could not be processed as the credentials are invalid
|
|
|
|
swagger:response authenticateUnauthorized
|
|
*/
|
|
type AuthenticateUnauthorized struct {
|
|
/*Denotes different type of security token related information
|
|
|
|
*/
|
|
WWWAuthenticate []string `json:"WWW-Authenticate"`
|
|
|
|
/*
|
|
In: Body
|
|
*/
|
|
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
|
|
}
|
|
|
|
// NewAuthenticateUnauthorized creates AuthenticateUnauthorized with default headers values
|
|
func NewAuthenticateUnauthorized() *AuthenticateUnauthorized {
|
|
|
|
return &AuthenticateUnauthorized{}
|
|
}
|
|
|
|
// WithWWWAuthenticate adds the wWWAuthenticate to the authenticate unauthorized response
|
|
func (o *AuthenticateUnauthorized) WithWWWAuthenticate(wWWAuthenticate []string) *AuthenticateUnauthorized {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
return o
|
|
}
|
|
|
|
// SetWWWAuthenticate sets the wWWAuthenticate to the authenticate unauthorized response
|
|
func (o *AuthenticateUnauthorized) SetWWWAuthenticate(wWWAuthenticate []string) {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
}
|
|
|
|
// WithPayload adds the payload to the authenticate unauthorized response
|
|
func (o *AuthenticateUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *AuthenticateUnauthorized {
|
|
o.Payload = payload
|
|
return o
|
|
}
|
|
|
|
// SetPayload sets the payload to the authenticate unauthorized response
|
|
func (o *AuthenticateUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) {
|
|
o.Payload = payload
|
|
}
|
|
|
|
// WriteResponse to the client
|
|
func (o *AuthenticateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
|
|
|
// response header WWW-Authenticate
|
|
|
|
var wWWAuthenticateIR []string
|
|
for _, wWWAuthenticateI := range o.WWWAuthenticate {
|
|
wWWAuthenticateIS := wWWAuthenticateI
|
|
if wWWAuthenticateIS != "" {
|
|
wWWAuthenticateIR = append(wWWAuthenticateIR, wWWAuthenticateIS)
|
|
}
|
|
}
|
|
wWWAuthenticate := swag.JoinByFormat(wWWAuthenticateIR, "")
|
|
if len(wWWAuthenticate) > 0 {
|
|
hv := wWWAuthenticate[0]
|
|
if hv != "" {
|
|
rw.Header().Set("WWW-Authenticate", hv)
|
|
}
|
|
}
|
|
|
|
rw.WriteHeader(401)
|
|
if o.Payload != nil {
|
|
payload := o.Payload
|
|
if err := producer.Produce(rw, payload); err != nil {
|
|
panic(err) // let the recovery middleware deal with this
|
|
}
|
|
}
|
|
}
|
|
|
|
// AuthenticateTooManyRequestsCode is the HTTP code returned for type AuthenticateTooManyRequests
|
|
const AuthenticateTooManyRequestsCode int = 429
|
|
|
|
/*
|
|
AuthenticateTooManyRequests The resource requested is rate limited and the rate limit has been exceeded
|
|
|
|
swagger:response authenticateTooManyRequests
|
|
*/
|
|
type AuthenticateTooManyRequests struct {
|
|
/*Denotes different type of security token related information
|
|
|
|
*/
|
|
WWWAuthenticate []string `json:"WWW-Authenticate"`
|
|
|
|
/*
|
|
In: Body
|
|
*/
|
|
Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"`
|
|
}
|
|
|
|
// NewAuthenticateTooManyRequests creates AuthenticateTooManyRequests with default headers values
|
|
func NewAuthenticateTooManyRequests() *AuthenticateTooManyRequests {
|
|
|
|
return &AuthenticateTooManyRequests{}
|
|
}
|
|
|
|
// WithWWWAuthenticate adds the wWWAuthenticate to the authenticate too many requests response
|
|
func (o *AuthenticateTooManyRequests) WithWWWAuthenticate(wWWAuthenticate []string) *AuthenticateTooManyRequests {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
return o
|
|
}
|
|
|
|
// SetWWWAuthenticate sets the wWWAuthenticate to the authenticate too many requests response
|
|
func (o *AuthenticateTooManyRequests) SetWWWAuthenticate(wWWAuthenticate []string) {
|
|
o.WWWAuthenticate = wWWAuthenticate
|
|
}
|
|
|
|
// WithPayload adds the payload to the authenticate too many requests response
|
|
func (o *AuthenticateTooManyRequests) WithPayload(payload *rest_model.APIErrorEnvelope) *AuthenticateTooManyRequests {
|
|
o.Payload = payload
|
|
return o
|
|
}
|
|
|
|
// SetPayload sets the payload to the authenticate too many requests response
|
|
func (o *AuthenticateTooManyRequests) SetPayload(payload *rest_model.APIErrorEnvelope) {
|
|
o.Payload = payload
|
|
}
|
|
|
|
// WriteResponse to the client
|
|
func (o *AuthenticateTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
|
|
|
// response header WWW-Authenticate
|
|
|
|
var wWWAuthenticateIR []string
|
|
for _, wWWAuthenticateI := range o.WWWAuthenticate {
|
|
wWWAuthenticateIS := wWWAuthenticateI
|
|
if wWWAuthenticateIS != "" {
|
|
wWWAuthenticateIR = append(wWWAuthenticateIR, wWWAuthenticateIS)
|
|
}
|
|
}
|
|
wWWAuthenticate := swag.JoinByFormat(wWWAuthenticateIR, "")
|
|
if len(wWWAuthenticate) > 0 {
|
|
hv := wWWAuthenticate[0]
|
|
if hv != "" {
|
|
rw.Header().Set("WWW-Authenticate", hv)
|
|
}
|
|
}
|
|
|
|
rw.WriteHeader(429)
|
|
if o.Payload != nil {
|
|
payload := o.Payload
|
|
if err := producer.Produce(rw, payload); err != nil {
|
|
panic(err) // let the recovery middleware deal with this
|
|
}
|
|
}
|
|
}
|