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

Service config redux #2

Open
wants to merge 1 commit into
base: e06013
Choose a base branch
from
Open

Service config redux #2

wants to merge 1 commit into from

Conversation

david-perez
Copy link
Owner

No description provided.

@david-perez david-perez changed the title Service config Service config redux Jul 24, 2023
david-perez added a commit to smithy-lang/smithy-rs that referenced this pull request Oct 25, 2023
This is a pared-down version of #2809.

This is the code-generated version of the
david-perez/smithy-rs-service-config#2 POC.

This introduces a code-generated `Config` object which is provided to
the service builder constructor via `PokemonService::builder(config:
Config)`. This will displace the current `builder_without_plugins` and
`builder_with_plugins`, deprecating them. We will eventually remove
them.

The motivation is to have a single place where to register plugins and
layers. Smithy traits can leverage this object to inject methods that
can apply plugins and layers. For example, an `@authorization` trait
implementer could vend a smithy-rs decorator that pre-applied an
authorization plugin inside the `Config` object, possibly exposing a
method to pass in any runtime arguments needed to configure the
middleware.
github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this pull request Oct 30, 2023
This is a pared-down version of #2809.

This is the code-generated version of the
david-perez/smithy-rs-service-config#2 POC.

This introduces a code-generated `PokemonServiceConfig` object which is
provided to the service builder constructor via
`PokemonService::builder(config: PokemonServiceConfig)`. This will
displace the
current `builder_without_plugins` and `builder_with_plugins`,
deprecating them.
We will eventually remove them.

The motivation is to have a single place where to register plugins and
layers.
Smithy traits can leverage this object to inject methods that can apply
plugins
and layers. For example, an `@authorization` trait implementer could
vend a
smithy-rs decorator that pre-applied an authorization plugin inside the
`${serviceName}Config` object, possibly exposing a method to pass in any
runtime arguments needed to configure the middleware.

## Checklist
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
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.

1 participant