security

package
v0.0.0-...-f6f89ba Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSecret

func GenerateSecret(length int) (string, error)

Types

type Security

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

func New

func New(secret string, allowedDomains []string, quit chan bool) (*Security, error)

func (*Security) CheckOTP

func (s *Security) CheckOTP(key string) bool

func (*Security) Decrypt

func (s *Security) Decrypt(value string) (string, error)

func (*Security) DeleteSession

func (s *Security) DeleteSession(id string)

func (*Security) DeleteSessionByObject

func (s *Security) DeleteSessionByObject(session *sessions.Session) error

func (*Security) Encrypt

func (s *Security) Encrypt(value string) (string, error)

func (*Security) GenerateOTP

func (s *Security) GenerateOTP() (string, error)

func (*Security) GetSession

func (s *Security) GetSession(id string) (*Session, error)

func (*Security) GetSessionByObject

func (s *Security) GetSessionByObject(session *sessions.Session) (*Session, error)

func (*Security) IsEmailAuthorized

func (s *Security) IsEmailAuthorized(email string) (bool, error)

func (*Security) NewSession

func (s *Security) NewSession() (string, error)

func (*Security) WatchOTPs

func (s *Security) WatchOTPs()

type Session

type Session struct {
	Authorized bool
	OAuthState string
}

Jump to

Keyboard shortcuts

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