test

package
v0.0.0-...-0ac5460 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpicedbSchemaBootstrapFile = "../internal/data/spicedb-test-data/basic_schema.zed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalKesselContainer

type LocalKesselContainer struct {
	Name string

	HTTPport string

	KeycloakHTTPPort string // host-mapped port for Keycloak HTTP (8080), for use in GetJWTToken etc.
	// contains filtered or unexported fields
}

LocalKesselContainer holds the testcontainers for the Kessel API, SpiceDB, and Keycloak

func CreateKesselAPIContainer

func CreateKesselAPIContainer(ctx context.Context, logger log.Logger) (_ *LocalKesselContainer, retErr error)

CreateKesselAPIContainer creates the network, SpiceDB, Keycloak, and Kessel API containers using testcontainers-go

func (*LocalKesselContainer) Close

func (l *LocalKesselContainer) Close()

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

func GetJWTToken

func GetJWTToken(baseURL, username, password string) (*TokenResponse, error)

GetJWTToken obtains a JWT from Keycloak (baseURL should be the host-accessible URL, e.g. http://localhost:PORT)

Jump to

Keyboard shortcuts

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