Currently, ungh provides a convenient way to fetch data from the GitHub API. While ungh might employ caching (or could potentially benefit from it) to mitigate this for repeated requests, there are scenarios where:
- The cached data might become stale, and a user might want to force a refresh or check for updates using conditional requests (like
If-None-Match or If-Modified-Since).
- Performing these cache validation/refresh requests reliably requires higher rate limits available only to authenticated users.
- Users might simply prefer to use their personal token for all interactions to leverage higher rate limits consistently, even when dealing with potentially cached data.
There doesn't seem to be a documented way to provide a personal GitHub token specifically to influence how ungh handles requests related to its cache (e.g., forcing a revalidation using the authenticated request).
I propose adding a mechanism to allow users to provide their GitHub Personal Access Token (PAT) when making requests with ungh. This token should then be used for the underlying Workspace call.
Specifically, this feature should enable:
- Authenticated Requests: The request to the GitHub API should use the provided token in the
Authorization header.
- Cache Interaction: When a token is provided,
ungh's caching logic (if present/implemented) should ideally leverage the authenticated request. This could mean:
- Using the token to perform conditional requests (checking
ETag/Last-Modified) against the GitHub API to see if the cached data is still valid, benefiting from the higher rate limit for these checks.
- Potentially offering an option (e.g., a flag like
forceRefresh: true alongside the token) to explicitly bypass the cache and fetch fresh data using the authenticated request.
Thank you for considering this feature request and for maintaining ungh!
Additional information
Currently,
unghprovides a convenient way to fetch data from the GitHub API. Whileunghmight employ caching (or could potentially benefit from it) to mitigate this for repeated requests, there are scenarios where:If-None-MatchorIf-Modified-Since).There doesn't seem to be a documented way to provide a personal GitHub token specifically to influence how
unghhandles requests related to its cache (e.g., forcing a revalidation using the authenticated request).I propose adding a mechanism to allow users to provide their GitHub Personal Access Token (PAT) when making requests with
ungh. This token should then be used for the underlyingWorkspacecall.Specifically, this feature should enable:
Authorizationheader.ungh's caching logic (if present/implemented) should ideally leverage the authenticated request. This could mean:ETag/Last-Modified) against the GitHub API to see if the cached data is still valid, benefiting from the higher rate limit for these checks.forceRefresh: truealongside the token) to explicitly bypass the cache and fetch fresh data using the authenticated request.Thank you for considering this feature request and for maintaining
ungh!Additional information