controlplane

package
v0.35.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

func Guard(next http.Handler, sessionToken string) http.Handler

Guard rejects cross-site and disallowed-origin mutating requests. It is the primary CSRF defence for the local desktop control plane.

func HasValidTokenHeader

func HasValidTokenHeader(r *http.Request, expected string) bool

func IsAllowedOrigin

func IsAllowedOrigin(origin string) bool

func IsMutatingMethod

func IsMutatingMethod(method string) bool

func NewToken

func NewToken() string

func SetTokenBootstrap

func SetTokenBootstrap(w http.ResponseWriter, token string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL