Files
object-browser/restapi/operations/user_api/oauth2_callback_responses.go
Lenin Alevski 44d8e9b975 idp integration for mcs (#75)
This PR adds support for oidc in  mcs, to enable idp
authentication you need to pass the following environment variables and
restart mcs.

```
MCS_IDP_URL=""
MCS_IDP_CLIENT_ID=""
MCS_IDP_SECRET=""
MCS_IDP_CALLBACK=""
```
2020-05-01 08:38:52 -07:00

114 lines
3.1 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2020 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package user_api
// 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/minio/mcs/models"
)
// Oauth2CallbackOKCode is the HTTP code returned for type Oauth2CallbackOK
const Oauth2CallbackOKCode int = 200
/*Oauth2CallbackOK A successful response.
swagger:response oauth2CallbackOK
*/
type Oauth2CallbackOK struct {
}
// NewOauth2CallbackOK creates Oauth2CallbackOK with default headers values
func NewOauth2CallbackOK() *Oauth2CallbackOK {
return &Oauth2CallbackOK{}
}
// WriteResponse to the client
func (o *Oauth2CallbackOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(200)
}
/*Oauth2CallbackDefault Generic error response.
swagger:response oauth2CallbackDefault
*/
type Oauth2CallbackDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewOauth2CallbackDefault creates Oauth2CallbackDefault with default headers values
func NewOauth2CallbackDefault(code int) *Oauth2CallbackDefault {
if code <= 0 {
code = 500
}
return &Oauth2CallbackDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the oauth2 callback default response
func (o *Oauth2CallbackDefault) WithStatusCode(code int) *Oauth2CallbackDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the oauth2 callback default response
func (o *Oauth2CallbackDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the oauth2 callback default response
func (o *Oauth2CallbackDefault) WithPayload(payload *models.Error) *Oauth2CallbackDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the oauth2 callback default response
func (o *Oauth2CallbackDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *Oauth2CallbackDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}