Documentation
¶
Index ¶
- func AcquirePGMigrationLock(t *testing.T, baseURL string) (release func())
- func AcquirePGMigrationLockMain(baseURL string) (release func())
- func AlpineImage(t *testing.T) string
- func ComposeServiceImage(composeFile, service string) string
- func MakeBundle(t *testing.T) []byte
- func MakeBundleWithoutEntrypoint(t *testing.T) []byte
- func MakeTraversalBundle(t *testing.T) []byte
- func TOMLDockerImage(t *testing.T) string
- type MockIdP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquirePGMigrationLock ¶ added in v0.0.4
AcquirePGMigrationLock holds a cluster-wide advisory lock on a dedicated single-connection pool until the returned fn runs. Callers must wrap the migration invocation — db.Open via golang-migrate — and any additional CREATE ROLE that targets a cluster-wide role (pg_authid is shared across databases). The lock serializes these against parallel `go test` packages that would otherwise race on the pg_authid unique index (#317).
baseURL is a superuser connection URL (any database works; the lock itself is cluster-scoped).
func AcquirePGMigrationLockMain ¶ added in v0.0.4
func AcquirePGMigrationLockMain(baseURL string) (release func())
AcquirePGMigrationLockMain is the TestMain-flavoured variant of AcquirePGMigrationLock. Logs to stderr and os.Exits on failure because TestMain doesn't have a *testing.T.
func AlpineImage ¶ added in v0.0.3
AlpineImage returns the Alpine image reference from docker/server.Dockerfile. This is the version we ship with, so integration tests should use it.
func ComposeServiceImage ¶ added in v0.0.3
ComposeServiceImage extracts the image for a named service from a docker-compose file, relative to the repo root. Panics on error so it can be used in TestMain and package-level vars.
func MakeBundle ¶
MakeBundle returns a valid tar.gz containing app.R and a DESCRIPTION file. The DESCRIPTION makes the bundle deployable without bare-script preprocessing.
func MakeBundleWithoutEntrypoint ¶
MakeBundleWithoutEntrypoint returns a valid tar.gz that has no app.R.
func MakeTraversalBundle ¶
MakeTraversalBundle returns a tar.gz with a path traversal entry.
func TOMLDockerImage ¶ added in v0.0.3
TOMLDockerImage reads the docker.image field from a blockyard.toml file, relative to the repo root.
Types ¶
type MockIdP ¶ added in v0.0.2
type MockIdP struct {
Server *httptest.Server
// Sub and Groups to include in issued ID tokens.
Sub string
Groups []string
// Nonce to embed in the next ID token. Tests should set this to the
// nonce extracted from the login redirect URL before calling /callback.
Nonce string
// contains filtered or unexported fields
}
MockIdP is a minimal OIDC-compliant mock identity provider for integration tests. Serves:
GET /.well-known/openid-configuration GET /jwks POST /token
func NewMockIdP ¶ added in v0.0.2
func NewMockIdP() *MockIdP
NewMockIdP starts a mock IdP on a random port. The default sub is "test-sub" with groups ["testers"].
func (*MockIdP) IssueJWT ¶ added in v0.0.2
IssueJWT creates a JWT for control-plane Bearer auth (client credentials style). Same signing key as ID tokens, different claims structure.
func (*MockIdP) PrivateKey ¶ added in v0.0.2
func (m *MockIdP) PrivateKey() *rsa.PrivateKey
PrivateKey returns the RSA private key used for signing.