2024-02-28 08:55:54 +00:00
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
2024-05-24 11:32:57 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/feature"
|
2024-02-28 08:55:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type InstanceFeatures struct {
|
|
|
|
Details *domain.ObjectDetails
|
|
|
|
LoginDefaultOrg FeatureSource[bool]
|
|
|
|
TriggerIntrospectionProjections FeatureSource[bool]
|
|
|
|
LegacyIntrospection FeatureSource[bool]
|
2024-03-12 13:50:13 +00:00
|
|
|
UserSchema FeatureSource[bool]
|
2024-03-20 10:18:46 +00:00
|
|
|
TokenExchange FeatureSource[bool]
|
2024-04-09 17:21:21 +00:00
|
|
|
Actions FeatureSource[bool]
|
2024-05-24 11:32:57 +00:00
|
|
|
ImprovedPerformance FeatureSource[[]feature.ImprovedPerformanceType]
|
2024-08-14 14:18:14 +00:00
|
|
|
WebKey FeatureSource[bool]
|
2024-08-20 06:45:24 +00:00
|
|
|
DebugOIDCParentError FeatureSource[bool]
|
2024-09-04 10:14:50 +00:00
|
|
|
OIDCSingleV1SessionTermination FeatureSource[bool]
|
2024-09-26 13:55:41 +00:00
|
|
|
DisableUserTokenEvent FeatureSource[bool]
|
2024-10-31 14:57:17 +00:00
|
|
|
EnableBackChannelLogout FeatureSource[bool]
|
2024-02-28 08:55:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Queries) GetInstanceFeatures(ctx context.Context, cascade bool) (_ *InstanceFeatures, err error) {
|
|
|
|
var system *SystemFeatures
|
|
|
|
if cascade {
|
|
|
|
system, err = q.GetSystemFeatures(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m := NewInstanceFeaturesReadModel(ctx, system)
|
|
|
|
if err = q.eventstore.FilterToQueryReducer(ctx, m); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
m.instance.Details = readModelToObjectDetails(m.ReadModel)
|
|
|
|
return m.instance, nil
|
|
|
|
}
|