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>
This commit is contained in:
Livio Amstutz
2021-02-17 15:31:47 +01:00
committed by GitHub
parent 39eb172804
commit 744185449e
64 changed files with 2275 additions and 836 deletions

View File

@@ -1,54 +0,0 @@
package model
import (
"time"
"github.com/caos/zitadel/internal/model"
)
type MachineKeyView struct {
ID string
UserID string
Type MachineKeyType
Sequence uint64
CreationDate time.Time
ExpirationDate time.Time
PublicKey []byte
}
type MachineKeySearchRequest struct {
Offset uint64
Limit uint64
SortingColumn MachineKeySearchKey
Asc bool
Queries []*MachineKeySearchQuery
}
type MachineKeySearchKey int32
const (
MachineKeyKeyUnspecified MachineKeySearchKey = iota
MachineKeyKeyID
MachineKeyKeyUserID
)
type MachineKeySearchQuery struct {
Key MachineKeySearchKey
Method model.SearchMethod
Value interface{}
}
type MachineKeySearchResponse struct {
Offset uint64
Limit uint64
TotalResult uint64
Result []*MachineKeyView
Sequence uint64
Timestamp time.Time
}
func (r *MachineKeySearchRequest) EnsureLimit(limit uint64) {
if r.Limit == 0 || r.Limit > limit {
r.Limit = limit
}
}

View File

@@ -4,6 +4,7 @@ import (
"time"
"github.com/caos/zitadel/internal/eventstore/models"
key_model "github.com/caos/zitadel/internal/key/model"
)
type Machine struct {
@@ -21,14 +22,7 @@ type MachineKey struct {
models.ObjectRoot
KeyID string
Type MachineKeyType
Type key_model.AuthNKeyType
ExpirationDate time.Time
PrivateKey []byte
}
type MachineKeyType int32
const (
MachineKeyTypeNONE = iota
MachineKeyTypeJSON
)