mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-03 12:52:16 +00:00
fix: improvements for login and oidc (#227)
* add csrf * caching * caching * caching * caching * security headers * csp and security headers * error handler csp * select user with display name * csp * user selection styling * username to loginname * regenerate grpc * regenerate * change to login name
This commit is contained in:
+7102
-13535
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3475,7 +3475,7 @@
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/protobufStruct"
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3486,19 +3486,6 @@
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"protobufListValue": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"values": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/protobufValue"
|
||||
},
|
||||
"description": "Repeated field of dynamically typed values."
|
||||
}
|
||||
},
|
||||
"description": "`ListValue` is a wrapper around a repeated field of values.\n\nThe JSON representation for `ListValue` is JSON array."
|
||||
},
|
||||
"protobufNullValue": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -3507,51 +3494,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."
|
||||
},
|
||||
"protobufStruct": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fields": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"$ref": "#/definitions/protobufValue"
|
||||
},
|
||||
"description": "Unordered map of dynamically typed values."
|
||||
}
|
||||
},
|
||||
"description": "`Struct` represents a structured data value, consisting of fields\nwhich map to dynamically typed values. In some languages, `Struct`\nmight be supported by a native representation. For example, in\nscripting languages like JS a struct is represented as an\nobject. The details of that representation are described together\nwith the proto support for the language.\n\nThe JSON representation for `Struct` is JSON object."
|
||||
},
|
||||
"protobufValue": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"null_value": {
|
||||
"$ref": "#/definitions/protobufNullValue",
|
||||
"description": "Represents a null value."
|
||||
},
|
||||
"number_value": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"description": "Represents a double value."
|
||||
},
|
||||
"string_value": {
|
||||
"type": "string",
|
||||
"description": "Represents a string value."
|
||||
},
|
||||
"bool_value": {
|
||||
"type": "boolean",
|
||||
"format": "boolean",
|
||||
"description": "Represents a boolean value."
|
||||
},
|
||||
"struct_value": {
|
||||
"$ref": "#/definitions/protobufStruct",
|
||||
"description": "Represents a structured value."
|
||||
},
|
||||
"list_value": {
|
||||
"$ref": "#/definitions/protobufListValue",
|
||||
"description": "Represents a repeated `Value`."
|
||||
}
|
||||
},
|
||||
"description": "`Value` represents a dynamically typed value which can be either\nnull, a number, a string, a boolean, a recursive struct value, or a\nlist of values. A producer of value is expected to set one of that\nvariants, absence of any variant indicates an error.\n\nThe JSON representation for `Value` is JSON value."
|
||||
},
|
||||
"v1AddOrgDomainRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -3844,7 +3786,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"$ref": "#/definitions/protobufStruct"
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3904,9 +3846,6 @@
|
||||
"nick_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"display_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"preferred_language": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -5877,9 +5816,6 @@
|
||||
"nick_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"display_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"preferred_language": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -757,6 +757,26 @@ func (mr *MockManagementServiceClientMockRecorder) GetGrantedProjectByID(arg0, a
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGrantedProjectByID", reflect.TypeOf((*MockManagementServiceClient)(nil).GetGrantedProjectByID), varargs...)
|
||||
}
|
||||
|
||||
// GetIam mocks base method
|
||||
func (m *MockManagementServiceClient) GetIam(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc0.CallOption) (*grpc.Iam, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetIam", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.Iam)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetIam indicates an expected call of GetIam
|
||||
func (mr *MockManagementServiceClientMockRecorder) GetIam(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, "GetIam", reflect.TypeOf((*MockManagementServiceClient)(nil).GetIam), varargs...)
|
||||
}
|
||||
|
||||
// GetOrgByDomainGlobal mocks base method
|
||||
func (m *MockManagementServiceClient) GetOrgByDomainGlobal(arg0 context.Context, arg1 *grpc.OrgDomain, arg2 ...grpc0.CallOption) (*grpc.Org, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -918,14 +938,14 @@ func (mr *MockManagementServiceClientMockRecorder) GetProjectMemberRoles(arg0, a
|
||||
}
|
||||
|
||||
// GetUserAddress mocks base method
|
||||
func (m *MockManagementServiceClient) GetUserAddress(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserAddress, error) {
|
||||
func (m *MockManagementServiceClient) GetUserAddress(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserAddressView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetUserAddress", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.UserAddress)
|
||||
ret0, _ := ret[0].(*grpc.UserAddressView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -958,14 +978,14 @@ func (mr *MockManagementServiceClientMockRecorder) GetUserByEmailGlobal(arg0, ar
|
||||
}
|
||||
|
||||
// GetUserByID mocks base method
|
||||
func (m *MockManagementServiceClient) GetUserByID(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.User, error) {
|
||||
func (m *MockManagementServiceClient) GetUserByID(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetUserByID", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.User)
|
||||
ret0, _ := ret[0].(*grpc.UserView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -978,14 +998,14 @@ func (mr *MockManagementServiceClientMockRecorder) GetUserByID(arg0, arg1 interf
|
||||
}
|
||||
|
||||
// GetUserEmail mocks base method
|
||||
func (m *MockManagementServiceClient) GetUserEmail(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserEmail, error) {
|
||||
func (m *MockManagementServiceClient) GetUserEmail(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserEmailView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetUserEmail", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.UserEmail)
|
||||
ret0, _ := ret[0].(*grpc.UserEmailView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -1018,14 +1038,14 @@ func (mr *MockManagementServiceClientMockRecorder) GetUserMfas(arg0, arg1 interf
|
||||
}
|
||||
|
||||
// GetUserPhone mocks base method
|
||||
func (m *MockManagementServiceClient) GetUserPhone(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserPhone, error) {
|
||||
func (m *MockManagementServiceClient) GetUserPhone(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserPhoneView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetUserPhone", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.UserPhone)
|
||||
ret0, _ := ret[0].(*grpc.UserPhoneView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -1038,14 +1058,14 @@ func (mr *MockManagementServiceClientMockRecorder) GetUserPhone(arg0, arg1 inter
|
||||
}
|
||||
|
||||
// GetUserProfile mocks base method
|
||||
func (m *MockManagementServiceClient) GetUserProfile(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserProfile, error) {
|
||||
func (m *MockManagementServiceClient) GetUserProfile(arg0 context.Context, arg1 *grpc.UserID, arg2 ...grpc0.CallOption) (*grpc.UserProfileView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetUserProfile", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.UserProfile)
|
||||
ret0, _ := ret[0].(*grpc.UserProfileView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ func userCreateToModel(u *CreateUserRequest) *usr_model.User {
|
||||
FirstName: u.FirstName,
|
||||
LastName: u.LastName,
|
||||
NickName: u.NickName,
|
||||
DisplayName: u.DisplayName,
|
||||
PreferredLanguage: preferredLanguage,
|
||||
Gender: genderToModel(u.Gender),
|
||||
},
|
||||
@@ -193,7 +192,6 @@ func updateProfileToModel(u *UpdateUserProfileRequest) *usr_model.Profile {
|
||||
FirstName: u.FirstName,
|
||||
LastName: u.LastName,
|
||||
NickName: u.NickName,
|
||||
DisplayName: u.DisplayName,
|
||||
PreferredLanguage: preferredLanguage,
|
||||
Gender: genderToModel(u.Gender),
|
||||
}
|
||||
|
||||
@@ -1336,19 +1336,18 @@ message CreateUserRequest {
|
||||
string first_name = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string last_name = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string nick_name = 4 [(validate.rules).string = {max_len: 200}];
|
||||
string display_name = 5[(validate.rules).string = {max_len: 200}];
|
||||
string preferred_language = 6[(validate.rules).string = {max_len: 200}];
|
||||
Gender gender = 7;
|
||||
string email = 8 [(validate.rules).string = {min_len: 1, max_len: 200, email: true}];
|
||||
bool is_email_verified = 9;
|
||||
string phone = 11 [(validate.rules).string = {max_len: 20}];
|
||||
bool is_phone_verified = 12;
|
||||
string country = 13 [(validate.rules).string = {max_len: 200}];
|
||||
string locality = 14 [(validate.rules).string = {max_len: 200}];
|
||||
string postal_code = 15 [(validate.rules).string = {max_len: 200}];
|
||||
string region = 16 [(validate.rules).string = {max_len: 200}];
|
||||
string street_address = 17 [(validate.rules).string = {max_len: 200}];
|
||||
string password = 18 [(validate.rules).string = {max_len: 72}];
|
||||
string preferred_language = 5[(validate.rules).string = {max_len: 200}];
|
||||
Gender gender = 6;
|
||||
string email = 7 [(validate.rules).string = {min_len: 1, max_len: 200, email: true}];
|
||||
bool is_email_verified = 8;
|
||||
string phone = 9 [(validate.rules).string = {max_len: 20}];
|
||||
bool is_phone_verified = 10;
|
||||
string country = 11 [(validate.rules).string = {max_len: 200}];
|
||||
string locality = 12 [(validate.rules).string = {max_len: 200}];
|
||||
string postal_code = 13 [(validate.rules).string = {max_len: 200}];
|
||||
string region = 14 [(validate.rules).string = {max_len: 200}];
|
||||
string street_address = 15 [(validate.rules).string = {max_len: 200}];
|
||||
string password = 16 [(validate.rules).string = {max_len: 72}];
|
||||
}
|
||||
|
||||
message User {
|
||||
@@ -1497,9 +1496,8 @@ message UpdateUserProfileRequest {
|
||||
string first_name = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string last_name = 3 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string nick_name = 4 [(validate.rules).string = {max_len: 200}];
|
||||
string display_name = 5 [(validate.rules).string = {max_len: 200}];
|
||||
string preferred_language = 6 [(validate.rules).string = {max_len: 200}];
|
||||
Gender gender = 7;
|
||||
string preferred_language = 5 [(validate.rules).string = {max_len: 200}];
|
||||
Gender gender = 6;
|
||||
}
|
||||
|
||||
message UserEmail {
|
||||
|
||||
Reference in New Issue
Block a user