mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-25 20:38:48 +00:00
feat: jwt as idp (#2363)
* feat: jwt idp * feat: command side * feat: add tests * fill idp views with jwt idps and return apis * add jwtEndpoint to jwt idp * begin jwt request handling * merge * handle jwt idp * cleanup * fixes * autoregister * get token from specific header name * error handling * fix texts * handle renderExternalNotFoundOption Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
@@ -17,6 +17,7 @@ type IDPConfigReadModel struct {
|
||||
ProviderType domain.IdentityProviderType
|
||||
|
||||
OIDCConfig *OIDCConfigReadModel
|
||||
JWTConfig *JWTConfigReadModel
|
||||
}
|
||||
|
||||
func NewIDPConfigReadModel(configID string) *IDPConfigReadModel {
|
||||
@@ -45,6 +46,13 @@ func (rm *IDPConfigReadModel) AppendEvents(events ...eventstore.EventReader) {
|
||||
case *idpconfig.OIDCConfigChangedEvent:
|
||||
rm.ReadModel.AppendEvents(e)
|
||||
rm.OIDCConfig.AppendEvents(event)
|
||||
case *idpconfig.JWTConfigAddedEvent:
|
||||
rm.JWTConfig = &JWTConfigReadModel{}
|
||||
rm.ReadModel.AppendEvents(e)
|
||||
rm.JWTConfig.AppendEvents(event)
|
||||
case *idpconfig.JWTConfigChangedEvent:
|
||||
rm.ReadModel.AppendEvents(e)
|
||||
rm.JWTConfig.AppendEvents(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,6 +78,11 @@ func (rm *IDPConfigReadModel) Reduce() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if rm.JWTConfig != nil {
|
||||
if err := rm.JWTConfig.Reduce(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return rm.ReadModel.Reduce()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user