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:
Livio Amstutz
2021-03-25 17:26:21 +01:00
committed by GitHub
parent c9b3839f3d
commit a4763b1e4c
97 changed files with 3335 additions and 109 deletions

View File

@@ -1,6 +1,8 @@
package view
import (
"time"
"github.com/caos/zitadel/internal/errors"
es_models "github.com/caos/zitadel/internal/eventstore/v1/models"
"github.com/caos/zitadel/internal/org/repository/eventsourcing/model"
@@ -36,13 +38,16 @@ func OrgNameUniqueQuery(name string) *es_models.SearchQuery {
SetLimit(1)
}
func ChangesQuery(orgID string, latestSequence, limit uint64, sortAscending bool) *es_models.SearchQuery {
func ChangesQuery(orgID string, latestSequence, limit uint64, sortAscending bool, auditLogRetention time.Duration) *es_models.SearchQuery {
query := es_models.NewSearchQuery().
AggregateTypeFilter(model.OrgAggregate)
if !sortAscending {
query.OrderDesc()
}
if auditLogRetention > 0 {
query.CreationDateNewerFilter(time.Now().Add(-auditLogRetention))
}
query.LatestSequenceFilter(latestSequence).
AggregateIDFilter(orgID).