curityio / aws-token-publisher

A Demo token publisher for the split token approach with AWS DynamoDB.
https://curity.io/resources/learn/aws-token-publisher/
Apache License 2.0
0 stars 2 forks source link

Use HTTPClient to add alarms to the event handler #12

Open ju-cu opened 2 years ago

ju-cu commented 2 years ago

Use HTTP client from configuration when calling awssdk. The Curity Identity Server only supports alarms for plugins of type datasource but it has support for alarm handling of HTTP clients. The DynamoDbClientBuilder allows to set the http client that the SDK service client will use to make HTTP calls.

There are two major benefits with this change: 1.) The alarm system of the Curity Identity Server can automatically catch problems/errors when the HTTP connection to DynamoDB breaks for some reason 2.) More (mocked) tests

ju-cu commented 2 years ago

Documentation AWS SDK: set the http client using DynamoDbClientBuilder: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/dynamodb/DynamoDbClientBuilder.html via the SdkSyncClientBuilder: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/client/builder/SdkSyncClientBuilder.html#httpClient-software.amazon.awssdk.http.SdkHttpClient-