csrf

package
v0.0.1-test Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 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 (*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)
}

func ProvideCSRFFilter

func ProvideCSRFFilter(cfg *setting.Cfg) Service

Jump to

Keyboard shortcuts

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