Documentation ¶
Index ¶
- func AuthHandler(h http.Handler) http.Handler
- func CORSHandler(h http.Handler) http.Handler
- func EnableCors(w *http.ResponseWriter)
- func HTTPError(w http.ResponseWriter, statusCode int, code, message string)
- func Init(listers controller.Listers)
- func InternalServerError(w http.ResponseWriter, message string)
- func SetRealm(realm string)
- func SetupOptionsResponse(w *http.ResponseWriter, req *http.Request)
- type Error
- type JSONWebKey
- type KeyCloak
- type KeyRepo
- type PublicKeys
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthHandler ¶
AuthHandler setups handler for API server HTTP requests.
func CORSHandler ¶
CORSHandler is an HTTP handler that will handle CORS preflight requests or delegate to the actual handler on real requests
func EnableCors ¶
func EnableCors(w *http.ResponseWriter)
EnableCors adds headers necessary for the browser running the UI to be able to call the API server
func HTTPError ¶ added in v0.0.99
func HTTPError(w http.ResponseWriter, statusCode int, code, message string)
HTTPError replies to the request with the specified error message and HTTP code.
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, message string)
InternalServerError replies to request with InternalServerError.
func SetupOptionsResponse ¶
func SetupOptionsResponse(w *http.ResponseWriter, req *http.Request)
SetupOptionsResponse creates the headers that are needed for a HTTP OPTIONS request The web UI makes an OPTIONS request before each GET/POST/etc.
Types ¶
type JSONWebKey ¶ added in v0.0.99
type JSONWebKey struct { KeyID string `json:"kid"` KeyType string `json:"kty"` Algorithm string `json:"alg"` CertificateChain []string `json:"x5c"` }
JSONWebKey represents a cryptographic key. https://tools.ietf.org/html/rfc7517#section-4.7 JsonWebKey
type KeyCloak ¶
KeyCloak represents a KeyCloak instance.
func (*KeyCloak) GetPublicKey ¶ added in v0.0.99
GetPublicKey returns a public key.
func (*KeyCloak) GetPublicKeys ¶ added in v0.0.99
GetPublicKeys returns boolean whether public keys exist or not.
type KeyRepo ¶
type KeyRepo interface { GetPublicKey(kid string) (*rsa.PublicKey, error) GetPublicKeys() (bool, error) }
KeyRepo defines interface to get public keys.
func NewKeyCloak ¶
NewKeyCloak creates a KeyCloak struct.
type PublicKeys ¶
type PublicKeys struct {
Keys []JSONWebKey `json:"keys"`
}
PublicKeys represents json public keys.