2020-11-04 10:26:10 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2021-03-01 07:48:50 +00:00
|
|
|
"github.com/caos/zitadel/internal/domain"
|
2020-11-04 10:26:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type SecondFactorsSearchRequest struct {
|
|
|
|
Queries []*MFASearchQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
type MultiFactorsSearchRequest struct {
|
|
|
|
Offset uint64
|
|
|
|
Limit uint64
|
|
|
|
Asc bool
|
|
|
|
Queries []*MFASearchQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
type MFASearchQuery struct {
|
|
|
|
Key MFASearchKey
|
2021-03-01 07:48:50 +00:00
|
|
|
Method domain.SearchMethod
|
2020-11-04 10:26:10 +00:00
|
|
|
Value interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type MFASearchKey int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
MFASearchKeyUnspecified MFASearchKey = iota
|
|
|
|
MFASearchKeyAggregateID
|
|
|
|
)
|
|
|
|
|
|
|
|
type SecondFactorsSearchResponse struct {
|
|
|
|
TotalResult uint64
|
|
|
|
Result []SecondFactorType
|
|
|
|
}
|
|
|
|
|
|
|
|
type MultiFactorsSearchResponse struct {
|
|
|
|
TotalResult uint64
|
|
|
|
Result []MultiFactorType
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *SecondFactorsSearchRequest) AppendAggregateIDQuery(aggregateID string) {
|
2021-03-01 07:48:50 +00:00
|
|
|
r.Queries = append(r.Queries, &MFASearchQuery{Key: MFASearchKeyAggregateID, Method: domain.SearchMethodEquals, Value: aggregateID})
|
2020-11-04 10:26:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *MultiFactorsSearchRequest) AppendAggregateIDQuery(aggregateID string) {
|
2021-03-01 07:48:50 +00:00
|
|
|
r.Queries = append(r.Queries, &MFASearchQuery{Key: MFASearchKeyAggregateID, Method: domain.SearchMethodEquals, Value: aggregateID})
|
2020-11-04 10:26:10 +00:00
|
|
|
}
|