Skip to content

Commit 137b22d

Browse files
committed
Update functional test cases
1 parent 3bb040e commit 137b22d

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

docs/proposals/authentication-filter.md

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -825,42 +825,45 @@ This can use the status `RouteConditionPartiallyInvalid` defined in the Gateway
825825
- Unit tests
826826
- Functional tests to validate behavioural scenarios when referencing filters in different combinations.
827827

828-
### Functional Test Cases
828+
## Functional Test Cases
829829

830-
The keyword "resolved" is used to refer to a filter that the controller has found, and matches the reference of the route rule.
831-
For a filter to be considered "resolved", it must:
830+
### Valid scenarios
832831

833-
1. Exist in the same namespace as the HTTP/GRPCRoute
834-
2. The group and kind referenced must match
832+
This sections covers deployment scenarios that are considered valid
835833

836-
For each test, we aim to ensure the NGINX configuration is always correct for each scenario.
834+
- Single route rule with a single path in an HTTPRoute/GRPCRoute referencing a valid AuthenticationFilter
835+
- Single route rule with two or more paths in an HTTPRoute/GRPCRoute referencing a valid AuthenticationFilter
836+
- Two or more route rules each with a single path in an HTTPRoute/GRPCRoute referencing a valid AuthenticationFilter
837+
- Two or more route rules each with two or more paths in an HTTPRoute/GRPCRoute referencing a valid AuthenticationFilter
838+
- Two or more HTTPRoute/GRPCRoute resource each with single route rule with a single path referencing a valid AuthenticationFilter.
839+
- Two or more HTTPRoute/GRPCRoute resource each with single route rule, each with two or more paths referencing a valid AuthenticationFilter.
840+
- Two or more HTTPRoute/GRPCRoute resource each with two or more route rules each with a single path referencing a valid AuthenticationFilter.
837841

838-
Invalid resolved filter scenarios:
842+
### Invalid scenarios
839843

840-
- Resolved filter that references a secret that does not exist
841-
- Expected outcome: Filter is marked as Invalid. The route rule that references this filter is also marked as Invalid
842-
- Resolved filter that references a secret with the incorrect data key
843-
- Expected outcome: Filter is marked as Invalid. The route rule that references this filter is also marked as Invalid
844+
This sections covers deployment scenarios that are considered valid
844845

845-
Valid reference scenarios:
846+
- Single route rule with a single path in an HTTPRoute/GRPCRoute referencing an invalid AuthenticationFilter
847+
- Single route rule with two or more paths in an HTTPRoute/GRPCRoute referencing an invalid AuthenticationFilter
848+
- Two or more route rules each with a single path in an HTTPRoute/GRPCRoute referencing an invalid AuthenticationFilter
849+
- Two or more route rules each with two or more paths in an HTTPRoute/GRPCRoute referencing an invalid AuthenticationFilter
850+
- Two or more HTTPRoute/GRPCRoute resource each with single route rule with a single path referencing an invalid AuthenticationFilter.
851+
- Two or more HTTPRoute/GRPCRoute resource each with single route rule, each with two or more paths referencing an invalid AuthenticationFilter.
852+
- Two or more HTTPRoute/GRPCRoute resource each with two or more route rules each with a single path referencing an invalid AuthenticationFilter.
853+
- Two or more route rules each with a single path in an HTTPRoute/GRPCRoute, where one rule references a valid AuthenticationFilter, and the other references an invalid AuthenticationFilter.
854+
- Two or more route rules each with two or more paths in an HTTPRoute/GRPCRoute where one rule references a valid AuthenticationFilter, and the other references an invalid AuthenticationFilter.
855+
- Two or more valid or invalid AuthenticationFilters referenced in a route rule.
846856

847-
- Resolved filter referenced by a single route rule within a single HTTP/GRPCRoute
848-
- Expected outcome: Requests to this route rule will successfully process authentication requests
849-
- Resolved filter referenced by multiple route rules within a single HTTP/GRPCRoute
850-
- Expected outcome: Requests to all route rules referencing the filter successfully process authentication requests
851-
- Resolved filter referenced by rules in multiple HTTP/GRPCRoutes
852-
- Expected outcome: Requests to all route rules across each HTTP/GRPCRoute successfully process authentication requests
857+
### Invalid AuthenticationFilter scenarios
853858

854-
Invalid reference scenarios:
859+
This section covers configuation scenarios for an AuthenticationFilter resource that would be considered invalid
855860

856-
- Resolved filter referenced multiple times in a single route rule within a single HTTP/GRPCRoute
857-
- Expected outcome: The route rule referencing multiple filters will be marked as Invalid
858-
- Resolved filter referenced multiple times by multiple route rules within a single HTTP/GRPCRoute
859-
- Expected outcome: Each route rule referencing multiple filters will be marked as Invalid
860-
- Unresolved filter referenced by a single route rule within a single HTTP/GRPCRoute
861-
- Expected outcome: The route rule referencing multiple filters will be marked as Invalid
862-
- Unresolved filter referenced by multiple route rules within a single HTTP/GRPCRoute
863-
- Expected outcome: Each route rule referencing multiple filters will be marked as Invalid
861+
- An AuthenticationFilter deployed with an empty `Realm` value
862+
- An AuthenticationFilter deployed with an empty `secretRef.Name` value
863+
- An AuthenticationFilter referencing a secret that does not exist
864+
- An AuthenticationFilter referencing a secret in a different namespace
865+
- An AuthenticationFilter referencing a secret with an incorrect type (e.g Opaque)
866+
- An AuthenticationFilter referencing a secret with an incorrect keyd
864867

865868
## Security Considerations
866869

0 commit comments

Comments
 (0)