2025-02-11 19:45:09 +01:00
|
|
|
//go:build integration
|
|
|
|
|
|
|
|
package saml_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/integration"
|
|
|
|
saml_pb "github.com/zitadel/zitadel/pkg/grpc/saml/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
CTX context.Context
|
|
|
|
IAMCTX context.Context
|
2025-07-15 07:38:00 -04:00
|
|
|
LoginCTX context.Context
|
2025-02-11 19:45:09 +01:00
|
|
|
Instance *integration.Instance
|
|
|
|
Client saml_pb.SAMLServiceClient
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
os.Exit(func() int {
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
|
|
|
defer cancel()
|
|
|
|
|
|
|
|
Instance = integration.NewInstance(ctx)
|
|
|
|
Client = Instance.Client.SAMLv2
|
|
|
|
|
|
|
|
IAMCTX = Instance.WithAuthorization(ctx, integration.UserTypeIAMOwner)
|
|
|
|
CTX = Instance.WithAuthorization(ctx, integration.UserTypeOrgOwner)
|
2025-07-15 07:38:00 -04:00
|
|
|
LoginCTX = Instance.WithAuthorization(ctx, integration.UserTypeLogin)
|
2025-02-11 19:45:09 +01:00
|
|
|
return m.Run()
|
|
|
|
}())
|
|
|
|
}
|