Grant longer subscription TTLs by re-checking access outside renewals

Open
#89 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github, go

Research direction

Read faucet/subscribe.go around the renewal handler and the RepoIDFresh call to see where the GitHub access check currently happens, then read docs/webhooks.md for the documented 10-minute TTL and the poll path's cached permission check the proposal wants to reuse. Decide where a server-side re-verification schedule or delivery-time check belongs, how terminated is emitted on revocation, and how the client-suggested TTL is capped at about a day. This is a design change touching renewal, caching and termination, so write the approach down before editing, and treat the spec sections cited in the issue as the acceptance criteria.

Written by the indexing model from the issue text.

Description

Problem

Grants are capped at 10 minutes because access is checked only at renewal (faucet/subscribe.go, docs/webhooks.md). Each renewal of a browser-login subscription asks GitHub again (RepoIDFresh). A long-lived client, such as a Coder deployment holding a subscription per automation, must then renew every subscription every few minutes forever with a fresh token, and each renewal spends one GitHub API call.

The spec recommends "grants from a few minutes up to about a day" and lets a long-lived tenant suggest days, so that it is not "forced to refresh on a cadence the server invented" (events.mdx L457-L461). It also says the server SHOULD periodically re-verify permissions at delivery time and terminate on revocation (L841).

Proposal

Move the access re-check off the renewal path: re-verify each subscription's access on a server-side schedule (or at delivery, reusing the cached check that poll uses), send terminated on revocation, and then grant TTLs up to the client's suggestion, capped at about a day.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Dominant language
Go
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/faucet

All issues in coder/faucet

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.