csrf

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data added in v0.2.0

type Data struct {
	CSRFToken string
}

type Service

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

Service handles CSRF token generation and validation operations.

func NewService

func NewService(csrfKey string) *Service

NewService initializes and returns a new Service.

func (*Service) Generate

func (cs *Service) Generate(userUUID string, actionID string) string

Generate generates a CSRF token for a given user and action.

func (*Service) Validate

func (cs *Service) Validate(token string, userUUID string, actionID string) bool

Validate validates a CSRF token for a given user and action.

Jump to

Keyboard shortcuts

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