Documentation
¶
Overview ¶
Package refreshtokentest is the shared contract suite for core.RefreshTokenStore's access-token bookkeeping: RecordAccessToken and the access tokens RevokeTokenFamily hands back. Revoking a refresh token has to take the access tokens issued from the same grant with it (RFC 7009 §2.1), and the store is the only place that knows which those are, so every backend runs these scenarios through RunAll.
See: https://www.rfc-editor.org/rfc/rfc7009#section-2.1 See: https://www.rfc-editor.org/rfc/rfc9700#section-4.14.2
Index ¶
- func RunAll(t *testing.T, factory Factory)
- func TestConcurrentRecordsAllKept(t *testing.T, factory Factory)
- func TestExpiredAccessTokensDropped(t *testing.T, factory Factory)
- func TestFamiliesAreIsolated(t *testing.T, factory Factory)
- func TestRecordOnMissingToken(t *testing.T, factory Factory)
- func TestRecordOnRevokedReportsRevoked(t *testing.T, factory Factory)
- func TestRevokeFamilyReturnsEveryGeneration(t *testing.T, factory Factory)
- func TestRevokeUnknownFamily(t *testing.T, factory Factory)
- func TestSeveralAccessTokensOnOneRecord(t *testing.T, factory Factory)
- type Factory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestConcurrentRecordsAllKept ¶
TestConcurrentRecordsAllKept: parallel refreshes on one unrotated token each append; a lost update would leave an access token that revocation can't find.
func TestExpiredAccessTokensDropped ¶
TestExpiredAccessTokensDropped: an expired access token needs no blacklist entry, and a record that is refreshed for days must not grow without bound.
func TestFamiliesAreIsolated ¶
TestFamiliesAreIsolated: revoking one session leaves another alone.
func TestRecordOnMissingToken ¶
TestRecordOnMissingToken maps an unknown token to core.ErrTokenNotFound.
func TestRecordOnRevokedReportsRevoked ¶
TestRecordOnRevokedReportsRevoked: a revocation that landed before the access token was recorded never saw it, so the caller has to be told.
func TestRevokeFamilyReturnsEveryGeneration ¶
TestRevokeFamilyReturnsEveryGeneration: an access token issued with the first refresh token is still live after rotation, and revoking the family through the newer token has to return it along with the newer one.
func TestRevokeUnknownFamily ¶
TestRevokeUnknownFamily is a no-op, not an error.
func TestSeveralAccessTokensOnOneRecord ¶
TestSeveralAccessTokensOnOneRecord: with rotation off (FAPI 2.0) one refresh token mints an access token per refresh.