Documentation ¶
Index ¶
- func RandString() string
- type AdminCredentials
- type Credentials
- type OneTimePassword
- func (o *OneTimePassword) Check(bodyStringOrBytes interface{}) (string, interface{}, bool)
- func (o *OneTimePassword) CurrentPassword() string
- func (o *OneTimePassword) RefreshPassword() string
- func (o *OneTimePassword) ServeHTTP(rw http.ResponseWriter, rq *http.Request)
- func (o *OneTimePassword) String() string
- func (o *OneTimePassword) Whitelist() []string
- type UserNamePassword
- func (o *UserNamePassword) Check(bodyStringOrBytes interface{}) (string, interface{}, bool)
- func (o *UserNamePassword) CheckAdmin(bodyStringOrBytes interface{}) (string, bool)
- func (o *UserNamePassword) ServeHTTP(rw http.ResponseWriter, rq *http.Request)
- func (o *UserNamePassword) String() string
- func (o *UserNamePassword) Whitelist() []string
- type WhiteLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminCredentials ¶
type Credentials ¶
type OneTimePassword ¶
type OneTimePassword struct { CurrentPass string Revokables map[string]string // contains filtered or unexported fields }
OneTimePassword is an account-generation method where a password is pre-generated. The administrator of the VPN gives that password to a client, and the client uses it to create an account. After this, that password cannot be re-used to create a new account.
func NewOneTimePassRotator ¶
func NewOneTimePassRotator() (*OneTimePassword, error)
NewOneTimePassRotator generates a new whitelister using the One-Time-Password creation pattern
func (*OneTimePassword) Check ¶
func (o *OneTimePassword) Check(bodyStringOrBytes interface{}) (string, interface{}, bool)
Check determines if the string or bytes it is passed correspond to a current password. If so, it creates an account. If the password corresponds to an already created account, then the the user is informed the account is active and if not, it says the user is anauthorized.
func (*OneTimePassword) CurrentPassword ¶
func (o *OneTimePassword) CurrentPassword() string
CurrentPassword returns the current password for creating a new account.
func (*OneTimePassword) RefreshPassword ¶
func (o *OneTimePassword) RefreshPassword() string
RefreshPassword generates a new password to replace the old password with.
func (*OneTimePassword) ServeHTTP ¶
func (o *OneTimePassword) ServeHTTP(rw http.ResponseWriter, rq *http.Request)
func (*OneTimePassword) String ¶
func (o *OneTimePassword) String() string
func (*OneTimePassword) Whitelist ¶
func (o *OneTimePassword) Whitelist() []string
Whitelist prints the whitelist of keys to be consumed by a tunnel
type UserNamePassword ¶
type UserNamePassword struct { Pairs map[string][]string // contains filtered or unexported fields }
func NewUserNamePassword ¶
func NewUserNamePassword(adminuser, adminpass string) (*UserNamePassword, error)
pairs map[string][]string
func (*UserNamePassword) Check ¶
func (o *UserNamePassword) Check(bodyStringOrBytes interface{}) (string, interface{}, bool)
func (*UserNamePassword) CheckAdmin ¶
func (o *UserNamePassword) CheckAdmin(bodyStringOrBytes interface{}) (string, bool)
func (*UserNamePassword) ServeHTTP ¶
func (o *UserNamePassword) ServeHTTP(rw http.ResponseWriter, rq *http.Request)
func (*UserNamePassword) String ¶
func (o *UserNamePassword) String() string
func (*UserNamePassword) Whitelist ¶
func (o *UserNamePassword) Whitelist() []string
type WhiteLister ¶
type WhiteLister interface { // Check is used to determine if a client is to be authorized by the WhiteLister. // The interface is sent by an authentication method, it may contain a password or // a message encrypted for the server and signed with a private key. // The string is a base64 string to whitelist if the authentication passes. // The first string it returns should be the base64 of the client to be whitelisted. // The second interface may be used to pass information from the whitelister to another // routine but is optional // The final bool should be true if the client is to be whitelisted, false if it is // not authorized. Check(interface{}) (string, interface{}, bool) // Whitelist returns the stored client whitelist Whitelist() []string // ServeHTTP implements an HTTP handler that does the login stuff ServeHTTP(http.ResponseWriter, *http.Request) // String returns a string to be used for identifying the auth method in use // to the server so it can expose it to the admin String() string }