mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 08:57:35 +00:00
feat: features (#1427)
* features * features * features * fix json tags * add features handler to auth * mocks for tests * add setup step * fixes * add featurelist to auth api * grandfather state and typos * typo * merge new-eventstore * fix login policy tests * label policy in features * audit log retention
This commit is contained in:
@@ -4,6 +4,8 @@ InternalAuthZ:
|
||||
Permissions:
|
||||
- "iam.read"
|
||||
- "iam.write"
|
||||
- "iam.features.read"
|
||||
- "iam.features.write"
|
||||
- "iam.policy.read"
|
||||
- "iam.policy.write"
|
||||
- "iam.policy.delete"
|
||||
@@ -31,6 +33,7 @@ InternalAuthZ:
|
||||
- "user.grant.write"
|
||||
- "user.grant.delete"
|
||||
- "user.membership.read"
|
||||
- "features.read"
|
||||
- "policy.read"
|
||||
- "policy.write"
|
||||
- "policy.delete"
|
||||
@@ -56,6 +59,7 @@ InternalAuthZ:
|
||||
- Role: 'IAM_OWNER_VIEWER'
|
||||
Permissions:
|
||||
- "iam.read"
|
||||
- "iam.features.read"
|
||||
- "iam.policy.read"
|
||||
- "iam.member.read"
|
||||
- "iam.idp.read"
|
||||
@@ -66,6 +70,7 @@ InternalAuthZ:
|
||||
- "user.global.read"
|
||||
- "user.grant.read"
|
||||
- "user.membership.read"
|
||||
- "features.read"
|
||||
- "policy.read"
|
||||
- "project.read"
|
||||
- "project.member.read"
|
||||
@@ -93,6 +98,7 @@ InternalAuthZ:
|
||||
- "user.grant.write"
|
||||
- "user.grant.delete"
|
||||
- "user.membership.read"
|
||||
- "features.read"
|
||||
- "policy.read"
|
||||
- "policy.write"
|
||||
- "policy.delete"
|
||||
@@ -123,6 +129,7 @@ InternalAuthZ:
|
||||
- "user.global.read"
|
||||
- "user.grant.read"
|
||||
- "user.membership.read"
|
||||
- "features.read"
|
||||
- "policy.read"
|
||||
- "project.read"
|
||||
- "project.member.read"
|
||||
|
@@ -103,24 +103,24 @@ func startZitadel(configPaths []string) {
|
||||
logging.Log("MAIN-FaF2r").OnError(err).Fatal("cannot read config")
|
||||
|
||||
ctx := context.Background()
|
||||
esCommands, err := eventstore.StartWithUser(conf.EventstoreBase, conf.Commands.Eventstore)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
commands, err := command.StartCommands(esCommands, conf.SystemDefaults, conf.InternalAuthZ)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
esQueries, err := eventstore.StartWithUser(conf.EventstoreBase, conf.Queries.Eventstore)
|
||||
if err != nil {
|
||||
return
|
||||
logging.Log("MAIN-Ddv21").OnError(err).Fatal("cannot start eventstore for queries")
|
||||
}
|
||||
queries, err := query.StartQueries(esQueries, conf.SystemDefaults)
|
||||
if err != nil {
|
||||
return
|
||||
logging.Log("MAIN-Ddv21").OnError(err).Fatal("cannot start queries")
|
||||
}
|
||||
authZRepo, err := authz.Start(ctx, conf.AuthZ, conf.InternalAuthZ, conf.SystemDefaults, queries)
|
||||
logging.Log("MAIN-s9KOw").OnError(err).Fatal("error starting authz repo")
|
||||
esCommands, err := eventstore.StartWithUser(conf.EventstoreBase, conf.Commands.Eventstore)
|
||||
if err != nil {
|
||||
logging.Log("MAIN-Ddv21").OnError(err).Fatal("cannot start eventstore for commands")
|
||||
}
|
||||
commands, err := command.StartCommands(esCommands, conf.SystemDefaults, conf.InternalAuthZ, authZRepo)
|
||||
if err != nil {
|
||||
logging.Log("MAIN-Ddv21").OnError(err).Fatal("cannot start commands")
|
||||
}
|
||||
var authRepo *auth_es.EsRepository
|
||||
if *authEnabled || *oidcEnabled || *loginEnabled {
|
||||
authRepo, err = auth_es.Start(conf.Auth, conf.InternalAuthZ, conf.SystemDefaults, commands, queries, authZRepo, esQueries)
|
||||
@@ -190,7 +190,7 @@ func startSetup(configPaths []string, localDevMode bool) {
|
||||
es, err := eventstore.Start(conf.Eventstore)
|
||||
logging.Log("MAIN-Ddt3").OnError(err).Fatal("cannot start eventstore")
|
||||
|
||||
commands, err := command.StartCommands(es, conf.SystemDefaults, conf.InternalAuthZ)
|
||||
commands, err := command.StartCommands(es, conf.SystemDefaults, conf.InternalAuthZ, nil)
|
||||
logging.Log("MAIN-dsjrr").OnError(err).Fatal("cannot start command side")
|
||||
|
||||
err = setup.Execute(ctx, conf.SetUp, conf.SystemDefaults.IamID, commands)
|
||||
|
@@ -175,3 +175,6 @@ SetUp:
|
||||
ButtonText: Login
|
||||
Step11:
|
||||
MigrateV1EventstoreToV2: $ZITADEL_MIGRATE_ES_V1
|
||||
Step12:
|
||||
TierName: FREE Tier
|
||||
AuditLogRetention: 9600h #400d = ~13months
|
||||
|
Reference in New Issue
Block a user