Better comments
This commit is contained in:
parent
3813360d91
commit
57c6abe86c
7
auth.go
7
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 {
|
||||
|
|
2
godoc.go
2
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.
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue