1.60.0
·
205 commits
to refs/heads/develop
since this release
Summary
This release introduces a new feature for the Idempotency utility that allows developers to manipulate the returned data from idempotent operations, providing greater flexibility and control over the response handling process.
Congratulations @Diogobitten for your first contribution ⭐
Manipulating idempotent responses
Now you can set up a response hook in the Idempotency configuration to modify the returned data when an operation is idempotent. The hook function is called with the current deserialized response object and the Idempotency DataRecord, allowing you to add custom logic or modify the response as needed.
Idempotency.Config()
.WithConfig(IdempotencyOptions.Builder()
.WithEventKeyJmesPath("powertools_json(body).address")
.WithResponseHook((responseData, dataRecord) => {
if (responseData is APIGatewayProxyResponse proxyResponse)
{
proxyResponse.Headers ??= new Dictionary<string, string>();
proxyResponse.Headers["x-idempotency-response"] = "true";
proxyResponse.Headers["x-idempotency-expiration"] = dataRecord.ExpiryTimestamp.ToString();
return proxyResponse;
}
return responseData;
})
.Build())
.WithPersistenceStore(DynamoDBPersistenceStore.Builder()
.WithTableName(Environment.GetEnvironmentVariable("IDEMPOTENCY_TABLE"))
.Build())
.Configure();Changes
🌟New features and non-breaking changes
📜 Documentation updates
- chore: Remove reference customer section from documentation (#982) by @hjgraca
- chore: Update copyright information in mkdocs.yml (#976) by @hjgraca
- feat: Add support for response hooks in idempotency utility (#968) by @hjgraca
🔧 Maintenance
- chore: Update version for release (#986) by @hjgraca
- chore: Remove reference customer section from documentation (#982) by @hjgraca
- chore: Update copyright information in mkdocs.yml (#976) by @hjgraca
- chore(deps): bump brace-expansion in /examples/Event Handler/BedrockAgentFunction/infra (#973) by @dependabot[bot]
- chore(deps): bump codecov/codecov-action from 5.4.3 to 5.5.0 (#967) by @dependabot[bot]
- chore(gitignore): add .kiro, .claude, .amazonq to prevent deletion (#971) by @Diogobitten
This release was made possible by the following contributors:
@Diogobitten, @dependabot[bot], @dreamorosi, @hjgraca and dependabot[bot]