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 pluginconfig #87

Draft
wants to merge 2 commits into
base: auth-response
Choose a base branch
from
Draft

Conversation

adam-cattermole
Copy link
Member

@adam-cattermole adam-cattermole commented Sep 20, 2024

Changes

  • Moved the domain field into the actions and renamed scope. This is the host for auth ContextExtensions and domain for ratelimit
  • Started using the data field in the actions and removed the data field in rules

Signed-off-by: Adam Cattermole <acatterm@redhat.com>
Signed-off-by: Adam Cattermole <acatterm@redhat.com>
pub conditions: Vec<Condition>,
//
pub data: Vec<DataItem>,
pub conditions: Vec<PatternExpression>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eguzki preferred retaining the name allOf over conditions here to be explicit that all conditions must apply. I myself am of the opinion that allOf suggests there's an anyOf so prefer conditions, so would like other thoughts

@adam-cattermole adam-cattermole marked this pull request as draft September 20, 2024 14:20
@adam-cattermole
Copy link
Member Author

adam-cattermole commented Sep 20, 2024

There's an issue with our design here, we've decoupled the rules from the data and actions, which makes some configurations impossible. We likely should nest the actions within the rules - if rule applies, actions performed with relevant data.

Examples:

  • Two rules, one for GET one for POST incrementing different limits
  • Two rules, one for GET one for POST, where we only perform auth on POST

These two examples are not possible with the current config, as either of the two rules would match, triggering all actions with all of the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant