mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-11 19:43:40 +00:00
c65331df1a
* fix: project events * fix: project events * fix: project events * fix: eventmapper * fix: project commands * fix: project role commands * fix: project command side * fix: oidc application * fix: oidc application * fix: reduce * fix: reduce * fix: project member * fix: project grant command side * fix: application command side * fix: project grant member remove * Update internal/v2/command/project.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/project.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/project_application.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/project_application.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/project_application.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: oidc application string pw * fix: project events * fix: project grant member * feat: change application to interface Co-authored-by: Livio Amstutz <livio.a@gmail.com>
75 lines
2.7 KiB
Go
75 lines
2.7 KiB
Go
package command
|
|
|
|
import (
|
|
"github.com/caos/zitadel/internal/v2/domain"
|
|
)
|
|
|
|
func projectWriteModelToProject(writeModel *ProjectWriteModel) *domain.Project {
|
|
return &domain.Project{
|
|
ObjectRoot: writeModelToObjectRoot(writeModel.WriteModel),
|
|
Name: writeModel.Name,
|
|
ProjectRoleAssertion: writeModel.ProjectRoleAssertion,
|
|
ProjectRoleCheck: writeModel.ProjectRoleCheck,
|
|
}
|
|
}
|
|
|
|
func projectGrantWriteModelToProjectGrant(writeModel *ProjectGrantWriteModel) *domain.ProjectGrant {
|
|
return &domain.ProjectGrant{
|
|
ObjectRoot: writeModelToObjectRoot(writeModel.WriteModel),
|
|
GrantID: writeModel.GrantID,
|
|
GrantedOrgID: writeModel.GrantedOrgID,
|
|
RoleKeys: writeModel.RoleKeys,
|
|
State: writeModel.State,
|
|
}
|
|
}
|
|
|
|
func applicationWriteModelToApplication(writeModel *ApplicationWriteModel) domain.Application {
|
|
return &domain.ChangeApp{
|
|
AppID: writeModel.AppID,
|
|
AppName: writeModel.Name,
|
|
State: writeModel.State,
|
|
}
|
|
}
|
|
|
|
func oidcWriteModelToOIDCConfig(writeModel *OIDCApplicationWriteModel) *domain.OIDCApp {
|
|
return &domain.OIDCApp{
|
|
ObjectRoot: writeModelToObjectRoot(writeModel.WriteModel),
|
|
AppID: writeModel.AggregateID,
|
|
AppName: writeModel.AppName,
|
|
State: writeModel.State,
|
|
ClientID: writeModel.ClientID,
|
|
ClientSecret: writeModel.ClientSecret,
|
|
RedirectUris: writeModel.RedirectUris,
|
|
ResponseTypes: writeModel.ResponseTypes,
|
|
GrantTypes: writeModel.GrantTypes,
|
|
ApplicationType: writeModel.ApplicationType,
|
|
AuthMethodType: writeModel.AuthMethodType,
|
|
PostLogoutRedirectUris: writeModel.PostLogoutRedirectUris,
|
|
OIDCVersion: writeModel.OIDCVersion,
|
|
DevMode: writeModel.DevMode,
|
|
AccessTokenType: writeModel.AccessTokenType,
|
|
AccessTokenRoleAssertion: writeModel.AccessTokenRoleAssertion,
|
|
IDTokenRoleAssertion: writeModel.IDTokenRoleAssertion,
|
|
IDTokenUserinfoAssertion: writeModel.IDTokenUserinfoAssertion,
|
|
ClockSkew: writeModel.ClockSkew,
|
|
}
|
|
}
|
|
|
|
func roleWriteModelToRole(writeModel *ProjectRoleWriteModel) *domain.ProjectRole {
|
|
return &domain.ProjectRole{
|
|
ObjectRoot: writeModelToObjectRoot(writeModel.WriteModel),
|
|
Key: writeModel.Key,
|
|
DisplayName: writeModel.DisplayName,
|
|
Group: writeModel.Group,
|
|
}
|
|
}
|
|
|
|
func memberWriteModelToProjectGrantMember(writeModel *ProjectGrantMemberWriteModel) *domain.ProjectGrantMember {
|
|
return &domain.ProjectGrantMember{
|
|
ObjectRoot: writeModelToObjectRoot(writeModel.WriteModel),
|
|
Roles: writeModel.Roles,
|
|
GrantID: writeModel.GrantID,
|
|
UserID: writeModel.UserID,
|
|
}
|
|
}
|