Documentation
¶
Index ¶
- Constants
- Variables
- func GetCorsDisablingHandler(next http.Handler) http.Handler
- func GetErrMsg(actualStatusCode int, respBodyMsg string) string
- func SendJsonResponse(w http.ResponseWriter, data interface{})
- func SetCookieAndOriginHeaders(req *http.Request, c *ComponentClient)
- type ChangePasswordForm
- type ComponentClient
- type SingleString
Constants ¶
View Source
const OriginHeader = "Origin"
Variables ¶
View Source
var Logger = shared.ProvideLogger(os.Getenv("LOG_LEVEL"))
Functions ¶
func GetCorsDisablingHandler ¶ added in v0.0.21
GetCorsDisablingHandler This is necessary to allow cross-origin requests from the ocelot-cloud GUI to the hub. The "Origin" header is managed and checked with custom logic to prevent CSRF attacks.
func SendJsonResponse ¶
func SendJsonResponse(w http.ResponseWriter, data interface{})
func SetCookieAndOriginHeaders ¶
func SetCookieAndOriginHeaders(req *http.Request, c *ComponentClient)
Types ¶
type ChangePasswordForm ¶
type ComponentClient ¶
type ComponentClient struct {
User string
Password string
NewPassword string
Origin string
Cookie *http.Cookie
SetOriginHeader bool
SetCookieHeader bool
RootUrl string
}
func (*ComponentClient) DoRequest ¶
func (c *ComponentClient) DoRequest(path string, payload interface{}, expectedMessage string) (interface{}, error)
func (*ComponentClient) DoRequestWithFullResponse ¶
type SingleString ¶
type SingleString struct {
Value string `json:"value"`
}
Click to show internal directories.
Click to hide internal directories.