Documentation ¶
Index ¶
- func BasicAuth(w http.ResponseWriter, r *http.Request, username, password string) bool
- func Contains(elems []interface{}, v string) bool
- func DumpRequest(r *http.Request)
- func GenerateGUID() string
- func GetAccessTokenFromRequest(r *http.Request) (string, error)
- func GetServiceById(serviceId string) model.Service
- func InitCFClient() *client.Client
- func IsAppBoundToSchedulerService(appguid string) bool
- func IsUserAuthorisedForSpace(token jwt.Token, spaceGuid string) bool
- func IsValidJKU(jkuURL string) bool
- func LastXChars(victim string, maxLen int) string
- func PrintIfDebug(msg string)
- func PrintfIfDebug(msg string, args ...interface{})
- func ProvisionObjectFromRequest(r *http.Request, object interface{}) error
- func WriteHttpResponse(w http.ResponseWriter, code int, object interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
BasicAuth validate if user/pass in the http request match the configured service broker user/pass
func DumpRequest ¶
func GenerateGUID ¶
func GenerateGUID() string
func GetAccessTokenFromRequest ¶
GetAccessTokenFromRequest - get the JWT from the request
func GetServiceById ¶
func InitCFClient ¶ added in v1.0.14
func IsUserAuthorisedForSpace ¶
IsUserAuthorisedForSpace - It takes the jwt, extracts the userId from it,
then queries cf (/v3/roles) to check if that user has at least developer or manager role for the give space
func IsValidJKU ¶
IsValidJKU - We compare the jku with the api hostname, only the first part should be different: like uaa.sys.cfd04.aws.rabo.cloud versus api.sys.cfd04.aws.rabo.cloud
func LastXChars ¶
func PrintIfDebug ¶
func PrintIfDebug(msg string)
func PrintfIfDebug ¶
func PrintfIfDebug(msg string, args ...interface{})
func WriteHttpResponse ¶
func WriteHttpResponse(w http.ResponseWriter, code int, object interface{})
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.