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

async_client: add support for filter state #33772

Merged
merged 1 commit into from Apr 29, 2024

Conversation

imccarten1
Copy link
Contributor

Commit Message: Add support for FilterState to AsyncClient
Additional Description: This allows upstream filters used in an AsyncClient request to access the FilterState.
Risk Level: low
Testing: Updated unit tests.
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

This allows upstream filters used in an AsyncClient request to access the FilterState.

Signed-off-by: Isabel Mccarten <imccarten@google.com>
auto filter_state =
std::make_shared<StreamInfo::FilterStateImpl>(StreamInfo::FilterState::LifeSpan::FilterChain);
filter_state->setData("test-filter", state_object, StreamInfo::FilterState::StateType::Mutable);
options.setFilterState(filter_state);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the idea that a client must explicitly set the filter state in-code? Or would it be something automatic for sidecalls like ext_authz?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is that the authors of individual filters would need to explicitly set the FilterState on an AsyncClient call if they want it in a similar way to how the DynamicMetadata is currently handled. I think this makes sense since whether or not it makes sense to apply the state/metadata from the main request to a side request may vary depending on the use case.

@imccarten1
Copy link
Contributor Author

/assign yanavlasov

Copy link

imccarten1 is not allowed to assign users.

🐱

Caused by: a #33772 (comment) was created by @imccarten1.

see: more, trace.

@yanavlasov yanavlasov self-assigned this Apr 25, 2024
@yanavlasov yanavlasov enabled auto-merge (squash) April 29, 2024 14:48
@yanavlasov yanavlasov merged commit 5451efd into envoyproxy:main Apr 29, 2024
52 of 53 checks passed
@imccarten1 imccarten1 deleted the async-client-filter-state branch April 30, 2024 13:32
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.

None yet

3 participants