fix: new es fix (#1532)

* fix: handle ListMyProjectOrgsRequestToModel queries

* fix: sort orgs for admin org list by org name

* fix: features converters

* fix: remove last role from user grant

* fix: ensure limit

* fix: ensure limit

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Fabi
2021-04-06 16:03:07 +02:00
committed by GitHub
parent efc90b382c
commit 08bfec6652
38 changed files with 325 additions and 79 deletions

View File

@@ -2,6 +2,8 @@ package model
import (
"github.com/caos/zitadel/internal/domain"
caos_errors "github.com/caos/zitadel/internal/errors"
"time"
)
@@ -53,8 +55,12 @@ type TokenSearchResponse struct {
Result []*Token
}
func (r *TokenSearchRequest) EnsureLimit(limit uint64) {
if r.Limit == 0 || r.Limit > limit {
func (r *TokenSearchRequest) EnsureLimit(limit uint64) error {
if r.Limit > limit {
return caos_errors.ThrowInvalidArgument(nil, "SEARCH-M0fse", "Errors.Limit.ExceedsDefault")
}
if r.Limit == 0 {
r.Limit = limit
}
return nil
}