mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 15:27:33 +00:00
cleanup
This commit is contained in:
@@ -1,35 +1,22 @@
|
|||||||
Log:
|
Log:
|
||||||
Level: info
|
Level: info
|
||||||
|
|
||||||
Telemetry:
|
|
||||||
Enabled: true
|
|
||||||
Endpoints:
|
|
||||||
- https://httpbin.org/post
|
|
||||||
|
|
||||||
ExternalDomain: host.docker.internal
|
ExternalDomain: host.docker.internal
|
||||||
ExternalSecure: false
|
ExternalSecure: false
|
||||||
|
|
||||||
TLS:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Database:
|
Database:
|
||||||
cockroach:
|
cockroach:
|
||||||
# This makes the e2e config reusable with an out-of-docker zitadel process and an /etc/hosts entry
|
# This makes the e2e config reusable with an out-of-docker zitadel process and an /etc/hosts entry
|
||||||
Host: host.docker.internal
|
Host: host.docker.internal
|
||||||
|
|
||||||
|
TLS:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
FirstInstance:
|
FirstInstance:
|
||||||
Org:
|
Org:
|
||||||
Human:
|
Human:
|
||||||
PasswordChangeRequired: false
|
PasswordChangeRequired: false
|
||||||
|
|
||||||
DefaultInstance:
|
|
||||||
Org:
|
|
||||||
Human:
|
|
||||||
PasswordChangeRequired: false
|
|
||||||
Password: "Password1!"
|
|
||||||
LoginPolicy:
|
|
||||||
MfaInitSkipLifetime: "0"
|
|
||||||
|
|
||||||
LogStore:
|
LogStore:
|
||||||
Access:
|
Access:
|
||||||
Database:
|
Database:
|
||||||
@@ -55,8 +42,10 @@ Projections:
|
|||||||
Customizations:
|
Customizations:
|
||||||
NotificationsQuotas:
|
NotificationsQuotas:
|
||||||
RequeueEvery: 1s
|
RequeueEvery: 1s
|
||||||
Telemetry:
|
|
||||||
RequeueEvery: 1s
|
DefaultInstance:
|
||||||
|
LoginPolicy:
|
||||||
|
MfaInitSkipLifetime: "0"
|
||||||
|
|
||||||
SystemAPIUsers:
|
SystemAPIUsers:
|
||||||
- cypress:
|
- cypress:
|
||||||
|
@@ -1,36 +1,22 @@
|
|||||||
Log:
|
Log:
|
||||||
Level: info
|
Level: info
|
||||||
|
|
||||||
Telemetry:
|
|
||||||
Enabled: true
|
|
||||||
Endpoints:
|
|
||||||
# - https://httpbin.org/post
|
|
||||||
- https://example.com
|
|
||||||
|
|
||||||
ExternalDomain: localhost
|
ExternalDomain: localhost
|
||||||
ExternalSecure: false
|
ExternalSecure: false
|
||||||
|
|
||||||
TLS:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Database:
|
Database:
|
||||||
cockroach:
|
cockroach:
|
||||||
# This makes the e2e config reusable with an out-of-docker zitadel process and an /etc/hosts entry
|
# This makes the e2e config reusable with an out-of-docker zitadel process and an /etc/hosts entry
|
||||||
Host: host.docker.internal
|
Host: host.docker.internal
|
||||||
|
|
||||||
|
TLS:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
FirstInstance:
|
FirstInstance:
|
||||||
Org:
|
Org:
|
||||||
Human:
|
Human:
|
||||||
PasswordChangeRequired: false
|
PasswordChangeRequired: false
|
||||||
|
|
||||||
DefaultInstance:
|
|
||||||
Org:
|
|
||||||
Human:
|
|
||||||
PasswordChangeRequired: false
|
|
||||||
Password: "Password1!"
|
|
||||||
LoginPolicy:
|
|
||||||
MfaInitSkipLifetime: "0"
|
|
||||||
|
|
||||||
LogStore:
|
LogStore:
|
||||||
Access:
|
Access:
|
||||||
Database:
|
Database:
|
||||||
@@ -56,8 +42,10 @@ Projections:
|
|||||||
Customizations:
|
Customizations:
|
||||||
NotificationsQuotas:
|
NotificationsQuotas:
|
||||||
RequeueEvery: 1s
|
RequeueEvery: 1s
|
||||||
Telemetry:
|
|
||||||
RequeueEvery: 30s
|
DefaultInstance:
|
||||||
|
LoginPolicy:
|
||||||
|
MfaInitSkipLifetime: "0"
|
||||||
|
|
||||||
SystemAPIUsers:
|
SystemAPIUsers:
|
||||||
- cypress:
|
- cypress:
|
||||||
|
@@ -44,6 +44,30 @@ func newClient(cc *grpc.ClientConn) Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *Tester) UseIsolatedInstance(ctx context.Context) (primaryDomain, instanceID string, systemCtx, iamOwnerCtx context.Context) {
|
||||||
|
systemCtx = t.WithAuthorization(ctx, SystemUser)
|
||||||
|
primaryDomain = randString(5) + ".integration"
|
||||||
|
instance, err := t.Client.System.CreateInstance(systemCtx, &system.CreateInstanceRequest{
|
||||||
|
InstanceName: "testinstance",
|
||||||
|
CustomDomain: primaryDomain,
|
||||||
|
Owner: &system.CreateInstanceRequest_Machine_{
|
||||||
|
Machine: &system.CreateInstanceRequest_Machine{
|
||||||
|
UserName: "owner",
|
||||||
|
Name: "owner",
|
||||||
|
PersonalAccessToken: &system.CreateInstanceRequest_PersonalAccessToken{},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
t.createClientConn(ctx, grpc.WithAuthority(primaryDomain))
|
||||||
|
t.Users[IAMOwner] = User{
|
||||||
|
Token: instance.GetPat(),
|
||||||
|
}
|
||||||
|
return primaryDomain, instance.GetInstanceId(), systemCtx, t.WithAuthorization(ctx, IAMOwner)
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Tester) CreateHumanUser(ctx context.Context) *user.AddHumanUserResponse {
|
func (s *Tester) CreateHumanUser(ctx context.Context) *user.AddHumanUserResponse {
|
||||||
resp, err := s.Client.UserV2.AddHumanUser(ctx, &user.AddHumanUserRequest{
|
resp, err := s.Client.UserV2.AddHumanUser(ctx, &user.AddHumanUserRequest{
|
||||||
Organisation: &object.Organisation{
|
Organisation: &object.Organisation{
|
||||||
|
@@ -8,7 +8,6 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -33,13 +32,8 @@ import (
|
|||||||
"github.com/zitadel/zitadel/internal/query"
|
"github.com/zitadel/zitadel/internal/query"
|
||||||
"github.com/zitadel/zitadel/internal/webauthn"
|
"github.com/zitadel/zitadel/internal/webauthn"
|
||||||
"github.com/zitadel/zitadel/pkg/grpc/admin"
|
"github.com/zitadel/zitadel/pkg/grpc/admin"
|
||||||
"github.com/zitadel/zitadel/pkg/grpc/system"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
rand.Seed(time.Now().UnixNano())
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
//go:embed config/zitadel.yaml
|
//go:embed config/zitadel.yaml
|
||||||
zitadelYAML []byte
|
zitadelYAML []byte
|
||||||
@@ -288,37 +282,3 @@ func Contexts(timeout time.Duration) (ctx, errCtx context.Context, cancel contex
|
|||||||
ctx, cancel = context.WithTimeout(context.Background(), timeout)
|
ctx, cancel = context.WithTimeout(context.Background(), timeout)
|
||||||
return ctx, errCtx, cancel
|
return ctx, errCtx, cancel
|
||||||
}
|
}
|
||||||
|
|
||||||
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")
|
|
||||||
|
|
||||||
func randStringRunes(n int) string {
|
|
||||||
b := make([]rune, n)
|
|
||||||
for i := range b {
|
|
||||||
b[i] = letterRunes[rand.Intn(len(letterRunes))]
|
|
||||||
}
|
|
||||||
return string(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *Tester) UseIsolatedInstance(ctx context.Context) (primaryDomain, instanceID string, systemCtx, iamOwnerCtx context.Context) {
|
|
||||||
systemCtx = t.WithAuthorization(ctx, SystemUser)
|
|
||||||
primaryDomain = randStringRunes(5) + ".integration"
|
|
||||||
instance, err := t.Client.System.CreateInstance(systemCtx, &system.CreateInstanceRequest{
|
|
||||||
InstanceName: "testinstance",
|
|
||||||
CustomDomain: primaryDomain,
|
|
||||||
Owner: &system.CreateInstanceRequest_Machine_{
|
|
||||||
Machine: &system.CreateInstanceRequest_Machine{
|
|
||||||
UserName: "owner",
|
|
||||||
Name: "owner",
|
|
||||||
PersonalAccessToken: &system.CreateInstanceRequest_PersonalAccessToken{},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
t.createClientConn(ctx, grpc.WithAuthority(primaryDomain))
|
|
||||||
t.Users[IAMOwner] = User{
|
|
||||||
Token: instance.GetPat(),
|
|
||||||
}
|
|
||||||
return primaryDomain, instance.GetInstanceId(), systemCtx, t.WithAuthorization(ctx, IAMOwner)
|
|
||||||
}
|
|
||||||
|
20
internal/integration/rand.go
Normal file
20
internal/integration/rand.go
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package integration
|
||||||
|
|
||||||
|
import (
|
||||||
|
"math/rand"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
}
|
||||||
|
|
||||||
|
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")
|
||||||
|
|
||||||
|
func randString(n int) string {
|
||||||
|
b := make([]rune, n)
|
||||||
|
for i := range b {
|
||||||
|
b[i] = letterRunes[rand.Intn(len(letterRunes))]
|
||||||
|
}
|
||||||
|
return string(b)
|
||||||
|
}
|
@@ -8,11 +8,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/zitadel/zitadel/pkg/grpc/management"
|
|
||||||
|
|
||||||
"github.com/zitadel/zitadel/pkg/grpc/system"
|
|
||||||
|
|
||||||
"github.com/zitadel/zitadel/internal/integration"
|
"github.com/zitadel/zitadel/internal/integration"
|
||||||
|
"github.com/zitadel/zitadel/pkg/grpc/management"
|
||||||
|
"github.com/zitadel/zitadel/pkg/grpc/system"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -27,8 +25,6 @@ func TestMain(m *testing.M) {
|
|||||||
ctx, _, cancel := integration.Contexts(5 * time.Minute)
|
ctx, _, cancel := integration.Contexts(5 * time.Minute)
|
||||||
CTX = ctx
|
CTX = ctx
|
||||||
defer cancel()
|
defer cancel()
|
||||||
os.Setenv("INTEGRATION_DB_FLAVOR", "postgres")
|
|
||||||
os.Setenv("ZITADEL_MASTERKEY", "MasterkeyNeedsToHave32Characters")
|
|
||||||
Tester = integration.NewTester(ctx)
|
Tester = integration.NewTester(ctx)
|
||||||
MgmtClient = Tester.Client.Mgmt
|
MgmtClient = Tester.Client.Mgmt
|
||||||
SystemClient = Tester.Client.System
|
SystemClient = Tester.Client.System
|
||||||
|
Reference in New Issue
Block a user