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

Build services with a model-derived configuration object #2809

Closed
wants to merge 1 commit into from

Conversation

david-perez
Copy link
Contributor

Checklist

  • 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.

@david-perez david-perez added the server Rust server SDK label Jun 26, 2023
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

david-perez added a commit 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 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._
@jmklix jmklix closed this Apr 12, 2024
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.

2 participants