diff --git a/cmd/cli/app/auth/auth_login.go b/cmd/cli/app/auth/auth_login.go index 0178128eec..1bcee59d52 100644 --- a/cmd/cli/app/auth/auth_login.go +++ b/cmd/cli/app/auth/auth_login.go @@ -206,18 +206,6 @@ func renderNewUser(cmd *cobra.Command, newUser *pb.CreateUserResponse) { {"Project Name", newUser.ProjectName}, } - if newUser.Email != nil { - rows = append(rows, table.Row{"Email", *newUser.Email}) - } - - if newUser.FirstName != nil { - rows = append(rows, table.Row{"First Name", *newUser.FirstName}) - } - - if newUser.LastName != nil { - rows = append(rows, table.Row{"Last Name", *newUser.LastName}) - } - renderUserToTable(cmd, rows) } @@ -236,19 +224,6 @@ func renderUserInfo(cmd *cobra.Command, user *pb.GetUserResponse) { {projectKey, strings.Join(projects, ", ")}, } - userInfo := user.GetUser() - if userInfo.Email != nil { - rows = append(rows, table.Row{"Email", *userInfo.Email}) - } - - if userInfo.FirstName != nil { - rows = append(rows, table.Row{"First Name", *userInfo.FirstName}) - } - - if userInfo.LastName != nil { - rows = append(rows, table.Row{"Last Name", *userInfo.LastName}) - } - renderUserToTable(cmd, rows) } diff --git a/database/migrations/000004_remove_personal_info.down.sql b/database/migrations/000004_remove_personal_info.down.sql new file mode 100644 index 0000000000..1ebdce0255 --- /dev/null +++ b/database/migrations/000004_remove_personal_info.down.sql @@ -0,0 +1,19 @@ +-- Copyright 2023 Stacklok, Inc +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Add personal user details to users table +ALTER TABLE users + ADD COLUMN email TEXT, + ADD COLUMN first_name TEXT, + ADD COLUMN last_name TEXT; diff --git a/database/migrations/000004_remove_personal_info.up.sql b/database/migrations/000004_remove_personal_info.up.sql new file mode 100644 index 0000000000..0d4c780022 --- /dev/null +++ b/database/migrations/000004_remove_personal_info.up.sql @@ -0,0 +1,19 @@ +-- Copyright 2023 Stacklok, Inc +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +-- Remove personal user details from users table +ALTER TABLE users + DROP COLUMN IF EXISTS email, + DROP COLUMN IF EXISTS first_name, + DROP COLUMN IF EXISTS last_name; diff --git a/database/query/users.sql b/database/query/users.sql index 23bc357997..5d06c56da5 100644 --- a/database/query/users.sql +++ b/database/query/users.sql @@ -1,5 +1,5 @@ -- name: CreateUser :one -INSERT INTO users (organization_id, email, identity_subject, first_name, last_name) VALUES ($1, $2, $3, $4, $5) RETURNING *; +INSERT INTO users (organization_id, identity_subject) VALUES ($1, $2) RETURNING *; -- name: GetUserByID :one SELECT * FROM users WHERE id = $1; diff --git a/docs/docs/protodocs/proto.md b/docs/docs/protodocs/proto.md index 12ab336663..4edfe2b027 100644 --- a/docs/docs/protodocs/proto.md +++ b/docs/docs/protodocs/proto.md @@ -398,10 +398,7 @@ User service | organizatio_name | [string](#string) | | | | project_id | [string](#string) | | | | project_name | [string](#string) | | | -| email | [string](#string) | optional | | | identity_subject | [string](#string) | | | -| first_name | [string](#string) | optional | | -| last_name | [string](#string) | optional | | | created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | @@ -2160,10 +2157,7 @@ user record to be returned | ----- | ---- | ----- | ----------- | | id | [int32](#int32) | | | | organization_id | [string](#string) | | | -| email | [string](#string) | optional | | | identity_subject | [string](#string) | | | -| first_name | [string](#string) | optional | | -| last_name | [string](#string) | optional | | | created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | diff --git a/internal/controlplane/handlers_user.go b/internal/controlplane/handlers_user.go index f3852bd877..30f04f4a46 100644 --- a/internal/controlplane/handlers_user.go +++ b/internal/controlplane/handlers_user.go @@ -34,13 +34,6 @@ import ( pb "github.com/stacklok/mediator/pkg/api/protobuf/go/mediator/v1" ) -func stringToNullString(s string) *sql.NullString { - if s == "" { - return &sql.NullString{Valid: false} - } - return &sql.NullString{String: s, Valid: true} -} - // CreateUser is a service for user self registration // //gocyclo:ignore @@ -102,9 +95,6 @@ func (s *Server) CreateUser(ctx context.Context, userOrg = organization.ID userProject = uuid.MustParse(orgProject.ProjectId) user, err := qtx.CreateUser(ctx, db.CreateUserParams{OrganizationID: userOrg, - Email: *stringToNullString(token.Email()), - FirstName: *stringToNullString(token.GivenName()), - LastName: *stringToNullString(token.FamilyName()), IdentitySubject: subject}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to create user: %s", err) @@ -132,10 +122,7 @@ func (s *Server) CreateUser(ctx context.Context, OrganizatioName: organization.Name, ProjectId: userProject.String(), ProjectName: orgProject.Name, - Email: &user.Email.String, IdentitySubject: user.IdentitySubject, - FirstName: &user.FirstName.String, - LastName: &user.LastName.String, CreatedAt: timestamppb.New(user.CreatedAt), }, nil } @@ -250,10 +237,7 @@ func (s *Server) GetUser(ctx context.Context, _ *pb.GetUserRequest) (*pb.GetUser resp.User = &pb.UserRecord{ Id: user.ID, OrganizationId: user.OrganizationID.String(), - Email: &user.Email.String, IdentitySubject: user.IdentitySubject, - FirstName: &user.FirstName.String, - LastName: &user.LastName.String, CreatedAt: timestamppb.New(user.CreatedAt), UpdatedAt: timestamppb.New(user.UpdatedAt), } diff --git a/internal/controlplane/handlers_user_test.go b/internal/controlplane/handlers_user_test.go index 2a3b57a91b..dcd1f9a622 100644 --- a/internal/controlplane/handlers_user_test.go +++ b/internal/controlplane/handlers_user_test.go @@ -71,9 +71,6 @@ func TestCreateUserDBMock(t *testing.T) { ID: 1, OrganizationID: orgID, IdentitySubject: "subject1", - Email: sql.NullString{String: "test@stacklok.com", Valid: true}, - FirstName: sql.NullString{String: "Foo", Valid: true}, - LastName: sql.NullString{String: "Bar", Valid: true}, CreatedAt: time.Now(), UpdatedAt: time.Now(), } @@ -98,10 +95,7 @@ func TestCreateUserDBMock(t *testing.T) { store.EXPECT().CreateProvider(gomock.Any(), gomock.Any()) store.EXPECT(). CreateUser(gomock.Any(), db.CreateUserParams{OrganizationID: orgID, - IdentitySubject: "subject1", - Email: sql.NullString{String: "test@stacklok.com", Valid: true}, - FirstName: sql.NullString{String: "Foo", Valid: true}, - LastName: sql.NullString{String: "Bar", Valid: true}}). + IdentitySubject: "subject1"}). Return(returnedUser, nil) store.EXPECT().AddUserProject(gomock.Any(), db.AddUserProjectParams{UserID: 1, ProjectID: projectID}) store.EXPECT().AddUserRole(gomock.Any(), db.AddUserRoleParams{UserID: 1, RoleID: 2}) @@ -117,10 +111,7 @@ func TestCreateUserDBMock(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, res) assert.Equal(t, int32(1), res.Id) - assert.Equal(t, "test@stacklok.com", *res.Email) assert.Equal(t, orgID.String(), res.OrganizationId) - assert.Equal(t, "Foo", *res.FirstName) - assert.Equal(t, "Bar", *res.LastName) }, }, } diff --git a/internal/db/models.go b/internal/db/models.go index 8fdcefd915..69e38beda5 100644 --- a/internal/db/models.go +++ b/internal/db/models.go @@ -474,14 +474,11 @@ type SigningKey struct { } type User struct { - ID int32 `json:"id"` - OrganizationID uuid.UUID `json:"organization_id"` - Email sql.NullString `json:"email"` - IdentitySubject string `json:"identity_subject"` - FirstName sql.NullString `json:"first_name"` - LastName sql.NullString `json:"last_name"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + ID int32 `json:"id"` + OrganizationID uuid.UUID `json:"organization_id"` + IdentitySubject string `json:"identity_subject"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` } type UserProject struct { diff --git a/internal/db/users.sql.go b/internal/db/users.sql.go index 76623e8692..ae87e46068 100644 --- a/internal/db/users.sql.go +++ b/internal/db/users.sql.go @@ -7,7 +7,6 @@ package db import ( "context" - "database/sql" "github.com/google/uuid" ) @@ -24,33 +23,21 @@ func (q *Queries) CountUsers(ctx context.Context) (int64, error) { } const createUser = `-- name: CreateUser :one -INSERT INTO users (organization_id, email, identity_subject, first_name, last_name) VALUES ($1, $2, $3, $4, $5) RETURNING id, organization_id, email, identity_subject, first_name, last_name, created_at, updated_at +INSERT INTO users (organization_id, identity_subject) VALUES ($1, $2) RETURNING id, organization_id, identity_subject, created_at, updated_at ` type CreateUserParams struct { - OrganizationID uuid.UUID `json:"organization_id"` - Email sql.NullString `json:"email"` - IdentitySubject string `json:"identity_subject"` - FirstName sql.NullString `json:"first_name"` - LastName sql.NullString `json:"last_name"` + OrganizationID uuid.UUID `json:"organization_id"` + IdentitySubject string `json:"identity_subject"` } func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) { - row := q.db.QueryRowContext(ctx, createUser, - arg.OrganizationID, - arg.Email, - arg.IdentitySubject, - arg.FirstName, - arg.LastName, - ) + row := q.db.QueryRowContext(ctx, createUser, arg.OrganizationID, arg.IdentitySubject) var i User err := row.Scan( &i.ID, &i.OrganizationID, - &i.Email, &i.IdentitySubject, - &i.FirstName, - &i.LastName, &i.CreatedAt, &i.UpdatedAt, ) @@ -67,7 +54,7 @@ func (q *Queries) DeleteUser(ctx context.Context, id int32) error { } const getUserByID = `-- name: GetUserByID :one -SELECT id, organization_id, email, identity_subject, first_name, last_name, created_at, updated_at FROM users WHERE id = $1 +SELECT id, organization_id, identity_subject, created_at, updated_at FROM users WHERE id = $1 ` func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error) { @@ -76,10 +63,7 @@ func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error) { err := row.Scan( &i.ID, &i.OrganizationID, - &i.Email, &i.IdentitySubject, - &i.FirstName, - &i.LastName, &i.CreatedAt, &i.UpdatedAt, ) @@ -87,7 +71,7 @@ func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error) { } const getUserBySubject = `-- name: GetUserBySubject :one -SELECT id, organization_id, email, identity_subject, first_name, last_name, created_at, updated_at FROM users WHERE identity_subject = $1 +SELECT id, organization_id, identity_subject, created_at, updated_at FROM users WHERE identity_subject = $1 ` func (q *Queries) GetUserBySubject(ctx context.Context, identitySubject string) (User, error) { @@ -96,10 +80,7 @@ func (q *Queries) GetUserBySubject(ctx context.Context, identitySubject string) err := row.Scan( &i.ID, &i.OrganizationID, - &i.Email, &i.IdentitySubject, - &i.FirstName, - &i.LastName, &i.CreatedAt, &i.UpdatedAt, ) @@ -107,7 +88,7 @@ func (q *Queries) GetUserBySubject(ctx context.Context, identitySubject string) } const listUsers = `-- name: ListUsers :many -SELECT id, organization_id, email, identity_subject, first_name, last_name, created_at, updated_at FROM users +SELECT id, organization_id, identity_subject, created_at, updated_at FROM users ORDER BY id LIMIT $1 OFFSET $2 @@ -130,10 +111,7 @@ func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, e if err := rows.Scan( &i.ID, &i.OrganizationID, - &i.Email, &i.IdentitySubject, - &i.FirstName, - &i.LastName, &i.CreatedAt, &i.UpdatedAt, ); err != nil { @@ -151,7 +129,7 @@ func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, e } const listUsersByOrganization = `-- name: ListUsersByOrganization :many -SELECT id, organization_id, email, identity_subject, first_name, last_name, created_at, updated_at FROM users +SELECT id, organization_id, identity_subject, created_at, updated_at FROM users WHERE organization_id = $1 ORDER BY id LIMIT $2 @@ -176,10 +154,7 @@ func (q *Queries) ListUsersByOrganization(ctx context.Context, arg ListUsersByOr if err := rows.Scan( &i.ID, &i.OrganizationID, - &i.Email, &i.IdentitySubject, - &i.FirstName, - &i.LastName, &i.CreatedAt, &i.UpdatedAt, ); err != nil { @@ -197,7 +172,7 @@ func (q *Queries) ListUsersByOrganization(ctx context.Context, arg ListUsersByOr } const listUsersByProject = `-- name: ListUsersByProject :many -SELECT users.id, users.organization_id, users.email, users.identity_subject, users.first_name, users.last_name, users.created_at, users.updated_at FROM users +SELECT users.id, users.organization_id, users.identity_subject, users.created_at, users.updated_at FROM users JOIN user_projects ON users.id = user_projects.user_id WHERE user_projects.project_id = $1 ORDER BY users.id @@ -223,10 +198,7 @@ func (q *Queries) ListUsersByProject(ctx context.Context, arg ListUsersByProject if err := rows.Scan( &i.ID, &i.OrganizationID, - &i.Email, &i.IdentitySubject, - &i.FirstName, - &i.LastName, &i.CreatedAt, &i.UpdatedAt, ); err != nil { diff --git a/internal/db/users_test.go b/internal/db/users_test.go index 4edcda81ce..ea4f6f536a 100644 --- a/internal/db/users_test.go +++ b/internal/db/users_test.go @@ -22,7 +22,6 @@ package db import ( "context" - "database/sql" "testing" "time" @@ -31,13 +30,6 @@ import ( "github.com/stacklok/mediator/internal/util/rand" ) -func stringToNullString(s string) sql.NullString { - if s == "" { - return sql.NullString{} - } - return sql.NullString{String: s, Valid: true} -} - func createRandomUser(t *testing.T, org Project) User { t.Helper() @@ -46,19 +38,13 @@ func createRandomUser(t *testing.T, org Project) User { arg := CreateUserParams{ OrganizationID: org.ID, IdentitySubject: rand.RandomString(10, seed), - Email: stringToNullString(rand.RandomEmail(seed)), - FirstName: stringToNullString(rand.RandomName(seed)), - LastName: stringToNullString(rand.RandomName(seed)), } user, err := testQueries.CreateUser(context.Background(), arg) require.NoError(t, err) require.NotEmpty(t, user) - require.Equal(t, arg.Email, user.Email) require.Equal(t, arg.OrganizationID, user.OrganizationID) - require.Equal(t, arg.FirstName, user.FirstName) - require.Equal(t, arg.LastName, user.LastName) require.NotZero(t, user.ID) require.NotZero(t, user.CreatedAt) @@ -87,9 +73,6 @@ func TestGetUser(t *testing.T) { require.Equal(t, user1.ID, user2.ID) require.Equal(t, user1.OrganizationID, user2.OrganizationID) - require.Equal(t, user1.Email, user2.Email) - require.Equal(t, user1.FirstName, user2.FirstName) - require.Equal(t, user1.LastName, user2.LastName) require.NotZero(t, user2.CreatedAt) require.NotZero(t, user2.UpdatedAt) diff --git a/pkg/api/openapi/mediator/v1/mediator.swagger.json b/pkg/api/openapi/mediator/v1/mediator.swagger.json index f347a0969d..f967f40f1f 100644 --- a/pkg/api/openapi/mediator/v1/mediator.swagger.json +++ b/pkg/api/openapi/mediator/v1/mediator.swagger.json @@ -1890,18 +1890,9 @@ "projectName": { "type": "string" }, - "email": { - "type": "string" - }, "identitySubject": { "type": "string" }, - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, "createdAt": { "type": "string", "format": "date-time" @@ -2635,18 +2626,9 @@ "organizationId": { "type": "string" }, - "email": { - "type": "string" - }, "identitySubject": { "type": "string" }, - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, "createdAt": { "type": "string", "format": "date-time" diff --git a/pkg/api/protobuf/go/mediator/v1/mediator.pb.go b/pkg/api/protobuf/go/mediator/v1/mediator.pb.go index 9aec47850f..8272a29158 100644 --- a/pkg/api/protobuf/go/mediator/v1/mediator.pb.go +++ b/pkg/api/protobuf/go/mediator/v1/mediator.pb.go @@ -3565,11 +3565,8 @@ type CreateUserResponse struct { OrganizatioName string `protobuf:"bytes,3,opt,name=organizatio_name,json=organizatioName,proto3" json:"organizatio_name,omitempty"` ProjectId string `protobuf:"bytes,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` ProjectName string `protobuf:"bytes,5,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` - Email *string `protobuf:"bytes,6,opt,name=email,proto3,oneof" json:"email,omitempty"` - IdentitySubject string `protobuf:"bytes,7,opt,name=identity_subject,json=identitySubject,proto3" json:"identity_subject,omitempty"` - FirstName *string `protobuf:"bytes,8,opt,name=first_name,json=firstName,proto3,oneof" json:"first_name,omitempty"` - LastName *string `protobuf:"bytes,9,opt,name=last_name,json=lastName,proto3,oneof" json:"last_name,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + IdentitySubject string `protobuf:"bytes,6,opt,name=identity_subject,json=identitySubject,proto3" json:"identity_subject,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` } func (x *CreateUserResponse) Reset() { @@ -3639,13 +3636,6 @@ func (x *CreateUserResponse) GetProjectName() string { return "" } -func (x *CreateUserResponse) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - func (x *CreateUserResponse) GetIdentitySubject() string { if x != nil { return x.IdentitySubject @@ -3653,20 +3643,6 @@ func (x *CreateUserResponse) GetIdentitySubject() string { return "" } -func (x *CreateUserResponse) GetFirstName() string { - if x != nil && x.FirstName != nil { - return *x.FirstName - } - return "" -} - -func (x *CreateUserResponse) GetLastName() string { - if x != nil && x.LastName != nil { - return *x.LastName - } - return "" -} - func (x *CreateUserResponse) GetCreatedAt() *timestamppb.Timestamp { if x != nil { return x.CreatedAt @@ -3758,12 +3734,9 @@ type UserRecord struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` - IdentitySubject string `protobuf:"bytes,4,opt,name=identity_subject,json=identitySubject,proto3" json:"identity_subject,omitempty"` - FirstName *string `protobuf:"bytes,5,opt,name=first_name,json=firstName,proto3,oneof" json:"first_name,omitempty"` - LastName *string `protobuf:"bytes,6,opt,name=last_name,json=lastName,proto3,oneof" json:"last_name,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + IdentitySubject string `protobuf:"bytes,3,opt,name=identity_subject,json=identitySubject,proto3" json:"identity_subject,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` } func (x *UserRecord) Reset() { @@ -3812,13 +3785,6 @@ func (x *UserRecord) GetOrganizationId() string { return "" } -func (x *UserRecord) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - func (x *UserRecord) GetIdentitySubject() string { if x != nil { return x.IdentitySubject @@ -3826,20 +3792,6 @@ func (x *UserRecord) GetIdentitySubject() string { return "" } -func (x *UserRecord) GetFirstName() string { - if x != nil && x.FirstName != nil { - return *x.FirstName - } - return "" -} - -func (x *UserRecord) GetLastName() string { - if x != nil && x.LastName != nil { - return *x.LastName - } - return "" -} - func (x *UserRecord) GetCreatedAt() *timestamppb.Timestamp { if x != nil { return x.CreatedAt @@ -8310,7 +8262,7 @@ var file_mediator_v1_mediator_proto_rawDesc = []byte{ 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa8, 0x03, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa0, 0x02, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, @@ -8322,47 +8274,30 @@ var file_mediator_v1_mediator_proto_rawDesc = []byte{ 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x29, - 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x22, 0x0a, 0x0a, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, - 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, - 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x02, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, - 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xee, 0x02, 0x0a, - 0x0a, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, - 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x22, 0x0a, 0x0a, 0x66, 0x69, - 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, - 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x20, - 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x02, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, - 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, - 0x0c, 0x0a, 0x0a, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x10, 0x0a, + 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, + 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, + 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, @@ -11034,8 +10969,6 @@ func file_mediator_v1_mediator_proto_init() { file_mediator_v1_mediator_proto_msgTypes[14].OneofWrappers = []interface{}{} file_mediator_v1_mediator_proto_msgTypes[17].OneofWrappers = []interface{}{} file_mediator_v1_mediator_proto_msgTypes[31].OneofWrappers = []interface{}{} - file_mediator_v1_mediator_proto_msgTypes[55].OneofWrappers = []interface{}{} - file_mediator_v1_mediator_proto_msgTypes[58].OneofWrappers = []interface{}{} file_mediator_v1_mediator_proto_msgTypes[60].OneofWrappers = []interface{}{} file_mediator_v1_mediator_proto_msgTypes[70].OneofWrappers = []interface{}{} file_mediator_v1_mediator_proto_msgTypes[82].OneofWrappers = []interface{}{} diff --git a/proto/mediator/v1/mediator.proto b/proto/mediator/v1/mediator.proto index d7c2cb188e..c909656ec7 100644 --- a/proto/mediator/v1/mediator.proto +++ b/proto/mediator/v1/mediator.proto @@ -762,11 +762,8 @@ message CreateUserResponse { string organizatio_name = 3; string project_id = 4; string project_name = 5; - optional string email = 6; - string identity_subject = 7; - optional string first_name = 8; - optional string last_name = 9; - google.protobuf.Timestamp created_at = 10; + string identity_subject = 6; + google.protobuf.Timestamp created_at = 7; } message DeleteUserRequest { @@ -779,12 +776,9 @@ message DeleteUserResponse { message UserRecord { int32 id = 1; string organization_id = 2; - optional string email = 3; - string identity_subject = 4; - optional string first_name = 5; - optional string last_name = 6; - google.protobuf.Timestamp created_at = 7; - google.protobuf.Timestamp updated_at = 8; + string identity_subject = 3; + google.protobuf.Timestamp created_at = 4; + google.protobuf.Timestamp updated_at = 5; } // list users