mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-30 02:52:16 +00:00
# Which Problems Are Solved This PR contains the command-layer implementation to add an instance IDP of the type `ZitadelProvider` # How the Problems Are Solved - Implementing `AddZitadelProvider` in AdminService - Adding the command-layer to create a `ZitadelProvider` and push `ZitadelIDPAddedEvent` # Additional Changes N/A # Additional Context - Related to https://github.com/zitadel/zitadel/issues/11823 - Follow-up for PR https://github.com/zitadel/zitadel/pull/12018 --------- Co-authored-by: Copilot <[email protected]>
62 lines
1.6 KiB
Go
62 lines
1.6 KiB
Go
package idp
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
)
|
|
|
|
type RolesInfo struct {
|
|
OrganizationID string `json:"organizationId"`
|
|
OrganizationDomain string `json:"organizationDomain"`
|
|
}
|
|
|
|
type ZitadelIDPAddedEvent struct {
|
|
eventstore.BaseEvent `json:"-"`
|
|
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Issuer string `json:"issuer"`
|
|
ClientID string `json:"clientId"`
|
|
ClientSecret *crypto.CryptoValue `json:"clientSecret"`
|
|
Scopes []string `json:"scopes,omitempty"`
|
|
InstanceRolesInfo []RolesInfo `json:"instanceRolesInfo,omitempty"`
|
|
Options
|
|
}
|
|
|
|
func NewZitadelIDPAddedEvent(
|
|
base *eventstore.BaseEvent,
|
|
id,
|
|
name,
|
|
issuer,
|
|
clientID string,
|
|
clientSecret *crypto.CryptoValue,
|
|
scopes []string,
|
|
options Options,
|
|
instanceRolesInfo []RolesInfo,
|
|
) *ZitadelIDPAddedEvent {
|
|
return &ZitadelIDPAddedEvent{
|
|
BaseEvent: *base,
|
|
ID: id,
|
|
Name: name,
|
|
Issuer: issuer,
|
|
ClientID: clientID,
|
|
ClientSecret: clientSecret,
|
|
Scopes: scopes,
|
|
Options: options,
|
|
InstanceRolesInfo: instanceRolesInfo,
|
|
}
|
|
}
|
|
|
|
func (e *ZitadelIDPAddedEvent) Payload() interface{} {
|
|
return e
|
|
}
|
|
|
|
func (e *ZitadelIDPAddedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
|
return nil
|
|
}
|
|
|
|
type ZitadelIDPChangedEvent struct {
|
|
eventstore.BaseEvent `json:"-"`
|
|
// todo (@grvijayan): will be added along with UpdateZitadelProvider changes
|
|
}
|