-
Notifications
You must be signed in to change notification settings - Fork 23
/
types.go
26 lines (20 loc) · 888 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package authenticators
import (
"regexp"
"code.cloudfoundry.org/lager"
"golang.org/x/crypto/ssh"
)
//go:generate counterfeiter -o fake_authenticators/fake_public_key_authenticator.go . PublicKeyAuthenticator
type PublicKeyAuthenticator interface {
Authenticate(metadata ssh.ConnMetadata, publicKey ssh.PublicKey) (*ssh.Permissions, error)
PublicKey() ssh.PublicKey
}
//go:generate counterfeiter -o fake_authenticators/fake_password_authenticator.go . PasswordAuthenticator
type PasswordAuthenticator interface {
UserRegexp() *regexp.Regexp
Authenticate(metadata ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)
}
//go:generate counterfeiter -o fake_authenticators/fake_permissions_builder.go . PermissionsBuilder
type PermissionsBuilder interface {
Build(logger lager.Logger, processGuid string, index int, metadata ssh.ConnMetadata) (*ssh.Permissions, error)
}