diff --git a/auth.go b/auth.go index 172cea3..8a15367 100644 --- a/auth.go +++ b/auth.go @@ -13,10 +13,11 @@ import ( "golang.org/x/crypto/ssh" ) -// The error returned a key is checked that is not whitelisted, with whitelisting required. +// ErrNotWhitelisted Is the error returned when a key is checked that is not whitelisted, +// when whitelisting is enabled. var ErrNotWhitelisted = errors.New("not whitelisted") -// The error returned a key is checked that is banned. +// ErrBanned is the error returned when a key is checked that is banned. var ErrBanned = errors.New("banned") // newAuthKey returns string from an ssh.PublicKey used to index the key in our lookup. @@ -182,7 +183,7 @@ func (a *Auth) Banned() (ip []string, fingerprint []string, client []string) { return } -// Ban will set an IP address as banned. +// BanAddr will set an IP address as banned. func (a *Auth) BanAddr(addr net.Addr, d time.Duration) { authItem := set.StringItem(newAuthAddr(addr)) if d != 0 { diff --git a/godoc.go b/godoc.go index 8b4842b..d65bb96 100644 --- a/godoc.go +++ b/godoc.go @@ -1,5 +1,5 @@ /* -sshchat package is an implementation of an ssh server which serves a chat room +Package sshchat is an implementation of an ssh server which serves a chat room instead of a shell. sshd subdirectory contains the ssh-related pieces which know nothing about chat. diff --git a/identity.go b/identity.go index 05d754f..0817792 100644 --- a/identity.go +++ b/identity.go @@ -26,18 +26,22 @@ func NewIdentity(conn sshd.Connection) *Identity { } } +// ID returns the name for the Identity func (i Identity) ID() string { return i.id } +// SetID Changes the Identity's name func (i *Identity) SetID(id string) { i.id = id } +// SetName Changes the Identity's name func (i *Identity) SetName(name string) { i.SetID(name) } +// Name returns the name for the Identity func (i Identity) Name() string { return i.id } diff --git a/logger.go b/logger.go index c9701d9..a2eefc3 100644 --- a/logger.go +++ b/logger.go @@ -9,6 +9,7 @@ import ( var logger *golog.Logger +// SetLogger sets the package logging to use l. func SetLogger(l *golog.Logger) { logger = l }