(conn ssh.ConnMetadata)
| 79 | } |
| 80 | |
| 81 | func (d *SftpDriver) NoClientAuth(conn ssh.ConnMetadata) (*ssh.Permissions, error) { |
| 82 | if conn.User() != "guest" { |
| 83 | return nil, errors.New("only guest is allowed to login without authorization") |
| 84 | } |
| 85 | guest, err := op.GetGuest() |
| 86 | if err != nil { |
| 87 | return nil, err |
| 88 | } |
| 89 | if guest.Disabled || !guest.CanFTPAccess() { |
| 90 | return nil, errors.New("user is not allowed to access via SFTP") |
| 91 | } |
| 92 | return nil, nil |
| 93 | } |
| 94 | |
| 95 | func (d *SftpDriver) PasswordAuth(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error) { |
| 96 | ip := conn.RemoteAddr().String() |
nothing calls this directly
no test coverage detected