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!: values property for endpoint teplating must be configured on the mechanism conf level #746

Merged
merged 9 commits into from
Jun 29, 2023

Conversation

dadrus
Copy link
Owner

@dadrus dadrus commented Jun 29, 2023

Related issue(s)

related to #686

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 makes the values property available in some mechanisms for endpoint path and query templating configurable on the config level of the particular mechanism and not at the level of the endpoint property any more. Same is true for usage in rules.

Old configuration:

 id: opa
 type: generic
 config:
   endpoint:
     url: http://opa:8181/v1/data/articles/{{ .Values.policy }}
     values:  # this property including its children has been moved one level up
       policy: can_read
   payload: |
     { 
        "user": {{ quote .Subject.ID }} 
     }

New configuration:

 id: opa
 type: generic
 config:
   endpoint:
     url: http://opa:8181/v1/data/articles/{{ .Values.policy }}
   values:  # now on the top level
     policy: can_read
   payload: |
     { 
        "user": {{ quote .Subject.ID }} 
     }

NOTE: This is a breaking change

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #746 (7362123) into main (e5a363c) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #746      +/-   ##
==========================================
- Coverage   89.60%   89.59%   -0.02%     
==========================================
  Files         215      215              
  Lines        9238     9227      -11     
==========================================
- Hits         8278     8267      -11     
  Misses        767      767              
  Partials      193      193              
Impacted Files Coverage Δ
internal/rules/mechanisms/values/values.go 100.00% <ø> (ø)
internal/endpoint/endpoint.go 93.33% <100.00%> (ø)
internal/endpoint/noop_renderer.go 100.00% <100.00%> (ø)
internal/endpoint/renderer.go 100.00% <100.00%> (ø)
...mechanisms/authenticators/generic_authenticator.go 92.27% <100.00%> (-0.06%) ⬇️
.../rules/mechanisms/authorizers/remote_authorizer.go 83.27% <100.00%> (-0.23%) ⬇️
...chanisms/contextualizers/generic_contextualizer.go 86.80% <100.00%> (-0.26%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dadrus dadrus merged commit 9809fe4 into main Jun 29, 2023
@dadrus dadrus deleted the refactor/values_under_mechanism_conf branch June 29, 2023 21:06
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.

1 participant