Home / Companies / Momento / Blog / Post Details
Content Deep Dive

Faster APIs, faster developers: API Gateway custom authorizers

Blog post from Momento

Post Details
Company
Date Published
Author
Ellery Addington-White
Word Count
1,656
Language
English
Hacker News Points
-
Summary

The blog post discusses enhancing an AWS-based API service by implementing new endpoints for user avatar images and securing them with custom authentication logic using AWS API Gateway custom authorizers. By introducing a new /profile-pic and /cached-profile-pic endpoint, the service fetches and returns the base64 encoded user images, allowing for improved security and performance. The custom authorizer, a Lambda function, checks if the requester's user ID is a follower of the profile picture's owner, allowing or denying access accordingly. The post highlights the benefits of using a centralized cache, demonstrating that integrating caching with serverless architectures like AWS Lambda and API Gateway can significantly reduce latency and enhance performance. The author also evaluates performance through testing and demonstrates that enabling a remote cache for the custom authorizer and service results in lower response times, underscoring the importance of caching in distributed, function-based applications.