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

Headers missing in webhook notification request #10566

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

strollo
Copy link
Contributor

@strollo strollo commented Jul 1, 2021

SUMMARY

The current request via webhook just uses default pre configured headers (with Agent/ContentType keys) by ignoring at all customer provided headers (self.headers).
Thus the OAuth authentication via Bearer cannot be implemented since custom headers are not sent to service so receiving Unauthorized response.

Solution is merging the default headers (get_awx_http_client_headers()) with custom ones (self.headers or {}).
Note: custom headers will override default ones in case of key clash (so on keys Agent/ContentType).

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • UI
AWX VERSION
19.2.0
devel
ADDITIONAL INFORMATION

Takes also into account a situation of a null header provided

self.headers or {}

At the request via webhook just uses default pre configured headers (with Agent/ContentType) by ignoring at all customer provided headers (self.headers).
Thus the OAuth authentication via Bearer cannot be implemented since custom headers are not sent to service so receiving Unauthorized response.

Solution is merging the default headers with custom ones (custom headers will override default ones in case of key clash).
@strollo strollo changed the title Update webhook_backend.py Headers missing in webhook notification request Jul 1, 2021
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

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

Successfully merging this pull request may close these issues.

4 participants