New Login Design (#1675)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
@@ -110,6 +110,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
|
||||
AdminAPIChangeUserPasswordHandler: admin_api.ChangeUserPasswordHandlerFunc(func(params admin_api.ChangeUserPasswordParams, principal *models.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin_api.ChangeUserPassword has not yet been implemented")
|
||||
}),
|
||||
UserAPICheckMinIOVersionHandler: user_api.CheckMinIOVersionHandlerFunc(func(params user_api.CheckMinIOVersionParams) middleware.Responder {
|
||||
return middleware.NotImplemented("operation user_api.CheckMinIOVersion has not yet been implemented")
|
||||
}),
|
||||
AdminAPIConfigInfoHandler: admin_api.ConfigInfoHandlerFunc(func(params admin_api.ConfigInfoParams, principal *models.Principal) middleware.Responder {
|
||||
return middleware.NotImplemented("operation admin_api.ConfigInfo has not yet been implemented")
|
||||
}),
|
||||
@@ -489,6 +492,8 @@ type ConsoleAPI struct {
|
||||
AdminAPIBulkUpdateUsersGroupsHandler admin_api.BulkUpdateUsersGroupsHandler
|
||||
// AdminAPIChangeUserPasswordHandler sets the operation handler for the change user password operation
|
||||
AdminAPIChangeUserPasswordHandler admin_api.ChangeUserPasswordHandler
|
||||
// UserAPICheckMinIOVersionHandler sets the operation handler for the check min i o version operation
|
||||
UserAPICheckMinIOVersionHandler user_api.CheckMinIOVersionHandler
|
||||
// AdminAPIConfigInfoHandler sets the operation handler for the config info operation
|
||||
AdminAPIConfigInfoHandler admin_api.ConfigInfoHandler
|
||||
// AdminAPICreateAUserServiceAccountHandler sets the operation handler for the create a user service account operation
|
||||
@@ -817,6 +822,9 @@ func (o *ConsoleAPI) Validate() error {
|
||||
if o.AdminAPIChangeUserPasswordHandler == nil {
|
||||
unregistered = append(unregistered, "admin_api.ChangeUserPasswordHandler")
|
||||
}
|
||||
if o.UserAPICheckMinIOVersionHandler == nil {
|
||||
unregistered = append(unregistered, "user_api.CheckMinIOVersionHandler")
|
||||
}
|
||||
if o.AdminAPIConfigInfoHandler == nil {
|
||||
unregistered = append(unregistered, "admin_api.ConfigInfoHandler")
|
||||
}
|
||||
@@ -1276,6 +1284,10 @@ func (o *ConsoleAPI) initHandlerCache() {
|
||||
if o.handlers["GET"] == nil {
|
||||
o.handlers["GET"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["GET"]["/check-version"] = user_api.NewCheckMinIOVersion(o.context, o.UserAPICheckMinIOVersionHandler)
|
||||
if o.handlers["GET"] == nil {
|
||||
o.handlers["GET"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["GET"]["/configs/{name}"] = admin_api.NewConfigInfo(o.context, o.AdminAPIConfigInfoHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
|
||||
73
restapi/operations/user_api/check_min_i_o_version.go
Normal file
73
restapi/operations/user_api/check_min_i_o_version.go
Normal file
@@ -0,0 +1,73 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2021 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 generate command
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/go-openapi/runtime/middleware"
|
||||
)
|
||||
|
||||
// CheckMinIOVersionHandlerFunc turns a function with the right signature into a check min i o version handler
|
||||
type CheckMinIOVersionHandlerFunc func(CheckMinIOVersionParams) middleware.Responder
|
||||
|
||||
// Handle executing the request and returning a response
|
||||
func (fn CheckMinIOVersionHandlerFunc) Handle(params CheckMinIOVersionParams) middleware.Responder {
|
||||
return fn(params)
|
||||
}
|
||||
|
||||
// CheckMinIOVersionHandler interface for that can handle valid check min i o version params
|
||||
type CheckMinIOVersionHandler interface {
|
||||
Handle(CheckMinIOVersionParams) middleware.Responder
|
||||
}
|
||||
|
||||
// NewCheckMinIOVersion creates a new http.Handler for the check min i o version operation
|
||||
func NewCheckMinIOVersion(ctx *middleware.Context, handler CheckMinIOVersionHandler) *CheckMinIOVersion {
|
||||
return &CheckMinIOVersion{Context: ctx, Handler: handler}
|
||||
}
|
||||
|
||||
/* CheckMinIOVersion swagger:route GET /check-version UserAPI checkMinIOVersion
|
||||
|
||||
Checks the current MinIO version against the latest
|
||||
|
||||
*/
|
||||
type CheckMinIOVersion struct {
|
||||
Context *middleware.Context
|
||||
Handler CheckMinIOVersionHandler
|
||||
}
|
||||
|
||||
func (o *CheckMinIOVersion) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||
if rCtx != nil {
|
||||
*r = *rCtx
|
||||
}
|
||||
var Params = NewCheckMinIOVersionParams()
|
||||
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||
return
|
||||
}
|
||||
|
||||
res := o.Handler.Handle(Params) // actually handle the request
|
||||
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2021 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/errors"
|
||||
"github.com/go-openapi/runtime/middleware"
|
||||
)
|
||||
|
||||
// NewCheckMinIOVersionParams creates a new CheckMinIOVersionParams object
|
||||
//
|
||||
// There are no default values defined in the spec.
|
||||
func NewCheckMinIOVersionParams() CheckMinIOVersionParams {
|
||||
|
||||
return CheckMinIOVersionParams{}
|
||||
}
|
||||
|
||||
// CheckMinIOVersionParams contains all the bound params for the check min i o version operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters CheckMinIOVersion
|
||||
type CheckMinIOVersionParams struct {
|
||||
|
||||
// HTTP Request Object
|
||||
HTTPRequest *http.Request `json:"-"`
|
||||
}
|
||||
|
||||
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||
// for simple values it will use straight method calls.
|
||||
//
|
||||
// To ensure default values, the struct must have been initialized with NewCheckMinIOVersionParams() beforehand.
|
||||
func (o *CheckMinIOVersionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||
var res []error
|
||||
|
||||
o.HTTPRequest = r
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
133
restapi/operations/user_api/check_min_i_o_version_responses.go
Normal file
133
restapi/operations/user_api/check_min_i_o_version_responses.go
Normal file
@@ -0,0 +1,133 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2021 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/console/models"
|
||||
)
|
||||
|
||||
// CheckMinIOVersionOKCode is the HTTP code returned for type CheckMinIOVersionOK
|
||||
const CheckMinIOVersionOKCode int = 200
|
||||
|
||||
/*CheckMinIOVersionOK A successful response.
|
||||
|
||||
swagger:response checkMinIOVersionOK
|
||||
*/
|
||||
type CheckMinIOVersionOK struct {
|
||||
|
||||
/*
|
||||
In: Body
|
||||
*/
|
||||
Payload *models.CheckVersionResponse `json:"body,omitempty"`
|
||||
}
|
||||
|
||||
// NewCheckMinIOVersionOK creates CheckMinIOVersionOK with default headers values
|
||||
func NewCheckMinIOVersionOK() *CheckMinIOVersionOK {
|
||||
|
||||
return &CheckMinIOVersionOK{}
|
||||
}
|
||||
|
||||
// WithPayload adds the payload to the check min i o version o k response
|
||||
func (o *CheckMinIOVersionOK) WithPayload(payload *models.CheckVersionResponse) *CheckMinIOVersionOK {
|
||||
o.Payload = payload
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPayload sets the payload to the check min i o version o k response
|
||||
func (o *CheckMinIOVersionOK) SetPayload(payload *models.CheckVersionResponse) {
|
||||
o.Payload = payload
|
||||
}
|
||||
|
||||
// WriteResponse to the client
|
||||
func (o *CheckMinIOVersionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*CheckMinIOVersionDefault Generic error response.
|
||||
|
||||
swagger:response checkMinIOVersionDefault
|
||||
*/
|
||||
type CheckMinIOVersionDefault struct {
|
||||
_statusCode int
|
||||
|
||||
/*
|
||||
In: Body
|
||||
*/
|
||||
Payload *models.Error `json:"body,omitempty"`
|
||||
}
|
||||
|
||||
// NewCheckMinIOVersionDefault creates CheckMinIOVersionDefault with default headers values
|
||||
func NewCheckMinIOVersionDefault(code int) *CheckMinIOVersionDefault {
|
||||
if code <= 0 {
|
||||
code = 500
|
||||
}
|
||||
|
||||
return &CheckMinIOVersionDefault{
|
||||
_statusCode: code,
|
||||
}
|
||||
}
|
||||
|
||||
// WithStatusCode adds the status to the check min i o version default response
|
||||
func (o *CheckMinIOVersionDefault) WithStatusCode(code int) *CheckMinIOVersionDefault {
|
||||
o._statusCode = code
|
||||
return o
|
||||
}
|
||||
|
||||
// SetStatusCode sets the status to the check min i o version default response
|
||||
func (o *CheckMinIOVersionDefault) SetStatusCode(code int) {
|
||||
o._statusCode = code
|
||||
}
|
||||
|
||||
// WithPayload adds the payload to the check min i o version default response
|
||||
func (o *CheckMinIOVersionDefault) WithPayload(payload *models.Error) *CheckMinIOVersionDefault {
|
||||
o.Payload = payload
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPayload sets the payload to the check min i o version default response
|
||||
func (o *CheckMinIOVersionDefault) SetPayload(payload *models.Error) {
|
||||
o.Payload = payload
|
||||
}
|
||||
|
||||
// WriteResponse to the client
|
||||
func (o *CheckMinIOVersionDefault) 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
|
||||
}
|
||||
}
|
||||
}
|
||||
104
restapi/operations/user_api/check_min_i_o_version_urlbuilder.go
Normal file
104
restapi/operations/user_api/check_min_i_o_version_urlbuilder.go
Normal file
@@ -0,0 +1,104 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2021 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 generate command
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/url"
|
||||
golangswaggerpaths "path"
|
||||
)
|
||||
|
||||
// CheckMinIOVersionURL generates an URL for the check min i o version operation
|
||||
type CheckMinIOVersionURL struct {
|
||||
_basePath string
|
||||
}
|
||||
|
||||
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||
// base path specified in the swagger spec.
|
||||
// When the value of the base path is an empty string
|
||||
func (o *CheckMinIOVersionURL) WithBasePath(bp string) *CheckMinIOVersionURL {
|
||||
o.SetBasePath(bp)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||
// base path specified in the swagger spec.
|
||||
// When the value of the base path is an empty string
|
||||
func (o *CheckMinIOVersionURL) SetBasePath(bp string) {
|
||||
o._basePath = bp
|
||||
}
|
||||
|
||||
// Build a url path and query string
|
||||
func (o *CheckMinIOVersionURL) Build() (*url.URL, error) {
|
||||
var _result url.URL
|
||||
|
||||
var _path = "/check-version"
|
||||
|
||||
_basePath := o._basePath
|
||||
if _basePath == "" {
|
||||
_basePath = "/api/v1"
|
||||
}
|
||||
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||
|
||||
return &_result, nil
|
||||
}
|
||||
|
||||
// Must is a helper function to panic when the url builder returns an error
|
||||
func (o *CheckMinIOVersionURL) Must(u *url.URL, err error) *url.URL {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if u == nil {
|
||||
panic("url can't be nil")
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
||||
// String returns the string representation of the path with query string
|
||||
func (o *CheckMinIOVersionURL) String() string {
|
||||
return o.Must(o.Build()).String()
|
||||
}
|
||||
|
||||
// BuildFull builds a full url with scheme, host, path and query string
|
||||
func (o *CheckMinIOVersionURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||
if scheme == "" {
|
||||
return nil, errors.New("scheme is required for a full url on CheckMinIOVersionURL")
|
||||
}
|
||||
if host == "" {
|
||||
return nil, errors.New("host is required for a full url on CheckMinIOVersionURL")
|
||||
}
|
||||
|
||||
base, err := o.Build()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
base.Scheme = scheme
|
||||
base.Host = host
|
||||
return base, nil
|
||||
}
|
||||
|
||||
// StringFull returns the string representation of a complete url
|
||||
func (o *CheckMinIOVersionURL) StringFull(scheme, host string) string {
|
||||
return o.Must(o.BuildFull(scheme, host)).String()
|
||||
}
|
||||
Reference in New Issue
Block a user