()
| 47 | ) |
| 48 | |
| 49 | func (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 | |
| 62 | func dynamicHostKey(db *gorm.DB, host *dbmodels.Host) gossh.HostKeyCallback { |
| 63 | return func(hostname string, remote net.Addr, key gossh.PublicKey) error { |
no outgoing calls
no test coverage detected