Documentation
¶
Index ¶
- Constants
- Variables
- func AuthenticateUser(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, ...) (string, error)
- func BootstrapGroup(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, ...) error
- func BootstrapOrganizations(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, ...) error
- func BootstrapProject(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, ...) error
- func BootstrapUsers(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, ...) error
- func ContextWithAuth(ctx context.Context, cookieStr string) context.Context
- func ContextWithHeaders(ctx context.Context, headers map[string]string) context.Context
- func CreateAdminClient(host string) (frontierv1beta1connect.AdminServiceClient, error)
- func CreateClient(host string) (frontierv1beta1connect.FrontierServiceClient, error)
- func EchoServer(network *docker.Network, pool *dockertest.Pool) (string, *dockertest.Resource, error)
- func GetFreePort() (int, error)
- func HeadersFromContext(ctx context.Context) map[string]string
- func MigrateFrontier(logger *log.Zap, appConfig *config.Frontier) error
- func StartFrontier(logger *log.Zap, appConfig *config.Frontier)
- func StartPG(network *docker.Network, pool *dockertest.Pool, dbName string) (connStringInternal, connStringExternal string, res *dockertest.Resource, ...)
- func StartSpiceDB(logger log.Logger, network *docker.Network, pool *dockertest.Pool, ...) (extPort string, close func() error, err error)
- func StartStripeMock(logger log.Logger, network *docker.Network, pool *dockertest.Pool) (extPort string, close func() error, err error)
- func StartStripeRecorder(mode recorder.Mode) func() error
- type StripeClientBuilder
- type TestBench
Constants ¶
View Source
const ( OrgAdminEmail = "admin1-group1-org1@raystack.org" TestOTP = "123456" )
Variables ¶
View Source
var (
RuleCacheRefreshDelay = time.Minute * 2
)
Functions ¶
func AuthenticateUser ¶
func AuthenticateUser(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, email string) (string, error)
AuthenticateUser authenticates a user via mail OTP using the test_users config (which skips SMTP) and returns the session cookie string (e.g. "sid=<encrypted>").
func BootstrapGroup ¶
func BootstrapGroup(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, sessionCookie string) error
func BootstrapOrganizations ¶
func BootstrapOrganizations(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, sessionCookie string) error
func BootstrapProject ¶
func BootstrapProject(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, sessionCookie string) error
func BootstrapUsers ¶
func BootstrapUsers(ctx context.Context, cl frontierv1beta1connect.FrontierServiceClient, sessionCookie string) error
func ContextWithAuth ¶
ContextWithAuth returns a context that carries the session cookie for authentication.
func ContextWithHeaders ¶
ContextWithHeaders returns a new context with the given headers. These headers will be automatically applied to ConnectRPC requests by the headerInterceptor.
func CreateAdminClient ¶
func CreateAdminClient(host string) (frontierv1beta1connect.AdminServiceClient, error)
func CreateClient ¶
func CreateClient(host string) (frontierv1beta1connect.FrontierServiceClient, error)
func EchoServer ¶
func EchoServer(network *docker.Network, pool *dockertest.Pool) (string, *dockertest.Resource, error)
func GetFreePort ¶
func HeadersFromContext ¶
HeadersFromContext returns headers stored in the context, if any.
func StartPG ¶
func StartPG(network *docker.Network, pool *dockertest.Pool, dbName string) (connStringInternal, connStringExternal string, res *dockertest.Resource, err error)
func StartSpiceDB ¶
func StartStripeMock ¶ added in v0.8.0
func StartStripeRecorder ¶ added in v0.8.30
Types ¶
type StripeClientBuilder ¶ added in v0.8.30
func BuildStripeClient ¶ added in v0.8.30
func BuildStripeClient(port, name string, mode recorder.Mode) (StripeClientBuilder, func() error)
type TestBench ¶
type TestBench struct {
Pool *dockertest.Pool
Network *docker.Network
Resources []*dockertest.Resource
Client frontierv1beta1connect.FrontierServiceClient
AdminClient frontierv1beta1connect.AdminServiceClient
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.