-
Notifications
You must be signed in to change notification settings - Fork 55
feat: implement recursion detection middleware #602
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
Conversation
|
A new generated diff is ready to view: __generated-main...__generated-feat-recursion-detection |
|
A new generated diff is ready to view: __generated-main...__generated-feat-recursion-detection |
aajtodd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall
| */ | ||
| @InternalSdkApi | ||
| public class RecursionDetection( | ||
| private val env: EnvironmentProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should just default to the real platform environment provider
| } | ||
|
|
||
| override fun renderProperties(writer: KotlinWriter) { | ||
| writer.addImport(middlewareSymbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these addImport calls should no longer be necessary. The #T formatter will import symbols automatically and setting a default for the environment provider will make the platform symbol unnecessary.
|
A new generated diff is ready to view: __generated-main...__generated-feat-recursion-detection |
|
A new generated diff is ready to view: __generated-main...__generated-feat-recursion-detection |
ianbotsf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we're missing a changelog entry here.
| /** | ||
| * HTTP middleware to add the recursion detection header where required. | ||
| */ | ||
| class RecursionDetectionMiddleware : ProtocolMiddleware { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: This middleware doesn't override isEnabledFor. Just confirming...we want this to run for every operation in every AWS service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a good question, it could be limited to only services that have an integration that causes recursion if we know that set. Otherwise it would have to be every service I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per post-standup discussion, we'll leave it on every request since
- defining the set of services that could be part of a recursive loop is non-trivial, and is subject to constant change
- the risk of causing a runaway workload for a user (large bill, eroded trust) is not worth selectively including the header
|
A new generated diff is ready to view: __generated-main...__generated-feat-recursion-detection |
|
A new generated diff is ready to view: __generated-main...__generated-feat-recursion-detection |
|
Kudos, SonarCloud Quality Gate passed!
|
|
A new generated diff is ready to view: __generated-main...__generated-feat-recursion-detection |








Description of changes
Implements recursion detection SEP.
Companion PR in smithy-kotlin: smithy-lang/smithy-kotlin#636
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.