2020-05-11 12:16:29 +02:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2021-03-01 08:48:50 +01:00
|
|
|
"github.com/caos/zitadel/internal/domain"
|
2021-04-06 16:03:07 +02:00
|
|
|
caos_errors "github.com/caos/zitadel/internal/errors"
|
|
|
|
|
2020-05-11 12:16:29 +02:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ApplicationView struct {
|
2021-08-24 08:34:10 +02:00
|
|
|
ID string
|
|
|
|
ProjectID string
|
|
|
|
Name string
|
|
|
|
CreationDate time.Time
|
|
|
|
ChangeDate time.Time
|
|
|
|
ResourceOwner string
|
|
|
|
State AppState
|
|
|
|
ProjectRoleAssertion bool
|
|
|
|
ProjectRoleCheck bool
|
|
|
|
HasProjectCheck bool
|
|
|
|
PrivateLabelingSetting domain.PrivateLabelingSetting
|
2020-05-11 12:16:29 +02:00
|
|
|
|
|
|
|
IsOIDC bool
|
2020-08-10 09:34:56 +02:00
|
|
|
OIDCVersion OIDCVersion
|
2020-05-11 12:16:29 +02:00
|
|
|
OIDCClientID string
|
|
|
|
OIDCRedirectUris []string
|
|
|
|
OIDCResponseTypes []OIDCResponseType
|
|
|
|
OIDCGrantTypes []OIDCGrantType
|
|
|
|
OIDCApplicationType OIDCApplicationType
|
|
|
|
OIDCAuthMethodType OIDCAuthMethodType
|
|
|
|
OIDCPostLogoutRedirectUris []string
|
2020-08-10 09:34:56 +02:00
|
|
|
NoneCompliant bool
|
|
|
|
ComplianceProblems []string
|
|
|
|
DevMode bool
|
2020-08-24 10:06:55 +02:00
|
|
|
OriginAllowList []string
|
2021-05-19 09:17:38 +02:00
|
|
|
AdditionalOrigins []string
|
2020-10-16 07:49:38 +02:00
|
|
|
AccessTokenType OIDCTokenType
|
|
|
|
IDTokenRoleAssertion bool
|
|
|
|
AccessTokenRoleAssertion bool
|
2020-11-27 14:10:52 +01:00
|
|
|
IDTokenUserinfoAssertion bool
|
|
|
|
ClockSkew time.Duration
|
2020-05-11 12:16:29 +02:00
|
|
|
|
|
|
|
Sequence uint64
|
|
|
|
}
|
|
|
|
|
|
|
|
type ApplicationSearchRequest struct {
|
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
2020-06-23 14:47:47 +02:00
|
|
|
SortingColumn AppSearchKey
|
2020-05-11 12:16:29 +02:00
|
|
|
Asc bool
|
|
|
|
Queries []*ApplicationSearchQuery
|
|
|
|
}
|
|
|
|
|
2020-06-23 14:47:47 +02:00
|
|
|
type AppSearchKey int32
|
2020-05-11 12:16:29 +02:00
|
|
|
|
|
|
|
const (
|
2020-06-23 14:47:47 +02:00
|
|
|
AppSearchKeyUnspecified AppSearchKey = iota
|
|
|
|
AppSearchKeyName
|
|
|
|
AppSearchKeyOIDCClientID
|
|
|
|
AppSearchKeyProjectID
|
|
|
|
AppSearchKeyAppID
|
2020-05-11 12:16:29 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type ApplicationSearchQuery struct {
|
2020-06-23 14:47:47 +02:00
|
|
|
Key AppSearchKey
|
2021-03-01 08:48:50 +01:00
|
|
|
Method domain.SearchMethod
|
2020-06-16 11:40:18 +02:00
|
|
|
Value interface{}
|
2020-05-11 12:16:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type ApplicationSearchResponse struct {
|
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
|
|
|
TotalResult uint64
|
|
|
|
Result []*ApplicationView
|
2020-07-15 13:24:36 +02:00
|
|
|
Sequence uint64
|
|
|
|
Timestamp time.Time
|
2020-05-11 12:16:29 +02:00
|
|
|
}
|
|
|
|
|
2021-04-06 16:03:07 +02:00
|
|
|
func (r *ApplicationSearchRequest) EnsureLimit(limit uint64) error {
|
|
|
|
if r.Limit > limit {
|
|
|
|
return caos_errors.ThrowInvalidArgument(nil, "SEARCH-3Mf8s", "Errors.Limit.ExceedsDefault")
|
|
|
|
}
|
|
|
|
if r.Limit == 0 {
|
2020-05-11 12:16:29 +02:00
|
|
|
r.Limit = limit
|
|
|
|
}
|
2021-04-06 16:03:07 +02:00
|
|
|
return nil
|
2020-05-11 12:16:29 +02:00
|
|
|
}
|