zitadel/internal/key/repository/view/model/authn_key_query.go
Livio Amstutz 744185449e
feat: token introspection, api clients and auth method private_key_jwt (#1276)
* introspect

* testingapplication key

* date

* client keys

* fix client keys

* fix client keys

* access tokens only for users

* AuthMethodPrivateKeyJWT

* client keys

* set introspection info correctly

* managae apis

* update oidc pkg

* cleanup

* merge msater

* set current sequence in migration

* set current sequence in migration

* set current sequence in migration

* Apply suggestions from code review

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>

* DeleteAuthNKeysByObjectID

* ensure authn keys uptodate

* update oidc version

* merge master

* merge master

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
2021-02-17 15:31:47 +01:00

64 lines
1.6 KiB
Go

package model
import (
key_model "github.com/caos/zitadel/internal/key/model"
global_model "github.com/caos/zitadel/internal/model"
"github.com/caos/zitadel/internal/view/repository"
)
type AuthNKeySearchRequest key_model.AuthNKeySearchRequest
type AuthNKeySearchQuery key_model.AuthNKeySearchQuery
type AuthNKeySearchKey key_model.AuthNKeySearchKey
func (req AuthNKeySearchRequest) GetLimit() uint64 {
return req.Limit
}
func (req AuthNKeySearchRequest) GetOffset() uint64 {
return req.Offset
}
func (req AuthNKeySearchRequest) GetSortingColumn() repository.ColumnKey {
if req.SortingColumn == key_model.AuthNKeyKeyUnspecified {
return nil
}
return AuthNKeySearchKey(req.SortingColumn)
}
func (req AuthNKeySearchRequest) GetAsc() bool {
return req.Asc
}
func (req AuthNKeySearchRequest) GetQueries() []repository.SearchQuery {
result := make([]repository.SearchQuery, len(req.Queries))
for i, q := range req.Queries {
result[i] = AuthNKeySearchQuery{Key: q.Key, Value: q.Value, Method: q.Method}
}
return result
}
func (req AuthNKeySearchQuery) GetKey() repository.ColumnKey {
return AuthNKeySearchKey(req.Key)
}
func (req AuthNKeySearchQuery) GetMethod() global_model.SearchMethod {
return req.Method
}
func (req AuthNKeySearchQuery) GetValue() interface{} {
return req.Value
}
func (key AuthNKeySearchKey) ToColumnName() string {
switch key_model.AuthNKeySearchKey(key) {
case key_model.AuthNKeyKeyID:
return AuthNKeyKeyID
case key_model.AuthNKeyObjectID:
return AuthNKeyObjectID
case key_model.AuthNKeyObjectType:
return AuthNKeyObjectType
default:
return ""
}
}