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

Add Route Select for Rate Limit #316

Merged
merged 3 commits into from
Jan 12, 2024
Merged

Conversation

jsmolar
Copy link
Contributor

@jsmolar jsmolar commented Jan 4, 2024

This PR creates two new sets of objects:

The placement of these resources can be discussed as I was not 100% sure.
Tests will be added later to this PR.

Usage example:

   selector = RouteSelector(
        RouteMatch(
            path=HTTPPathMatch(type=MatchType.EXACT, value="/get"),
            headers=[HeadersMatch(name="header", value="value"), HeadersMatch(name="another", value="value")],
            query_params=[HTTPQueryParamsMatch(name="param", value="value")]
            method=HTTPMethod.GET,
        )
    )
    rate_limit.add_limit("multiple", [limit], route_selectors=[selector])

testsuite/gateway/__init__.py Outdated Show resolved Hide resolved
testsuite/utils.py Outdated Show resolved Hide resolved
@jsmolar jsmolar force-pushed the rate_limit_auth branch 2 times, most recently from 3097eea to 6649ce0 Compare January 8, 2024 15:56
testsuite/gateway/gateway_api/route.py Outdated Show resolved Hide resolved
testsuite/gateway/gateway_api/route.py Outdated Show resolved Hide resolved
testsuite/gateway/__init__.py Outdated Show resolved Hide resolved
@jsmolar jsmolar requested a review from ficap January 11, 2024 13:27
Copy link
Contributor

@averevki averevki left a comment

Choose a reason for hiding this comment

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

LGTM. Is this a setup for tests in the feature PR, or do you want to also add them here?

testsuite/gateway/__init__.py Show resolved Hide resolved
@jsmolar jsmolar merged commit f763238 into Kuadrant:main Jan 12, 2024
2 checks passed
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.

4 participants