mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-12 17:15:15 +00:00
feat: get/list Zitadel IdP (#12394)
# Which Problems Are Solved This PR extends the functionality of `GetProviderByID`, `ListProviders` v1 endpoints and `GetIDPByID` v2 endpoint to also return Zitadel IdP when queried. # How the Problems Are Solved - Add `PROVIDER_TYPE_ZITADEL` and a `ZitadelConfig` to `zitadel.idp.v1.ProviderConfig` (v1 APIs). - Add `IDP_TYPE_ZITADEL`, `ZitadelConfig`, `InstanceRolesInfo` in v2 `idp.proto` - Extend internal/query IDP template querying to include a `ZitadelIDPTemplate` (incl. issuer, client credentials, scopes, instance roles info). - Add/extend integration tests for updating + fetching providers by ID and listing providers. # Additional Changes N/A # Additional Context Closes https://github.com/zitadel/zitadel/issues/12051 --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
39ad66bded
commit
77169181a3
@@ -2461,10 +2461,10 @@ func (wm *ZitadelIDPWriteModel) NewChanges(
|
||||
if wm.Issuer != issuer {
|
||||
changes = append(changes, idp.ChangeZitadelIDPIssuer(issuer))
|
||||
}
|
||||
if scopes != nil && !slices.Equal(wm.Scopes, scopes) {
|
||||
if !slices.Equal(wm.Scopes, scopes) {
|
||||
changes = append(changes, idp.ChangeZitadelIDPScopes(scopes))
|
||||
}
|
||||
if info != nil && !slices.Equal(wm.InstanceRolesInfo, info) {
|
||||
if !slices.Equal(wm.InstanceRolesInfo, info) {
|
||||
changes = append(changes, idp.ChangeZitadelIDPInstanceRolesInfo(info))
|
||||
}
|
||||
opts := wm.Changes(options)
|
||||
|
||||
@@ -6424,6 +6424,8 @@ func TestCommands_UpdateInstanceZitadelProvider(t *testing.T) {
|
||||
KeyID: "id",
|
||||
Crypted: []byte("newSecret"),
|
||||
}),
|
||||
idp.ChangeZitadelIDPInstanceRolesInfo(nil),
|
||||
idp.ChangeZitadelIDPScopes(nil),
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -6489,6 +6491,17 @@ func TestCommands_UpdateInstanceZitadelProvider(t *testing.T) {
|
||||
Name: "name",
|
||||
Issuer: "issuer",
|
||||
ClientID: "clientID",
|
||||
Scopes: []string{openid.ScopeOpenID, openid.ScopeEmail},
|
||||
InstanceRolesInfo: []idp.RolesInfo{
|
||||
{
|
||||
OrganizationID: "org1",
|
||||
OrganizationDomain: "example-org1.com",
|
||||
},
|
||||
{
|
||||
OrganizationID: "org2",
|
||||
OrganizationDomain: "example-org2.com",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
res: res{
|
||||
@@ -6756,7 +6769,7 @@ func TestCommands_UpdateInstanceZitadelProvider(t *testing.T) {
|
||||
Issuer: "new issuer",
|
||||
ClientID: "clientID2",
|
||||
ClientSecret: "newSecret",
|
||||
Scopes: nil,
|
||||
Scopes: []string{openid.ScopeOpenID, openid.ScopeEmail},
|
||||
IDPOptions: idp.Options{
|
||||
IsCreationAllowed: true,
|
||||
IsLinkingAllowed: true,
|
||||
|
||||
@@ -6459,6 +6459,8 @@ func TestCommands_UpdateOrgZitadelIDP(t *testing.T) {
|
||||
KeyID: "id",
|
||||
Crypted: []byte("newSecret"),
|
||||
}),
|
||||
idp.ChangeZitadelIDPScopes(nil),
|
||||
idp.ChangeZitadelIDPInstanceRolesInfo(nil),
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -6524,6 +6526,17 @@ func TestCommands_UpdateOrgZitadelIDP(t *testing.T) {
|
||||
Name: "name",
|
||||
Issuer: "issuer",
|
||||
ClientID: "clientID",
|
||||
Scopes: []string{openid.ScopeOpenID, openid.ScopeEmail},
|
||||
InstanceRolesInfo: []idp.RolesInfo{
|
||||
{
|
||||
OrganizationID: "org1",
|
||||
OrganizationDomain: "example-org1.com",
|
||||
},
|
||||
{
|
||||
OrganizationID: "org2",
|
||||
OrganizationDomain: "example-org2.com",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
res: res{
|
||||
@@ -6791,7 +6804,7 @@ func TestCommands_UpdateOrgZitadelIDP(t *testing.T) {
|
||||
Issuer: "new issuer",
|
||||
ClientID: "clientID2",
|
||||
ClientSecret: "newSecret",
|
||||
Scopes: nil,
|
||||
Scopes: []string{openid.ScopeOpenID, openid.ScopeEmail},
|
||||
IDPOptions: idp.Options{
|
||||
IsCreationAllowed: true,
|
||||
IsLinkingAllowed: true,
|
||||
|
||||
Reference in New Issue
Block a user