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

fix: add support for compressed hydrator. Closes #988 #1018

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mvanderlee
Copy link

Oathkeeper doesn't restrict the encoding it accepts when making the hydrator HTTP call. If the hydrator is configured with compression it will try to parse the compressed string directly as JSON and fail.

This PR restricts the accepted encoding types to gzip and deflate, and add the ability to handle those encodings.
I experimented with brotli as well, but that would require CGO, which seemed too big of a change.

Related issue(s)

#988

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

I've already deployed this fix in our production environment and it work.
Don't think we need to update any docs as this fixes a low level bug.

@mvanderlee mvanderlee changed the title Add support for compressed hydrator #988 fix: Add support for compressed hydrator. Closes #988 Sep 22, 2022
@mvanderlee mvanderlee changed the title fix: Add support for compressed hydrator. Closes #988 fix: add support for compressed hydrator. Closes #988 Sep 22, 2022
@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Merging #1018 (24aab25) into master (b5a13cc) will decrease coverage by 0.09%.
Report is 135 commits behind head on master.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #1018      +/-   ##
==========================================
- Coverage   78.06%   77.98%   -0.09%     
==========================================
  Files          83       83              
  Lines        3999     4010      +11     
==========================================
+ Hits         3122     3127       +5     
- Misses        598      604       +6     
  Partials      279      279              
Files Coverage Δ
pipeline/mutate/mutator_hydrator.go 64.28% <50.00%> (-1.81%) ⬇️

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

Successfully merging this pull request may close these issues.

None yet

2 participants