-
Notifications
You must be signed in to change notification settings - Fork 0
Cache IATs #15
Copy link
Copy link
Open
Labels
optimizationReduces the amount of resources used to perform a taskReduces the amount of resources used to perform a task
Description
Metadata
Metadata
Assignees
Labels
optimizationReduces the amount of resources used to perform a taskReduces the amount of resources used to perform a task
GitHub makes use of an Installation Access Token (IAT) to authenticate a service as a GitHub App installation for a specific account. An IAT is valid for one hour after its creation.
Currently, the IAT is discarded right after it is used, potentially increasing the amount of requests made to GitHub. Instead, an Installation ID should be associated to the corresponding IAT. This would give us the opportunity to reuse the IAT until it expires.
Since IATs are short-lived (only one hour), there's no need to store them in the database. Instead, an in-memory solution should be preferred. I searched a bit, and
mokaseems to be a good candidate, since it also supports a Time to live (TTL) expiration policy.