Documentation ¶
Index ¶
- Variables
- func GetClientCertificate(in string) (*x509.Certificate, error)
- func GetClientCertificateHeader(header http.Header) (string, error)
- func GetClientCertiifcateThumbprint(certificate *x509.Certificate) string
- func ReadJSONBody(r *http.Request, v interface{}) error
- func WriteJSONResponse(w http.ResponseWriter, r *http.Request, code int, response interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClientCertificateNotPresent = errors.New("client certificate not presented") ErrClientCertificateError = errors.New("client certificate error") )
Functions ¶
func GetClientCertificate ¶ added in v0.2.30
func GetClientCertificate(in string) (*x509.Certificate, error)
GetClientCertificate retrieves the client certificate from headers injected by the ingress controller.
func GetClientCertificateHeader ¶ added in v0.2.30
GetClientCertificateHeader extracts a client certificate from any present headers. TODO: may need to extract into a canonical form. NOTE: propagation at present expects this to be url encoded.
func GetClientCertiifcateThumbprint ¶ added in v0.2.30
func GetClientCertiifcateThumbprint(certificate *x509.Certificate) string
GetClientCertiifcateThumbprint returns the client certificate thumbprint as defined by RFC8705.
func ReadJSONBody ¶
ReadJSONBody is a generic request reader to unmarshal JSON bodies.
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, r *http.Request, code int, response interface{})
WriteJSONResponse is a generic wrapper for returning a JSON payload to the client.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.