Documentation
¶
Index ¶
- Constants
- func Guard(next http.Handler, sessionToken string) http.Handler
- func HasValidTokenHeader(r *http.Request, expected string) bool
- func IsAllowedOrigin(origin string) bool
- func IsMutatingMethod(method string) bool
- func NewToken() string
- func SetTokenBootstrap(w http.ResponseWriter, token string)
Constants ¶
View Source
const ( // MaxBodySize caps mutating local control-plane requests. Control-plane // POST/PATCH bodies are small forms; 1 MB is intentionally generous. MaxBodySize = 1 << 20 TokenCookieName = "speechkit_control_plane" TokenHeaderName = "X-SpeechKit-Control-Token" )
Variables ¶
This section is empty.
Functions ¶
func Guard ¶
Guard rejects cross-site and disallowed-origin mutating requests. It is the primary CSRF defence for the local desktop control plane.
func IsAllowedOrigin ¶
func IsMutatingMethod ¶
func SetTokenBootstrap ¶
func SetTokenBootstrap(w http.ResponseWriter, token string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.