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

Add passthrough support for request headers in http requests from Oathkeeper. #752

Closed
mugioka opened this issue Jun 20, 2021 · 3 comments
Closed
Labels
feat New feature or request. stale Feedback from one or more authors is required to proceed.
Milestone

Comments

@mugioka
Copy link

mugioka commented Jun 20, 2021

Is your feature request related to a problem? Please describe.
I would like to be able to pass the x-request-id in the client request header for all HTTP requests from Oathkeeper (e.g. here).
This is because when using Jaeger, we can use x-request-id to aggregate spans and consider them as part of the same request.

Describe the solution you'd like

What I'm thinking is to have a wrapped method to create an HTTP client and pass the client request as an argument to it.

e.g

# The headers is assumed to be the key of the header you want to pass through from the oathkeeper configuration file.

func NewRequestPassThrogh(method, path url, body io.Reader, clientRequest *http.Request, headers []string) (*http.Request, error) {
    req, err := http.NewRequest(method, path, body)
    if err != nil {
        return nil, err
    }
   for i ,v := range headers {
       req.Header.Set(v, clientRequest.Header.Get(v))
    }
    
    return req, nil
}
@aeneasr
Copy link
Member

aeneasr commented Jun 21, 2021

This really sounds like a useful thing to have. There's a PR going on for adding self-signed CAs to all upstream requests (#744) so we could probably re-use the ideas introduced there to this PR. Would you be open to work on a PR for this? :)

@aeneasr aeneasr added the feat New feature or request. label Jun 21, 2021
@aeneasr aeneasr added this to the unplanned milestone Jun 21, 2021
@mugioka
Copy link
Author

mugioka commented Jun 22, 2021

Thanks for the reply.

OK, Once #744 is merged, I'll open the PR for this issue.

@github-actions
Copy link

Hello contributors!

I am marking this issue as stale as it has not received any engagement from the community or maintainers a year. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic.

Unfortunately, burnout has become a topic of concern amongst open-source projects.

It can lead to severe personal and health issues as well as opening catastrophic attack vectors.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone.

If this issue was marked as stale erroneous you can exempt it by adding the backlog label, assigning someone, or setting a milestone for it.

Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you!

Thank you 🙏✌️

@github-actions github-actions bot added the stale Feedback from one or more authors is required to proceed. label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request. stale Feedback from one or more authors is required to proceed.
Projects
None yet
Development

No branches or pull requests

2 participants