예제 #1
0
파일: host.go 프로젝트: dream1986/ssh-chat
func (h Host) isOp(conn sshd.Connection) bool {
	key := conn.PublicKey()
	if key == nil {
		return false
	}
	return h.auth.IsOp(key)
}
예제 #2
0
// NewIdentity returns a new identity object from an sshd.Connection.
func NewIdentity(conn sshd.Connection) *Identity {
	return &Identity{
		Connection: conn,
		id:         chat.SanitizeName(conn.Name()),
	}
}