Documentation ¶
Overview ¶
Copyright (c) 2021 Cisco Systems, Inc and its affiliates All Rights reserved
Index ¶
- Variables
- func AddSecureRoutes(router *mux.Router, routers ...openapi.Router) *mux.Router
- func NewEnsureAuth(handlerToWrap http.Handler, permission string) http.Handler
- func NewSecureRouter(routers ...openapi.Router) *mux.Router
- func NewSecurity(cfg *config.Config) error
- func UpdateConfig(c *config.Config, consul *consul.HelloWorldConsul, ...) error
- type EnsureAuth
Constants ¶
This section is empty.
Variables ¶
View Source
var Security = &msxsecurity.MsxSecurity{}
The Security global will represent the Security validator provided by msx-security.
Functions ¶
func AddSecureRoutes ¶
AddSecureRoutes adds api routes to an existing router.
func NewEnsureAuth ¶
NewEnsureAuth will be used to generate an auth wrapper.
func NewSecureRouter ¶
NewSecureRouter creates a new router for any number of api routers. Routes are secured using our ensure auth wrapper.
func UpdateConfig ¶
func UpdateConfig(c *config.Config, consul *consul.HelloWorldConsul, vault *vault.HelloWorldVault) error
Override configuration with values from Consul and Vault.
Types ¶
type EnsureAuth ¶
type EnsureAuth struct {
// contains filtered or unexported fields
}
EnsureAuth will wrap http handle funcs that require auth.
func (*EnsureAuth) ServeHTTP ¶
func (ea *EnsureAuth) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP will perform the auth on behalf of the embedded handlerfunc.
Click to show internal directories.
Click to hide internal directories.