mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-25 22:08:46 +00:00
feat: idp and login policy configurations (#619)
* feat: oidc config * fix: oidc configurations * feat: oidc idp config * feat: add oidc config test * fix: tests * fix: tests * feat: translate new events * feat: idp eventstore * feat: idp eventstore * fix: tests * feat: command side idp * feat: query side idp * feat: idp config on org * fix: tests * feat: authz idp on org * feat: org idps * feat: login policy * feat: login policy * feat: login policy * feat: add idp func on login policy * feat: add validation to loginpolicy and idp provider * feat: add default login policy * feat: login policy on org * feat: login policy on org * fix: id config handlers * fix: id config handlers * fix: create idp on org * fix: create idp on org * fix: not existing idp config * fix: default login policy * fix: add login policy on org * fix: idp provider search on org * fix: test * fix: remove idp on org * fix: test * fix: test * fix: remove admin idp * fix: logo src as byte * fix: migration * fix: tests * Update internal/iam/repository/eventsourcing/iam.go Co-authored-by: Silvan <[email protected]> * Update internal/iam/repository/eventsourcing/iam_test.go Co-authored-by: Silvan <[email protected]> * Update internal/iam/repository/eventsourcing/iam_test.go Co-authored-by: Silvan <[email protected]> * Update internal/iam/repository/eventsourcing/model/login_policy.go Co-authored-by: Silvan <[email protected]> * Update internal/iam/repository/eventsourcing/model/login_policy.go Co-authored-by: Silvan <[email protected]> * Update internal/org/repository/eventsourcing/org_test.go Co-authored-by: Silvan <[email protected]> * Update internal/iam/repository/eventsourcing/model/login_policy_test.go Co-authored-by: Silvan <[email protected]> * Update internal/iam/repository/eventsourcing/model/login_policy_test.go Co-authored-by: Silvan <[email protected]> * fix: pr comments * fix: tests * Update types.go * fix: merge request changes * fix: reduce optimization Co-authored-by: Silvan <[email protected]> Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Silvan
Livio Amstutz
parent
f05c5bae24
commit
db1d8f4efe
@@ -553,4 +553,79 @@ var ManagementService_AuthMethods = authz.MethodMapping{
|
||||
Permission: "user.grant.delete",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/IdpByID": authz.Option{
|
||||
Permission: "org.idp.read",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/CreateOidcIdp": authz.Option{
|
||||
Permission: "org.idp.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/UpdateIdpConfig": authz.Option{
|
||||
Permission: "org.idp.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/DeactivateIdpConfig": authz.Option{
|
||||
Permission: "org.idp.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/ReactivateIdpConfig": authz.Option{
|
||||
Permission: "org.idp.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/RemoveIdpConfig": authz.Option{
|
||||
Permission: "org.idp.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/UpdateOidcIdpConfig": authz.Option{
|
||||
Permission: "org.idp.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/SearchIdps": authz.Option{
|
||||
Permission: "org.idp.read",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/GetLoginPolicy": authz.Option{
|
||||
Permission: "policy.read",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/CreateLoginPolicy": authz.Option{
|
||||
Permission: "policy.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/UpdateLoginPolicy": authz.Option{
|
||||
Permission: "policy.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/RemoveLoginPolicy": authz.Option{
|
||||
Permission: "policy.delete",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/GetLoginPolicyIdpProviders": authz.Option{
|
||||
Permission: "policy.read",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/AddIdpProviderToLoginPolicy": authz.Option{
|
||||
Permission: "policy.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/RemoveIdpProviderFromLoginPolicy": authz.Option{
|
||||
Permission: "policy.write",
|
||||
CheckParam: "",
|
||||
},
|
||||
}
|
||||
|
||||
+17435
-7657
File diff suppressed because it is too large
Load Diff
+815
-5567
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,26 @@ func (m *MockManagementServiceClient) EXPECT() *MockManagementServiceClientMockR
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// AddIdpProviderToLoginPolicy mocks base method
|
||||
func (m *MockManagementServiceClient) AddIdpProviderToLoginPolicy(arg0 context.Context, arg1 *management.IdpProviderAdd, arg2 ...grpc.CallOption) (*management.IdpProvider, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "AddIdpProviderToLoginPolicy", varargs...)
|
||||
ret0, _ := ret[0].(*management.IdpProvider)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// AddIdpProviderToLoginPolicy indicates an expected call of AddIdpProviderToLoginPolicy
|
||||
func (mr *MockManagementServiceClientMockRecorder) AddIdpProviderToLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddIdpProviderToLoginPolicy", reflect.TypeOf((*MockManagementServiceClient)(nil).AddIdpProviderToLoginPolicy), varargs...)
|
||||
}
|
||||
|
||||
// AddMyOrgDomain mocks base method
|
||||
func (m *MockManagementServiceClient) AddMyOrgDomain(arg0 context.Context, arg1 *management.AddOrgDomainRequest, arg2 ...grpc.CallOption) (*management.OrgDomain, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -337,6 +357,26 @@ func (mr *MockManagementServiceClientMockRecorder) ChangeUserPhone(arg0, arg1 in
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChangeUserPhone", reflect.TypeOf((*MockManagementServiceClient)(nil).ChangeUserPhone), varargs...)
|
||||
}
|
||||
|
||||
// CreateLoginPolicy mocks base method
|
||||
func (m *MockManagementServiceClient) CreateLoginPolicy(arg0 context.Context, arg1 *management.LoginPolicyAdd, arg2 ...grpc.CallOption) (*management.LoginPolicy, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "CreateLoginPolicy", varargs...)
|
||||
ret0, _ := ret[0].(*management.LoginPolicy)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// CreateLoginPolicy indicates an expected call of CreateLoginPolicy
|
||||
func (mr *MockManagementServiceClientMockRecorder) CreateLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateLoginPolicy", reflect.TypeOf((*MockManagementServiceClient)(nil).CreateLoginPolicy), varargs...)
|
||||
}
|
||||
|
||||
// CreateOIDCApplication mocks base method
|
||||
func (m *MockManagementServiceClient) CreateOIDCApplication(arg0 context.Context, arg1 *management.OIDCApplicationCreate, arg2 ...grpc.CallOption) (*management.Application, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -357,6 +397,26 @@ func (mr *MockManagementServiceClientMockRecorder) CreateOIDCApplication(arg0, a
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOIDCApplication", reflect.TypeOf((*MockManagementServiceClient)(nil).CreateOIDCApplication), varargs...)
|
||||
}
|
||||
|
||||
// CreateOidcIdp mocks base method
|
||||
func (m *MockManagementServiceClient) CreateOidcIdp(arg0 context.Context, arg1 *management.OidcIdpConfigCreate, arg2 ...grpc.CallOption) (*management.Idp, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "CreateOidcIdp", varargs...)
|
||||
ret0, _ := ret[0].(*management.Idp)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// CreateOidcIdp indicates an expected call of CreateOidcIdp
|
||||
func (mr *MockManagementServiceClientMockRecorder) CreateOidcIdp(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOidcIdp", reflect.TypeOf((*MockManagementServiceClient)(nil).CreateOidcIdp), varargs...)
|
||||
}
|
||||
|
||||
// CreateOrg mocks base method
|
||||
func (m *MockManagementServiceClient) CreateOrg(arg0 context.Context, arg1 *management.OrgCreateRequest, arg2 ...grpc.CallOption) (*management.Org, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -537,6 +597,26 @@ func (mr *MockManagementServiceClientMockRecorder) DeactivateApplication(arg0, a
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeactivateApplication", reflect.TypeOf((*MockManagementServiceClient)(nil).DeactivateApplication), varargs...)
|
||||
}
|
||||
|
||||
// DeactivateIdpConfig mocks base method
|
||||
func (m *MockManagementServiceClient) DeactivateIdpConfig(arg0 context.Context, arg1 *management.IdpID, arg2 ...grpc.CallOption) (*management.Idp, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "DeactivateIdpConfig", varargs...)
|
||||
ret0, _ := ret[0].(*management.Idp)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// DeactivateIdpConfig indicates an expected call of DeactivateIdpConfig
|
||||
func (mr *MockManagementServiceClientMockRecorder) DeactivateIdpConfig(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeactivateIdpConfig", reflect.TypeOf((*MockManagementServiceClient)(nil).DeactivateIdpConfig), varargs...)
|
||||
}
|
||||
|
||||
// DeactivateMyOrg mocks base method
|
||||
func (m *MockManagementServiceClient) DeactivateMyOrg(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*management.Org, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -797,6 +877,46 @@ func (mr *MockManagementServiceClientMockRecorder) GetIam(arg0, arg1 interface{}
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIam", reflect.TypeOf((*MockManagementServiceClient)(nil).GetIam), varargs...)
|
||||
}
|
||||
|
||||
// GetLoginPolicy mocks base method
|
||||
func (m *MockManagementServiceClient) GetLoginPolicy(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*management.LoginPolicyView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetLoginPolicy", varargs...)
|
||||
ret0, _ := ret[0].(*management.LoginPolicyView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetLoginPolicy indicates an expected call of GetLoginPolicy
|
||||
func (mr *MockManagementServiceClientMockRecorder) GetLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLoginPolicy", reflect.TypeOf((*MockManagementServiceClient)(nil).GetLoginPolicy), varargs...)
|
||||
}
|
||||
|
||||
// GetLoginPolicyIdpProviders mocks base method
|
||||
func (m *MockManagementServiceClient) GetLoginPolicyIdpProviders(arg0 context.Context, arg1 *management.IdpProviderSearchRequest, arg2 ...grpc.CallOption) (*management.IdpProviderSearchResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetLoginPolicyIdpProviders", varargs...)
|
||||
ret0, _ := ret[0].(*management.IdpProviderSearchResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetLoginPolicyIdpProviders indicates an expected call of GetLoginPolicyIdpProviders
|
||||
func (mr *MockManagementServiceClientMockRecorder) GetLoginPolicyIdpProviders(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLoginPolicyIdpProviders", reflect.TypeOf((*MockManagementServiceClient)(nil).GetLoginPolicyIdpProviders), varargs...)
|
||||
}
|
||||
|
||||
// GetMyOrg mocks base method
|
||||
func (m *MockManagementServiceClient) GetMyOrg(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*management.OrgView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -1157,6 +1277,26 @@ func (mr *MockManagementServiceClientMockRecorder) Healthz(arg0, arg1 interface{
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Healthz", reflect.TypeOf((*MockManagementServiceClient)(nil).Healthz), varargs...)
|
||||
}
|
||||
|
||||
// IdpByID mocks base method
|
||||
func (m *MockManagementServiceClient) IdpByID(arg0 context.Context, arg1 *management.IdpID, arg2 ...grpc.CallOption) (*management.IdpView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "IdpByID", varargs...)
|
||||
ret0, _ := ret[0].(*management.IdpView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// IdpByID indicates an expected call of IdpByID
|
||||
func (mr *MockManagementServiceClientMockRecorder) IdpByID(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IdpByID", reflect.TypeOf((*MockManagementServiceClient)(nil).IdpByID), varargs...)
|
||||
}
|
||||
|
||||
// IsUserUnique mocks base method
|
||||
func (m *MockManagementServiceClient) IsUserUnique(arg0 context.Context, arg1 *management.UniqueUserRequest, arg2 ...grpc.CallOption) (*management.UniqueUserResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -1297,6 +1437,26 @@ func (mr *MockManagementServiceClientMockRecorder) ReactivateApplication(arg0, a
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReactivateApplication", reflect.TypeOf((*MockManagementServiceClient)(nil).ReactivateApplication), varargs...)
|
||||
}
|
||||
|
||||
// ReactivateIdpConfig mocks base method
|
||||
func (m *MockManagementServiceClient) ReactivateIdpConfig(arg0 context.Context, arg1 *management.IdpID, arg2 ...grpc.CallOption) (*management.Idp, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "ReactivateIdpConfig", varargs...)
|
||||
ret0, _ := ret[0].(*management.Idp)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ReactivateIdpConfig indicates an expected call of ReactivateIdpConfig
|
||||
func (mr *MockManagementServiceClientMockRecorder) ReactivateIdpConfig(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReactivateIdpConfig", reflect.TypeOf((*MockManagementServiceClient)(nil).ReactivateIdpConfig), varargs...)
|
||||
}
|
||||
|
||||
// ReactivateMyOrg mocks base method
|
||||
func (m *MockManagementServiceClient) ReactivateMyOrg(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*management.Org, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -1457,6 +1617,66 @@ func (mr *MockManagementServiceClientMockRecorder) RemoveApplication(arg0, arg1
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveApplication", reflect.TypeOf((*MockManagementServiceClient)(nil).RemoveApplication), varargs...)
|
||||
}
|
||||
|
||||
// RemoveIdpConfig mocks base method
|
||||
func (m *MockManagementServiceClient) RemoveIdpConfig(arg0 context.Context, arg1 *management.IdpID, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "RemoveIdpConfig", varargs...)
|
||||
ret0, _ := ret[0].(*emptypb.Empty)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// RemoveIdpConfig indicates an expected call of RemoveIdpConfig
|
||||
func (mr *MockManagementServiceClientMockRecorder) RemoveIdpConfig(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveIdpConfig", reflect.TypeOf((*MockManagementServiceClient)(nil).RemoveIdpConfig), varargs...)
|
||||
}
|
||||
|
||||
// RemoveIdpProviderFromLoginPolicy mocks base method
|
||||
func (m *MockManagementServiceClient) RemoveIdpProviderFromLoginPolicy(arg0 context.Context, arg1 *management.IdpProviderID, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "RemoveIdpProviderFromLoginPolicy", varargs...)
|
||||
ret0, _ := ret[0].(*emptypb.Empty)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// RemoveIdpProviderFromLoginPolicy indicates an expected call of RemoveIdpProviderFromLoginPolicy
|
||||
func (mr *MockManagementServiceClientMockRecorder) RemoveIdpProviderFromLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveIdpProviderFromLoginPolicy", reflect.TypeOf((*MockManagementServiceClient)(nil).RemoveIdpProviderFromLoginPolicy), varargs...)
|
||||
}
|
||||
|
||||
// RemoveLoginPolicy mocks base method
|
||||
func (m *MockManagementServiceClient) RemoveLoginPolicy(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "RemoveLoginPolicy", varargs...)
|
||||
ret0, _ := ret[0].(*emptypb.Empty)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// RemoveLoginPolicy indicates an expected call of RemoveLoginPolicy
|
||||
func (mr *MockManagementServiceClientMockRecorder) RemoveLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLoginPolicy", reflect.TypeOf((*MockManagementServiceClient)(nil).RemoveLoginPolicy), varargs...)
|
||||
}
|
||||
|
||||
// RemoveMyOrgDomain mocks base method
|
||||
func (m *MockManagementServiceClient) RemoveMyOrgDomain(arg0 context.Context, arg1 *management.RemoveOrgDomainRequest, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -1717,6 +1937,26 @@ func (mr *MockManagementServiceClientMockRecorder) SearchGrantedProjects(arg0, a
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchGrantedProjects", reflect.TypeOf((*MockManagementServiceClient)(nil).SearchGrantedProjects), varargs...)
|
||||
}
|
||||
|
||||
// SearchIdps mocks base method
|
||||
func (m *MockManagementServiceClient) SearchIdps(arg0 context.Context, arg1 *management.IdpSearchRequest, arg2 ...grpc.CallOption) (*management.IdpSearchResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "SearchIdps", varargs...)
|
||||
ret0, _ := ret[0].(*management.IdpSearchResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// SearchIdps indicates an expected call of SearchIdps
|
||||
func (mr *MockManagementServiceClientMockRecorder) SearchIdps(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchIdps", reflect.TypeOf((*MockManagementServiceClient)(nil).SearchIdps), varargs...)
|
||||
}
|
||||
|
||||
// SearchMyOrgDomains mocks base method
|
||||
func (m *MockManagementServiceClient) SearchMyOrgDomains(arg0 context.Context, arg1 *management.OrgDomainSearchRequest, arg2 ...grpc.CallOption) (*management.OrgDomainSearchResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -2037,6 +2277,66 @@ func (mr *MockManagementServiceClientMockRecorder) UpdateApplicationOIDCConfig(a
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateApplicationOIDCConfig", reflect.TypeOf((*MockManagementServiceClient)(nil).UpdateApplicationOIDCConfig), varargs...)
|
||||
}
|
||||
|
||||
// UpdateIdpConfig mocks base method
|
||||
func (m *MockManagementServiceClient) UpdateIdpConfig(arg0 context.Context, arg1 *management.IdpUpdate, arg2 ...grpc.CallOption) (*management.Idp, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "UpdateIdpConfig", varargs...)
|
||||
ret0, _ := ret[0].(*management.Idp)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// UpdateIdpConfig indicates an expected call of UpdateIdpConfig
|
||||
func (mr *MockManagementServiceClientMockRecorder) UpdateIdpConfig(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateIdpConfig", reflect.TypeOf((*MockManagementServiceClient)(nil).UpdateIdpConfig), varargs...)
|
||||
}
|
||||
|
||||
// UpdateLoginPolicy mocks base method
|
||||
func (m *MockManagementServiceClient) UpdateLoginPolicy(arg0 context.Context, arg1 *management.LoginPolicy, arg2 ...grpc.CallOption) (*management.LoginPolicy, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "UpdateLoginPolicy", varargs...)
|
||||
ret0, _ := ret[0].(*management.LoginPolicy)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// UpdateLoginPolicy indicates an expected call of UpdateLoginPolicy
|
||||
func (mr *MockManagementServiceClientMockRecorder) UpdateLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLoginPolicy", reflect.TypeOf((*MockManagementServiceClient)(nil).UpdateLoginPolicy), varargs...)
|
||||
}
|
||||
|
||||
// UpdateOidcIdpConfig mocks base method
|
||||
func (m *MockManagementServiceClient) UpdateOidcIdpConfig(arg0 context.Context, arg1 *management.OidcIdpConfigUpdate, arg2 ...grpc.CallOption) (*management.OidcIdpConfig, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "UpdateOidcIdpConfig", varargs...)
|
||||
ret0, _ := ret[0].(*management.OidcIdpConfig)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// UpdateOidcIdpConfig indicates an expected call of UpdateOidcIdpConfig
|
||||
func (mr *MockManagementServiceClientMockRecorder) UpdateOidcIdpConfig(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOidcIdpConfig", reflect.TypeOf((*MockManagementServiceClient)(nil).UpdateOidcIdpConfig), varargs...)
|
||||
}
|
||||
|
||||
// UpdatePasswordAgePolicy mocks base method
|
||||
func (m *MockManagementServiceClient) UpdatePasswordAgePolicy(arg0 context.Context, arg1 *management.PasswordAgePolicyUpdate, arg2 ...grpc.CallOption) (*management.PasswordAgePolicy, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
||||
@@ -950,7 +950,7 @@ service ManagementService {
|
||||
|
||||
rpc CreateOIDCApplication(OIDCApplicationCreate) returns (Application) {
|
||||
option (google.api.http) = {
|
||||
post: "/projects/{project_id}/oidcapplications"
|
||||
post: "/projects/{project_id}/applications/oidc"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
@@ -1243,10 +1243,172 @@ service ManagementService {
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "user.grant.delete"
|
||||
};
|
||||
}
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "user.grant.delete"
|
||||
};
|
||||
}
|
||||
|
||||
rpc IdpByID(IdpID) returns (IdpView) {
|
||||
option (google.api.http) = {
|
||||
get: "/orgs/me/idps/{id}"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.read"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CreateOidcIdp(OidcIdpConfigCreate) returns (Idp) {
|
||||
option (google.api.http) = {
|
||||
post: "/orgs/me/idps/oidc"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateIdpConfig(IdpUpdate) returns (Idp) {
|
||||
option (google.api.http) = {
|
||||
put: "/orgs/me/idps/{id}"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc DeactivateIdpConfig(IdpID) returns (Idp) {
|
||||
option (google.api.http) = {
|
||||
put: "/orgs/me/idps/{id}/_deactivate"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ReactivateIdpConfig(IdpID) returns (Idp) {
|
||||
option (google.api.http) = {
|
||||
put: "/orgs/me/idps/{id}/_reactivate"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc RemoveIdpConfig(IdpID) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
delete: "/orgs/me/idps/{id}"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateOidcIdpConfig(OidcIdpConfigUpdate) returns (OidcIdpConfig) {
|
||||
option (google.api.http) = {
|
||||
put: "/orgs/me/idps/{idp_id}/oidcconfig"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc SearchIdps(IdpSearchRequest) returns (IdpSearchResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/orgs/me/idps/_search"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "org.idp.read"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
rpc GetLoginPolicy(google.protobuf.Empty) returns (LoginPolicyView) {
|
||||
option (google.api.http) = {
|
||||
get: "/orgs/me/policies/login"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "policy.read"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CreateLoginPolicy(LoginPolicyAdd) returns (LoginPolicy) {
|
||||
option (google.api.http) = {
|
||||
post: "/orgs/me/policies/login"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "policy.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateLoginPolicy(LoginPolicy) returns (LoginPolicy) {
|
||||
option (google.api.http) = {
|
||||
put: "/orgs/me/policies/login"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "policy.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc RemoveLoginPolicy(google.protobuf.Empty) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
delete: "/orgs/me/policies/login"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "policy.delete"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetLoginPolicyIdpProviders(IdpProviderSearchRequest) returns (IdpProviderSearchResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/orgs/me/policies/login/idpproviders/_search"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "policy.read"
|
||||
};
|
||||
}
|
||||
|
||||
rpc AddIdpProviderToLoginPolicy(IdpProviderAdd) returns (IdpProvider) {
|
||||
option (google.api.http) = {
|
||||
post: "/orgs/me/policies/login/idpproviders"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "policy.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc RemoveIdpProviderFromLoginPolicy(IdpProviderID) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/orgs/me/policies/login/idpproviders/{idp_config_id}"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "policy.write"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message ZitadelDocs {
|
||||
@@ -2583,3 +2745,173 @@ enum MemberType {
|
||||
MEMBERTYPE_PROJECT = 2;
|
||||
MEMBERTYPE_PROJECT_GRANT = 3;
|
||||
}
|
||||
|
||||
|
||||
message IdpID {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message Idp {
|
||||
string id = 1;
|
||||
IdpState state = 2;
|
||||
google.protobuf.Timestamp creation_date = 3;
|
||||
google.protobuf.Timestamp change_date = 4;
|
||||
string name = 5;
|
||||
bytes logo_src = 6;
|
||||
oneof idp_config {
|
||||
OidcIdpConfig oidc_config = 7;
|
||||
}
|
||||
uint64 sequence = 8;
|
||||
}
|
||||
|
||||
message IdpUpdate {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
bytes logo_src = 3;
|
||||
}
|
||||
|
||||
message OidcIdpConfig {
|
||||
string client_id = 1;
|
||||
string client_secret = 2;
|
||||
string issuer = 3;
|
||||
repeated string scopes = 4;
|
||||
}
|
||||
enum IdpState {
|
||||
IDPCONFIGSTATE_UNSPECIFIED = 0;
|
||||
IDPCONFIGSTATE_ACTIVE = 1;
|
||||
IDPCONFIGSTATE_INACTIVE = 2;
|
||||
}
|
||||
|
||||
message OidcIdpConfigCreate {
|
||||
string name = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
bytes logo_src = 2;
|
||||
string client_id = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_secret = 4 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string issuer = 5 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
repeated string scopes = 6;
|
||||
}
|
||||
|
||||
message OidcIdpConfigUpdate {
|
||||
string idp_id = 1;
|
||||
string client_id = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string client_secret = 3;
|
||||
string issuer = 4 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
repeated string scopes = 5;
|
||||
}
|
||||
|
||||
message IdpSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated IdpView result = 4;
|
||||
uint64 processed_sequence = 5;
|
||||
google.protobuf.Timestamp view_timestamp = 6;
|
||||
}
|
||||
|
||||
message IdpView {
|
||||
string id = 1;
|
||||
IdpState state = 2;
|
||||
google.protobuf.Timestamp creation_date = 3;
|
||||
google.protobuf.Timestamp change_date = 4;
|
||||
string name = 5;
|
||||
bytes logo_src = 6;
|
||||
IdpProviderType provider_type = 7;
|
||||
oneof idp_config_view {
|
||||
OidcIdpConfigView oidc_config = 8;
|
||||
}
|
||||
uint64 sequence = 9;
|
||||
}
|
||||
|
||||
message OidcIdpConfigView {
|
||||
string client_id = 1;
|
||||
string issuer = 2;
|
||||
repeated string scopes = 3;
|
||||
}
|
||||
|
||||
message IdpSearchRequest {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
repeated IdpSearchQuery queries = 3;
|
||||
}
|
||||
|
||||
message IdpSearchQuery {
|
||||
IdpSearchKey key = 1 [(validate.rules).enum = {not_in: [0]}];
|
||||
SearchMethod method = 2;
|
||||
string value = 3;
|
||||
}
|
||||
|
||||
enum IdpSearchKey {
|
||||
IDPSEARCHKEY_UNSPECIFIED = 0;
|
||||
IDPSEARCHKEY_IDP_CONFIG_ID = 1;
|
||||
IDPSEARCHKEY_NAME = 2;
|
||||
IDPSEARCHKEY_PROVIDER_TYPE = 3;
|
||||
}
|
||||
|
||||
message LoginPolicy {
|
||||
bool allow_username_password = 1;
|
||||
bool allow_register = 2;
|
||||
bool allow_external_idp = 3;
|
||||
}
|
||||
|
||||
message LoginPolicyAdd {
|
||||
bool allow_username_password = 1;
|
||||
bool allow_register = 2;
|
||||
bool allow_external_idp = 3;
|
||||
}
|
||||
|
||||
message IdpProviderID {
|
||||
string idp_config_id = 1;
|
||||
}
|
||||
|
||||
message IdpProviderAdd {
|
||||
string idp_config_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
IdpProviderType idp_provider_type = 2;
|
||||
}
|
||||
|
||||
message IdpProvider {
|
||||
string idp_config_id = 1;
|
||||
IdpProviderType idp_provider_Type = 2;
|
||||
}
|
||||
|
||||
message LoginPolicyView {
|
||||
bool default = 1;
|
||||
bool allow_username_password = 2;
|
||||
bool allow_register = 3;
|
||||
bool allow_external_idp = 4;
|
||||
}
|
||||
|
||||
message IdpProviderViews {
|
||||
repeated IdpProviderView providers = 1;
|
||||
}
|
||||
|
||||
message IdpProviderView {
|
||||
string idp_config_id = 1;
|
||||
string name = 2;
|
||||
IdpType type = 3;
|
||||
}
|
||||
|
||||
enum IdpType {
|
||||
IDPTYPE_UNSPECIFIED = 0;
|
||||
IDPTYPE_OIDC = 1;
|
||||
IDPTYPE_SAML = 2;
|
||||
}
|
||||
|
||||
enum IdpProviderType {
|
||||
IDPPROVIDERTYPE_UNSPECIFIED = 0;
|
||||
IDPPROVIDERTYPE_SYSTEM = 1;
|
||||
IDPPROVIDERTYPE_ORG = 2;
|
||||
}
|
||||
|
||||
message IdpProviderSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated IdpProviderView result = 4;
|
||||
uint64 processed_sequence = 5;
|
||||
google.protobuf.Timestamp view_timestamp = 6;
|
||||
}
|
||||
|
||||
message IdpProviderSearchRequest {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user