MCPcopy
hub / github.com/moul/sshportal / userType

Method userType

pkg/bastion/ssh.go:49–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47)
48
49func (c authContext) userType() userType {
50 switch {
51 case c.inputUsername == "healthcheck":
52 return userTypeHealthcheck
53 case c.inputUsername == c.user.Name || c.inputUsername == c.user.Email || c.inputUsername == "admin":
54 return userTypeShell
55 case strings.HasPrefix(c.inputUsername, "invite:"):
56 return userTypeInvite
57 default:
58 return userTypeBastion
59 }
60}
61
62func dynamicHostKey(db *gorm.DB, host *dbmodels.Host) gossh.HostKeyCallback {
63 return func(hostname string, remote net.Addr, key gossh.PublicKey) error {

Callers 4

PasswordAuthHandlerFunction · 0.95
PublicKeyAuthHandlerFunction · 0.95
ChannelHandlerFunction · 0.80
ShellHandlerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected