csrf

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Implementation

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

func (*Implementation) AddOriginHeader

func (i *Implementation) AddOriginHeader(headerName string)

func (*Implementation) AddSafeEndpoint

func (i *Implementation) AddSafeEndpoint(endpoint string)

AddSafeEndpoint is used for endpoints requests to skip CSRF check

func (*Implementation) Middleware

func (i *Implementation) Middleware(logger log.Logger) func(http.Handler) http.Handler

func (*Implementation) TrustOrigin

func (i *Implementation) TrustOrigin(origin string)

type Service

type Service interface {
	Middleware(logger log.Logger) func(http.Handler) http.Handler
	TrustOrigin(origin string)
	AddOriginHeader(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