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 GetAccessTokenFromRequest(r *http.Request) (string, error)
- func GetOrgByGuidCached(guid string) (org *resource.Organization)
- func GetSpaceByGuidCached(guid string) (space *resource.Space)
- func Guid2AppName(guid string) string
- func InitCFClient()
- func IsUserAuthorisedForSpace(token jwt.Token, spaceGuid string) bool
- func IsValidJKU(jkuURL string) bool
- func PrintIfDebug(msg string)
- func PrintfIfDebug(msg string, args ...interface{})
- func ProvisionObjectFromRequest(r *http.Request, object interface{}) error
- func Send2PolicyServer(action string, policies model.NetworkPolicies) error
- func SyncLabels2Policies()
- func WriteHttpResponse(w http.ResponseWriter, code int, object interface{})
- type CacheEntry
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 GetAccessTokenFromRequest ¶
GetAccessTokenFromRequest - get the JWT from the request
func GetOrgByGuidCached ¶
func GetOrgByGuidCached(guid string) (org *resource.Organization)
func GetSpaceByGuidCached ¶
func Guid2AppName ¶
func InitCFClient ¶
func InitCFClient()
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 PrintIfDebug ¶
func PrintIfDebug(msg string)
func PrintfIfDebug ¶
func PrintfIfDebug(msg string, args ...interface{})
func Send2PolicyServer ¶
func Send2PolicyServer(action string, policies model.NetworkPolicies) error
Send2PolicyServer - Send the give network policies to the cf policy server (actual update/add of the network policy). If a policy already exists, it will be ignored.
func SyncLabels2Policies ¶ added in v1.0.4
func SyncLabels2Policies()
SyncLabels2Policies - Find all ServiceInstances and their bound apps, figure out what network policies they represent, check if they exist, and if not, report and create them.
func WriteHttpResponse ¶
func WriteHttpResponse(w http.ResponseWriter, code int, object interface{})
Types ¶
type CacheEntry ¶
type CacheEntry struct {
// contains filtered or unexported fields
}