Help us shape the future of Go! Take the 2026 Go Developer Survey

ssotest

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ssotest provides a backend-agnostic conformance suite for the sso.Store interface. Every backend (memory, sqlite, postgres, mongo) is expected to pass the same contract, so behavioral drift between them is caught here rather than in production.

SSO connections route by domain, so most of the risk in this store is tenancy: a domain lookup that forgets its app predicate hands one tenant's users to another tenant's identity provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConformance

func RunConformance(t *testing.T, newFixture Factory, skip ...string)

RunConformance runs every contract test against fixtures from newFixture.

Types

type Factory

type Factory func(t *testing.T) Fixture

Factory builds a fresh, empty, migrated fixture for a single test.

type Fixture

type Fixture struct {
	Store sso.Store
	AppID id.AppID
	// EnvID is the app's default environment. Postgres declares a foreign key
	// on it; memory, sqlite and mongo do not, so a fixture that omits it
	// passes on three backends and fails on the fourth.
	EnvID string
	// OtherAppID is a second tenant, used to prove that domain, provider and
	// listing lookups are all scoped to one app.
	OtherAppID id.AppID
	// OtherEnvID is that second tenant's default environment.
	OtherEnvID string
	// OrgID and OtherOrgID are two organizations inside AppID. Connections
	// route per organization as well as per app, so proving that lookup needs
	// two orgs under one tenant rather than two tenants. org_id carries no
	// foreign key on any backend, so these need no row of their own.
	OrgID      id.OrgID
	OtherOrgID id.OrgID
}

Fixture is one backend ready to test, plus the tenants its rows hang off.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL