374742d8e8
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
19 lines
340 B
Go
19 lines
340 B
Go
package main
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"fmt"
|
|
|
|
"github.com/gliderlabs/ssh"
|
|
"github.com/gomodule/redigo/redis"
|
|
)
|
|
|
|
func (s *Server) getConn() (redis.Conn, error) {
|
|
return redis.DialURL(s.cfg.RedisURL)
|
|
}
|
|
|
|
func (s *Server) getID(key ssh.PublicKey) string {
|
|
h := sha256.New()
|
|
h.Write(key.Marshal())
|
|
return fmt.Sprintf("%x", h.Sum(nil))
|
|
}
|