testsupport

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

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package testsupport contains helper functions for testing auth service.

Index

Constants

View Source
const (
	TestRevision    = "test-revision"
	TestContentHash = "test-hash"
)

Variables

This section is empty.

Functions

func BuildTargz

func BuildTargz(files map[string][]byte) []byte

BuildTargz builds a tar bundle.

func PermissionsCfg

func PermissionsCfg() *configspb.PermissionsConfig

func PermissionsCfgMeta

func PermissionsCfgMeta() *config.Meta

func PermissionsDB

func PermissionsDB(implicitRootBindings bool) *permissions.PermissionsDB

PermissionsDB creates a PermissionsDB for tests.

func SetTestContextSigner

func SetTestContextSigner(ctx context.Context, appID, serviceAccount string) context.Context

SetTestContextSigner is a helper functionfor unit tests.

It installs a test Signer implementation into the context, with the given app ID and service account.

Types

type FakeConfigClient

type FakeConfigClient struct {
	config.Interface
}

func (*FakeConfigClient) Close

func (*FakeConfigClient) Close() error

func (*FakeConfigClient) GetConfig

func (*FakeConfigClient) GetConfig(ctx context.Context, configSet config.Set, path string, metaOnly bool) (*config.Config, error)

func (*FakeConfigClient) GetExpectedConfigsForTest

func (f *FakeConfigClient) GetExpectedConfigsForTest(ctx context.Context) map[string]*config.Config

func (*FakeConfigClient) GetProjectConfigs

func (*FakeConfigClient) GetProjectConfigs(ctx context.Context, path string, metaOnly bool) ([]config.Config, error)

Jump to

Keyboard shortcuts

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