mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:17:32 +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:
@@ -159,6 +159,66 @@ func TestCommandSide_AddIDPConfig(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "idp config jwt add, ok",
|
||||
fields: fields{
|
||||
eventstore: eventstoreExpect(
|
||||
t,
|
||||
expectPush(
|
||||
[]*repository.Event{
|
||||
eventFromEventPusher(
|
||||
org.NewIDPConfigAddedEvent(context.Background(),
|
||||
&org.NewAggregate("org1", "org1").Aggregate,
|
||||
"config1",
|
||||
"name1",
|
||||
domain.IDPConfigTypeOIDC,
|
||||
domain.IDPConfigStylingTypeGoogle,
|
||||
false,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewIDPJWTConfigAddedEvent(context.Background(),
|
||||
&org.NewAggregate("org1", "org1").Aggregate,
|
||||
"config1",
|
||||
"jwt-endpoint",
|
||||
"issuer",
|
||||
"keys-endpoint",
|
||||
"auth",
|
||||
),
|
||||
),
|
||||
},
|
||||
uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name1", "org1")),
|
||||
),
|
||||
),
|
||||
idGenerator: id_mock.NewIDGeneratorExpectIDs(t, "config1"),
|
||||
},
|
||||
args: args{
|
||||
ctx: context.Background(),
|
||||
resourceOwner: "org1",
|
||||
config: &domain.IDPConfig{
|
||||
Name: "name1",
|
||||
StylingType: domain.IDPConfigStylingTypeGoogle,
|
||||
JWTConfig: &domain.JWTIDPConfig{
|
||||
JWTEndpoint: "jwt-endpoint",
|
||||
Issuer: "issuer",
|
||||
KeysEndpoint: "keys-endpoint",
|
||||
HeaderName: "auth",
|
||||
},
|
||||
},
|
||||
},
|
||||
res: res{
|
||||
want: &domain.IDPConfig{
|
||||
ObjectRoot: models.ObjectRoot{
|
||||
AggregateID: "org1",
|
||||
ResourceOwner: "org1",
|
||||
},
|
||||
IDPConfigID: "config1",
|
||||
Name: "name1",
|
||||
StylingType: domain.IDPConfigStylingTypeGoogle,
|
||||
State: domain.IDPConfigStateActive,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user