mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-01 16:38:52 +00:00
feat: new user auth api (#1168)
* fix: correct selectors for extended writemodel * fix: no previous checks in eventstore * start check previous * feat: auth user commands * feat: auth user commands * feat: auth user commands * feat: otp * feat: corrections from pr merge * feat: webauthn * feat: comment old webauthn * feat: refactor user, human, machine * feat: webauth command side * feat: command and query side in login * feat: fix user writemodel append events * fix: remove creation dates on command side * fix: remove previous sequence * previous sequence * fix: external idps * Update internal/api/grpc/management/user.go Co-authored-by: Livio Amstutz <[email protected]> * Update internal/v2/command/user_human_email.go Co-authored-by: Livio Amstutz <[email protected]> * fix: pr changes * fix: phone verification Co-authored-by: adlerhurst <[email protected]> Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
adlerhurst
parent
e5731b0d3b
commit
959530ddad
@@ -13,11 +13,6 @@ type Aggregater interface {
|
||||
ResourceOwner() string
|
||||
//Version represents the semantic version of the aggregate
|
||||
Version() Version
|
||||
//PreviouseSequence should return the sequence of the latest event of this aggregate
|
||||
// stored in the eventstore
|
||||
// it's set to the first event of this push transaction,
|
||||
// later events consume the sequence of the previously pushed event of the aggregate
|
||||
PreviousSequence() uint64
|
||||
}
|
||||
|
||||
func NewAggregate(
|
||||
@@ -25,15 +20,13 @@ func NewAggregate(
|
||||
typ AggregateType,
|
||||
resourceOwner string,
|
||||
version Version,
|
||||
previousSequence uint64,
|
||||
) *Aggregate {
|
||||
return &Aggregate{
|
||||
id: id,
|
||||
typ: typ,
|
||||
resourceOwner: resourceOwner,
|
||||
version: version,
|
||||
previousSequence: previousSequence,
|
||||
events: []EventPusher{},
|
||||
id: id,
|
||||
typ: typ,
|
||||
resourceOwner: resourceOwner,
|
||||
version: version,
|
||||
events: []EventPusher{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,23 +36,21 @@ func AggregateFromWriteModel(
|
||||
version Version,
|
||||
) *Aggregate {
|
||||
return &Aggregate{
|
||||
id: wm.AggregateID,
|
||||
typ: typ,
|
||||
resourceOwner: wm.ResourceOwner,
|
||||
version: version,
|
||||
previousSequence: wm.ProcessedSequence,
|
||||
events: []EventPusher{},
|
||||
id: wm.AggregateID,
|
||||
typ: typ,
|
||||
resourceOwner: wm.ResourceOwner,
|
||||
version: version,
|
||||
events: []EventPusher{},
|
||||
}
|
||||
}
|
||||
|
||||
//Aggregate is the basic implementation of Aggregater
|
||||
type Aggregate struct {
|
||||
id string `json:"-"`
|
||||
typ AggregateType `json:"-"`
|
||||
events []EventPusher `json:"-"`
|
||||
resourceOwner string `json:"-"`
|
||||
version Version `json:"-"`
|
||||
previousSequence uint64 `json:"-"`
|
||||
id string `json:"-"`
|
||||
typ AggregateType `json:"-"`
|
||||
events []EventPusher `json:"-"`
|
||||
resourceOwner string `json:"-"`
|
||||
version Version `json:"-"`
|
||||
}
|
||||
|
||||
//PushEvents adds all the events to the aggregate.
|
||||
@@ -93,8 +84,3 @@ func (a *Aggregate) ResourceOwner() string {
|
||||
func (a *Aggregate) Version() Version {
|
||||
return a.version
|
||||
}
|
||||
|
||||
//PreviousSequence implements Aggregater
|
||||
func (a *Aggregate) PreviousSequence() uint64 {
|
||||
return a.previousSequence
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user