Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balrogadmin should return 401 instead 500 on AuthError #2605

Open
allan-silva opened this issue Jul 30, 2022 · 3 comments
Open

Balrogadmin should return 401 instead 500 on AuthError #2605

allan-silva opened this issue Jul 30, 2022 · 3 comments

Comments

@allan-silva
Copy link
Contributor

image

balrog-balrogadmin-1  | 2022-07-30 13:02:29,525 - ERROR - PID: 11 - Request: 140355487237408 - auslib.web.admin.base.ise#140: Caught ISE 500 error: AuthError({'code': 'authorization_header_missing', 'description': 'Authorization header is expected'}, 401)
balrog-balrogadmin-1  | Traceback (most recent call last):
balrog-balrogadmin-1  |   File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
balrog-balrogadmin-1  |     rv = self.dispatch_request()
balrog-balrogadmin-1  |   File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
balrog-balrogadmin-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
balrog-balrogadmin-1  |   File "/usr/local/lib/python3.9/site-packages/connexion/decorators/decorator.py", line 68, in wrapper
balrog-balrogadmin-1  |     response = function(request)
balrog-balrogadmin-1  |   File "/usr/local/lib/python3.9/site-packages/connexion/decorators/uri_parsing.py", line 149, in wrapper
balrog-balrogadmin-1  |     response = function(request)
balrog-balrogadmin-1  |   File "/usr/local/lib/python3.9/site-packages/connexion/decorators/validation.py", line 193, in wrapper
balrog-balrogadmin-1  |     response = function(request)
balrog-balrogadmin-1  |   File "/usr/local/lib/python3.9/site-packages/connexion/decorators/validation.py", line 396, in wrapper
balrog-balrogadmin-1  |     return function(request)
balrog-balrogadmin-1  |   File "/usr/local/lib/python3.9/site-packages/connexion/decorators/parameter.py", line 116, in wrapper
balrog-balrogadmin-1  |     return function(**kwargs)
balrog-balrogadmin-1  |   File "/app/src/auslib/web/admin/views/base.py", line 17, in decorated
balrog-balrogadmin-1  |     username = verified_userinfo(request, app.config["AUTH_DOMAIN"], app.config["AUTH_AUDIENCE"])["email"]
balrog-balrogadmin-1  |   File "/app/src/auslib/util/auth.py", line 58, in verified_userinfo
balrog-balrogadmin-1  |     access_token = get_access_token(request)
balrog-balrogadmin-1  |   File "/app/src/auslib/util/auth.py", line 26, in get_access_token
balrog-balrogadmin-1  |     raise AuthError({"code": "authorization_header_missing", "description": "Authorization header is expected"}, 401)
balrog-balrogadmin-1  | auslib.util.auth.AuthError: ({'code': 'authorization_header_missing', 'description': 'Authorization header is expected'}, 401)
balrog-balrogadmin-1  | [pid: 11|app: 0|req: 115/115] 172.20.0.6 () {48 vars in 741 bytes} [Sat Jul 30 13:02:28 2022] POST /api/emergency_shutoff => generated 107 bytes in 753 msecs (HTTP/1.1 500) 10 headers in 439 bytes (1 switches on core 0)
@MelakuAlehegn
Copy link
Contributor

Can I pick this issue @gabrielBusta @bhearsum @allan-silva . Confirming if the issue still exists.

@bhearsum
Copy link
Contributor

Can I pick this issue @gabrielBusta @bhearsum @allan-silva . Confirming if the issue still exists.

Sure - but FYI, this is a backend issue, not a frontend one.

@MelakuAlehegn
Copy link
Contributor

Can I pick this issue @gabrielBusta @bhearsum @allan-silva . Confirming if the issue still exists.

Sure - but FYI, this is a backend issue, not a frontend one.

Ok. Thanks for the info @bhearsum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants