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 PluginExt extension trait and FilterByOperationName plugin #1837

Merged
merged 6 commits into from
Oct 11, 2022

Conversation

hlbarber
Copy link
Contributor

@hlbarber hlbarber commented Oct 11, 2022

Motivation and Context

Customers may not want to apply a Plugin to every operation in their service. They might want to filter application by operation name.

Description

  • Refactor different Plugins to live in their own folders.
  • Add PluginExt extension trait, which has methods stack and filter_by_operation_name.
  • Add FilterByOperationName Plugin.

@@ -193,8 +193,11 @@ pub use upgrade::*;
///
/// The `L` is held and applied lazily during [`Upgradable::upgrade`].
pub struct Operation<S, L = Identity> {
inner: S,
layer: L,
/// The inner [`Service`](tower::Service) representing the logic of the operation.
Copy link
Contributor Author

@hlbarber hlbarber Oct 11, 2022

Choose a reason for hiding this comment

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

These have become public in order to allow Plugin developers access to them.

Is this too severe? Maybe we should document that the average customer should use the from_handler/from_service methods?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we want customers to be able to write their own plugins, along the same lines of what we are doing here with the filtering, I don't see many other options.

rust-runtime/aws-smithy-http-server/src/plugin/filter.rs Outdated Show resolved Hide resolved
@hlbarber hlbarber marked this pull request as ready for review October 11, 2022 11:03
@hlbarber hlbarber requested a review from a team as a code owner October 11, 2022 11:03
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 11, 2022
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Base automatically changed from harryb/anatomy-service to main October 11, 2022 18:40
@hlbarber hlbarber requested a review from a team as a code owner October 11, 2022 18:40
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@hlbarber hlbarber removed the request for review from a team October 11, 2022 22:39
@hlbarber hlbarber merged commit d879da1 into main Oct 11, 2022
@hlbarber hlbarber deleted the harryb/plugin-ext branch October 11, 2022 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Rust server SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants