* Split endpoint resolution middleware into two parts & refactor endpoint generation
* Endpoints 2.0 Integration pre-work
This PR does a 3 bits of pre-work ahead of ep2 integration:
1. Split endpoint resolution into two separate middlewares:
1. A smithy native middleware that applies URI and headers
2. An AWS middleware that applies the auth schemes
2. Add vendorParams support to the ProtocolTestGenerator so that protocol tests can insert a region.
3. Simplify endpoint resolution logic by allowing `make_operation` to fail when an endpoint cannot be resolved.
* Back out previous change to insert endpoint directly into the bag
* backout changes to property bag
* Update changelog & add more docs
* Fix AWS test
* Fix test
* Link to super from Handler and OperationService
* Note that structure documentation is from model
* Don't refer to ZSTs in operation_shape.rs opener
* Re-export everything from service to root
* Add reference to root documentation on service
* Fix spelling of MissingOperationsError
* #[doc(hidden)] for opaque_future
* Rename from-parts.md to from_parts.md
* Fix Connected link
* Use S type parameter and service as variable name
* Remove MissingOperation dead code
* Remove Operation header from operation.rs
* Remove reference to closures
* Document ConnectInfo<T> .0
* Add BoxBody documentation
* Rephrase operation.rs documentation
* Reference PluginPipeline from PluginStack
* Move the BoxBody documentation
* Document Plugin associated types
* Add example implementation for Plugin
* Link to plugin module from Plugin
* Improve FromParts/FromRequest documentation
* Remove links to doc(hidden) RuntimeError
* Add link from Upgradable to operation module
* Implement RFC 23, with the exception of PluginBuilder
* Update documentation.
* Avoid star re-exports.
* Elide implementation details in `Upgradable`.
* Update wording in docs to avoid personal pronouns.
* Update `Upgradable`'s documentation.
* Template the service builder name.
* Template MissingOperationsError directly.
* Code-generate an array directly.
* Sketch out the implementation of `PluginPipeline`.
Remove `PluginExt`.
Add a public constructor for `FilterByOperationName`.
* Ask for a `PluginPipeline` as input for the generated builder.
* Rename `add` to `push`.
* Remove Pluggable.
Rename `composer` module to `pipeline`.
* Remove all mentions of `Pluggable` from docs and examples.
* Fix punctuation.
* Rename variable from `composer` to `pipeline` in doc examples.
* Add a free-standing function for filtering.
* Rename.
* Rename.
* Update design/src/server/anatomy.md
Co-authored-by: david-perez <d@vidp.dev>
* Use `rust` where we do not need templating.
* Remove unused variable.
* Add `expect` message to point users at our issue board in case a panic slips through.
* Typo.
* Update `expect` error message.
* Refactor the `for` loop in ``requestSpecMap` into an `associateWith` call.
* Remove unnecessary bound - since `new` is private, the condition is already enforced via `filter_by_operation_name`.
* Use `Self` in `new`.
* Rename `inner` to `into_inner`
* Rename `concat` to `append` to correctly mirror Vec's API terminology.
* Fix codegen to use renamed method.
* Cut down the public API surface to key methods for a sequence-like interface.
* Add a note about ordering.
* Add method docs.
* Add Default implementation.
* Fix new pokemon bin example.
* Fix new pokemon bin example.
* Fix code-generated builder.
* Fix unresolved symbolProvider.
* Assign the `expect` error message to a variable.
* Do not require a PluginPipeline as input to `builder_with_plugins`.
* Reverse plugin application order.
* Upgrade documentation.
* Add a test to verify that plugin layers are executed in registration order.
* Add license header.
* Update middleware.md
* Typo.
* Fix more builder() calls.
Co-authored-by: david-perez <d@vidp.dev>
* Implement RFC 23, with the exception of PluginBuilder
* Update documentation.
* Elide implementation details in `Upgradable`.
* Update wording in docs to avoid personal pronouns.
* Update `Upgradable`'s documentation.
* Template the service builder name.
* Template MissingOperationsError directly.
* Code-generate an array directly.
* Update design/src/server/anatomy.md
Co-authored-by: david-perez <d@vidp.dev>
* Use `rust` where we do not need templating.
* Remove unused variable.
* Add `expect` message to point users at our issue board in case a panic slips through.
* Typo.
* Update `expect` error message.
* Refactor the `for` loop in ``requestSpecMap` into an `associateWith` call.
* Fix new pokemon bin example.
* Fix new pokemon bin example.
* Fix unresolved symbolProvider.
* Assign the `expect` error message to a variable.
* Omit additional generic parameters in Upgradable when it's first introduced.
Co-authored-by: david-perez <d@vidp.dev>
* RFC draft.
* Fix checkbox.
* Briefly describe the strategy in the `Overview` section.
* Add setter snippet
* Dive deeper into alternative mechanisms for scoping plugins.
* Add more changes.
* Fix snippet.
* Elaborate on type erasure.
* Remove dangling footnote.
* Fix common type.
* Add more caveats.
* Update the first approach for lazy type erasure
* Fix backtick fences to render code block
* Render list as a list instead of a code block.
* Indent further to get nested code block.
* Remove `ignore` descriptors.
* Add documentation covering instrumentation approaches for Smithy Rust.
* Tweak the logging in the Pokemon service to better exemplify instrumentation.
* Remove `TraceLayer` which violates sensitivity contract.
* Switch to [Pretty](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/format/struct.Pretty.html) logs to better showcase the outputs.
* Update [Logging in the Presence of Sensitive Data](https://github.com/awslabs/smithy-rs/pull/1536) checklist.
* Rename `logging` module to `instrumentation` to improve coherence across struct names and documentation.
* Docs: generation of Pokemon service
This is an overview of the Pokémon service. It describes:
* How a smithy-rs customer uses the vanilla SDK and writes their business logic
* What the runtime is and how code is generated
* The folder structure of the project
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* Fix retry for native Smithy clients
* Treat `SdkError::ResponseError` as a retryable transient failure
* Rename `ClassifyResponse` to `ClassifyRetry`
* Rename 'policy' to 'classifier' in AWS SDK public API
* Rename `AwsResponseClassifier` to `AwsResponseRetryClassifier`
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
* Add `ServerProtocol` interface to allow for server side protocol specific methods.
* Make public the structs merged in https://github.com/awslabs/smithy-rs/pull/1679.
* Add `ServerOperationGenerator`, which generates a ZST and implements `OperationShape` on it.
* Add `ServerServiceGeneratorV2`, which generates the service newtype around a router and a service builder.
* Add `hidden` argument to `RustModule` which allows modules to be marked with `#[doc(hidden)]`.
* Add `BuildModifier` trait to provide a common interface for extending service builders.
* Add `Upgradable` trait to simplifying bounds when upgrading from an `Operation` to a HTTP service.
* Add `FromRequest`, `FromParts`, and `IntoResponse` implementations.
* Make `RoutingService` accept general body types `B` for the inner services `http::Response<B>`.
* Use new service builder in protocol tests.
feature: customizable operations
update: CHANGELOG.next.toml
update: RFC0017
update: add IntelliJ idea folder to .gitignore
add: GenericsGenerator with tests and docs
add: rustTypeParameters helper fn with tests and docs
add: RetryPolicy optional arg to FluentClientGenerator
move: FluentClientGenerator into its own file
* Add `MakeFmt` trait which modifies `Display`/`Debug` implementations.
* Add `http` wrappers which modify the `Debug` and `Display` implementations based on closures marking sensitivity. Each wrapper has an associated `MakeFmt` impl.
* Add `InstrumentOperation` [tower::Service](https://docs.rs/tower/latest/tower/trait.Service.html) which logs requests and responses. Accepts a `MakeFmt` for each potentially sensitive component of the request/response.
* Add [ServerHttpSensitivityGenerator.kt](https://github.com/awslabs/smithy-rs/compare/harryb/add-logging?expand=1#diff-a7ad7f28d152bba6f2a63f3bde498582d91c8f7ab9c2de0c7f4494d6fd1c02ff) which generates marker closures from models.
* Apply `InstrumentationOperation` to the `OperationHandler` using `MakeFmt`s using the marker closures.
Co-authored-by: Matteo Bigoi <1781140+crisidev@users.noreply.github.com>
* Support server event streams
* Rename EventStreamInput to EventStreamSender
* Custom event stream errors
* EventStreamSender and Receiver are parametrized also on event stream error types
* Pokemon service model updated
* Pokemon server event handler
* Pokemon client to test event streams
* EventStreamDecorator to make optional using SigV4 signing
* Use forInlineFun for all errors
Closes: #1157
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* add: RFC for supporting flexible checksums
add: link to RFC0016 in SUMMARY.md
fix: too many zeroes in RFC filenames
* update: sigv4 update section language
* update: RFC overview
remove: arbitrary chunk size limit
* update: RFC code to be safe from num conversion panics
* add: contributing docs overview page
add: article on difficulties Zelda encountered while implementing streaming checksums
update: SUMMARY.md table of contents
add: link to contributor design docs in CONTRIBUTING.md
* in-progress draft of features RFC
* add: info on default feature functionality change
* Update design/src/rfcs/rfc0009_using_features_responsibly.md
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* rename: RFC filename
add: rfc to summary page
remove: TODO section
* update: design summary ToC
remove: default feature example
* fix: RFC numbers in SUMMARY ToC
* fix: bad link
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* add: initial draft of bytestream callback RFC
* add: builder-style method
* update: remove callback insert method in favor of builder method
update: Arc callbacks instead of boxing them
remove: most bounds from ByteStreamReadCallback trait
add: PartialEq/Eq impl for Inner that disregards callback list
* update: RFC with SdkBody impl
update: RFC with checksum callback example
* update: respond to PR comments
* update: callback impls
* remove: Sync bounds from callback traits
* update: consolidate and simplify callback API
* fix: leftover terminology
* Add Support for Paginators
This commit adds pagination support for both clients. It does this via the `FnStream` abstraction which combines a rendezvous-channel with a closure to produce a stream. When the stream is polled, the underlying closure is polled to advance the computation which then pushes data into the channel.
Two paginators are generated:
1. `.paginate()` which produces a stream of `Result<Page, Err>`
2. `.paginate().items()` which produces a stream of `Result<Item, Err>` where items are flattened from the individual pages. This uses `TryFlatMap` to support conveniently generating a flat page iterator.
In addition, docs are generated to point customers towards the paginators.
* Add RFC, more tests
* backout unrelated changes
* Fix paginators for glacier
* Fix clippy error
* Add test for paginators that point to maps & fix apigateway paginator
* Fix docs
* remove extraeneous println
* Fix DynamoDB examples
* Disallow paginating operations with the idempotency token trait
* Apply suggestions from code review
misc typos / cleanups
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
* CR feedback
* Fix typo
* Update changelog
* Apply suggestions from code review
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* CR feedback round 1
* Rename paginate to into_paginator()
* update pr bot comment
Co-authored-by: Zelda Hessler <zhessler@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Add RFC for a split release process
* Incorporate feedback
* Fix change checklist
* Simplify release process further
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* service specific middleware
* Uncheck the boxes
* Update design/src/rfcs/rfc0006_service_specific_middleware.md
Co-authored-by: John DiSanti <jdisanti@amazon.com>
Co-authored-by: John DiSanti <jdisanti@amazon.com>
* Split out MakeOperationGenerator for HttpProtocolGenerator
* Clean up body metadata calculation
* Add debug instructions to readme
* Add example for Polly presigned requests
* Add ability to change payload signing type for query signing
* Generate special cased make operation functions for presigning
* Reorganize protocol generators
* Rename ProtocolConfig to CodegenContext and move to a central location
* Consolidate protocol classes in protocols package
* Make protocol generator names consistent
* Fully decompose ProtocolGenerator
* Add integration test for Polly presigning
* Add make_operation and presigned to reserved words
* Update presigning RFC
* Make Polly transforms reusable and add tests
* Fix RequestBindingGeneratorTest
* Update changelogs
* Remove `HttpBodySigningType`
* Perform model transformations up front
* Add checks to presigning transformers
* Fix `codegen-server` build
* Initial implementation of RestJson and Http ser/de
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Visitor render operation shapes from server generators
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Use a symlink for the ebs test model
* Revert "Use a symlink for the ebs test model"
This reverts commit 0c2adcbf12.
* Now the model is emitted in different files
* A little more general model generation
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Use a very simple model to try the service generators
* Move serializer in its own folder
* Initial implementation of RestJson and Http ser/de
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Visitor render operation shapes from server generators
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Use a symlink for the ebs test model
* Revert "Use a symlink for the ebs test model"
This reverts commit 0c2adcbf12.
* Now the model is emitted in different files
* A little more general model generation
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* Use a very simple model to try the service generators
* Move serializer in its own folder
* Refactor RestJson to accomodate upstream changes
* Refactor a little RestJson1 and add simple RFC doc
* Remove inheritance from Json ser/de and refactor codegen visitor to
directly use the rendering functions
* Make operation.rs module public
* Use the protocol ID instead of its string representation
Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
* add: incomplete draft rfc for retry configuraion
* update: rfc based on suggestions
add: reference to SDK reference page on max_attempts
fix: heading levels
update: simplify shared config example
fix: copypaste error in EnvironmentVariableRegionProvider
* update: to use builder method called max_attempts
* fix: leftover language
* update: go back to RetryConfig
add: more definitions
update: examples
add: explainer for process of sending a request
add: note about breaking change to
update: changes checklist
add: note about breaking changes
* fix: use correct module for shard config
update: emit warn log for invalid AWS_MAX_ATTEMPTS
* add: note about where RetryConfigDecorator will be defined
add: note about panics when setting invalid max_attempts
* Add initial draft RFC for pre-signed URLs
* Change "pre-sign" to "presign" to match other AWS documentation
* Incorporate initial round of feedback
* Change `http::Request` to `PresignedRequest`
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* Add initial RFC doc for supporting multiple HTTP versions
* Incorporate `SharedConfig` design and HTTP settings requirements
* Improve design for HTTP settings that vary per operation
* Create a place for RFCs to be merged into
* Refactor Smithy service tower to include a property bag with the response
* Add doc comments and rename functions on operation Request/Response
* Fix codegen
* Update CHANGELOG
* Attach PR number to CHANGELOG
* Fix test compile error
* CR feedback
* Fix AWS runtime tests
* Fix doc comment link
* Fix API gateway customization
* Fix AWS integration tests and update design doc
* Make it possible to run IAM test outside CI and fix it
* Add initial set of docs
* More design documentation updates
* Updates to the docs
* Update tenets again to remove the dependeny tenet
* Remove `!`
* Add more design documentation
* More updates to tenets
* More tenets updates
* tenets typo
* Rephrase as 'AWS SDK for Rust'
* rephrase tenets
* Add AwsEndpointResolver when constructing operations
This commit adds a customization for AWS-services to allow specifying an EndpointResolver, with a default fallback provided.
* Enforce no doc warnings, fix bug, add cargoCheck to CI
* Implement core Smithy endpoint support
This commit adds `Endpoint` to smithy-http & records our design decisions in `endpoint.md`. This provides support for the endpoint trait in Smithy. A design for endpoint discovery is proposed but is not currently implemented.
* Apply suggestions from code review
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
* More cleanups
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
* Http Operation traits and structures
Initial implementation of `Operation` for HTTP based services and `ParseHttpResponse`. I'm also starting to collect design documentation in `design`, an mdBook intended to serve as a repository for public facing design documentation.
* Update rust-runtime/smithy-http/src/body.rs
Co-authored-by: Jonathan Esterhazy <jonathan.esterhazy@gmail.com>
* Add retry policy
* Fix doctest failures
* Update rust-runtime/smithy-http/src/operation.rs
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update rust-runtime/smithy-http/src/operation.rs
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update rust-runtime/smithy-http/src/response.rs
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
* Update design/src/operation.md
Co-authored-by: Kerem Kat <keremkat@gmail.com>
Co-authored-by: Jonathan Esterhazy <jonathan.esterhazy@gmail.com>
Co-authored-by: Kerem Kat <keremkat@gmail.com>