1package proto
2
3import "golang.org/x/crypto/ssh"
4
5// ContextKeyUser is the context key for the user.
6var ContextKeyUser = &struct{ string }{"user"}
7
8// User is an interface representing a user.
9type User interface {
10 // ID returns the user's ID.
11 ID() int64
12 // Username returns the user's username.
13 Username() string
14 // IsAdmin returns whether the user is an admin.
15 IsAdmin() bool
16 // PublicKeys returns the user's public keys.
17 PublicKeys() []ssh.PublicKey
18}
19
20// UserOptions are options for creating a user.
21type UserOptions struct {
22 // Admin is whether the user is an admin.
23 Admin bool
24 // PublicKeys are the user's public keys.
25 PublicKeys []ssh.PublicKey
26}