security

package
v0.0.0-...-2d75744 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureAuth

func EnsureAuth(next http.HandlerFunc) http.HandlerFunc

func HashCompare

func HashCompare(hash, password string) error

func HashGenerate

func HashGenerate(password string) ([]byte, error)

func TokenGenerate

func TokenGenerate(userId, tenantId string) (string, error)

func TokenValidate

func TokenValidate(r *http.Request) error

Types

type Sessions

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

func Session

func Session() *Sessions

func (*Sessions) GetRoles

func (s *Sessions) GetRoles(value int) []string

func (*Sessions) GetTenant

func (s *Sessions) GetTenant() string

func (*Sessions) GetUser

func (s *Sessions) GetUser() string

func (*Sessions) Tenant

func (s *Sessions) Tenant(userID string) *Sessions

func (*Sessions) User

func (s *Sessions) User(userID string) *Sessions

Jump to

Keyboard shortcuts

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