feat: Private label email policy (#813)

* Label Policy added

* save

* chore: update docs action

* Save

* Save

* Get colors from DB

* Variables inserted

* Get images from global directory.

* Add tests

* Add tests

* Corrections from mergerequest

* Corrections from mergerequest

* Test corrected.

* Added colors to all notifications.

* Added colors to
Corrected text and formatting.all notifications.

* Spelling error corrected.

* fix: tests

* Merge Branch corrected.

* Step6 added

* Corrections from mergerequest

* fix: generate management

* Formatted texts.

* fix: migrations

Co-authored-by: Florian Forster <[email protected]>
Co-authored-by: adlerhurst <[email protected]>
Co-authored-by: Fabiennne <[email protected]>
This commit is contained in:
Michael Waeger
2020-10-20 19:10:23 +02:00
committed by GitHub
co-authored by Florian Forster adlerhurst Fabiennne
parent cfd119924f
commit 42384763d1
65 changed files with 7143 additions and 13940 deletions
+10
View File
@@ -149,6 +149,16 @@ var AdminService_AuthMethods = authz.MethodMapping{
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/GetDefaultLabelPolicy": authz.Option{
Permission: "iam.policy.read",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/UpdateDefaultLabelPolicy": authz.Option{
Permission: "iam.policy.write",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/GetDefaultLoginPolicy": authz.Option{
Permission: "iam.policy.read",
CheckParam: "",
+1256 -884
View File
File diff suppressed because it is too large Load Diff
+140
View File
@@ -1420,6 +1420,58 @@ func local_request_AdminService_SearchIdps_0(ctx context.Context, marshaler runt
}
func request_AdminService_GetDefaultLabelPolicy_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq empty.Empty
var metadata runtime.ServerMetadata
msg, err := client.GetDefaultLabelPolicy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AdminService_GetDefaultLabelPolicy_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq empty.Empty
var metadata runtime.ServerMetadata
msg, err := server.GetDefaultLabelPolicy(ctx, &protoReq)
return msg, metadata, err
}
func request_AdminService_UpdateDefaultLabelPolicy_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DefaultLabelPolicyUpdate
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.UpdateDefaultLabelPolicy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AdminService_UpdateDefaultLabelPolicy_0(ctx context.Context, marshaler runtime.Marshaler, server AdminServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DefaultLabelPolicyUpdate
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.UpdateDefaultLabelPolicy(ctx, &protoReq)
return msg, metadata, err
}
func request_AdminService_GetDefaultLoginPolicy_0(ctx context.Context, marshaler runtime.Marshaler, client AdminServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq empty.Empty
var metadata runtime.ServerMetadata
@@ -2355,6 +2407,46 @@ func RegisterAdminServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
})
mux.Handle("GET", pattern_AdminService_GetDefaultLabelPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AdminService_GetDefaultLabelPolicy_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AdminService_GetDefaultLabelPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_AdminService_UpdateDefaultLabelPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AdminService_UpdateDefaultLabelPolicy_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AdminService_UpdateDefaultLabelPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_AdminService_GetDefaultLoginPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -3216,6 +3308,46 @@ func RegisterAdminServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
})
mux.Handle("GET", pattern_AdminService_GetDefaultLabelPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AdminService_GetDefaultLabelPolicy_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AdminService_GetDefaultLabelPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_AdminService_UpdateDefaultLabelPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AdminService_UpdateDefaultLabelPolicy_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AdminService_UpdateDefaultLabelPolicy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_AdminService_GetDefaultLoginPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -3500,6 +3632,10 @@ var (
pattern_AdminService_SearchIdps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"idps", "_search"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_AdminService_GetDefaultLabelPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"policies", "label"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_AdminService_UpdateDefaultLabelPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"policies", "label"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_AdminService_GetDefaultLoginPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"policies", "login"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_AdminService_UpdateDefaultLoginPolicy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"policies", "login"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -3584,6 +3720,10 @@ var (
forward_AdminService_SearchIdps_0 = runtime.ForwardResponseMessage
forward_AdminService_GetDefaultLabelPolicy_0 = runtime.ForwardResponseMessage
forward_AdminService_UpdateDefaultLabelPolicy_0 = runtime.ForwardResponseMessage
forward_AdminService_GetDefaultLoginPolicy_0 = runtime.ForwardResponseMessage
forward_AdminService_UpdateDefaultLoginPolicy_0 = runtime.ForwardResponseMessage
+253
View File
@@ -4209,6 +4209,259 @@ var _IdpSearchQuery_Key_NotInLookup = map[IdpSearchKey]struct{}{
0: {},
}
// Validate checks the field values on DefaultLabelPolicy with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *DefaultLabelPolicy) Validate() error {
if m == nil {
return nil
}
// no validation rules for PrimaryColor
// no validation rules for SecondaryColor
if v, ok := interface{}(m.GetCreationDate()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DefaultLabelPolicyValidationError{
field: "CreationDate",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetChangeDate()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DefaultLabelPolicyValidationError{
field: "ChangeDate",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// DefaultLabelPolicyValidationError is the validation error returned by
// DefaultLabelPolicy.Validate if the designated constraints aren't met.
type DefaultLabelPolicyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DefaultLabelPolicyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DefaultLabelPolicyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DefaultLabelPolicyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DefaultLabelPolicyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DefaultLabelPolicyValidationError) ErrorName() string {
return "DefaultLabelPolicyValidationError"
}
// Error satisfies the builtin error interface
func (e DefaultLabelPolicyValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDefaultLabelPolicy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DefaultLabelPolicyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DefaultLabelPolicyValidationError{}
// Validate checks the field values on DefaultLabelPolicyUpdate with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *DefaultLabelPolicyUpdate) Validate() error {
if m == nil {
return nil
}
// no validation rules for PrimaryColor
// no validation rules for SecondaryColor
return nil
}
// DefaultLabelPolicyUpdateValidationError is the validation error returned by
// DefaultLabelPolicyUpdate.Validate if the designated constraints aren't met.
type DefaultLabelPolicyUpdateValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DefaultLabelPolicyUpdateValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DefaultLabelPolicyUpdateValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DefaultLabelPolicyUpdateValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DefaultLabelPolicyUpdateValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DefaultLabelPolicyUpdateValidationError) ErrorName() string {
return "DefaultLabelPolicyUpdateValidationError"
}
// Error satisfies the builtin error interface
func (e DefaultLabelPolicyUpdateValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDefaultLabelPolicyUpdate.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DefaultLabelPolicyUpdateValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DefaultLabelPolicyUpdateValidationError{}
// Validate checks the field values on DefaultLabelPolicyView with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *DefaultLabelPolicyView) Validate() error {
if m == nil {
return nil
}
// no validation rules for PrimaryColor
// no validation rules for SecondaryColor
if v, ok := interface{}(m.GetCreationDate()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DefaultLabelPolicyViewValidationError{
field: "CreationDate",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetChangeDate()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DefaultLabelPolicyViewValidationError{
field: "ChangeDate",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// DefaultLabelPolicyViewValidationError is the validation error returned by
// DefaultLabelPolicyView.Validate if the designated constraints aren't met.
type DefaultLabelPolicyViewValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DefaultLabelPolicyViewValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DefaultLabelPolicyViewValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DefaultLabelPolicyViewValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DefaultLabelPolicyViewValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DefaultLabelPolicyViewValidationError) ErrorName() string {
return "DefaultLabelPolicyViewValidationError"
}
// Error satisfies the builtin error interface
func (e DefaultLabelPolicyViewValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDefaultLabelPolicyView.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DefaultLabelPolicyViewValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DefaultLabelPolicyViewValidationError{}
// Validate checks the field values on DefaultLoginPolicy with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
+101
View File
@@ -845,6 +845,58 @@
]
}
},
"/policies/label": {
"get": {
"operationId": "AdminService_GetDefaultLabelPolicy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1DefaultLabelPolicyView"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
"AdminService"
]
},
"put": {
"operationId": "AdminService_UpdateDefaultLabelPolicy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1DefaultLabelPolicy"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1DefaultLabelPolicyUpdate"
}
}
],
"tags": [
"AdminService"
]
}
},
"/policies/login": {
"get": {
"operationId": "AdminService_GetDefaultLoginPolicy",
@@ -1412,6 +1464,55 @@
}
}
},
"v1DefaultLabelPolicy": {
"type": "object",
"properties": {
"primary_color": {
"type": "string"
},
"secondary_color": {
"type": "string"
},
"creation_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
}
}
},
"v1DefaultLabelPolicyUpdate": {
"type": "object",
"properties": {
"primary_color": {
"type": "string"
},
"secondary_color": {
"type": "string"
}
}
},
"v1DefaultLabelPolicyView": {
"type": "object",
"properties": {
"primary_color": {
"type": "string"
},
"secondary_color": {
"type": "string"
},
"creation_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
}
}
},
"v1DefaultLoginPolicy": {
"type": "object",
"properties": {
+40
View File
@@ -177,6 +177,26 @@ func (mr *MockAdminServiceClientMockRecorder) DeactivateIdpConfig(arg0, arg1 int
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeactivateIdpConfig", reflect.TypeOf((*MockAdminServiceClient)(nil).DeactivateIdpConfig), varargs...)
}
// GetDefaultLabelPolicy mocks base method
func (m *MockAdminServiceClient) GetDefaultLabelPolicy(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.DefaultLabelPolicyView, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetDefaultLabelPolicy", varargs...)
ret0, _ := ret[0].(*admin.DefaultLabelPolicyView)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetDefaultLabelPolicy indicates an expected call of GetDefaultLabelPolicy
func (mr *MockAdminServiceClientMockRecorder) GetDefaultLabelPolicy(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, "GetDefaultLabelPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDefaultLabelPolicy), varargs...)
}
// GetDefaultLoginPolicy mocks base method
func (m *MockAdminServiceClient) GetDefaultLoginPolicy(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.DefaultLoginPolicyView, error) {
m.ctrl.T.Helper()
@@ -677,6 +697,26 @@ func (mr *MockAdminServiceClientMockRecorder) SetUpOrg(arg0, arg1 interface{}, a
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpOrg", reflect.TypeOf((*MockAdminServiceClient)(nil).SetUpOrg), varargs...)
}
// UpdateDefaultLabelPolicy mocks base method
func (m *MockAdminServiceClient) UpdateDefaultLabelPolicy(arg0 context.Context, arg1 *admin.DefaultLabelPolicyUpdate, arg2 ...grpc.CallOption) (*admin.DefaultLabelPolicy, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateDefaultLabelPolicy", varargs...)
ret0, _ := ret[0].(*admin.DefaultLabelPolicy)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UpdateDefaultLabelPolicy indicates an expected call of UpdateDefaultLabelPolicy
func (mr *MockAdminServiceClientMockRecorder) UpdateDefaultLabelPolicy(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, "UpdateDefaultLabelPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).UpdateDefaultLabelPolicy), varargs...)
}
// UpdateDefaultLoginPolicy mocks base method
func (m *MockAdminServiceClient) UpdateDefaultLoginPolicy(arg0 context.Context, arg1 *admin.DefaultLoginPolicyRequest, arg2 ...grpc.CallOption) (*admin.DefaultLoginPolicy, error) {
m.ctrl.T.Helper()
+40
View File
@@ -342,6 +342,27 @@ service AdminService {
};
}
rpc GetDefaultLabelPolicy(google.protobuf.Empty) returns (DefaultLabelPolicyView) {
option (google.api.http) = {
get: "/policies/label"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.read"
};
}
rpc UpdateDefaultLabelPolicy(DefaultLabelPolicyUpdate) returns (DefaultLabelPolicy) {
option (google.api.http) = {
put: "/policies/label"
body: "*"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.write"
};
}
rpc GetDefaultLoginPolicy(google.protobuf.Empty) returns (DefaultLoginPolicyView) {
option (google.api.http) = {
get: "/policies/login"
@@ -903,6 +924,25 @@ enum IdpSearchKey {
IDPSEARCHKEY_NAME = 2;
}
message DefaultLabelPolicy {
string primary_color = 1;
string secondary_color = 2;
google.protobuf.Timestamp creation_date = 3;
google.protobuf.Timestamp change_date = 4;
}
message DefaultLabelPolicyUpdate {
string primary_color = 1;
string secondary_color = 2;
}
message DefaultLabelPolicyView {
string primary_color = 1;
string secondary_color = 2;
google.protobuf.Timestamp creation_date = 3;
google.protobuf.Timestamp change_date = 4;
}
message DefaultLoginPolicy {
bool allow_username_password = 1;
bool allow_register = 2;
+2427 -4380
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+32 -260
View File
@@ -21,19 +21,13 @@
"paths": {
"/global/projectorgs/_search": {
"post": {
"operationId": "AuthService_SearchMyProjectOrgs",
"operationId": "SearchMyProjectOrgs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1MyProjectOrgSearchResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -54,19 +48,13 @@
"/healthz": {
"get": {
"summary": "Readiness",
"operationId": "AuthService_Healthz",
"operationId": "Healthz",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -76,19 +64,13 @@
},
"/permissions/me": {
"get": {
"operationId": "AuthService_GetMyProjectPermissions",
"operationId": "GetMyProjectPermissions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1MyPermissions"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -99,19 +81,13 @@
"/permissions/zitadel/me": {
"get": {
"summary": "Permission",
"operationId": "AuthService_GetMyZitadelPermissions",
"operationId": "GetMyZitadelPermissions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1MyPermissions"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -121,19 +97,13 @@
},
"/policies/passwords/complexity": {
"get": {
"operationId": "AuthService_GetMyPasswordComplexityPolicy",
"operationId": "GetMyPasswordComplexityPolicy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1PasswordComplexityPolicy"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -143,19 +113,13 @@
},
"/ready": {
"get": {
"operationId": "AuthService_Ready",
"operationId": "Ready",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -165,19 +129,13 @@
},
"/usergrants/me/_search": {
"post": {
"operationId": "AuthService_SearchMyUserGrant",
"operationId": "SearchMyUserGrant",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserGrantSearchResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -198,19 +156,13 @@
"/users/me": {
"get": {
"summary": "User",
"operationId": "AuthService_GetMyUser",
"operationId": "GetMyUser",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserView"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -220,19 +172,13 @@
},
"/users/me/address": {
"get": {
"operationId": "AuthService_GetMyUserAddress",
"operationId": "GetMyUserAddress",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserAddressView"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -240,19 +186,13 @@
]
},
"put": {
"operationId": "AuthService_UpdateMyUserAddress",
"operationId": "UpdateMyUserAddress",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserAddress"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -272,19 +212,13 @@
},
"/users/me/changes": {
"get": {
"operationId": "AuthService_GetMyUserChanges",
"operationId": "GetMyUserChanges",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1Changes"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -317,19 +251,13 @@
},
"/users/me/email": {
"get": {
"operationId": "AuthService_GetMyUserEmail",
"operationId": "GetMyUserEmail",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserEmailView"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -337,19 +265,13 @@
]
},
"put": {
"operationId": "AuthService_ChangeMyUserEmail",
"operationId": "ChangeMyUserEmail",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserEmail"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -369,19 +291,13 @@
},
"/users/me/email/_resendverification": {
"post": {
"operationId": "AuthService_ResendMyEmailVerificationMail",
"operationId": "ResendMyEmailVerificationMail",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -401,19 +317,13 @@
},
"/users/me/email/_verify": {
"post": {
"operationId": "AuthService_VerifyMyUserEmail",
"operationId": "VerifyMyUserEmail",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -434,19 +344,13 @@
"/users/me/externalidps/_search": {
"post": {
"summary": "ExternalIDP",
"operationId": "AuthService_SearchMyExternalIDPs",
"operationId": "SearchMyExternalIDPs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1ExternalIDPSearchResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -466,19 +370,13 @@
},
"/users/me/externalidps/{idp_config_id}/{external_user_id}": {
"delete": {
"operationId": "AuthService_RemoveMyExternalIDP",
"operationId": "RemoveMyExternalIDP",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -502,19 +400,13 @@
},
"/users/me/mfas": {
"get": {
"operationId": "AuthService_GetMyMfas",
"operationId": "GetMyMfas",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1MultiFactors"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -524,19 +416,13 @@
},
"/users/me/mfas/otp": {
"delete": {
"operationId": "AuthService_RemoveMfaOTP",
"operationId": "RemoveMfaOTP",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -545,19 +431,13 @@
},
"post": {
"summary": "MFA",
"operationId": "AuthService_AddMfaOTP",
"operationId": "AddMfaOTP",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1MfaOtpResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -577,19 +457,13 @@
},
"/users/me/mfas/otp/_verify": {
"put": {
"operationId": "AuthService_VerifyMfaOTP",
"operationId": "VerifyMfaOTP",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -610,19 +484,13 @@
"/users/me/passwords/_change": {
"put": {
"summary": "Password",
"operationId": "AuthService_ChangeMyPassword",
"operationId": "ChangeMyPassword",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -642,19 +510,13 @@
},
"/users/me/phone": {
"get": {
"operationId": "AuthService_GetMyUserPhone",
"operationId": "GetMyUserPhone",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserPhoneView"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -662,19 +524,13 @@
]
},
"delete": {
"operationId": "AuthService_RemoveMyUserPhone",
"operationId": "RemoveMyUserPhone",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -682,19 +538,13 @@
]
},
"put": {
"operationId": "AuthService_ChangeMyUserPhone",
"operationId": "ChangeMyUserPhone",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserPhone"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -714,19 +564,13 @@
},
"/users/me/phone/_resendverification": {
"post": {
"operationId": "AuthService_ResendMyPhoneVerificationCode",
"operationId": "ResendMyPhoneVerificationCode",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -746,19 +590,13 @@
},
"/users/me/phone/_verify": {
"post": {
"operationId": "AuthService_VerifyMyUserPhone",
"operationId": "VerifyMyUserPhone",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -778,19 +616,13 @@
},
"/users/me/profile": {
"get": {
"operationId": "AuthService_GetMyUserProfile",
"operationId": "GetMyUserProfile",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserProfileView"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -798,19 +630,13 @@
]
},
"put": {
"operationId": "AuthService_UpdateMyUserProfile",
"operationId": "UpdateMyUserProfile",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserProfile"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -831,19 +657,13 @@
"/users/me/sessions": {
"get": {
"summary": "Authorization",
"operationId": "AuthService_GetMyUserSessions",
"operationId": "GetMyUserSessions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1UserSessionViews"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -853,19 +673,13 @@
},
"/users/me/username": {
"put": {
"operationId": "AuthService_ChangeMyUserName",
"operationId": "ChangeMyUserName",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
@@ -885,19 +699,13 @@
},
"/validate": {
"get": {
"operationId": "AuthService_Validate",
"operationId": "Validate",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"type": "object"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
@@ -907,21 +715,6 @@
}
},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n ...\n foo := \u0026pb.Foo{}\n if err := ptypes.UnmarshalAny(any, foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
},
"protobufNullValue": {
"type": "string",
"enum": [
@@ -930,27 +723,6 @@
"default": "NULL_VALUE",
"description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value."
},
"runtimeError": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"v1Change": {
"type": "object",
"properties": {
+4 -4
View File
@@ -22651,11 +22651,11 @@ func file_management_proto_init() {
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
const _ = grpc.SupportPackageIsVersion4
// ManagementServiceClient is the client API for ManagementService service.
//
@@ -22819,10 +22819,10 @@ type ManagementServiceClient interface {
}
type managementServiceClient struct {
cc grpc.ClientConnInterface
cc *grpc.ClientConn
}
func NewManagementServiceClient(cc grpc.ClientConnInterface) ManagementServiceClient {
func NewManagementServiceClient(cc *grpc.ClientConn) ManagementServiceClient {
return &managementServiceClient{cc}
}
File diff suppressed because it is too large Load Diff