testbench

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrgAdminEmail  = "admin1-group1-org1@odpf.io"
	IdentityHeader = "X-Shield-Email"
)

Variables

View Source
var (
	RuleCacheRefreshDelay = time.Minute * 2
)

Functions

func BootstrapGroup added in v0.4.1

func BootstrapGroup(ctx context.Context, cl shieldv1beta1.ShieldServiceClient, creatorEmail string, testDataPath string) error

func BootstrapMetadataKey added in v0.4.1

func BootstrapMetadataKey(ctx context.Context, cl shieldv1beta1.ShieldServiceClient, creatorEmail string, testDataPath string) error

func BootstrapOrganization added in v0.4.1

func BootstrapOrganization(ctx context.Context, cl shieldv1beta1.ShieldServiceClient, creatorEmail string, testDataPath string) error

func BootstrapProject added in v0.4.1

func BootstrapProject(ctx context.Context, cl shieldv1beta1.ShieldServiceClient, creatorEmail string, testDataPath string) error

func BootstrapUser added in v0.4.1

func BootstrapUser(ctx context.Context, cl shieldv1beta1.ShieldServiceClient, creatorEmail string, testDataPath string) error

func BuildAPIDependenciesAndMigrate added in v0.5.1

func BuildAPIDependenciesAndMigrate(
	ctx context.Context,
	logger *log.Zap,
	resourceBlobRepository *blob.ResourcesRepository,
	dbc *db.Client,
	sdb *spicedb.SpiceDB,
	rbfs blob.Bucket,
) (api.Deps, error)

func CreateClient added in v0.4.1

func CreateClient(ctx context.Context, host string) (shieldv1beta1.ShieldServiceClient, func(), error)

func GetFreePort added in v0.4.1

func GetFreePort() (int, error)

func ServeProxies added in v0.5.1

func ServeProxies(
	ctx context.Context,
	logger *log.Zap,
	identityProxyHeaderKey,
	userIDHeaderKey string,
	cfg proxy.ServicesConfig,
	resourceService *resource.Service,
	relationService *relation.Service,
	userService *user.Service,
	projectService *project.Service,
) ([]func() error, []func(ctx context.Context) error, error)

func SetupDB added in v0.5.1

func SetupDB(cfg db.Config) (dbc *db.Client, err error)

Types

type TestBench

type TestBench struct {
	PGConfig      db.Config
	SpiceDBConfig spicedb.Config
	// contains filtered or unexported fields
}

func Init

func Init(appConfig *config.Shield) (*TestBench, *config.Shield, error)

func (*TestBench) CleanUp

func (te *TestBench) CleanUp() error

Jump to

Keyboard shortcuts

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