Documentation
¶
Overview ¶
Package oauth2test provides a backend-agnostic conformance suite for the oauth2provider.Store interface. Every backend (memory, sqlite, postgres, mongo) is expected to pass the same contract, so behavioral drift between implementations is caught here rather than in production.
It mirrors store/storetest, which does the same job for the core store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunConformance ¶
RunConformance runs every contract test against fixtures from newFixture. Names in skip are not run, for backends that legitimately cannot support a case; skipping anything else is a bug in the backend, not in the suite.
Types ¶
type Fixture ¶
type Fixture struct {
Store oauth2provider.Store
AppID id.AppID
// UserID must exist in authsome_users for backends that enforce the
// auth-code foreign key.
UserID id.UserID
// OtherAppID is a second tenant, used to prove app scoping. Backends that
// cannot seed one may leave it zero and the scoping case is skipped.
OtherAppID id.AppID
}
Fixture is one backend ready to test: a migrated plugin store plus the tenant rows its foreign keys point at. The SQL backends reference authsome_apps and authsome_users, so a suite cannot invent those ids.
func (Fixture) OtherUserID ¶
OtherUserID is a user id that owns nothing in the fixture, for proving per-user scoping without a second seeded user.