feat: Add integration.NewDefaultClient() to load default config by default (#9452)

This commit is contained in:
Marco Ardizzone
2025-04-29 12:59:19 +02:00
parent 6802cb5468
commit 9f032460a7

View File

@@ -74,6 +74,10 @@ type Client struct {
InstanceV2Beta instance.InstanceServiceClient
}
func NewDefaultClient(ctx context.Context) (*Client, error) {
return newClient(ctx, loadedConfig.Host())
}
func newClient(ctx context.Context, target string) (*Client, error) {
cc, err := grpc.NewClient(target,
grpc.WithTransportCredentials(insecure.NewCredentials()),
@@ -105,6 +109,7 @@ func newClient(ctx context.Context, target string) (*Client, error) {
UserV3Alpha: user_v3alpha.NewZITADELUsersClient(cc),
SAMLv2: saml_pb.NewSAMLServiceClient(cc),
SCIM: scim.NewScimClient(target),
InstanceV2Beta: instance.NewInstanceServiceClient(cc),
}
return client, client.pollHealth(ctx)
}