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

feat: pass only essential and configured headers to authenticator #952

Merged
merged 42 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f0cb78f
fix: added gzip support for cookie_session authenticator
gen1us2k Apr 11, 2022
6999a5f
fix: added proxy_headers config variable for authenticators
gen1us2k May 9, 2022
5b94457
fix: better design for forwardRequestToSessionStore
gen1us2k May 9, 2022
50f01b1
fix: better solution to convert array to map
gen1us2k May 10, 2022
85d391d
renamed field
gen1us2k May 13, 2022
0cceab9
added header package to improve readability
gen1us2k May 13, 2022
6cbc29a
fixed build
gen1us2k May 13, 2022
f4b9936
updated schema
gen1us2k May 13, 2022
4f5d8af
removed old test
gen1us2k May 13, 2022
5c35b6d
added tests
gen1us2k May 13, 2022
27e785a
better backwards compatibility
gen1us2k May 23, 2022
e456520
Merge branch 'master' into gzip_support
gen1us2k May 23, 2022
0a9c066
fix: added gzip support for cookie_session authenticator
gen1us2k Apr 11, 2022
9906ce4
fix: added proxy_headers config variable for authenticators
gen1us2k May 9, 2022
198902c
fix: better design for forwardRequestToSessionStore
gen1us2k May 9, 2022
134c9dc
fix: better solution to convert array to map
gen1us2k May 10, 2022
eea93ee
renamed field
gen1us2k May 13, 2022
3d4333d
added header package to improve readability
gen1us2k May 13, 2022
6f0982f
fixed build
gen1us2k May 13, 2022
8941f8b
updated schema
gen1us2k May 13, 2022
9417a30
removed old test
gen1us2k May 13, 2022
81c0fae
added tests
gen1us2k May 13, 2022
aeba3ce
better backwards compatibility
gen1us2k May 23, 2022
b671e8b
Update pipeline/authn/authenticator_cookie_session.go
gen1us2k May 30, 2022
f7f6da9
Merge
gen1us2k May 30, 2022
0ca5c51
Small refactoring
gen1us2k May 30, 2022
339e8e7
fix: Don't use maps anymore
gen1us2k Jun 9, 2022
affc702
Merge branch 'master' into gzip_support
gen1us2k Jun 9, 2022
0bbc5fd
Small fixes
gen1us2k Jun 10, 2022
da038f8
fixed test
gen1us2k Jun 10, 2022
690d766
Merge branch 'master' into gzip_support
gen1us2k Jun 21, 2022
ba19be3
chore: code review
aeneasr Jun 23, 2022
afaf5af
Remove header constants
gen1us2k Jun 23, 2022
fe4bd05
fixed tests. Check only canonical header names
gen1us2k Jun 23, 2022
5e16805
Merge branch 'master' into gzip_support
gen1us2k Jun 23, 2022
046422f
Drop header values
gen1us2k Jun 23, 2022
f2d31ea
Added tests for the cookie session authenticator
gen1us2k Jun 23, 2022
a19b283
Added test for token authenticator
gen1us2k Jun 23, 2022
c66ba2a
run prettifier
gen1us2k Jun 23, 2022
ab72681
Fixed linter
gen1us2k Jun 23, 2022
4b735e3
Drop dead headers
gen1us2k Jun 23, 2022
028c091
not canonical header
gen1us2k Jun 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker_compose/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mutators:
enabled: true
config:
headers:
X-User: '{{ print .Subject }}'
X-User: "{{ print .Subject }}"
noop:
enabled: true
id_token:
Expand Down
50 changes: 25 additions & 25 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
description: 'Create a bug report'
description: "Create a bug report"
labels:
- bug
name: 'Bug Report'
name: "Bug Report"
body:
- attributes:
value: "Thank you for taking the time to fill out this bug report!\n"
type: markdown
- attributes:
label: 'Preflight checklist'
label: "Preflight checklist"
options:
- label:
'I could not find a solution in the existing issues, docs, nor
discussions.'
"I could not find a solution in the existing issues, docs, nor
discussions."
required: true
- label:
"I agree to follow this project's [Code of
Expand All @@ -22,18 +22,18 @@ body:
Guidelines](https://github.com/ory/oathkeeper/blob/master/CONTRIBUTING.md)."
required: true
- label:
'This issue affects my [Ory Cloud](https://www.ory.sh/) project.'
"This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label:
'I have joined the [Ory Community Slack](https://slack.ory.sh).'
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
'I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53).'
"I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
- attributes:
description: 'A clear and concise description of what the bug is.'
label: 'Describe the bug'
placeholder: 'Tell us what you see!'
description: "A clear and concise description of what the bug is."
label: "Describe the bug"
placeholder: "Tell us what you see!"
id: describe-bug
type: textarea
validations:
Expand All @@ -47,28 +47,28 @@ body:
1. Run `docker run ....`
2. Make API Request to with `curl ...`
3. Request fails with response: `{"some": "error"}`
label: 'Reproducing the bug'
label: "Reproducing the bug"
id: reproduce-bug
type: textarea
validations:
required: true
- attributes:
description:
'Please copy and paste any relevant log output. This will be
"Please copy and paste any relevant log output. This will be
automatically formatted into code, so no need for backticks. Please
redact any sensitive information'
label: 'Relevant log output'
redact any sensitive information"
label: "Relevant log output"
render: shell
placeholder: |
log=error ....
id: logs
type: textarea
- attributes:
description:
'Please copy and paste any relevant configuration. This will be
"Please copy and paste any relevant configuration. This will be
automatically formatted into code, so no need for backticks. Please
redact any sensitive information!'
label: 'Relevant configuration'
redact any sensitive information!"
label: "Relevant configuration"
render: yml
placeholder: |
server:
Expand All @@ -77,14 +77,14 @@ body:
id: config
type: textarea
- attributes:
description: 'What version of our software are you running?'
description: "What version of our software are you running?"
label: Version
id: version
type: input
validations:
required: true
- attributes:
label: 'On which operating system are you observing this issue?'
label: "On which operating system are you observing this issue?"
options:
- Ory Cloud
- macOS
Expand All @@ -95,19 +95,19 @@ body:
id: operating-system
type: dropdown
- attributes:
label: 'In which environment are you deploying?'
label: "In which environment are you deploying?"
options:
- Ory Cloud
- Docker
- 'Docker Compose'
- 'Kubernetes with Helm'
- "Docker Compose"
- "Kubernetes with Helm"
- Kubernetes
- Binary
- Other
id: deployment
type: dropdown
- attributes:
description: 'Add any other context about the problem here.'
description: "Add any other context about the problem here."
label: Additional Context
id: additional
type: textarea
32 changes: 16 additions & 16 deletions .github/ISSUE_TEMPLATE/DESIGN-DOC.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description:
'A design document is needed for non-trivial changes to the code base.'
"A design document is needed for non-trivial changes to the code base."
labels:
- rfc
name: 'Design Document'
name: "Design Document"
body:
- attributes:
value: |
Expand All @@ -18,11 +18,11 @@ body:
after code reviews, and your pull requests will be merged faster.
type: markdown
- attributes:
label: 'Preflight checklist'
label: "Preflight checklist"
options:
- label:
'I could not find a solution in the existing issues, docs, nor
discussions.'
"I could not find a solution in the existing issues, docs, nor
discussions."
required: true
- label:
"I agree to follow this project's [Code of
Expand All @@ -33,18 +33,18 @@ body:
Guidelines](https://github.com/ory/oathkeeper/blob/master/CONTRIBUTING.md)."
required: true
- label:
'This issue affects my [Ory Cloud](https://www.ory.sh/) project.'
"This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label:
'I have joined the [Ory Community Slack](https://slack.ory.sh).'
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
'I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53).'
"I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
- attributes:
description: |
This section gives the reader a very rough overview of the landscape in which the new system is being built and what is actually being built. This isn’t a requirements doc. Keep it succinct! The goal is that readers are brought up to speed but some previous knowledge can be assumed and detailed info can be linked to. This section should be entirely focused on objective background facts.
label: 'Context and scope'
label: "Context and scope"
id: scope
type: textarea
validations:
Expand All @@ -53,7 +53,7 @@ body:
- attributes:
description: |
A short list of bullet points of what the goals of the system are, and, sometimes more importantly, what non-goals are. Note, that non-goals aren’t negated goals like “The system shouldn’t crash”, but rather things that could reasonably be goals, but are explicitly chosen not to be goals. A good example would be “ACID compliance”; when designing a database, you’d certainly want to know whether that is a goal or non-goal. And if it is a non-goal you might still select a solution that provides it, if it doesn’t introduce trade-offs that prevent achieving the goals.
label: 'Goals and non-goals'
label: "Goals and non-goals"
id: goals
type: textarea
validations:
Expand All @@ -65,7 +65,7 @@ body:
The design doc is the place to write down the trade-offs you made in designing your software. Focus on those trade-offs to produce a useful document with long-term value. That is, given the context (facts), goals and non-goals (requirements), the design doc is the place to suggest solutions and show why a particular solution best satisfies those goals.

The point of writing a document over a more formal medium is to provide the flexibility to express the problem set at hand in an appropriate manner. Because of this, there is no explicit guidance for how to actually describe the design.
label: 'The design'
label: "The design"
id: design
type: textarea
validations:
Expand All @@ -74,21 +74,21 @@ body:
- attributes:
description: |
If the system under design exposes an API, then sketching out that API is usually a good idea. In most cases, however, one should withstand the temptation to copy-paste formal interface or data definitions into the doc as these are often verbose, contain unnecessary detail and quickly get out of date. Instead focus on the parts that are relevant to the design and its trade-offs.
label: 'APIs'
label: "APIs"
id: apis
type: textarea

- attributes:
description: |
Systems that store data should likely discuss how and in what rough form this happens. Similar to the advice on APIs, and for the same reasons, copy-pasting complete schema definitions should be avoided. Instead focus on the parts that are relevant to the design and its trade-offs.
label: 'Data storage'
label: "Data storage"
id: persistence
type: textarea

- attributes:
description: |
Design docs should rarely contain code, or pseudo-code except in situations where novel algorithms are described. As appropriate, link to prototypes that show the implementability of the design.
label: 'Code and pseudo-code'
label: "Code and pseudo-code"
id: pseudocode
type: textarea

Expand All @@ -101,7 +101,7 @@ body:
On the other end are systems where the possible solutions are very well defined, but it isn’t at all obvious how they could even be combined to achieve the goals. This may be a legacy system that is difficult to change and wasn’t designed to do what you want it to do or a library design that needs to operate within the constraints of the host programming language.

In this situation you may be able to enumerate all the things you can do relatively easily, but you need to creatively put those things together to achieve the goals. There may be multiple solutions, and none of them are really great, and hence such a document should focus on selecting the best way given all identified trade-offs.
label: 'Degree of constraint'
label: "Degree of constraint"
id: constrait
type: textarea

Expand Down
30 changes: 15 additions & 15 deletions .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description:
'Suggest an idea for this project without a plan for implementation'
"Suggest an idea for this project without a plan for implementation"
labels:
- feat
name: 'Feature Request'
name: "Feature Request"
body:
- attributes:
value: |
Expand All @@ -11,11 +11,11 @@ body:
If you already have a plan to implement a feature or a change, please create a [design document](https://github.com/aeneasr/gh-template-test/issues/new?assignees=&labels=rfc&template=DESIGN-DOC.yml) instead if the change is non-trivial!
type: markdown
- attributes:
label: 'Preflight checklist'
label: "Preflight checklist"
options:
- label:
'I could not find a solution in the existing issues, docs, nor
discussions.'
"I could not find a solution in the existing issues, docs, nor
discussions."
required: true
- label:
"I agree to follow this project's [Code of
Expand All @@ -26,18 +26,18 @@ body:
Guidelines](https://github.com/ory/oathkeeper/blob/master/CONTRIBUTING.md)."
required: true
- label:
'This issue affects my [Ory Cloud](https://www.ory.sh/) project.'
"This issue affects my [Ory Cloud](https://www.ory.sh/) project."
- label:
'I have joined the [Ory Community Slack](https://slack.ory.sh).'
"I have joined the [Ory Community Slack](https://slack.ory.sh)."
- label:
'I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53).'
"I am signed up to the [Ory Security Patch
Newsletter](https://ory.us10.list-manage.com/subscribe?u=ffb1a878e4ec6c0ed312a3480&id=f605a41b53)."
id: checklist
type: checkboxes
- attributes:
description:
'Is your feature request related to a problem? Please describe.'
label: 'Describe your problem'
"Is your feature request related to a problem? Please describe."
label: "Describe your problem"
placeholder:
"A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]"
Expand All @@ -50,28 +50,28 @@ body:
Describe the solution you'd like
placeholder: |
A clear and concise description of what you want to happen.
label: 'Describe your ideal solution'
label: "Describe your ideal solution"
id: solution
type: textarea
validations:
required: true
- attributes:
description: "Describe alternatives you've considered"
label: 'Workarounds or alternatives'
label: "Workarounds or alternatives"
id: alternatives
type: textarea
validations:
required: true
- attributes:
description: 'What version of our software are you running?'
description: "What version of our software are you running?"
label: Version
id: version
type: input
validations:
required: true
- attributes:
description:
'Add any other context or screenshots about the feature request here.'
"Add any other context or screenshots about the feature request here."
label: Additional Context
id: additional
type: textarea
2 changes: 1 addition & 1 deletion .github/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
todo:
keyword: '@todo'
keyword: "@todo"
label: todo
17 changes: 11 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ If you're unsure about any of them, don't hesitate to ask. We're here to help!
-->

- [ ] I have read the [contributing guidelines](../blob/master/CONTRIBUTING.md).
- [ ] I have referenced an issue containing the design document if my change introduces a new feature.
- [ ] I am following the [contributing code guidelines](../blob/master/CONTRIBUTING.md#contributing-code).
- [ ] I have referenced an issue containing the design document if my change
introduces a new feature.
- [ ] I am following the
[contributing code guidelines](../blob/master/CONTRIBUTING.md#contributing-code).
- [ ] I have read the [security policy](../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 [[email protected]](mailto:[email protected])) from the
maintainers to push the changes.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] 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
[[email protected]](mailto:[email protected])) 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](https://github.com/ory/docs).

## Further Comments
Expand Down
Loading