mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:47:32 +00:00
fix: rename iam to instance (#3345)
* fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename orgiampolicy to domain policy * fix: merge conflicts * fix: protos * fix: md files * implement deprecated org iam policy again Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
86
internal/repository/instance/idp_jwt_config.go
Normal file
86
internal/repository/instance/idp_jwt_config.go
Normal file
@@ -0,0 +1,86 @@
|
||||
package instance
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/repository"
|
||||
"github.com/caos/zitadel/internal/repository/idpconfig"
|
||||
)
|
||||
|
||||
const (
|
||||
IDPJWTConfigAddedEventType eventstore.EventType = "iam.idp." + idpconfig.JWTConfigAddedEventType
|
||||
IDPJWTConfigChangedEventType eventstore.EventType = "iam.idp." + idpconfig.JWTConfigChangedEventType
|
||||
)
|
||||
|
||||
type IDPJWTConfigAddedEvent struct {
|
||||
idpconfig.JWTConfigAddedEvent
|
||||
}
|
||||
|
||||
func NewIDPJWTConfigAddedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
idpConfigID,
|
||||
jwtEndpoint,
|
||||
issuer,
|
||||
keysEndpoint,
|
||||
headerName string,
|
||||
) *IDPJWTConfigAddedEvent {
|
||||
return &IDPJWTConfigAddedEvent{
|
||||
JWTConfigAddedEvent: *idpconfig.NewJWTConfigAddedEvent(
|
||||
eventstore.NewBaseEventForPush(
|
||||
ctx,
|
||||
aggregate,
|
||||
IDPJWTConfigAddedEventType,
|
||||
),
|
||||
idpConfigID,
|
||||
jwtEndpoint,
|
||||
issuer,
|
||||
keysEndpoint,
|
||||
headerName,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
func IDPJWTConfigAddedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
e, err := idpconfig.JWTConfigAddedEventMapper(event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &IDPJWTConfigAddedEvent{JWTConfigAddedEvent: *e.(*idpconfig.JWTConfigAddedEvent)}, nil
|
||||
}
|
||||
|
||||
type IDPJWTConfigChangedEvent struct {
|
||||
idpconfig.JWTConfigChangedEvent
|
||||
}
|
||||
|
||||
func NewIDPJWTConfigChangedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
idpConfigID string,
|
||||
changes []idpconfig.JWTConfigChanges,
|
||||
) (*IDPJWTConfigChangedEvent, error) {
|
||||
changeEvent, err := idpconfig.NewJWTConfigChangedEvent(
|
||||
eventstore.NewBaseEventForPush(
|
||||
ctx,
|
||||
aggregate,
|
||||
IDPJWTConfigChangedEventType),
|
||||
idpConfigID,
|
||||
changes,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &IDPJWTConfigChangedEvent{JWTConfigChangedEvent: *changeEvent}, nil
|
||||
}
|
||||
|
||||
func IDPJWTConfigChangedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
e, err := idpconfig.JWTConfigChangedEventMapper(event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &IDPJWTConfigChangedEvent{JWTConfigChangedEvent: *e.(*idpconfig.JWTConfigChangedEvent)}, nil
|
||||
}
|
Reference in New Issue
Block a user