Refactor HTTP endpoints to be less complicated and follow better standards

This commit is contained in:
Dane Everitt
2020-10-31 10:04:20 -07:00
parent c4703f5541
commit 334b3e8d10
12 changed files with 203 additions and 245 deletions

View File

@@ -72,7 +72,7 @@ func validateCredentials(c api.SftpAuthRequest) (*api.SftpAuthResponse, error) {
f := log.Fields{"subsystem": "sftp", "username": c.User, "ip": c.IP}
log.WithFields(f).Debug("validating credentials for SFTP connection")
resp, err := api.NewRequester().ValidateSftpCredentials(c)
resp, err := api.New().ValidateSftpCredentials(c)
if err != nil {
if api.IsInvalidCredentialsError(err) {
log.WithFields(f).Warn("failed to validate user credentials (invalid username or password)")