Skip to content

api/gh/redis/redis should return 401 unauthorized and not 500 internal server error on bad auth requests #14

@filipecosta90

Description

@filipecosta90

Sample trace:

root@ip-172-31-57-104:~# tail -n 20 -f /var/opt/redis-benchmarks-specification-api.log
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.6/dist-packages/flask_httpauth.py", line 161, in decorated
    user = self.authenticate(auth, password)
  File "/usr/local/lib/python3.6/dist-packages/flask_httpauth.py", line 238, in authenticate
    return self.verify_password_callback(username, client_password)
  File "/usr/local/lib/python3.6/dist-packages/redis_benchmarks_specification/__api__/api.py", line 48, in verify_password
    auth_server_conn.ping()
  File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 1378, in ping
    return self.execute_command('PING')
  File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 901, in execute_command
    return self.parse_response(conn, command_name, **options)
  File "/usr/local/lib/python3.6/dist-packages/redis/client.py", line 915, in parse_response
    response = connection.read_response()
  File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 739, in read_response
    response = self._parser.read_response()
  File "/usr/local/lib/python3.6/dist-packages/redis/connection.py", line 484, in read_response
    raise response
redis.exceptions.AuthenticationError: Authentication required
18.116.150.197 - - [17/Aug/2021 17:14:29] "POST /api/gh/redis/redis/commits HTTP/1.1" 500 -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions