accounts

package
v0.0.0-...-9a1c0c1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpiryDate

func ExpiryDate() int64

of Seconds since ...

func FindFile

func FindFile(paths []string) (string, error)

func GetKey

func GetKey(token *jwt.Token) (interface{}, error)

func Hostname

func Hostname() string

func SecretKey

func SecretKey() []byte

func Username

func Username() string

func Validate

func Validate(token *Token) bool

Types

type Account

type Account struct {
	Username  string
	Hostname  string
	Passwd    string
	Directory string
	Uid       uint32
	Gid       uint32
	NextId    uint
	Token     *Token
}

All of the information necessary for both the client and server to function.

func FindAccount

func FindAccount(username string) *Account

func NewAccount

func NewAccount(hostname string, username string, token *Token) *Account

Assume that this is only getting called by the registration TODO: If I've set the setuid bit to run as root, how to I know the original uid?

type AccountMap

type AccountMap struct {
	Accounts map[string]*Account
}

type Authentication

type Authentication struct {
	Map *AccountMap
	// contains filtered or unexported fields
}

func NewAuthentication

func NewAuthentication() *Authentication

func (*Authentication) Find

func (auth *Authentication) Find(username string) *Account

func (*Authentication) GetFilepath

func (auth *Authentication) GetFilepath() string

TODO: Quick fix to expose the file name

func (*Authentication) Reload

func (auth *Authentication) Reload()

func (*Authentication) UpdateAccount

func (auth *Authentication) UpdateAccount(account *Account)

Update the datastructure in memory

type ClientConfig

type ClientConfig struct {
	Protocol    string
	Hostname    string
	Port        string
	Username    string
	Credentials string
	Token       *Token
}

func FindClientConfig

func FindClientConfig() *ClientConfig

Client initialization

func NewClientConfig

func NewClientConfig(hostname string, username string, token *Token) *ClientConfig

Register initialization

func (*ClientConfig) GetUrl

func (config *ClientConfig) GetUrl(request_type string) string

func (*ClientConfig) SaveConfig

func (config *ClientConfig) SaveConfig()

type Token

type Token struct {
	Signed string
}

func CreateToken

func CreateToken() *Token

func NewToken

func NewToken(tokenString string) *Token

Jump to

Keyboard shortcuts

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