mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-04 01:48:50 +00:00
feat: idps (#1188)
* add setup steps * refactoring * omitempty * cleanup * begin org * create org * setup org * setup org * merge * fixes * fixes * fixes * add project * add oidc application * fix app creation * add resourceOwner to writemodels * resource owner * cleanup * global org, iam project and iam member in setup * logs * logs * logs * cleanup * Update internal/v2/command/project.go Co-authored-by: Fabi <[email protected]> * check project state * add org domain commands * add org status changes and member commands * fixes * policies * login policy * fix iam project event * mapper * label policy * change to command * fix * fix * handle change event differently and lot of fixes * idps * fixes * fixes * fixes * changedEvent handling * fix change events * remove creation date Co-authored-by: Fabi <[email protected]>
This commit is contained in:
@@ -2,8 +2,10 @@ package management
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
|
||||
"github.com/caos/zitadel/internal/api/authz"
|
||||
"github.com/caos/zitadel/pkg/grpc/management"
|
||||
)
|
||||
|
||||
@@ -16,48 +18,42 @@ func (s *Server) IdpByID(ctx context.Context, id *management.IdpID) (*management
|
||||
}
|
||||
|
||||
func (s *Server) CreateOidcIdp(ctx context.Context, oidcIdpConfig *management.OidcIdpConfigCreate) (*management.Idp, error) {
|
||||
config, err := s.org.AddOIDCIDPConfig(ctx, createOidcIdpToModel(oidcIdpConfig))
|
||||
config, err := s.command.AddIDPConfig(ctx, createOidcIdpToDomain(oidcIdpConfig))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return idpFromModel(config), nil
|
||||
return idpFromDomain(config), nil
|
||||
}
|
||||
|
||||
func (s *Server) UpdateIdpConfig(ctx context.Context, idpConfig *management.IdpUpdate) (*management.Idp, error) {
|
||||
config, err := s.org.ChangeIDPConfig(ctx, updateIdpToModel(idpConfig))
|
||||
config, err := s.command.ChangeIDPConfig(ctx, updateIdpToDomain(ctx, idpConfig))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return idpFromModel(config), nil
|
||||
return idpFromDomain(config), nil
|
||||
}
|
||||
|
||||
func (s *Server) DeactivateIdpConfig(ctx context.Context, id *management.IdpID) (*management.Idp, error) {
|
||||
config, err := s.org.DeactivateIDPConfig(ctx, id.Id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return idpFromModel(config), nil
|
||||
func (s *Server) DeactivateIdpConfig(ctx context.Context, id *management.IdpID) (*empty.Empty, error) {
|
||||
err := s.command.DeactivateIDPConfig(ctx, id.Id, authz.GetCtxData(ctx).OrgID)
|
||||
return &empty.Empty{}, err
|
||||
}
|
||||
|
||||
func (s *Server) ReactivateIdpConfig(ctx context.Context, id *management.IdpID) (*management.Idp, error) {
|
||||
config, err := s.org.ReactivateIDPConfig(ctx, id.Id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return idpFromModel(config), nil
|
||||
func (s *Server) ReactivateIdpConfig(ctx context.Context, id *management.IdpID) (*empty.Empty, error) {
|
||||
err := s.command.ReactivateIDPConfig(ctx, id.Id, authz.GetCtxData(ctx).OrgID)
|
||||
return &empty.Empty{}, err
|
||||
}
|
||||
|
||||
func (s *Server) RemoveIdpConfig(ctx context.Context, id *management.IdpID) (*empty.Empty, error) {
|
||||
err := s.org.RemoveIDPConfig(ctx, id.Id)
|
||||
err := s.command.RemoveIDPConfig(ctx, id.Id, authz.GetCtxData(ctx).OrgID)
|
||||
return &empty.Empty{}, err
|
||||
}
|
||||
|
||||
func (s *Server) UpdateOidcIdpConfig(ctx context.Context, request *management.OidcIdpConfigUpdate) (*management.OidcIdpConfig, error) {
|
||||
config, err := s.org.ChangeOIDCIDPConfig(ctx, updateOidcIdpToModel(request))
|
||||
config, err := s.command.ChangeIDPOIDCConfig(ctx, updateOidcIdpToDomain(ctx, request))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return oidcIdpConfigFromModel(config), nil
|
||||
return oidcIdpConfigFromDomain(config), nil
|
||||
}
|
||||
|
||||
func (s *Server) SearchIdps(ctx context.Context, request *management.IdpSearchRequest) (*management.IdpSearchResponse, error) {
|
||||
|
||||
Reference in New Issue
Block a user