csrf

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSRF

type CSRF struct {
	// contains filtered or unexported fields
}

func ProvideCSRFFilter

func ProvideCSRFFilter(cfg *setting.Cfg) *CSRF

func (*CSRF) AddAdditionalHeaders

func (c *CSRF) AddAdditionalHeaders(headerName string)

func (*CSRF) AddSafeEndpoint

func (c *CSRF) AddSafeEndpoint(endpoint string)

AddSafeEndpoint is used for endpoints requests to skip CSRF check

func (*CSRF) Middleware

func (c *CSRF) Middleware() func(http.Handler) http.Handler

func (*CSRF) TrustOrigin

func (c *CSRF) TrustOrigin(origin string)

type Service

type Service interface {
	Middleware() func(http.Handler) http.Handler
	TrustOrigin(origin string)
	AddAdditionalHeaders(headerName string)
	AddSafeEndpoint(endpoint string)
}

Jump to

Keyboard shortcuts

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