|
|
|
@ -29,7 +29,7 @@ import (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (s *APIV1Service) ListUsers(ctx context.Context, _ *v1pb.ListUsersRequest) (*v1pb.ListUsersResponse, error) {
|
|
|
|
|
currentUser, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
currentUser, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -136,7 +136,7 @@ func (s *APIV1Service) GetUserAvatarBinary(ctx context.Context, request *v1pb.Ge
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *APIV1Service) CreateUser(ctx context.Context, request *v1pb.CreateUserRequest) (*v1pb.User, error) {
|
|
|
|
|
currentUser, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
currentUser, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -170,7 +170,7 @@ func (s *APIV1Service) UpdateUser(ctx context.Context, request *v1pb.UpdateUserR
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
|
|
|
}
|
|
|
|
|
currentUser, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
currentUser, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -239,7 +239,7 @@ func (s *APIV1Service) DeleteUser(ctx context.Context, request *v1pb.DeleteUserR
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
|
|
|
}
|
|
|
|
|
currentUser, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
currentUser, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -273,7 +273,7 @@ func getDefaultUserSetting() *v1pb.UserSetting {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *APIV1Service) GetUserSetting(ctx context.Context, _ *v1pb.GetUserSettingRequest) (*v1pb.UserSetting, error) {
|
|
|
|
|
user, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
user, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -298,7 +298,7 @@ func (s *APIV1Service) GetUserSetting(ctx context.Context, _ *v1pb.GetUserSettin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.UpdateUserSettingRequest) (*v1pb.UserSetting, error) {
|
|
|
|
|
user, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
user, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -352,7 +352,7 @@ func (s *APIV1Service) ListUserAccessTokens(ctx context.Context, request *v1pb.L
|
|
|
|
|
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
currentUser, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
currentUser, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -413,7 +413,7 @@ func (s *APIV1Service) CreateUserAccessToken(ctx context.Context, request *v1pb.
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
|
|
|
}
|
|
|
|
|
currentUser, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
currentUser, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
|
|
|
}
|
|
|
|
@ -471,7 +471,7 @@ func (s *APIV1Service) DeleteUserAccessToken(ctx context.Context, request *v1pb.
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err)
|
|
|
|
|
}
|
|
|
|
|
currentUser, err := getCurrentUser(ctx, s.Store)
|
|
|
|
|
currentUser, err := s.GetCurrentUser(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
|
|
|
|
}
|
|
|
|
|