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

refactor!: Subject has been made immutable #1487

Merged
merged 13 commits into from
May 22, 2024
Merged

Conversation

dadrus
Copy link
Owner

@dadrus dadrus commented May 22, 2024

Related issue(s)

addresses #1317

Prepares the code to support pre-authentication stages

Checklist

  • I agree to follow this project's Code of Conduct.
  • I have read, and I am following this repository's Contributing Guidelines.
  • I have read the Security Policy.
  • I have referenced an issue describing the bug/feature request.
  • I have added tests that prove the correctness of my implementation.
  • I have updated the documentation.

Description

This PR introduces a breaking change and makes the Subject object immutable. That means it is not used to store results of any pipeline step any more. A new Outputs object has been introduced for that purpose instead.

Old Behavior

# rule
id: whatever
match:
  # match expression
execute:
  - authenticator: some_auth
  - contextualizer: some_data_fetcher # stored the results in Subject.Attribute.some_data_fetcher in the past
  - finalizer: create_header
    config:
      header:
         # access to the results from the "some_data_fetcher" step
         X-Some-Header: {{ .Subject.Attribute.some_data_fetcher | quote }}

New Behavior

# rule
id: whatever
match:
  # match expression
execute:
  - authenticator: some_auth
  - contextualizer: some_data_fetcher # stores now the results in Outputs.some_data_fetcher
  - finalizer: create_header
    config:
      header:
         # access to the results from the "some_data_fetcher" step
         X-Some-Header: {{ .Outputs.some_data_fetcher | quote }}

Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 89.63%. Comparing base (55fb491) to head (e265c85).
Report is 2 commits behind head on main.

Files Patch % Lines
...nal/handler/envoyextauth/grpcv3/request_context.go 0.00% 4 Missing ⚠️
internal/handler/requestcontext/request_context.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1487   +/-   ##
=======================================
  Coverage   89.62%   89.63%           
=======================================
  Files         270      271    +1     
  Lines        9051     9075   +24     
=======================================
+ Hits         8112     8134   +22     
- Misses        694      699    +5     
+ Partials      245      242    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dadrus dadrus merged commit 6c4957f into main May 22, 2024
27 checks passed
@dadrus dadrus deleted the refactor/immutable_subject branch May 22, 2024 15:34
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

1 participant