webService

package
v0.0.0-...-7797f25 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartWebService

func StartWebService(conf conf.ServerConf, _devices *mqtt.DeviceData, _macDb db.UserDb)

Types

type SimpleXSRFCheck

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

SimpleXSRFCheck creates/compares and stores the XSRF tokens for the associated ip. After cleanupAfter amount of time a cleanup go routine removes old entries.

func NewSimpleXSRFCheck

func NewSimpleXSRFCheck() *SimpleXSRFCheck

NewSimpleXSRFCheck creates a new instance

func (SimpleXSRFCheck) CheckAndClearToken

func (sx SimpleXSRFCheck) CheckAndClearToken(ip string, token string) bool

CheckAndClearToken returns true if the given token matches for the given ip. If no entry was found for the ip, false is returned. At the end the ip entry is removed from the internal map.

func (SimpleXSRFCheck) NewToken

func (sx SimpleXSRFCheck) NewToken(ip string) string

Jump to

Keyboard shortcuts

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