mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
# Which Problems Are Solved - Some mail providers (e.g.: MS Exchange) have deprecated plain auth # How the Problems Are Solved Adds XOauth2 auth option to SMPT - SMTP config now can contain XOAuth2 auth config - Proto files are updated to have a oneof for configuration selection. Old fields for configuring plain auth are still available not to create a breaking change. These can be removed in the future. - Columns are added to the database to persist the config # Additional Changes none # Additional Context Replace this example with links to related issues, discussions, discord threads, or other sources with more context. Use the Closing #issue syntax for issues that are resolved with this PR. - Closes #8042 --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Tim Möhlmann <[email protected]>
64 lines
2.1 KiB
Go
64 lines
2.1 KiB
Go
package integration
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/muhlemmer/gu"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/zitadel/zitadel/pkg/grpc/feature/v2"
|
|
)
|
|
|
|
func EnsureInstanceFeature(t *testing.T, ctx context.Context, instance *Instance, features *feature.SetInstanceFeaturesRequest, assertFeatures func(t *assert.CollectT, got *feature.GetInstanceFeaturesResponse)) {
|
|
ctx = instance.WithAuthorizationToken(ctx, UserTypeIAMOwner)
|
|
_, err := instance.Client.FeatureV2.SetInstanceFeatures(ctx, features)
|
|
require.NoError(t, err)
|
|
retryDuration, tick := WaitForAndTickWithMaxDuration(ctx, 5*time.Minute)
|
|
require.EventuallyWithT(t,
|
|
func(tt *assert.CollectT) {
|
|
got, err := instance.Client.FeatureV2.GetInstanceFeatures(ctx, &feature.GetInstanceFeaturesRequest{
|
|
Inheritance: true,
|
|
})
|
|
require.NoError(tt, err)
|
|
assertFeatures(tt, got)
|
|
},
|
|
retryDuration,
|
|
tick,
|
|
"timed out waiting for ensuring instance feature")
|
|
}
|
|
|
|
type RelationalTableFeatureMatrix struct {
|
|
Name string
|
|
Inst *Instance
|
|
InstOwner context.Context
|
|
}
|
|
|
|
// TODO(IAM-Marco): Once we have gotten rid of eventstore, this can be removed
|
|
func RelationalTablesEnableMatrix(t *testing.T, ctx context.Context, sysAuthZ context.Context) []RelationalTableFeatureMatrix {
|
|
return []RelationalTableFeatureMatrix{
|
|
func() RelationalTableFeatureMatrix {
|
|
inst := NewInstance(sysAuthZ)
|
|
instOwner := inst.WithAuthorizationToken(ctx, UserTypeIAMOwner)
|
|
return RelationalTableFeatureMatrix{
|
|
Name: "when relational tables are disabled",
|
|
Inst: inst,
|
|
InstOwner: instOwner,
|
|
}
|
|
}(),
|
|
func() RelationalTableFeatureMatrix {
|
|
inst := NewInstance(sysAuthZ)
|
|
instOwner := inst.WithAuthorizationToken(ctx, UserTypeIAMOwner)
|
|
_, err := inst.Client.FeatureV2.SetInstanceFeatures(instOwner, &feature.SetInstanceFeaturesRequest{EnableRelationalTables: gu.Ptr(false)})
|
|
require.NoError(t, err)
|
|
return RelationalTableFeatureMatrix{
|
|
Name: "when relational tables are enabled",
|
|
Inst: inst,
|
|
InstOwner: instOwner,
|
|
}
|
|
}(),
|
|
}
|
|
}
|