mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-29 07:28:52 +00:00
feat: command layer implementation for AddZitadelProvider (#12020)
# 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]>
This commit is contained in:
co-authored by
Copilot
parent
01fe34a526
commit
bb3b52dda3
@@ -0,0 +1,61 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user