feat(web): stamp login_events on every gated request
The registration gate, once it resolves the authenticated subject to a tapir user_id, calls StampLogin (store-throttled to one row per user per day). Best- effort: a stamp failure is logged and swallowed so it never breaks the request. This is what makes the read-side Stage-0 usage signal actually accrue. Tests cover the happy-path stamp, the same-day throttle, and that an unregistered subject (redirected to /register) is never stamped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,11 @@ type Store interface {
|
||||
DeleteConnection(ctx context.Context, userID, provider string) error
|
||||
DeleteUser(ctx context.Context, userID string) error
|
||||
DisplayName(ctx context.Context, userID string) (string, error)
|
||||
|
||||
// StampLogin records (throttled, one row per user per day) that the resolved
|
||||
// user was active on this request — the read-side Stage-0 usage signal the
|
||||
// registration gate stamps for every authenticated request.
|
||||
StampLogin(ctx context.Context, userID string) error
|
||||
}
|
||||
|
||||
// SecretRemover deletes secret material by its opaque ref. *secrets.FileStore
|
||||
|
||||
Reference in New Issue
Block a user