# lambda-fan-response

This lambda processes music fans form responses. It is triggered by an API Gateway event, which is configured to accept POST requests. 
The lambda expects a JSON payload. The only required field in the payload is `email_address`

Once message is validated, it is sent to a Kafka topic according to the vendor of the fan response. The vendor is determined in the API URL (e.g. /smf/response where `smf` is vendor name).

### Logging

Besides the standard logging messages it also includes logs of processed email hashes. The email hashing is done using HMAC-SHA256 algorithm with a secret key stored in AWS Secrets Manager and is rotated periodically. The secret key is retrieved at the start of the lambda execution.
