auth

package
v0.0.0-...-55c0a6c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUTH_USER = iota
	AUTH_ADMIN
	AUTH_SU
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthBackend

type AuthBackend struct {
	StorageOnline  bool
	FrontendOnline bool
	Frontends      []Consumer
	AuthChannel    chan AuthRequest
	AddChannel     chan User
	DelChannel     chan User
	UpdateChannel  chan User
	Closer         chan bool
	Response       chan AuthResponse
	// contains filtered or unexported fields
}

func NewAuthBackend

func NewAuthBackend() *AuthBackend

func (*AuthBackend) AddFrontend

func (b *AuthBackend) AddFrontend(c *Consumer)

func (*AuthBackend) ConnectStorage

func (b *AuthBackend) ConnectStorage(s *data.StorageConnection)

func (*AuthBackend) Run

func (b *AuthBackend) Run()

type AuthFrontend

type AuthFrontend struct {
	Mux    *http.ServeMux
	Srv    *graceful.Server
	Key    *rsa.PrivateKey
	CtrlLn net.Listener
	Logger *log.Logger
}

type AuthRequest

type AuthRequest struct {
	Id         []byte
	Login      string
	Name       string
	Hash       []byte
	CunsumerId []byte
}

type AuthResponse

type AuthResponse struct {
	Error       error
	Authorized  bool
	UserId      []byte
	AccessLevel int
}

type Consumer

type Consumer struct {
	ConsumerInterface
	Id             []byte
	Name           string
	Description    string
	Key            *rsa.PrivateKey
	GrandRequester chan GrandRequest
	GrandResponder chan GrandResponse
}

type ConsumerAccess

type ConsumerAccess struct {
	User        []byte
	Consumer    []byte
	Id          []byte
	Signatur    []byte
	AccessLevel int
}

type ConsumerInterface

type ConsumerInterface interface {
	ConnectAuthBackend(b *AuthBackend)
}

type GrandRequest

type GrandRequest struct {
	UserId     []byte
	CunsumerId []byte
}

type GrandResponse

type GrandResponse struct {
	UserId      []byte
	AccessLevel int
}

type User

type User struct {
	data.RequestContent
	Login    string `search:"userlogin"`
	Name     string `search:"username"`
	PassHash []byte
	Created  time.Time
	Id       []byte
	Key      *rsa.PrivateKey
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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