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

Consolidate & expand connectors headers validations #6278

Merged
merged 8 commits into from
Nov 19, 2024

Conversation

dylan-apollo
Copy link
Member

Before this PR, there were four separate validations for headers:

  1. At composition, header names and values are parsed to check for validity. This also checks whether to and from are both set or just one of them, and disallows duplicate headers.
  2. When the router loads a schema, it has a separate, less thorough check for argument validity on @source
  3. When the router loads a schema, it also checks @connect headers in a similar code path, but one that didn't allow single header objects yet.
  4. At runtime, certain header names are disallowed in some contexts

This PR unifies the base definition of what's considered a valid headers argument, catching disallowed header names at composition time and at router schema load (so there's no need to validate again at runtime).

Improves the locations of a number of validations, pointing at the specific header that errored rather than the whole headers block.

@dylan-apollo dylan-apollo requested review from nicholascioli and a team as code owners November 18, 2024 23:51
@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Nov 18, 2024

✅ Docs Preview Ready

No new or changed pages found.

@router-perf
Copy link

router-perf bot commented Nov 18, 2024

CI performance tests

  • connectors-const - Connectors stress test that runs with a constant number of users
  • const - Basic stress test that runs with a constant number of users
  • demand-control-instrumented - A copy of the step test, but with demand control monitoring and metrics enabled
  • demand-control-uninstrumented - A copy of the step test, but with demand control monitoring enabled
  • enhanced-signature - Enhanced signature enabled
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • extended-reference-mode - Extended reference mode enabled
  • large-request - Stress test with a 1 MB request payload
  • no-tracing - Basic stress test, no tracing
  • reload - Reload test over a long period of time at a constant rate of users
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • step-local-metrics - Field stats that are generated from the router rather than FTV1
  • step-with-prometheus - A copy of the step test with the Prometheus metrics exporter enabled
  • step - Basic stress test that steps up the number of users over time
  • xlarge-request - Stress test with 10 MB request payload
  • xxlarge-request - Stress test with 100 MB request payload

@dylan-apollo dylan-apollo changed the title Dylan/validate reserved headers after merge Consolidate & expand connectors headers validations Nov 18, 2024
Copy link
Contributor

@pubmodmatt pubmodmatt left a comment

Choose a reason for hiding this comment

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

Looks good overall! Just one change requested on a new header error type.

apollo-federation/src/sources/connect/variable.rs Outdated Show resolved Hide resolved
apollo-federation/src/sources/connect/header.rs Outdated Show resolved Hide resolved
@dylan-apollo dylan-apollo enabled auto-merge (squash) November 19, 2024 17:44
@dylan-apollo dylan-apollo merged commit 22ee12f into next Nov 19, 2024
12 of 13 checks passed
@dylan-apollo dylan-apollo deleted the dylan/validate-reserved-headers-after-merge branch November 19, 2024 17:53
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