-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ROUTER-890] Ability to skip safelisting enforcement via plugin
If safelisting is enabled, a `router_service` plugin can skip enforcement of the safelist (including the `require_id` check) by adding the key `apollo_persisted_queries::safelist::skip_enforcement` with value `true` to the request context. (This does not affect the logging of unknown operations by the `persisted_queries.log_unknown` option.) In cases where an operation would have been denied but is allowed due to the context key existing, the attribute `persisted_queries.safelist.enforcement_skipped` is set on the `apollo.router.operations.persisted_queries` metric with value true. This PR improves the testing of that metric as well. When writing the tests, I discovered that the `persisted_queries.safelist.rejected.unknown` attribute had its value set to `false` when the operation is denied but not logged, and to `true` when denied and logged. (You can also tell whether it is logged via the `persisted_queries.logged` attribute.) This dated to the creation of this metric in #3609 and seems to be a mistake. This PR normalizes this attribute to always be `true` if it is set. The metric was described as unstable when released in v1.28.1, so this seems reasonable.
- Loading branch information
Showing
6 changed files
with
315 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.