Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSRFProtector ¶
CSRFProtector adds a CSRF protection middleware to the chain if the program is not running in development mode.
func CSRFTokenHeader ¶
func CSRFTokenHeader(w http.ResponseWriter, r *http.Request)
CSRFTokenHeader writes masked CSRF token in a HTTP response header.
func ServerAuthorizer ¶
ServerAuthorizer uses two models to authorize incoming requests:
- if the request comes from a trusted client authenticated using mutual TLS, it is authorized.
- if the request comes from a web browser (directly or via a single-page application), it is authorized only if it meets CORS middleware prerequisites (which depend on the development mode setting and the configuration of the application).
- if none of the above methods authorized the request, it is denied.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.