From 189ee96857af3231718012c432c7255299bdeb7a Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 19 Jul 2024 14:20:23 -0400 Subject: [PATCH] Remove unused E2EE messaging code --- Gemfile | 1 - Gemfile.lock | 2 - .../activitypub/claims_controller.rb | 18 ----- .../activitypub/collections_controller.rb | 6 +- .../api/v1/crypto/deliveries_controller.rb | 30 ------- .../crypto/encrypted_messages_controller.rb | 47 ----------- .../api/v1/crypto/keys/claims_controller.rb | 25 ------ .../api/v1/crypto/keys/counts_controller.rb | 17 ---- .../api/v1/crypto/keys/queries_controller.rb | 26 ------ .../api/v1/crypto/keys/uploads_controller.rb | 29 ------- app/helpers/context_helper.rb | 17 ---- app/lib/activitypub/activity/create.rb | 35 +------- app/lib/inline_renderer.rb | 2 - app/lib/vacuum/system_keys_vacuum.rb | 13 --- app/models/account.rb | 8 +- app/models/concerns/account/associations.rb | 3 - app/models/device.rb | 36 --------- app/models/encrypted_message.rb | 49 ------------ app/models/message_franking.rb | 19 ----- app/models/one_time_key.rb | 22 ------ app/models/system_key.rb | 41 ---------- .../activitypub/activity_serializer.rb | 2 - .../activitypub/actor_serializer.rb | 7 +- .../activitypub/collection_serializer.rb | 2 - .../activitypub/device_serializer.rb | 52 ------------ .../encrypted_message_serializer.rb | 61 -------------- .../activitypub/one_time_key_serializer.rb | 35 -------- .../rest/encrypted_message_serializer.rb | 19 ----- .../rest/keys/claim_result_serializer.rb | 9 --- .../rest/keys/device_serializer.rb | 6 -- .../rest/keys/query_result_serializer.rb | 11 --- .../activitypub/process_account_service.rb | 1 - app/services/delete_account_service.rb | 2 - app/services/deliver_to_device_service.rb | 78 ------------------ app/services/keys/claim_service.rb | 79 ------------------- app/services/keys/query_service.rb | 79 ------------------- app/validators/ed25519_key_validator.rb | 19 ----- app/validators/ed25519_signature_validator.rb | 29 ------- app/workers/push_encrypted_message_worker.rb | 16 ---- config/initializers/doorkeeper.rb | 3 +- config/initializers/inflections.rb | 1 - config/locales/an.yml | 4 - config/locales/ar.yml | 4 - config/locales/ast.yml | 4 - config/locales/be.yml | 4 - config/locales/bg.yml | 4 - config/locales/ca.yml | 4 - config/locales/ckb.yml | 4 - config/locales/co.yml | 4 - config/locales/cs.yml | 4 - config/locales/cy.yml | 4 - config/locales/da.yml | 4 - config/locales/de.yml | 4 - config/locales/el.yml | 4 - config/locales/en-GB.yml | 4 - config/locales/en.yml | 4 - config/locales/eo.yml | 4 - config/locales/es-AR.yml | 4 - config/locales/es-MX.yml | 4 - config/locales/es.yml | 4 - config/locales/et.yml | 4 - config/locales/eu.yml | 4 - config/locales/fa.yml | 4 - config/locales/fi.yml | 4 - config/locales/fo.yml | 4 - config/locales/fr-CA.yml | 4 - config/locales/fr.yml | 4 - config/locales/fy.yml | 4 - config/locales/ga.yml | 4 - config/locales/gd.yml | 4 - config/locales/gl.yml | 4 - config/locales/he.yml | 4 - config/locales/hu.yml | 4 - config/locales/hy.yml | 4 - config/locales/ia.yml | 4 - config/locales/id.yml | 4 - config/locales/ie.yml | 4 - config/locales/io.yml | 4 - config/locales/is.yml | 4 - config/locales/it.yml | 4 - config/locales/ja.yml | 4 - config/locales/kab.yml | 3 - config/locales/ko.yml | 4 - config/locales/ku.yml | 4 - config/locales/lad.yml | 4 - config/locales/lv.yml | 4 - config/locales/ms.yml | 4 - config/locales/my.yml | 4 - config/locales/nl.yml | 4 - config/locales/nn.yml | 4 - config/locales/no.yml | 4 - config/locales/pl.yml | 4 - config/locales/pt-BR.yml | 4 - config/locales/pt-PT.yml | 4 - config/locales/ru.yml | 4 - config/locales/sc.yml | 4 - config/locales/sco.yml | 4 - config/locales/si.yml | 4 - config/locales/sl.yml | 4 - config/locales/sq.yml | 4 - config/locales/sr-Latn.yml | 4 - config/locales/sr.yml | 4 - config/locales/sv.yml | 4 - config/locales/ta.yml | 4 - config/locales/th.yml | 4 - config/locales/tr.yml | 4 - config/locales/uk.yml | 4 - config/locales/vi.yml | 4 - config/locales/zh-CN.yml | 4 - config/locales/zh-HK.yml | 4 - config/locales/zh-TW.yml | 4 - config/routes.rb | 1 - config/routes/api.rb | 17 ---- ...20140205_drop_end_to_end_message_tables.rb | 15 ++++ db/schema.rb | 50 ------------ .../activitypub/claims_controller_spec.rb | 19 ----- spec/fabricators/device_fabricator.rb | 10 --- .../encrypted_message_fabricator.rb | 7 -- spec/fabricators/one_time_key_fabricator.rb | 13 --- spec/fabricators/system_key_fabricator.rb | 3 - spec/lib/activitypub/activity/create_spec.rb | 58 -------------- spec/lib/vacuum/system_keys_vacuum_spec.rb | 24 ------ spec/models/one_time_key_spec.rb | 23 ------ .../activitypub/device_serializer_spec.rb | 14 ---- .../one_time_key_serializer_spec.rb | 14 ---- .../rest/encrypted_message_serializer_spec.rb | 14 ---- .../rest/keys/claim_result_serializer_spec.rb | 14 ---- .../rest/keys/device_serializer_spec.rb | 14 ---- .../rest/keys/query_result_serializer_spec.rb | 14 ---- .../push_encrypted_message_worker_spec.rb | 13 --- streaming/index.js | 9 +-- 131 files changed, 25 insertions(+), 1557 deletions(-) delete mode 100644 app/controllers/activitypub/claims_controller.rb delete mode 100644 app/controllers/api/v1/crypto/deliveries_controller.rb delete mode 100644 app/controllers/api/v1/crypto/encrypted_messages_controller.rb delete mode 100644 app/controllers/api/v1/crypto/keys/claims_controller.rb delete mode 100644 app/controllers/api/v1/crypto/keys/counts_controller.rb delete mode 100644 app/controllers/api/v1/crypto/keys/queries_controller.rb delete mode 100644 app/controllers/api/v1/crypto/keys/uploads_controller.rb delete mode 100644 app/lib/vacuum/system_keys_vacuum.rb delete mode 100644 app/models/device.rb delete mode 100644 app/models/encrypted_message.rb delete mode 100644 app/models/message_franking.rb delete mode 100644 app/models/one_time_key.rb delete mode 100644 app/models/system_key.rb delete mode 100644 app/serializers/activitypub/device_serializer.rb delete mode 100644 app/serializers/activitypub/encrypted_message_serializer.rb delete mode 100644 app/serializers/activitypub/one_time_key_serializer.rb delete mode 100644 app/serializers/rest/encrypted_message_serializer.rb delete mode 100644 app/serializers/rest/keys/claim_result_serializer.rb delete mode 100644 app/serializers/rest/keys/device_serializer.rb delete mode 100644 app/serializers/rest/keys/query_result_serializer.rb delete mode 100644 app/services/deliver_to_device_service.rb delete mode 100644 app/services/keys/claim_service.rb delete mode 100644 app/services/keys/query_service.rb delete mode 100644 app/validators/ed25519_key_validator.rb delete mode 100644 app/validators/ed25519_signature_validator.rb delete mode 100644 app/workers/push_encrypted_message_worker.rb create mode 100644 db/migrate/20240720140205_drop_end_to_end_message_tables.rb delete mode 100644 spec/controllers/activitypub/claims_controller_spec.rb delete mode 100644 spec/fabricators/device_fabricator.rb delete mode 100644 spec/fabricators/encrypted_message_fabricator.rb delete mode 100644 spec/fabricators/one_time_key_fabricator.rb delete mode 100644 spec/fabricators/system_key_fabricator.rb delete mode 100644 spec/lib/vacuum/system_keys_vacuum_spec.rb delete mode 100644 spec/models/one_time_key_spec.rb delete mode 100644 spec/serializers/activitypub/device_serializer_spec.rb delete mode 100644 spec/serializers/activitypub/one_time_key_serializer_spec.rb delete mode 100644 spec/serializers/rest/encrypted_message_serializer_spec.rb delete mode 100644 spec/serializers/rest/keys/claim_result_serializer_spec.rb delete mode 100644 spec/serializers/rest/keys/device_serializer_spec.rb delete mode 100644 spec/serializers/rest/keys/query_result_serializer_spec.rb delete mode 100644 spec/workers/push_encrypted_message_worker_spec.rb diff --git a/Gemfile b/Gemfile index de9bc45f320..73caa5279a5 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,6 @@ gem 'color_diff', '~> 0.1' gem 'csv', '~> 3.2' gem 'discard', '~> 1.2' gem 'doorkeeper', '~> 5.6' -gem 'ed25519', '~> 1.3' gem 'fast_blank', '~> 1.0' gem 'fastimage' gem 'hiredis', '~> 0.6' diff --git a/Gemfile.lock b/Gemfile.lock index 1cf7f8d7696..bf76bb20cd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -212,7 +212,6 @@ GEM railties (>= 5) dotenv (3.1.2) drb (2.2.1) - ed25519 (1.3.0) elasticsearch (7.17.10) elasticsearch-api (= 7.17.10) elasticsearch-transport (= 7.17.10) @@ -936,7 +935,6 @@ DEPENDENCIES discard (~> 1.2) doorkeeper (~> 5.6) dotenv - ed25519 (~> 1.3) email_spec fabrication (~> 2.30) faker (~> 3.2) diff --git a/app/controllers/activitypub/claims_controller.rb b/app/controllers/activitypub/claims_controller.rb deleted file mode 100644 index 480baaf2bcc..00000000000 --- a/app/controllers/activitypub/claims_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class ActivityPub::ClaimsController < ActivityPub::BaseController - skip_before_action :authenticate_user! - - before_action :require_account_signature! - before_action :set_claim_result - - def create - render json: @claim_result, serializer: ActivityPub::OneTimeKeySerializer - end - - private - - def set_claim_result - @claim_result = ::Keys::ClaimService.new.call(@account.id, params[:id]) - end -end diff --git a/app/controllers/activitypub/collections_controller.rb b/app/controllers/activitypub/collections_controller.rb index c25362c9bc0..ab1b98e646a 100644 --- a/app/controllers/activitypub/collections_controller.rb +++ b/app/controllers/activitypub/collections_controller.rb @@ -22,8 +22,6 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController @items = @items.map { |item| item.distributable? ? item : ActivityPub::TagManager.instance.uri_for(item) } when 'tags' @items = for_signed_account { @account.featured_tags } - when 'devices' - @items = @account.devices else not_found end @@ -31,7 +29,7 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController def set_size case params[:id] - when 'featured', 'devices', 'tags' + when 'featured', 'tags' @size = @items.size else not_found @@ -42,7 +40,7 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController case params[:id] when 'featured' @type = :ordered - when 'devices', 'tags' + when 'tags' @type = :unordered else not_found diff --git a/app/controllers/api/v1/crypto/deliveries_controller.rb b/app/controllers/api/v1/crypto/deliveries_controller.rb deleted file mode 100644 index aa9df6e03b2..00000000000 --- a/app/controllers/api/v1/crypto/deliveries_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class Api::V1::Crypto::DeliveriesController < Api::BaseController - before_action -> { doorkeeper_authorize! :crypto } - before_action :require_user! - before_action :set_current_device - - def create - devices.each do |device_params| - DeliverToDeviceService.new.call(current_account, @current_device, device_params) - end - - render_empty - end - - private - - def set_current_device - @current_device = Device.find_by!(access_token: doorkeeper_token) - end - - def resource_params - params.require(:device) - params.permit(device: [:account_id, :device_id, :type, :body, :hmac]) - end - - def devices - Array(resource_params[:device]) - end -end diff --git a/app/controllers/api/v1/crypto/encrypted_messages_controller.rb b/app/controllers/api/v1/crypto/encrypted_messages_controller.rb deleted file mode 100644 index 93ae0e77713..00000000000 --- a/app/controllers/api/v1/crypto/encrypted_messages_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -class Api::V1::Crypto::EncryptedMessagesController < Api::BaseController - LIMIT = 80 - - before_action -> { doorkeeper_authorize! :crypto } - before_action :require_user! - before_action :set_current_device - - before_action :set_encrypted_messages, only: :index - after_action :insert_pagination_headers, only: :index - - def index - render json: @encrypted_messages, each_serializer: REST::EncryptedMessageSerializer - end - - def clear - @current_device.encrypted_messages.up_to(params[:up_to_id]).delete_all - render_empty - end - - private - - def set_current_device - @current_device = Device.find_by!(access_token: doorkeeper_token) - end - - def set_encrypted_messages - @encrypted_messages = @current_device.encrypted_messages.to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id)) - end - - def next_path - api_v1_crypto_encrypted_messages_url pagination_params(max_id: pagination_max_id) if records_continue? - end - - def prev_path - api_v1_crypto_encrypted_messages_url pagination_params(min_id: pagination_since_id) unless @encrypted_messages.empty? - end - - def pagination_collection - @encrypted_messages - end - - def records_continue? - @encrypted_messages.size == limit_param(LIMIT) - end -end diff --git a/app/controllers/api/v1/crypto/keys/claims_controller.rb b/app/controllers/api/v1/crypto/keys/claims_controller.rb deleted file mode 100644 index f9d202d67b8..00000000000 --- a/app/controllers/api/v1/crypto/keys/claims_controller.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class Api::V1::Crypto::Keys::ClaimsController < Api::BaseController - before_action -> { doorkeeper_authorize! :crypto } - before_action :require_user! - before_action :set_claim_results - - def create - render json: @claim_results, each_serializer: REST::Keys::ClaimResultSerializer - end - - private - - def set_claim_results - @claim_results = devices.filter_map { |device_params| ::Keys::ClaimService.new.call(current_account, device_params[:account_id], device_params[:device_id]) } - end - - def resource_params - params.permit(device: [:account_id, :device_id]) - end - - def devices - Array(resource_params[:device]) - end -end diff --git a/app/controllers/api/v1/crypto/keys/counts_controller.rb b/app/controllers/api/v1/crypto/keys/counts_controller.rb deleted file mode 100644 index ffd7151b782..00000000000 --- a/app/controllers/api/v1/crypto/keys/counts_controller.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class Api::V1::Crypto::Keys::CountsController < Api::BaseController - before_action -> { doorkeeper_authorize! :crypto } - before_action :require_user! - before_action :set_current_device - - def show - render json: { one_time_keys: @current_device.one_time_keys.count } - end - - private - - def set_current_device - @current_device = Device.find_by!(access_token: doorkeeper_token) - end -end diff --git a/app/controllers/api/v1/crypto/keys/queries_controller.rb b/app/controllers/api/v1/crypto/keys/queries_controller.rb deleted file mode 100644 index e6ce9f9192a..00000000000 --- a/app/controllers/api/v1/crypto/keys/queries_controller.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class Api::V1::Crypto::Keys::QueriesController < Api::BaseController - before_action -> { doorkeeper_authorize! :crypto } - before_action :require_user! - before_action :set_accounts - before_action :set_query_results - - def create - render json: @query_results, each_serializer: REST::Keys::QueryResultSerializer - end - - private - - def set_accounts - @accounts = Account.where(id: account_ids).includes(:devices) - end - - def set_query_results - @query_results = @accounts.filter_map { |account| ::Keys::QueryService.new.call(account) } - end - - def account_ids - Array(params[:id]).map(&:to_i) - end -end diff --git a/app/controllers/api/v1/crypto/keys/uploads_controller.rb b/app/controllers/api/v1/crypto/keys/uploads_controller.rb deleted file mode 100644 index fc4abf63b3a..00000000000 --- a/app/controllers/api/v1/crypto/keys/uploads_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class Api::V1::Crypto::Keys::UploadsController < Api::BaseController - before_action -> { doorkeeper_authorize! :crypto } - before_action :require_user! - - def create - device = Device.find_or_initialize_by(access_token: doorkeeper_token) - - device.transaction do - device.account = current_account - device.update!(resource_params[:device]) - - if resource_params[:one_time_keys].present? && resource_params[:one_time_keys].is_a?(Enumerable) - resource_params[:one_time_keys].each do |one_time_key_params| - device.one_time_keys.create!(one_time_key_params) - end - end - end - - render json: device, serializer: REST::Keys::DeviceSerializer - end - - private - - def resource_params - params.permit(device: [:device_id, :name, :fingerprint_key, :identity_key], one_time_keys: [:key_id, :key, :signature]) - end -end diff --git a/app/helpers/context_helper.rb b/app/helpers/context_helper.rb index cbefe0fe538..3ab071a4595 100644 --- a/app/helpers/context_helper.rb +++ b/app/helpers/context_helper.rb @@ -23,23 +23,6 @@ module ContextHelper indexable: { 'toot' => 'http://joinmastodon.org/ns#', 'indexable' => 'toot:indexable' }, memorial: { 'toot' => 'http://joinmastodon.org/ns#', 'memorial' => 'toot:memorial' }, voters_count: { 'toot' => 'http://joinmastodon.org/ns#', 'votersCount' => 'toot:votersCount' }, - olm: { - 'toot' => 'http://joinmastodon.org/ns#', - 'Device' => 'toot:Device', - 'Ed25519Signature' => 'toot:Ed25519Signature', - 'Ed25519Key' => 'toot:Ed25519Key', - 'Curve25519Key' => 'toot:Curve25519Key', - 'EncryptedMessage' => 'toot:EncryptedMessage', - 'publicKeyBase64' => 'toot:publicKeyBase64', - 'deviceId' => 'toot:deviceId', - 'claim' => { '@type' => '@id', '@id' => 'toot:claim' }, - 'fingerprintKey' => { '@type' => '@id', '@id' => 'toot:fingerprintKey' }, - 'identityKey' => { '@type' => '@id', '@id' => 'toot:identityKey' }, - 'devices' => { '@type' => '@id', '@id' => 'toot:devices' }, - 'messageFranking' => 'toot:messageFranking', - 'messageType' => 'toot:messageType', - 'cipherText' => 'toot:cipherText', - }, suspended: { 'toot' => 'http://joinmastodon.org/ns#', 'suspended' => 'toot:suspended' }, }.freeze diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 5d700b49613..f97323b4789 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -8,44 +8,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity dereference_object! - case @object['type'] - when 'EncryptedMessage' - create_encrypted_message - else - create_status - end + create_status end private - def create_encrypted_message - return reject_payload! if non_matching_uri_hosts?(@account.uri, object_uri) || @options[:delivered_to_account_id].blank? - - target_account = Account.find(@options[:delivered_to_account_id]) - target_device = target_account.devices.find_by(device_id: @object.dig('to', 'deviceId')) - - return if target_device.nil? - - target_device.encrypted_messages.create!( - from_account: @account, - from_device_id: @object.dig('attributedTo', 'deviceId'), - type: @object['messageType'], - body: @object['cipherText'], - digest: @object.dig('digest', 'digestValue'), - message_franking: message_franking.to_token - ) - end - - def message_franking - MessageFranking.new( - hmac: @object.dig('digest', 'digestValue'), - original_franking: @object['messageFranking'], - source_account_id: @account.id, - target_account_id: @options[:delivered_to_account_id], - timestamp: Time.now.utc - ) - end - def create_status return reject_payload! if unsupported_object_type? || non_matching_uri_hosts?(@account.uri, object_uri) || tombstone_exists? || !related_to_local_activity? diff --git a/app/lib/inline_renderer.rb b/app/lib/inline_renderer.rb index 0aebb13fce4..af967ac215d 100644 --- a/app/lib/inline_renderer.rb +++ b/app/lib/inline_renderer.rb @@ -20,8 +20,6 @@ class InlineRenderer serializer = REST::AnnouncementSerializer when :reaction serializer = REST::ReactionSerializer - when :encrypted_message - serializer = REST::EncryptedMessageSerializer else return end diff --git a/app/lib/vacuum/system_keys_vacuum.rb b/app/lib/vacuum/system_keys_vacuum.rb deleted file mode 100644 index ceee2fd164b..00000000000 --- a/app/lib/vacuum/system_keys_vacuum.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class Vacuum::SystemKeysVacuum - def perform - vacuum_expired_system_keys! - end - - private - - def vacuum_expired_system_keys! - SystemKey.expired.delete_all - end -end diff --git a/app/models/account.rb b/app/models/account.rb index 23ff07c7696..ee37b214aea 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -44,7 +44,6 @@ # hide_collections :boolean # avatar_storage_schema_version :integer # header_storage_schema_version :integer -# devices_url :string # suspension_origin :integer # sensitized_at :datetime # trendable :boolean @@ -55,11 +54,12 @@ class Account < ApplicationRecord self.ignored_columns += %w( - subscription_expires_at - secret + devices_url + hub_url remote_url salmon_url - hub_url + secret + subscription_expires_at trust_level ) diff --git a/app/models/concerns/account/associations.rb b/app/models/concerns/account/associations.rb index 1c67b07e511..637e785953d 100644 --- a/app/models/concerns/account/associations.rb +++ b/app/models/concerns/account/associations.rb @@ -7,9 +7,6 @@ module Account::Associations # Local users has_one :user, inverse_of: :account, dependent: :destroy - # E2EE - has_many :devices, dependent: :destroy, inverse_of: :account - # Timelines has_many :statuses, inverse_of: :account, dependent: :destroy has_many :favourites, inverse_of: :account, dependent: :destroy diff --git a/app/models/device.rb b/app/models/device.rb deleted file mode 100644 index 5dc6cf1e66f..00000000000 --- a/app/models/device.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# == Schema Information -# -# Table name: devices -# -# id :bigint(8) not null, primary key -# access_token_id :bigint(8) -# account_id :bigint(8) -# device_id :string default(""), not null -# name :string default(""), not null -# fingerprint_key :text default(""), not null -# identity_key :text default(""), not null -# created_at :datetime not null -# updated_at :datetime not null -# - -class Device < ApplicationRecord - belongs_to :access_token, class_name: 'Doorkeeper::AccessToken' - belongs_to :account - - has_many :one_time_keys, dependent: :destroy, inverse_of: :device - has_many :encrypted_messages, dependent: :destroy, inverse_of: :device - - validates :name, :fingerprint_key, :identity_key, presence: true - validates :fingerprint_key, :identity_key, ed25519_key: true - - before_save :invalidate_associations, if: -> { device_id_changed? || fingerprint_key_changed? || identity_key_changed? } - - private - - def invalidate_associations - one_time_keys.destroy_all - encrypted_messages.destroy_all - end -end diff --git a/app/models/encrypted_message.rb b/app/models/encrypted_message.rb deleted file mode 100644 index 3e7e95594ce..00000000000 --- a/app/models/encrypted_message.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# == Schema Information -# -# Table name: encrypted_messages -# -# id :bigint(8) not null, primary key -# device_id :bigint(8) -# from_account_id :bigint(8) -# from_device_id :string default(""), not null -# type :integer default(0), not null -# body :text default(""), not null -# digest :text default(""), not null -# message_franking :text default(""), not null -# created_at :datetime not null -# updated_at :datetime not null -# - -class EncryptedMessage < ApplicationRecord - self.inheritance_column = nil - - include Paginable - include Redisable - - scope :up_to, ->(id) { where(arel_table[:id].lteq(id)) } - - belongs_to :device - belongs_to :from_account, class_name: 'Account' - - around_create Mastodon::Snowflake::Callbacks - - after_commit :push_to_streaming_api - - private - - def push_to_streaming_api - return if destroyed? || !subscribed_to_timeline? - - PushEncryptedMessageWorker.perform_async(id) - end - - def subscribed_to_timeline? - redis.exists?("subscribed:#{streaming_channel}") - end - - def streaming_channel - "timeline:#{device.account_id}:#{device.device_id}" - end -end diff --git a/app/models/message_franking.rb b/app/models/message_franking.rb deleted file mode 100644 index c72bd1ccaca..00000000000 --- a/app/models/message_franking.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class MessageFranking - attr_reader :hmac, :source_account_id, :target_account_id, - :timestamp, :original_franking - - def initialize(attributes = {}) - @hmac = attributes[:hmac] - @source_account_id = attributes[:source_account_id] - @target_account_id = attributes[:target_account_id] - @timestamp = attributes[:timestamp] - @original_franking = attributes[:original_franking] - end - - def to_token - crypt = ActiveSupport::MessageEncryptor.new(SystemKey.current_key, serializer: Oj) - crypt.encrypt_and_sign(self) - end -end diff --git a/app/models/one_time_key.rb b/app/models/one_time_key.rb deleted file mode 100644 index 23604e2f7d3..00000000000 --- a/app/models/one_time_key.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# == Schema Information -# -# Table name: one_time_keys -# -# id :bigint(8) not null, primary key -# device_id :bigint(8) -# key_id :string default(""), not null -# key :text default(""), not null -# signature :text default(""), not null -# created_at :datetime not null -# updated_at :datetime not null -# - -class OneTimeKey < ApplicationRecord - belongs_to :device - - validates :key_id, :key, :signature, presence: true - validates :key, ed25519_key: true - validates :signature, ed25519_signature: { message: :key, verify_key: ->(one_time_key) { one_time_key.device.fingerprint_key } } -end diff --git a/app/models/system_key.rb b/app/models/system_key.rb deleted file mode 100644 index 1be399dd689..00000000000 --- a/app/models/system_key.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# == Schema Information -# -# Table name: system_keys -# -# id :bigint(8) not null, primary key -# key :binary -# created_at :datetime not null -# updated_at :datetime not null -# -class SystemKey < ApplicationRecord - ROTATION_PERIOD = 1.week.freeze - - before_validation :set_key - - scope :expired, ->(now = Time.now.utc) { where(arel_table[:created_at].lt(now - (ROTATION_PERIOD * 3))) } - - class << self - def current_key - previous_key = order(id: :asc).last - - if previous_key && previous_key.created_at >= ROTATION_PERIOD.ago - previous_key.key - else - create.key - end - end - end - - private - - def set_key - return if key.present? - - cipher = OpenSSL::Cipher.new('AES-256-GCM') - cipher.encrypt - - self.key = cipher.random_key - end -end diff --git a/app/serializers/activitypub/activity_serializer.rb b/app/serializers/activitypub/activity_serializer.rb index 5bdf53f032d..23a5b42bc79 100644 --- a/app/serializers/activitypub/activity_serializer.rb +++ b/app/serializers/activitypub/activity_serializer.rb @@ -5,8 +5,6 @@ class ActivityPub::ActivitySerializer < ActivityPub::Serializer case model.class.name when 'Status' ActivityPub::NoteSerializer - when 'DeliverToDeviceService::EncryptedMessage' - ActivityPub::EncryptedMessageSerializer else super end diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb index 4ab48ff204b..d5e1f56acea 100644 --- a/app/serializers/activitypub/actor_serializer.rb +++ b/app/serializers/activitypub/actor_serializer.rb @@ -7,7 +7,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer context :security context_extensions :manually_approves_followers, :featured, :also_known_as, - :moved_to, :property_value, :discoverable, :olm, :suspended, + :moved_to, :property_value, :discoverable, :suspended, :memorial, :indexable attributes :id, :type, :following, :followers, @@ -21,7 +21,6 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer has_many :virtual_tags, key: :tag has_many :virtual_attachments, key: :attachment - attribute :devices, unless: :instance_actor? attribute :moved_to, if: :moved? attribute :also_known_as, if: :also_known_as? attribute :suspended, if: :suspended? @@ -71,10 +70,6 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer object.instance_actor? ? instance_actor_inbox_url : account_inbox_url(object) end - def devices - account_collection_url(object, :devices) - end - def outbox object.instance_actor? ? instance_actor_outbox_url : account_outbox_url(object) end diff --git a/app/serializers/activitypub/collection_serializer.rb b/app/serializers/activitypub/collection_serializer.rb index 34026a6b5be..1b410cecaef 100644 --- a/app/serializers/activitypub/collection_serializer.rb +++ b/app/serializers/activitypub/collection_serializer.rb @@ -14,8 +14,6 @@ class ActivityPub::CollectionSerializer < ActivityPub::Serializer case model.class.name when 'Status' ActivityPub::NoteSerializer - when 'Device' - ActivityPub::DeviceSerializer when 'FeaturedTag' ActivityPub::HashtagSerializer when 'ActivityPub::CollectionPresenter' diff --git a/app/serializers/activitypub/device_serializer.rb b/app/serializers/activitypub/device_serializer.rb deleted file mode 100644 index 5f0fdc8af93..00000000000 --- a/app/serializers/activitypub/device_serializer.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -class ActivityPub::DeviceSerializer < ActivityPub::Serializer - context_extensions :olm - - include RoutingHelper - - class FingerprintKeySerializer < ActivityPub::Serializer - attributes :type, :public_key_base64 - - def type - 'Ed25519Key' - end - - def public_key_base64 - object.fingerprint_key - end - end - - class IdentityKeySerializer < ActivityPub::Serializer - attributes :type, :public_key_base64 - - def type - 'Curve25519Key' - end - - def public_key_base64 - object.identity_key - end - end - - attributes :device_id, :type, :name, :claim - - has_one :fingerprint_key, serializer: FingerprintKeySerializer - has_one :identity_key, serializer: IdentityKeySerializer - - def type - 'Device' - end - - def claim - account_claim_url(object.account, id: object.device_id) - end - - def fingerprint_key - object - end - - def identity_key - object - end -end diff --git a/app/serializers/activitypub/encrypted_message_serializer.rb b/app/serializers/activitypub/encrypted_message_serializer.rb deleted file mode 100644 index 3c525d23e5c..00000000000 --- a/app/serializers/activitypub/encrypted_message_serializer.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -class ActivityPub::EncryptedMessageSerializer < ActivityPub::Serializer - context :security - - context_extensions :olm - - class DeviceSerializer < ActivityPub::Serializer - attributes :type, :device_id - - def type - 'Device' - end - - def device_id - object - end - end - - class DigestSerializer < ActivityPub::Serializer - attributes :type, :digest_algorithm, :digest_value - - def type - 'Digest' - end - - def digest_algorithm - 'http://www.w3.org/2000/09/xmldsig#hmac-sha256' - end - - def digest_value - object - end - end - - attributes :type, :message_type, :cipher_text, :message_franking - - has_one :attributed_to, serializer: DeviceSerializer - has_one :to, serializer: DeviceSerializer - has_one :digest, serializer: DigestSerializer - - def type - 'EncryptedMessage' - end - - def attributed_to - object.source_device.device_id - end - - def to - object.target_device_id - end - - def message_type - object.type - end - - def cipher_text - object.body - end -end diff --git a/app/serializers/activitypub/one_time_key_serializer.rb b/app/serializers/activitypub/one_time_key_serializer.rb deleted file mode 100644 index 5932eb5b55a..00000000000 --- a/app/serializers/activitypub/one_time_key_serializer.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class ActivityPub::OneTimeKeySerializer < ActivityPub::Serializer - context :security - - context_extensions :olm - - class SignatureSerializer < ActivityPub::Serializer - attributes :type, :signature_value - - def type - 'Ed25519Signature' - end - - def signature_value - object.signature - end - end - - attributes :key_id, :type, :public_key_base64 - - has_one :signature, serializer: SignatureSerializer - - def type - 'Curve25519Key' - end - - def public_key_base64 - object.key - end - - def signature - object - end -end diff --git a/app/serializers/rest/encrypted_message_serializer.rb b/app/serializers/rest/encrypted_message_serializer.rb deleted file mode 100644 index 80c26d060ea..00000000000 --- a/app/serializers/rest/encrypted_message_serializer.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class REST::EncryptedMessageSerializer < ActiveModel::Serializer - attributes :id, :account_id, :device_id, - :type, :body, :digest, :message_franking, - :created_at - - def id - object.id.to_s - end - - def account_id - object.from_account_id.to_s - end - - def device_id - object.from_device_id - end -end diff --git a/app/serializers/rest/keys/claim_result_serializer.rb b/app/serializers/rest/keys/claim_result_serializer.rb deleted file mode 100644 index 145044f5572..00000000000 --- a/app/serializers/rest/keys/claim_result_serializer.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class REST::Keys::ClaimResultSerializer < ActiveModel::Serializer - attributes :account_id, :device_id, :key_id, :key, :signature - - def account_id - object.account.id.to_s - end -end diff --git a/app/serializers/rest/keys/device_serializer.rb b/app/serializers/rest/keys/device_serializer.rb deleted file mode 100644 index f9b821b79ca..00000000000 --- a/app/serializers/rest/keys/device_serializer.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -class REST::Keys::DeviceSerializer < ActiveModel::Serializer - attributes :device_id, :name, :identity_key, - :fingerprint_key -end diff --git a/app/serializers/rest/keys/query_result_serializer.rb b/app/serializers/rest/keys/query_result_serializer.rb deleted file mode 100644 index 8f8bdde289f..00000000000 --- a/app/serializers/rest/keys/query_result_serializer.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class REST::Keys::QueryResultSerializer < ActiveModel::Serializer - attributes :account_id - - has_many :devices, serializer: REST::Keys::DeviceSerializer - - def account_id - object.account.id.to_s - end -end diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index b667e97f4d8..922575d2f38 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -108,7 +108,6 @@ class ActivityPub::ProcessAccountService < BaseService def set_immediate_attributes! @account.featured_collection_url = @json['featured'] || '' - @account.devices_url = @json['devices'] || '' @account.display_name = @json['name'] || '' @account.note = @json['summary'] || '' @account.locked = @json['manuallyApprovesFollowers'] || false diff --git a/app/services/delete_account_service.rb b/app/services/delete_account_service.rb index 328d8ae8f83..0c03267d43d 100644 --- a/app/services/delete_account_service.rb +++ b/app/services/delete_account_service.rb @@ -13,7 +13,6 @@ class DeleteAccountService < BaseService conversation_mutes conversations custom_filters - devices domain_blocks featured_tags follow_requests @@ -40,7 +39,6 @@ class DeleteAccountService < BaseService conversation_mutes conversations custom_filters - devices domain_blocks featured_tags follow_requests diff --git a/app/services/deliver_to_device_service.rb b/app/services/deliver_to_device_service.rb deleted file mode 100644 index 71711945c06..00000000000 --- a/app/services/deliver_to_device_service.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -class DeliverToDeviceService < BaseService - include Payloadable - - class EncryptedMessage < ActiveModelSerializers::Model - attributes :source_account, :target_account, :source_device, - :target_device_id, :type, :body, :digest, - :message_franking - end - - def call(source_account, source_device, options = {}) - @source_account = source_account - @source_device = source_device - @target_account = Account.find(options[:account_id]) - @target_device_id = options[:device_id] - @body = options[:body] - @type = options[:type] - @hmac = options[:hmac] - - set_message_franking! - - if @target_account.local? - deliver_to_local! - else - deliver_to_remote! - end - end - - private - - def set_message_franking! - @message_franking = message_franking.to_token - end - - def deliver_to_local! - target_device = @target_account.devices.find_by!(device_id: @target_device_id) - - target_device.encrypted_messages.create!( - from_account: @source_account, - from_device_id: @source_device.device_id, - type: @type, - body: @body, - digest: @hmac, - message_franking: @message_franking - ) - end - - def deliver_to_remote! - ActivityPub::DeliveryWorker.perform_async( - Oj.dump(serialize_payload(ActivityPub::ActivityPresenter.from_encrypted_message(encrypted_message), ActivityPub::ActivitySerializer)), - @source_account.id, - @target_account.inbox_url - ) - end - - def message_franking - MessageFranking.new( - source_account_id: @source_account.id, - target_account_id: @target_account.id, - hmac: @hmac, - timestamp: Time.now.utc - ) - end - - def encrypted_message - EncryptedMessage.new( - source_account: @source_account, - target_account: @target_account, - source_device: @source_device, - target_device_id: @target_device_id, - type: @type, - body: @body, - digest: @hmac, - message_franking: @message_franking - ) - end -end diff --git a/app/services/keys/claim_service.rb b/app/services/keys/claim_service.rb deleted file mode 100644 index ebce9cce7d8..00000000000 --- a/app/services/keys/claim_service.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -class Keys::ClaimService < BaseService - HEADERS = { 'Content-Type' => 'application/activity+json' }.freeze - - class Result < ActiveModelSerializers::Model - attributes :account, :device_id, :key_id, - :key, :signature - - def initialize(account, device_id, key_attributes = {}) - super( - account: account, - device_id: device_id, - key_id: key_attributes[:key_id], - key: key_attributes[:key], - signature: key_attributes[:signature], - ) - end - end - - def call(source_account, target_account_id, device_id) - @source_account = source_account - @target_account = Account.find(target_account_id) - @device_id = device_id - - if @target_account.local? - claim_local_key! - else - claim_remote_key! - end - rescue ActiveRecord::RecordNotFound - nil - end - - private - - def claim_local_key! - device = @target_account.devices.find_by(device_id: @device_id) - key = nil - - ApplicationRecord.transaction do - key = device.one_time_keys.order(Arel.sql('random()')).first! - key.destroy! - end - - @result = Result.new(@target_account, @device_id, key) - end - - def claim_remote_key! - query_result = QueryService.new.call(@target_account) - device = query_result.find(@device_id) - - return unless device.present? && device.valid_claim_url? - - json = fetch_resource_with_post(device.claim_url) - - return unless json.present? && json['publicKeyBase64'].present? - - @result = Result.new(@target_account, @device_id, key_id: json['id'], key: json['publicKeyBase64'], signature: json.dig('signature', 'signatureValue')) - rescue HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error => e - Rails.logger.debug { "Claiming one-time key for #{@target_account.acct}:#{@device_id} failed: #{e}" } - nil - end - - def fetch_resource_with_post(uri) - build_post_request(uri).perform do |response| - raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response) - - body_to_json(response.body_with_limit) if response.code == 200 - end - end - - def build_post_request(uri) - Request.new(:post, uri).tap do |request| - request.on_behalf_of(@source_account) - request.add_headers(HEADERS) - end - end -end diff --git a/app/services/keys/query_service.rb b/app/services/keys/query_service.rb deleted file mode 100644 index 33e13293f31..00000000000 --- a/app/services/keys/query_service.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -class Keys::QueryService < BaseService - include JsonLdHelper - - class Result < ActiveModelSerializers::Model - attributes :account, :devices - - def initialize(account, devices) - super( - account: account, - devices: devices || [], - ) - end - - def find(device_id) - @devices.find { |device| device.device_id == device_id } - end - end - - class Device < ActiveModelSerializers::Model - attributes :device_id, :name, :identity_key, :fingerprint_key - - def initialize(attributes = {}) - super( - device_id: attributes[:device_id], - name: attributes[:name], - identity_key: attributes[:identity_key], - fingerprint_key: attributes[:fingerprint_key], - ) - @claim_url = attributes[:claim_url] - end - - def valid_claim_url? - return false if @claim_url.blank? - - begin - parsed_url = Addressable::URI.parse(@claim_url).normalize - rescue Addressable::URI::InvalidURIError - return false - end - - %w(http https).include?(parsed_url.scheme) && parsed_url.host.present? - end - end - - def call(account) - @account = account - - if @account.local? - query_local_devices! - else - query_remote_devices! - end - - Result.new(@account, @devices) - end - - private - - def query_local_devices! - @devices = @account.devices.map { |device| Device.new(device) } - end - - def query_remote_devices! - return if @account.devices_url.blank? - - json = fetch_resource(@account.devices_url) - - return if json['items'].blank? - - @devices = as_array(json['items']).map do |device| - Device.new(device_id: device['id'], name: device['name'], identity_key: device.dig('identityKey', 'publicKeyBase64'), fingerprint_key: device.dig('fingerprintKey', 'publicKeyBase64'), claim_url: device['claim']) - end - rescue HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error => e - Rails.logger.debug { "Querying devices for #{@account.acct} failed: #{e}" } - nil - end -end diff --git a/app/validators/ed25519_key_validator.rb b/app/validators/ed25519_key_validator.rb deleted file mode 100644 index adf49296b2f..00000000000 --- a/app/validators/ed25519_key_validator.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class Ed25519KeyValidator < ActiveModel::EachValidator - def validate_each(record, attribute, value) - return if value.blank? - - key = Base64.decode64(value) - - record.errors.add(attribute, I18n.t('crypto.errors.invalid_key')) unless verified?(key) - end - - private - - def verified?(key) - Ed25519.validate_key_bytes(key) - rescue ArgumentError - false - end -end diff --git a/app/validators/ed25519_signature_validator.rb b/app/validators/ed25519_signature_validator.rb deleted file mode 100644 index 0e74c231ece..00000000000 --- a/app/validators/ed25519_signature_validator.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class Ed25519SignatureValidator < ActiveModel::EachValidator - def validate_each(record, attribute, value) - return if value.blank? - - verify_key = Ed25519::VerifyKey.new(Base64.decode64(option_to_value(record, :verify_key))) - signature = Base64.decode64(value) - message = option_to_value(record, :message) - - record.errors.add(attribute, I18n.t('crypto.errors.invalid_signature')) unless verified?(verify_key, signature, message) - end - - private - - def verified?(verify_key, signature, message) - verify_key.verify(signature, message) - rescue Ed25519::VerifyError, ArgumentError - false - end - - def option_to_value(record, key) - if options[key].is_a?(Proc) - options[key].call(record) - else - record.public_send(options[key]) - end - end -end diff --git a/app/workers/push_encrypted_message_worker.rb b/app/workers/push_encrypted_message_worker.rb deleted file mode 100644 index 6bee12675b0..00000000000 --- a/app/workers/push_encrypted_message_worker.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class PushEncryptedMessageWorker - include Sidekiq::Worker - include Redisable - - def perform(encrypted_message_id) - encrypted_message = EncryptedMessage.find(encrypted_message_id) - message = InlineRenderer.render(encrypted_message, nil, :encrypted_message) - timeline_id = "timeline:#{encrypted_message.device.account_id}:#{encrypted_message.device.device_id}" - - redis.publish(timeline_id, Oj.dump(event: :encrypted_message, payload: message)) - rescue ActiveRecord::RecordNotFound - true - end -end diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 83100b1cf5f..30bb5289f43 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -118,8 +118,7 @@ Doorkeeper.configure do :'admin:write:domain_blocks', :'admin:write:ip_blocks', :'admin:write:email_domain_blocks', - :'admin:write:canonical_email_blocks', - :crypto + :'admin:write:canonical_email_blocks' # Change the way client credentials are retrieved from the request object. # By default it retrieves first from the `HTTP_AUTHORIZATION` header, then diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ba459e19f22..2b0563f4d32 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -19,7 +19,6 @@ ActiveSupport::Inflector.inflections(:en) do |inflect| inflect.acronym 'CLI' inflect.acronym 'DeepL' inflect.acronym 'DSL' - inflect.acronym 'Ed25519' inflect.acronym 'JsonLd' inflect.acronym 'OEmbed' inflect.acronym 'OStatus' diff --git a/config/locales/an.yml b/config/locales/an.yml index 637aa8c8b37..e1cf1dd6f29 100644 --- a/config/locales/an.yml +++ b/config/locales/an.yml @@ -984,10 +984,6 @@ an: hint_html: "Tip: No tornaremos a preguntar-te per la clau entre la siguient hora." invalid_password: Clau incorrecta prompt: Confirmar clau pa seguir - crypto: - errors: - invalid_key: no ye una clau Ed25519 u Curve25519 valida - invalid_signature: no ye una sinyatura Ed25519 valida date: formats: default: "%d %b %Y" diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 4df24c984c0..4849cf413e5 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1191,10 +1191,6 @@ ar: hint_html: "توصية: لن نطلب منك ثانية كلمتك السرية في غضون الساعة اللاحقة." invalid_password: الكلمة السرية خاطئة prompt: أكِّد الكلمة السرية للمواصلة - crypto: - errors: - invalid_key: ليس بمفتاح Ed25519 أو Curve25519 صالح - invalid_signature: ليس بتوقيع Ed25519 صالح date: formats: default: "%d %b %Y" diff --git a/config/locales/ast.yml b/config/locales/ast.yml index 567e5357ebc..e8138ff8717 100644 --- a/config/locales/ast.yml +++ b/config/locales/ast.yml @@ -499,10 +499,6 @@ ast: hint_html: "Conseyu: nun vamos volver pidite la contraseña hasta dientro d'una hora." invalid_password: La contraseña nun ye válida prompt: Confirma la contraseña pa siguir - crypto: - errors: - invalid_key: nun ye una clave ed25519 o curve25519 válida - invalid_signature: nun ye una clave ed25519 válida datetime: distance_in_words: about_x_hours: "%{count} h" diff --git a/config/locales/be.yml b/config/locales/be.yml index a14ba3d2243..c65c003f553 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -1165,10 +1165,6 @@ be: hint_html: "Парада: Мы не будзем запытваць ваш пароль зноўку на працягу наступнай гадзіны." invalid_password: Няправільны пароль prompt: Пацвердзіць пароль, каб працягнуць - crypto: - errors: - invalid_key: гэта не сапраўдны Ed25519 або Curve25519 ключ - invalid_signature: гэта не сапраўдная Ed25519 сігнатура date: formats: default: "%d.%m.%Y" diff --git a/config/locales/bg.yml b/config/locales/bg.yml index fdaab7ac2af..77274466189 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1135,10 +1135,6 @@ bg: hint_html: "Съвет: няма да ви питаме пак за паролата през следващия час." invalid_password: Невалидна парола prompt: Потвърдете паролата, за да продължите - crypto: - errors: - invalid_key: не е валиден ключ Ed25519 или Curve25519 - invalid_signature: не е валиден подпис Ed25519 date: formats: default: "%b %d, %Y" diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 321afb4dcb5..9845994b1cc 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1135,10 +1135,6 @@ ca: hint_html: "Pista: No et preguntarem un altre cop la teva contrasenya en la pròxima hora." invalid_password: Contrasenya no vàlida prompt: Confirmi la contrasenya per a continuar - crypto: - errors: - invalid_key: no és una clau Ed25519 o Curve25519 vàlida - invalid_signature: no és una signatura Ed25519 vàlida date: formats: default: "%b %d, %Y" diff --git a/config/locales/ckb.yml b/config/locales/ckb.yml index 93eea8273f5..ef1c9ffffd8 100644 --- a/config/locales/ckb.yml +++ b/config/locales/ckb.yml @@ -627,10 +627,6 @@ ckb: hint_html: "خاڵ: ئیمە لە کاتژمێری داهاتوو تێپەروشەت لێداوا ناکەین." invalid_password: تێپەروشە دروست نیە prompt: دڵنیابوون لە نهێنوشە بۆ بەردەوامبوون - crypto: - errors: - invalid_key: کلیلی باوڕپێکراو Ed25519 یان Curve25519 دروست نییە - invalid_signature: واژووی Ed25519 بڕوادار نییە date: formats: default: "%b %d, %Y" diff --git a/config/locales/co.yml b/config/locales/co.yml index 6edbbc95ffb..b26639c5919 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -587,10 +587,6 @@ co: hint_html: "Astuzia: Ùn avemu micca da dumandavvi stu codice per l'ore chì vene." invalid_password: Chjave d'accessu micca curretta prompt: Cunfirmà a chjave d'accessu per cuntinuvà - crypto: - errors: - invalid_key: ùn hè micca una chjave Ed25519 o Curve25519 valida - invalid_signature: ùn hè micca una firma Ed25519 valida date: formats: default: "%d %b %Y" diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 7e0aaaeefb6..fe65ee621e6 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1166,10 +1166,6 @@ cs: hint_html: "Tip: Po dobu jedné hodiny vás o heslo nebudeme znovu žádat." invalid_password: Neplatné heslo prompt: Pokračujte potvrzením hesla - crypto: - errors: - invalid_key: není platný klíč Ed25519 nebo Curve25519 - invalid_signature: není platný podpis typu Ed25519 date: formats: default: "%d. %b %Y" diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 5f1b0b4bcef..7c91c616df9 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -1204,10 +1204,6 @@ cy: hint_html: "Awgrym: Fyddwn ni ddim yn gofyn i chi am eich cyfrinair eto am yr awr nesaf." invalid_password: Cyfrinair annilys prompt: Cadarnhewch gyfrinair i barhau - crypto: - errors: - invalid_key: ddim yn allwedd Ed25519 na Curve25519 dilys - invalid_signature: ddim yn llofnod Ed25519 dilys date: formats: default: "%b %d %Y" diff --git a/config/locales/da.yml b/config/locales/da.yml index e699d9e8ade..15b9501f8d4 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1134,10 +1134,6 @@ da: hint_html: "Tip: Du bliver ikke anmodet om din adgangskode igen den næste time." invalid_password: Ugyldig adgangskode prompt: Bekræft adgangskode for at fortsætte - crypto: - errors: - invalid_key: er ikke en gyldig Ed25519- eller Curve25519-nøgle - invalid_signature: er ikke en gylidig Ed25519-signatur date: formats: default: "%d. %b %Y" diff --git a/config/locales/de.yml b/config/locales/de.yml index 33df5453852..58d2b8a8173 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1135,10 +1135,6 @@ de: hint_html: "Hinweis: Wir werden dich für die nächste Stunde nicht erneut nach deinem Passwort fragen." invalid_password: Ungültiges Passwort prompt: Bestätige mit deinem Passwort, um fortzufahren - crypto: - errors: - invalid_key: ist kein gültiger Ed25519- oder Curve25519-Schlüssel - invalid_signature: ist keine gültige Ed25519-Signatur date: formats: default: "%d. %b %Y" diff --git a/config/locales/el.yml b/config/locales/el.yml index e177bf342af..7a2f9a849fa 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -1058,10 +1058,6 @@ el: hint_html: "Συμβουλή: Δεν θα σου ζητήσουμε τον κωδικό ασφαλείας σου ξανά για την επόμενη ώρα." invalid_password: Μη έγκυρο συνθηματικό prompt: Επιβεβαίωση συνθηματικού για συνέχεια - crypto: - errors: - invalid_key: δεν είναι έγκυρο κλειδί Ed25519 ή Curve25519 - invalid_signature: δεν είναι έγκυρη υπογραφή Ed25519 date: formats: default: "%b %d, %Y" diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index a7e6ed7a665..c23982445b3 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1135,10 +1135,6 @@ en-GB: hint_html: "Tip: We won't ask you for your password again for the next hour." invalid_password: Invalid password prompt: Confirm password to continue - crypto: - errors: - invalid_key: is not a valid Ed25519 or Curve25519 key - invalid_signature: is not a valid Ed25519 signature date: formats: default: "%b %d, %Y" diff --git a/config/locales/en.yml b/config/locales/en.yml index 322183f4ce9..a619b5d8db2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1135,10 +1135,6 @@ en: hint_html: "Tip: We won't ask you for your password again for the next hour." invalid_password: Invalid password prompt: Confirm password to continue - crypto: - errors: - invalid_key: is not a valid Ed25519 or Curve25519 key - invalid_signature: is not a valid Ed25519 signature date: formats: default: "%b %d, %Y" diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 95e3dd5a8d9..4fb40589045 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -1077,10 +1077,6 @@ eo: hint_html: "Konsileto: Ni ne demandos pri via pasvorto ĝis 1 horo." invalid_password: Nevalida pasvorto prompt: Konfirmi pasvorton por daŭrigi - crypto: - errors: - invalid_key: 올바른 Ed25519 혹은 Curve25519 키가 아닙니다 - invalid_signature: 올바른 Ed25519 시그니처가 아닙니다 date: formats: default: "%Y-%b-%d" diff --git a/config/locales/es-AR.yml b/config/locales/es-AR.yml index 35dc9a348de..9276108b0de 100644 --- a/config/locales/es-AR.yml +++ b/config/locales/es-AR.yml @@ -1135,10 +1135,6 @@ es-AR: hint_html: "Dato: No volveremos a preguntarte por la contraseña durante la siguiente hora." invalid_password: Contraseña no válida prompt: Confirmar contraseña para seguir - crypto: - errors: - invalid_key: no es una clave Ed25519 o Curve25519 válida - invalid_signature: no es una firma Ed25519 válida date: formats: default: "%d de %b de %Y" diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index f39de2b27b1..5947e64e7cb 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -1135,10 +1135,6 @@ es-MX: hint_html: "Tip: No volveremos a preguntarte por la contraseña durante la siguiente hora." invalid_password: Contraseña incorrecta prompt: Confirmar contraseña para seguir - crypto: - errors: - invalid_key: no es una clave Ed25519 o Curve25519 válida - invalid_signature: no es una firma Ed25519 válida date: formats: default: "%d %b %Y" diff --git a/config/locales/es.yml b/config/locales/es.yml index fbee73ed2ac..e46c39f63b4 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1135,10 +1135,6 @@ es: hint_html: "Tip: No volveremos a preguntarte por la contraseña durante la siguiente hora." invalid_password: Contraseña incorrecta prompt: Confirmar contraseña para seguir - crypto: - errors: - invalid_key: no es una clave Ed25519 o Curve25519 válida - invalid_signature: no es una firma Ed25519 válida date: formats: default: "%d %b %Y" diff --git a/config/locales/et.yml b/config/locales/et.yml index 30d75d25ee4..d7936a75174 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -1130,10 +1130,6 @@ et: hint_html: "Nõuanne: Me ei küsi salasõna uuesti järgmise tunni jooksul." invalid_password: Vigane salasõna prompt: Jätkamiseks salasõna veelkord - crypto: - errors: - invalid_key: ei ole õige Ed25519 ega Curve25519 võti - invalid_signature: ei ole õige Ed25519 allkiri date: formats: default: "%d. %b %Y" diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 67da357e1de..4fe56f3921a 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1129,10 +1129,6 @@ eu: hint_html: "Oharra: Ez dizugu pasahitza berriro eskatuko ordu batez." invalid_password: Pasahitz baliogabea prompt: Berretsi pasahitza jarraitzeko - crypto: - errors: - invalid_key: ez da baliozko Ed25519 edo Curve25519 gakoa - invalid_signature: ez da baliozko Ed25519 sinadura date: formats: default: "%Y(e)ko %b %d" diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 509d69fcba7..549082fab84 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -949,10 +949,6 @@ fa: hint_html: "نکته: ما در یک ساعت آینده گذرواژه‌تان را از شما نخواهیم پرسید." invalid_password: گذرواژه نامعتبر prompt: برای ادامه گذرواژه‌تان را تأیید کنید - crypto: - errors: - invalid_key: یک کلید معتبر Ed25519 یا Curve25519 نیست - invalid_signature: یک امضای معتبر Ed25519 نیست date: formats: default: "%d %b %Y" diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 0aa38ed923a..5ccbf585dc9 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1135,10 +1135,6 @@ fi: hint_html: "Vihje: Emme pyydä sinulta salasanaa uudelleen seuraavan tunnin aikana." invalid_password: Virheellinen salasana prompt: Vahvista salasanasi jatkaaksesi - crypto: - errors: - invalid_key: ei ole kelvollinen Ed25519- tai Curve25519-avain - invalid_signature: ei ole kelvollinen Ed25519-allekirjoitus date: formats: default: "%b %d, %Y" diff --git a/config/locales/fo.yml b/config/locales/fo.yml index b483a321a92..fcfe0d7aadf 100644 --- a/config/locales/fo.yml +++ b/config/locales/fo.yml @@ -1135,10 +1135,6 @@ fo: hint_html: "Góð ráð: vit spyrja teg ikki aftur um loyniorðið næsta tíman." invalid_password: Skeivt loyniorð prompt: Vátta loyniorð fyri at halda fram - crypto: - errors: - invalid_key: er ikki ein gildur Ed25519 ella Curve25519 lykil - invalid_signature: er ikki ein gildug Ed25519 undirskrift date: formats: default: "%b %d, %Y" diff --git a/config/locales/fr-CA.yml b/config/locales/fr-CA.yml index f297e8bfdea..fb9a29d64c2 100644 --- a/config/locales/fr-CA.yml +++ b/config/locales/fr-CA.yml @@ -1126,10 +1126,6 @@ fr-CA: hint_html: "Astuce : Nous ne vous demanderons plus votre mot de passe pour la prochaine heure." invalid_password: Mot de passe invalide prompt: Confirmez votre mot de passe pour continuer - crypto: - errors: - invalid_key: n’est pas une clé Ed25519 ou Curve25519 valide - invalid_signature: n’est pas une signature Ed25519 valide date: formats: default: "%d %b %Y" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 33cdcd44cc5..034c38ec49e 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1126,10 +1126,6 @@ fr: hint_html: "Astuce : Nous ne vous demanderons plus votre mot de passe pour la prochaine heure." invalid_password: Mot de passe invalide prompt: Confirmez votre mot de passe pour continuer - crypto: - errors: - invalid_key: n’est pas une clé Ed25519 ou Curve25519 valide - invalid_signature: n’est pas une signature Ed25519 valide date: formats: default: "%d %b %Y" diff --git a/config/locales/fy.yml b/config/locales/fy.yml index 054ae2fab2a..16326e5aed0 100644 --- a/config/locales/fy.yml +++ b/config/locales/fy.yml @@ -1135,10 +1135,6 @@ fy: hint_html: "Tip: Wy freegje jo it kommende oere net mear nei jo wachtwurd." invalid_password: Unjildich wachtwurd prompt: Befêstigje wachtwurd om troch te gean - crypto: - errors: - invalid_key: is gjin jildige Ed25519- of Curve25519-kaai - invalid_signature: is gjin jildige Ed25519-hantekening date: formats: default: "%d %b %Y" diff --git a/config/locales/ga.yml b/config/locales/ga.yml index 57162e2ed1d..2e18fc397d5 100644 --- a/config/locales/ga.yml +++ b/config/locales/ga.yml @@ -1189,10 +1189,6 @@ ga: hint_html: "Leid: Ní iarrfaimid do phasfhocal ort arís go ceann uair an chloig eile." invalid_password: Pasfhocal neamhbhailí prompt: Deimhnigh an pasfhocal chun leanúint ar aghaidh - crypto: - errors: - invalid_key: nach eochair bhailí Ed25519 nó Curve25519 í - invalid_signature: nach síniú bailí Ed25519 é date: formats: default: "%b %d, %Y" diff --git a/config/locales/gd.yml b/config/locales/gd.yml index 52b25e28543..9b94c21b686 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -1162,10 +1162,6 @@ gd: hint_html: "Gliocas: Chan iarr sinn am facal-faire agad ort a-rithist fad uair a thìde." invalid_password: Facal-faire mì-dhligheach prompt: Dearbh am facal-faire airson leantainn air adhart - crypto: - errors: - invalid_key: "– chan e iuchair Ed25519 no Curve25519 dhligheach a th’ ann" - invalid_signature: "– chan e soidhneadh Ed25519 dligheach a th’ ann" date: formats: default: "%d %b %Y" diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 45ae60008cf..e7ea664936f 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1135,10 +1135,6 @@ gl: hint_html: "Nota: Non che pediremos o contrasinal na seguinte hora." invalid_password: Contrasinal incorrecto prompt: Confirma o contrasinal para continuar - crypto: - errors: - invalid_key: non é unha chave Ed25519 ou Curve25519 válida - invalid_signature: non é unha sinatura Ed25519 válida date: formats: default: "%d %b, %Y" diff --git a/config/locales/he.yml b/config/locales/he.yml index 5a9571da754..2e1802499d7 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1171,10 +1171,6 @@ he: hint_html: "טיפ: לא נבקש את סיסמתך שוב בשעה הקרובה." invalid_password: סיסמה שגויה prompt: יש לאשר את הסיסמה כדי להמשיך - crypto: - errors: - invalid_key: זהו לא מפתח Ed25519 או Curve25519 קביל - invalid_signature: היא לא חתימת Ed25519 קבילה date: formats: default: "%b %d, %Y" diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 695b3786f26..33159cd8ad6 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1135,10 +1135,6 @@ hu: hint_html: "Hasznos: Nem fogjuk megint a jelszavadat kérdezni a következő órában." invalid_password: Érvénytelen jelszó prompt: Add meg a jelszót a folytatáshoz - crypto: - errors: - invalid_key: érvénytelen Ed25519 vagy Curve25519 kulcs - invalid_signature: érvénytelen Ed25519 aláírás date: formats: default: "%Y. %b %d." diff --git a/config/locales/hy.yml b/config/locales/hy.yml index 5042e3f7f06..fb9ec4dfaa6 100644 --- a/config/locales/hy.yml +++ b/config/locales/hy.yml @@ -505,10 +505,6 @@ hy: confirm: Շարունակել invalid_password: Անվաւեր ծածկագիր prompt: Շարունակելու համար մուտքագրիր ծածկագիրդ - crypto: - errors: - invalid_key: անվաւեր Ed25519 կամ Curve25519 բանալի - invalid_signature: անվաւեր Ed25519 բանալի date: formats: default: "%b %d, %Y" diff --git a/config/locales/ia.yml b/config/locales/ia.yml index 101d1ecc81e..a61019607ef 100644 --- a/config/locales/ia.yml +++ b/config/locales/ia.yml @@ -1132,10 +1132,6 @@ ia: hint_html: "Consilio: Nos non te demandara tu contrasigno de novo in le proxime hora." invalid_password: Contrasigno non valide prompt: Confirma le contrasigno pro continuar - crypto: - errors: - invalid_key: non es un clave Ed25519 o Curve25519 valide - invalid_signature: non es un signatura Ed25519 valide date: formats: default: "%d %b %Y" diff --git a/config/locales/id.yml b/config/locales/id.yml index ac42afdb4f7..122ebda12d5 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -967,10 +967,6 @@ id: hint_html: "Tip: Kami tidak akan meminta kata sandi Anda lagi untuk beberapa jam ke depan." invalid_password: Kata sandi tidak valid prompt: Konfirmasi kata sandi untuk melanjutkan - crypto: - errors: - invalid_key: bukan kunci Ed25519 atau Curve25519 yang valid - invalid_signature: bukan tanda tangan Ed25519 yang valid date: formats: default: "%d %b %Y" diff --git a/config/locales/ie.yml b/config/locales/ie.yml index 432e7d031b0..aba8b230918 100644 --- a/config/locales/ie.yml +++ b/config/locales/ie.yml @@ -1127,10 +1127,6 @@ ie: hint_html: "Nota: On ne va petir tui passa-parol denov por li venient hor." invalid_password: Ínvalid passa-parol prompt: Confirmar passa-parol por avansar - crypto: - errors: - invalid_key: ne es un valid clave Ed25519 o Curve25519 - invalid_signature: ne es un valid signatura Ed25519 date: formats: default: "%d.%m.%Y" diff --git a/config/locales/io.yml b/config/locales/io.yml index bccdcb3cc5c..2102be29363 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -1102,10 +1102,6 @@ io: hint_html: "Guidilo: Ni ne demandos vua pasvorto itere til 1 horo." invalid_password: Nevalida pasvorto prompt: Konfirmez pasvorto por avancar - crypto: - errors: - invalid_key: ne esas valida klefo Ed25519 o Curve25519 - invalid_signature: ne esas valida parafo Ed25519 date: formats: default: "%d %b, %Y" diff --git a/config/locales/is.yml b/config/locales/is.yml index b008e284dd6..e4d3b8f6e6b 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -1139,10 +1139,6 @@ is: hint_html: "Ábending: Við munum ekki spyrja þig um lykilorðið aftur næstu klukkustundina." invalid_password: Ógilt lykilorð prompt: Staðfestu lykilorðið til að halda áfram - crypto: - errors: - invalid_key: er ekki gildur Ed25519 eða Curve25519-lykill - invalid_signature: er ekki gild Ed25519 undirritun date: formats: default: "%d. %b, %Y" diff --git a/config/locales/it.yml b/config/locales/it.yml index 02c21ac312c..769e756287d 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1137,10 +1137,6 @@ it: hint_html: "Suggerimento: Non ti chiederemo di nuovo la tua password per la prossima ora." invalid_password: Password non valida prompt: Conferma la tua password per continuare - crypto: - errors: - invalid_key: non è una chiave Ed25519 o Curve25519 valida - invalid_signature: non è una firma Ed25519 valida date: formats: default: "%d %b %Y" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 0eeb055170a..864cd0a84c3 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1114,10 +1114,6 @@ ja: hint_html: 以後1時間はパスワードの再入力を求めません invalid_password: パスワードが間違っています prompt: 続行するにはパスワードを入力してください - crypto: - errors: - invalid_key: 有効なEd25519またはCurve25519キーではありません - invalid_signature: 有効なEd25519署名ではありません date: formats: default: "%Y年%m月%d日" diff --git a/config/locales/kab.yml b/config/locales/kab.yml index d6295ec9ae0..ac5abdeb8a0 100644 --- a/config/locales/kab.yml +++ b/config/locales/kab.yml @@ -549,9 +549,6 @@ kab: confirm: Kemmel invalid_password: Yir awal uffir prompt: Sentem awal uffir send ad tkemleḍ - crypto: - errors: - invalid_key: maci d tasarut tameɣtut n Ed25519 neɣ Curve25519 date: formats: default: "%d %b %Y" diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 4a1afee8427..c8a1334443a 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1118,10 +1118,6 @@ ko: hint_html: "팁: 한 시간 동안 다시 암호를 묻지 않을 것입니다." invalid_password: 잘못된 암호 prompt: 계속하려면 암호를 확인하세요 - crypto: - errors: - invalid_key: 유효하지 않은 Ed25519 또는 Curve25519 키 - invalid_signature: 유효하지 않은 Ed25519 서명 date: formats: default: "%Y-%m-%d" diff --git a/config/locales/ku.yml b/config/locales/ku.yml index c24337dd7c0..267974434be 100644 --- a/config/locales/ku.yml +++ b/config/locales/ku.yml @@ -981,10 +981,6 @@ ku: hint_html: "Nîşe:Ji bo demjimêreke din em ê borînpeyva te careke din ji te nexwazin." invalid_password: Borînpeyva nederbasdar prompt: Ji bo bidomî borînpeyvê bipejirîne - crypto: - errors: - invalid_key: ed25519 ne derbasdare ne jî Curve25519 kilîta - invalid_signature: Ed25519 ne îmzeyek derbasdar e date: formats: default: "%b%d%Y" diff --git a/config/locales/lad.yml b/config/locales/lad.yml index d0657e73f99..9b42330d2ac 100644 --- a/config/locales/lad.yml +++ b/config/locales/lad.yml @@ -1127,10 +1127,6 @@ lad: hint_html: "Konsejo: No retornaremos a demandarte por el kod durante la sigiente ora." invalid_password: Kod inkorekto prompt: Konfirma kod para segir - crypto: - errors: - invalid_key: no es una yave Ed25519 o Curve25519 valida - invalid_signature: no es una firma Ed25519 valida date: formats: default: "%d %b %Y" diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 5a071eba863..5017010ac49 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1136,10 +1136,6 @@ lv: hint_html: "Padoms: Nākamās stundas laikā mēs tev vairs neprasīsim paroli." invalid_password: Nepareiza parole prompt: Lai turpinātu, apstiprini paroli - crypto: - errors: - invalid_key: nav derīga Ed25519 vai Curve25519 atslēga - invalid_signature: nav derīgs Ed25519 paraksts date: formats: default: "%b %d, %Y" diff --git a/config/locales/ms.yml b/config/locales/ms.yml index a778d0c28f1..d2d9f365656 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -1089,10 +1089,6 @@ ms: hint_html: "Petua: Kami tidak akan meminta kata laluan anda lagi untuk sejam berikutnya." invalid_password: Kata laluan tidak sah prompt: Sahkan kata laluan untuk teruskan - crypto: - errors: - invalid_key: bukan kunci Ed25519 atau Curve25519 yang sah - invalid_signature: bukan tandatangan Ed25519 yang sah date: formats: default: "%b %d, %Y" diff --git a/config/locales/my.yml b/config/locales/my.yml index f28458360b5..590c95c4a64 100644 --- a/config/locales/my.yml +++ b/config/locales/my.yml @@ -1081,10 +1081,6 @@ my: hint_html: "အကြံပြုချက် - နောက်နာရီများတွင် သင့်စကားဝှက်ကို ထပ်မံတောင်းဆိုမည်မဟုတ်ပါ။" invalid_password: စကားဝှက် မမှန်ပါ prompt: ဆက်လက်လုပ်ဆောင်ရန်အတွက် စကားဝှက်အတည်ပြုပါ - crypto: - errors: - invalid_key: မှန်ကန်သော Ed25519 သို့မဟုတ် Curve25519 ကီး မဟုတ်ပါ။ - invalid_signature: မှန်ကန်သော Ed25519 လက်မှတ်မဟုတ်ပါ date: formats: default: "%b %d, %Y" diff --git a/config/locales/nl.yml b/config/locales/nl.yml index b23b4e10afb..c30c6c040f4 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1135,10 +1135,6 @@ nl: hint_html: "Tip: We vragen jou het komende uur niet meer naar jouw wachtwoord." invalid_password: Ongeldig wachtwoord prompt: Bevestig wachtwoord om door te gaan - crypto: - errors: - invalid_key: is geen geldige Ed25519- of Curve25519-sleutel - invalid_signature: is geen geldige Ed25519-handtekening date: formats: default: "%d %b %Y" diff --git a/config/locales/nn.yml b/config/locales/nn.yml index ec77a2edf87..bf27f87022b 100644 --- a/config/locales/nn.yml +++ b/config/locales/nn.yml @@ -1132,10 +1132,6 @@ nn: hint_html: "Tips: Vi skal ikkje spørja deg om passordet ditt igjen i laupet av den neste timen." invalid_password: Ugyldig passord prompt: Stadfest passord for å halda fram - crypto: - errors: - invalid_key: er ikkje ein gild Ed25519 eller Curve25519 nykel - invalid_signature: er ikkje ein gild Ed25519-signatur date: formats: default: "%d. %b, %Y" diff --git a/config/locales/no.yml b/config/locales/no.yml index 537552ea986..63b30cc3e5f 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -1120,10 +1120,6 @@ hint_html: "Tips: Vi ber deg ikke om passordet ditt igjen i løpet av neste time." invalid_password: Ugyldig passord prompt: Bekreft passordet for å fortsette - crypto: - errors: - invalid_key: er ikke en gyldig Ed25519- eller Curve25519-nøkkel - invalid_signature: er ikke en gyldig Ed25519-signatur date: formats: default: "%d. %b, %Y" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 8a2dab5b991..12cdaed08c6 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1171,10 +1171,6 @@ pl: hint_html: "Informacja: Nie będziemy prosić Cię o ponowne podanie hasła przez następną godzinę." invalid_password: Nieprawidłowe hasło prompt: Potwierdź hasło, aby kontynuować - crypto: - errors: - invalid_key: nie jest prawidłowym kluczem Ed25519 lub Curve25519 - invalid_signature: nie jest prawidłowym podpisem Ed25519 date: formats: default: "%d. %b %Y" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 584a9253b81..1d8d3779f56 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1130,10 +1130,6 @@ pt-BR: hint_html: "Dica: Não pediremos novamente sua senha pela próxima hora." invalid_password: Senha inválida prompt: Confirme sua senha para continuar - crypto: - errors: - invalid_key: não é uma chave Ed25519 ou Curve25519 válida - invalid_signature: não é uma assinatura Ed25519 válida date: formats: default: "%d %b, %Y" diff --git a/config/locales/pt-PT.yml b/config/locales/pt-PT.yml index b0db0709c16..6f461d04257 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/pt-PT.yml @@ -1135,10 +1135,6 @@ pt-PT: hint_html: "Dica: Não vamos pedir novamente a sua palavra-passe durante a próxima hora." invalid_password: Palavra-passe inválida prompt: Confirmar a sua palavra-passe para continuar - crypto: - errors: - invalid_key: não é uma chave Ed25519 ou Curve25519 válida - invalid_signature: não é uma assinatura Ed25519 válida date: formats: default: "%d %b %Y" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 5f5b3676fb6..6b8ad11b2bf 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1155,10 +1155,6 @@ ru: hint_html: "Подсказка: мы не будем спрашивать пароль повторно в течение часа." invalid_password: Неверный пароль prompt: Введите пароль для продолжения - crypto: - errors: - invalid_key: не является допустимым Ed25519 или Curve25519 ключом - invalid_signature: не является допустимой Ed25519 подписью date: formats: default: "%d %b %Y" diff --git a/config/locales/sc.yml b/config/locales/sc.yml index 6f4fd6eb30d..a90298c5699 100644 --- a/config/locales/sc.yml +++ b/config/locales/sc.yml @@ -709,10 +709,6 @@ sc: hint_html: "Cussìgiu: No t'amus a torrare a dimandare sa crae in s'ora imbeniente." invalid_password: Sa crae no est vàlida prompt: Cunfirma sa crae pro sighire - crypto: - errors: - invalid_key: no est una crae Ed25519 o Curve25519 vàlida - invalid_signature: no est una firma Ed25519 vàlida date: formats: default: "%d %b, %Y" diff --git a/config/locales/sco.yml b/config/locales/sco.yml index 7c733b71b50..b2918f3ef88 100644 --- a/config/locales/sco.yml +++ b/config/locales/sco.yml @@ -971,10 +971,6 @@ sco: hint_html: "wee tip: We wullnae ask ye fir yer passwird again fir the neist oor." invalid_password: Passwird isnae valid prompt: Confirm yer passwird fir tae continue - crypto: - errors: - invalid_key: isnae a valid Ed25519 or Curve25519 key - invalid_signature: isnae a valid Ed25519 signature date: formats: default: "%b %d, %Y" diff --git a/config/locales/si.yml b/config/locales/si.yml index 85e242b630f..c0d73e80e6e 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -852,10 +852,6 @@ si: hint_html: "ඉඟිය: අපි ඉදිරි පැය සඳහා නැවත ඔබගේ මුරපදය ඔබෙන් නොඉල්ලමු." invalid_password: මුරපදය වැරදිය prompt: ඉදිරියට යාමට මුරපදය තහවුරු කරන්න - crypto: - errors: - invalid_key: වලංගු Ed25519 හෝ Curve25519 යතුරක් නොවේ - invalid_signature: වලංගු Ed25519 අත්සනක් නොවේ date: formats: default: "%Y %b %d" diff --git a/config/locales/sl.yml b/config/locales/sl.yml index f63aadd6c8f..ddeebf10e2e 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1168,10 +1168,6 @@ sl: hint_html: "Namig: naslednjo uro vas ne bomo več vprašali po vašem geslu." invalid_password: Neveljavno geslo prompt: Potrdite geslo za nadaljevanje - crypto: - errors: - invalid_key: ni veljaven ključ Ed25519 ali Curve25519 - invalid_signature: ni veljaven podpis Ed25519 date: formats: default: "%d %b %Y" diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 7ba5bf6570b..3a2055812bf 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1129,10 +1129,6 @@ sq: hint_html: "Ndihmëz: S’do t’ju pyesim për fjalëkalimin tuaj sërish, për një orë." invalid_password: Fjalëkalim i pavlefshëm prompt: Që të vazhdohet, ripohoni fjalëkalimin - crypto: - errors: - invalid_key: s’është kyç Ed25519 ose Curve25519 i vlefshëm - invalid_signature: s’është nënshkrim Ed25519 i vlefshëm date: formats: default: "%d %b, %Y" diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index f6e6d4d2a68..0fad0bc2bf9 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -1148,10 +1148,6 @@ sr-Latn: hint_html: "Savet: Nećemo Vas pitati za lozinku ponovo u narednih sat vremena." invalid_password: Neispravna lozinka prompt: Potvrdite lozinku za nastavak - crypto: - errors: - invalid_key: nije validan Ed25519 ili Curve25519 ključ - invalid_signature: nije validan Ed25519 potpis date: formats: default: "%d. %b. %Y." diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 9bfefde83c0..de746378209 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1148,10 +1148,6 @@ sr: hint_html: "Савет: Нећемо Вас питати за лозинку поново у наредних сат времена." invalid_password: Неисправна лозинка prompt: Потврдите лозинку за наставак - crypto: - errors: - invalid_key: није валидан Ed25519 или Curve25519 кључ - invalid_signature: није валидан Ed25519 потпис date: formats: default: "%d. %b. %Y." diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 72eefe5632b..8acabcbd1d3 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1135,10 +1135,6 @@ sv: hint_html: "Tips: Vi frågar dig inte efter ditt lösenord igen under nästkommande timme." invalid_password: Ogiltigt lösenord prompt: Bekräfta lösenord för att fortsätta - crypto: - errors: - invalid_key: är inte en giltig Ed25519 eller Curve25519 nyckel - invalid_signature: är inte en giltig Ed25519 signatur date: formats: default: "%b %d, %Y" diff --git a/config/locales/ta.yml b/config/locales/ta.yml index 3a22b572b11..4b669a86c45 100644 --- a/config/locales/ta.yml +++ b/config/locales/ta.yml @@ -191,10 +191,6 @@ ta: localization: body: மாஸ்டோடான் தன்னார்வலர்களால் மொழிபெயர்க்கப்படுகிறது. guide_link_text: அனைவரும் பங்களிக்கலாம். - crypto: - errors: - invalid_key: ஒரு முறையான Ed25519 அல்லது Curve25519 key அல்ல - invalid_signature: ஒரு முறையான Ed25519 அடையாளம் அல்ல filters: index: empty: தடுப்புகள் ஏதும் இல்லை. diff --git a/config/locales/th.yml b/config/locales/th.yml index 678b5ab638f..555d57d7b0b 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1117,10 +1117,6 @@ th: hint_html: "เคล็ดลับ: เราจะไม่ถามรหัสผ่านของคุณกับคุณสำหรับชั่วโมงถัดไป" invalid_password: รหัสผ่านไม่ถูกต้อง prompt: ยืนยันรหัสผ่านเพื่อดำเนินการต่อ - crypto: - errors: - invalid_key: ไม่ใช่กุญแจ Ed25519 หรือ Curve25519 ที่ถูกต้อง - invalid_signature: ไม่ใช่ลายเซ็น Ed25519 ที่ถูกต้อง date: formats: default: "%d %b %Y" diff --git a/config/locales/tr.yml b/config/locales/tr.yml index f561781e59e..37ee61dcc92 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1135,10 +1135,6 @@ tr: hint_html: "İpucu: Önümüzdeki saat boyunca sana parolanı sormayacağız." invalid_password: Geçersiz parola prompt: Devam etmek için parolanızı doğrulayın - crypto: - errors: - invalid_key: geçerli bir Ed25519 veya Curve25519 anahtarı değil - invalid_signature: geçerli bir Ed25519 imzası değil date: formats: default: "%d %b %Y" diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 31ce3e6b798..d3b5fa55943 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1171,10 +1171,6 @@ uk: hint_html: "Підказка: ми не будемо запитувати ваш пароль впродовж наступної години." invalid_password: Невірний пароль prompt: Підтвердіть пароль для продовження - crypto: - errors: - invalid_key: не є припустимим ключем Ed25519 або Curve25519 - invalid_signature: не є дійсним підписом Ed25519 date: formats: default: "%b %d, %Y" diff --git a/config/locales/vi.yml b/config/locales/vi.yml index b44ba15a77f..5eb33cd47f6 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1117,10 +1117,6 @@ vi: hint_html: "Mẹo: Chúng tôi sẽ không hỏi lại mật khẩu của bạn sau này." invalid_password: Mật khẩu không hợp lệ prompt: Nhập mật khẩu để tiếp tục - crypto: - errors: - invalid_key: không phải là mã khóa Ed25519 hoặc Curve25519 đúng - invalid_signature: không phải là chữ ký số Ed25519 đúng date: formats: default: "%-d %B, %Y" diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 50921b07d8c..0eae7331ad9 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1117,10 +1117,6 @@ zh-CN: hint_html: "注意:接下来一小时内我们不会再次要求你输入密码。" invalid_password: 无效密码 prompt: 确认密码以继续 - crypto: - errors: - invalid_key: 不是有效的 Ed25519 或者 Curve25519 密钥 - invalid_signature: 不是有效的 Ed25519 签名 date: formats: default: "%Y年%m月%d日" diff --git a/config/locales/zh-HK.yml b/config/locales/zh-HK.yml index ddc6571e6da..d3e1ab24330 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -1109,10 +1109,6 @@ zh-HK: hint_html: "温馨提示 我們在未來一小時內不會再要求你填寫密碼。" invalid_password: 密碼錯誤 prompt: 確認密碼以繼續 - crypto: - errors: - invalid_key: 不是一個有效的 Ed25519 或 Curve25519 密鑰 - invalid_signature: 不是一個有效的 Ed25519 簽名 date: formats: default: "%Y年%b月%d日" diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 388fe35d842..e15e336c670 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1119,10 +1119,6 @@ zh-TW: hint_html: "温馨小提醒: 我們於接下來一小時內不會再要求您輸入密碼。" invalid_password: 密碼錯誤 prompt: 輸入密碼以繼續 - crypto: - errors: - invalid_key: 這不是一把有效的 Ed25519 或 Curve25519 金鑰 - invalid_signature: 這不是有效的 Ed25519 簽章 date: formats: default: "%Y年%b月%d日" diff --git a/config/routes.rb b/config/routes.rb index 93bdb959695..f917fbc5234 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -134,7 +134,6 @@ Rails.application.routes.draw do scope module: :activitypub do resource :outbox, only: [:show] resource :inbox, only: [:create] - resource :claim, only: [:create] resources :collections, only: [:show] resource :followers_synchronization, only: [:show] end diff --git a/config/routes/api.rb b/config/routes/api.rb index 90119166974..55c844b439f 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -68,23 +68,6 @@ namespace :api, format: false do end end - # namespace :crypto do - # resources :deliveries, only: :create - - # namespace :keys do - # resource :upload, only: [:create] - # resource :query, only: [:create] - # resource :claim, only: [:create] - # resource :count, only: [:show] - # end - - # resources :encrypted_messages, only: [:index] do - # collection do - # post :clear - # end - # end - # end - resources :conversations, only: [:index, :destroy] do member do post :read diff --git a/db/migrate/20240720140205_drop_end_to_end_message_tables.rb b/db/migrate/20240720140205_drop_end_to_end_message_tables.rb new file mode 100644 index 00000000000..dd5662885c5 --- /dev/null +++ b/db/migrate/20240720140205_drop_end_to_end_message_tables.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropEndToEndMessageTables < ActiveRecord::Migration[7.1] + def up + drop_table :system_keys + drop_table :one_time_keys + drop_table :encrypted_messages + drop_table :devices + safety_assured { remove_column :accounts, :devices_url } + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/schema.rb b/db/schema.rb index d4796079cae..d6133c9c92b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -193,7 +193,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_24_181224) do t.boolean "hide_collections" t.integer "avatar_storage_schema_version" t.integer "header_storage_schema_version" - t.string "devices_url" t.datetime "sensitized_at", precision: nil t.integer "suspension_origin" t.boolean "trendable" @@ -411,19 +410,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_24_181224) do t.index ["account_id"], name: "index_custom_filters_on_account_id" end - create_table "devices", force: :cascade do |t| - t.bigint "access_token_id" - t.bigint "account_id" - t.string "device_id", default: "", null: false - t.string "name", default: "", null: false - t.text "fingerprint_key", default: "", null: false - t.text "identity_key", default: "", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.index ["access_token_id"], name: "index_devices_on_access_token_id" - t.index ["account_id"], name: "index_devices_on_account_id" - end - create_table "domain_allows", force: :cascade do |t| t.string "domain", default: "", null: false t.datetime "created_at", precision: nil, null: false @@ -453,20 +439,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_24_181224) do t.index ["domain"], name: "index_email_domain_blocks_on_domain", unique: true end - create_table "encrypted_messages", id: :bigint, default: -> { "timestamp_id('encrypted_messages'::text)" }, force: :cascade do |t| - t.bigint "device_id" - t.bigint "from_account_id" - t.string "from_device_id", default: "", null: false - t.integer "type", default: 0, null: false - t.text "body", default: "", null: false - t.text "digest", default: "", null: false - t.text "message_franking", default: "", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.index ["device_id"], name: "index_encrypted_messages_on_device_id" - t.index ["from_account_id"], name: "index_encrypted_messages_on_from_account_id" - end - create_table "favourites", force: :cascade do |t| t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false @@ -779,17 +751,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_24_181224) do t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true end - create_table "one_time_keys", force: :cascade do |t| - t.bigint "device_id" - t.string "key_id", default: "", null: false - t.text "key", default: "", null: false - t.text "signature", default: "", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.index ["device_id"], name: "index_one_time_keys_on_device_id" - t.index ["key_id"], name: "index_one_time_keys_on_key_id" - end - create_table "pghero_space_stats", force: :cascade do |t| t.text "database" t.text "schema" @@ -1102,12 +1063,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_24_181224) do t.index ["status_id"], name: "index_statuses_tags_on_status_id" end - create_table "system_keys", force: :cascade do |t| - t.binary "key" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - end - create_table "tag_follows", force: :cascade do |t| t.bigint "tag_id", null: false t.bigint "account_id", null: false @@ -1304,11 +1259,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_24_181224) do add_foreign_key "custom_filter_statuses", "custom_filters", on_delete: :cascade add_foreign_key "custom_filter_statuses", "statuses", on_delete: :cascade add_foreign_key "custom_filters", "accounts", on_delete: :cascade - add_foreign_key "devices", "accounts", on_delete: :cascade - add_foreign_key "devices", "oauth_access_tokens", column: "access_token_id", on_delete: :cascade add_foreign_key "email_domain_blocks", "email_domain_blocks", column: "parent_id", on_delete: :cascade - add_foreign_key "encrypted_messages", "accounts", column: "from_account_id", on_delete: :cascade - add_foreign_key "encrypted_messages", "devices", on_delete: :cascade add_foreign_key "favourites", "accounts", name: "fk_5eb6c2b873", on_delete: :cascade add_foreign_key "favourites", "statuses", name: "fk_b0e856845e", on_delete: :cascade add_foreign_key "featured_tags", "accounts", on_delete: :cascade @@ -1351,7 +1302,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_07_24_181224) do add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id", name: "fk_f5fc4c1ee3", on_delete: :cascade add_foreign_key "oauth_access_tokens", "users", column: "resource_owner_id", name: "fk_e84df68546", on_delete: :cascade add_foreign_key "oauth_applications", "users", column: "owner_id", name: "fk_b0988c7c0a", on_delete: :cascade - add_foreign_key "one_time_keys", "devices", on_delete: :cascade add_foreign_key "poll_votes", "accounts", on_delete: :cascade add_foreign_key "poll_votes", "polls", on_delete: :cascade add_foreign_key "polls", "accounts", on_delete: :cascade diff --git a/spec/controllers/activitypub/claims_controller_spec.rb b/spec/controllers/activitypub/claims_controller_spec.rb deleted file mode 100644 index f00eeb732a7..00000000000 --- a/spec/controllers/activitypub/claims_controller_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe ActivityPub::ClaimsController do - let(:account) { Fabricate(:account) } - - describe 'POST #create' do - context 'without signature' do - before do - post :create, params: { account_username: account.username }, body: '{}' - end - - it 'returns http not authorized' do - expect(response).to have_http_status(401) - end - end - end -end diff --git a/spec/fabricators/device_fabricator.rb b/spec/fabricators/device_fabricator.rb deleted file mode 100644 index 37a2e8977d1..00000000000 --- a/spec/fabricators/device_fabricator.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -Fabricator(:device) do - access_token { Fabricate.build(:access_token) } - account { Fabricate.build(:account) } - device_id { Faker::Number.number(digits: 5) } - name { Faker::App.name } - fingerprint_key { Base64.strict_encode64(Ed25519::SigningKey.generate.verify_key.to_bytes) } - identity_key { Base64.strict_encode64(Ed25519::SigningKey.generate.verify_key.to_bytes) } -end diff --git a/spec/fabricators/encrypted_message_fabricator.rb b/spec/fabricators/encrypted_message_fabricator.rb deleted file mode 100644 index 349b659c2f5..00000000000 --- a/spec/fabricators/encrypted_message_fabricator.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -Fabricator(:encrypted_message) do - device { Fabricate.build(:device) } - from_account { Fabricate.build(:account) } - from_device_id { Faker::Number.number(digits: 5) } -end diff --git a/spec/fabricators/one_time_key_fabricator.rb b/spec/fabricators/one_time_key_fabricator.rb deleted file mode 100644 index 505282e05dd..00000000000 --- a/spec/fabricators/one_time_key_fabricator.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -Fabricator(:one_time_key) do - device { Fabricate.build(:device) } - key_id { Faker::Alphanumeric.alphanumeric(number: 10) } - key { Base64.strict_encode64(Ed25519::SigningKey.generate.verify_key.to_bytes) } - - signature do |attrs| - signing_key = Ed25519::SigningKey.generate - attrs[:device].update(fingerprint_key: Base64.strict_encode64(signing_key.verify_key.to_bytes)) - Base64.strict_encode64(signing_key.sign(attrs[:key])) - end -end diff --git a/spec/fabricators/system_key_fabricator.rb b/spec/fabricators/system_key_fabricator.rb deleted file mode 100644 index bcb3bd5577b..00000000000 --- a/spec/fabricators/system_key_fabricator.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true - -Fabricator(:system_key) diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb index dec17b916b8..0986ae17151 100644 --- a/spec/lib/activitypub/activity/create_spec.rb +++ b/spec/lib/activitypub/activity/create_spec.rb @@ -936,64 +936,6 @@ RSpec.describe ActivityPub::Activity::Create do end end - context 'with an encrypted message' do - subject { described_class.new(json, sender, delivery: true, delivered_to_account_id: recipient.id) } - - let(:recipient) { Fabricate(:account) } - let(:object_json) do - { - id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join, - type: 'EncryptedMessage', - attributedTo: { - type: 'Device', - deviceId: '1234', - }, - to: { - type: 'Device', - deviceId: target_device.device_id, - }, - messageType: 1, - cipherText: 'Foo', - messageFranking: 'Baz678', - digest: { - digestAlgorithm: 'Bar456', - digestValue: 'Foo123', - }, - } - end - let(:target_device) { Fabricate(:device, account: recipient) } - - before do - subject.perform - end - - it 'creates an encrypted message' do - encrypted_message = target_device.encrypted_messages.reload.first - - expect(encrypted_message) - .to be_present - .and have_attributes( - from_device_id: eq('1234'), - from_account: eq(sender), - type: eq(1), - body: eq('Foo'), - digest: eq('Foo123') - ) - end - - it 'creates a message franking' do - encrypted_message = target_device.encrypted_messages.reload.first - message_franking = encrypted_message.message_franking - - crypt = ActiveSupport::MessageEncryptor.new(SystemKey.current_key, serializer: Oj) - json = crypt.decrypt_and_verify(message_franking) - - expect(json['source_account_id']).to eq sender.id - expect(json['target_account_id']).to eq recipient.id - expect(json['original_franking']).to eq 'Baz678' - end - end - context 'when sender is followed by local users' do subject { described_class.new(json, sender, delivery: true) } diff --git a/spec/lib/vacuum/system_keys_vacuum_spec.rb b/spec/lib/vacuum/system_keys_vacuum_spec.rb deleted file mode 100644 index 84cae30411e..00000000000 --- a/spec/lib/vacuum/system_keys_vacuum_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Vacuum::SystemKeysVacuum do - subject { described_class.new } - - describe '#perform' do - let!(:expired_system_key) { Fabricate(:system_key, created_at: (SystemKey::ROTATION_PERIOD * 4).ago) } - let!(:current_system_key) { Fabricate(:system_key) } - - before do - subject.perform - end - - it 'deletes the expired key' do - expect { expired_system_key.reload }.to raise_error ActiveRecord::RecordNotFound - end - - it 'does not delete the current key' do - expect { current_system_key.reload }.to_not raise_error - end - end -end diff --git a/spec/models/one_time_key_spec.rb b/spec/models/one_time_key_spec.rb deleted file mode 100644 index 6ff7ffc5c14..00000000000 --- a/spec/models/one_time_key_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe OneTimeKey do - describe 'validations' do - context 'with an invalid signature' do - let(:one_time_key) { Fabricate.build(:one_time_key, signature: 'wrong!') } - - it 'is invalid' do - expect(one_time_key).to_not be_valid - end - end - - context 'with an invalid key' do - let(:one_time_key) { Fabricate.build(:one_time_key, key: 'wrong!') } - - it 'is invalid' do - expect(one_time_key).to_not be_valid - end - end - end -end diff --git a/spec/serializers/activitypub/device_serializer_spec.rb b/spec/serializers/activitypub/device_serializer_spec.rb deleted file mode 100644 index 23f0b24c4ea..00000000000 --- a/spec/serializers/activitypub/device_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe ActivityPub::DeviceSerializer do - let(:serialization) { serialized_record_json(record, described_class) } - let(:record) { Fabricate(:device) } - - describe 'type' do - it 'returns correct serialized type' do - expect(serialization['type']).to eq('Device') - end - end -end diff --git a/spec/serializers/activitypub/one_time_key_serializer_spec.rb b/spec/serializers/activitypub/one_time_key_serializer_spec.rb deleted file mode 100644 index 89efe95c8c2..00000000000 --- a/spec/serializers/activitypub/one_time_key_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe ActivityPub::OneTimeKeySerializer do - let(:serialization) { serialized_record_json(record, described_class) } - let(:record) { Fabricate(:one_time_key) } - - describe 'type' do - it 'returns correct serialized type' do - expect(serialization['type']).to eq('Curve25519Key') - end - end -end diff --git a/spec/serializers/rest/encrypted_message_serializer_spec.rb b/spec/serializers/rest/encrypted_message_serializer_spec.rb deleted file mode 100644 index 01db1149af5..00000000000 --- a/spec/serializers/rest/encrypted_message_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe REST::EncryptedMessageSerializer do - let(:serialization) { serialized_record_json(record, described_class) } - let(:record) { Fabricate(:encrypted_message) } - - describe 'account' do - it 'returns the associated account' do - expect(serialization['account_id']).to eq(record.from_account.id.to_s) - end - end -end diff --git a/spec/serializers/rest/keys/claim_result_serializer_spec.rb b/spec/serializers/rest/keys/claim_result_serializer_spec.rb deleted file mode 100644 index 7f7fb850cda..00000000000 --- a/spec/serializers/rest/keys/claim_result_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe REST::Keys::ClaimResultSerializer do - let(:serialization) { serialized_record_json(record, described_class) } - let(:record) { Keys::ClaimService::Result.new(Account.new(id: 123), 456) } - - describe 'account' do - it 'returns the associated account' do - expect(serialization['account_id']).to eq('123') - end - end -end diff --git a/spec/serializers/rest/keys/device_serializer_spec.rb b/spec/serializers/rest/keys/device_serializer_spec.rb deleted file mode 100644 index 28177a3db5a..00000000000 --- a/spec/serializers/rest/keys/device_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe REST::Keys::DeviceSerializer do - let(:serialization) { serialized_record_json(record, described_class) } - let(:record) { Device.new(name: 'Device name') } - - describe 'name' do - it 'returns the name' do - expect(serialization['name']).to eq('Device name') - end - end -end diff --git a/spec/serializers/rest/keys/query_result_serializer_spec.rb b/spec/serializers/rest/keys/query_result_serializer_spec.rb deleted file mode 100644 index ef67d706750..00000000000 --- a/spec/serializers/rest/keys/query_result_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe REST::Keys::QueryResultSerializer do - let(:serialization) { serialized_record_json(record, described_class) } - let(:record) { Keys::QueryService::Result.new(Account.new(id: 123), []) } - - describe 'account' do - it 'returns the associated account id' do - expect(serialization['account_id']).to eq('123') - end - end -end diff --git a/spec/workers/push_encrypted_message_worker_spec.rb b/spec/workers/push_encrypted_message_worker_spec.rb deleted file mode 100644 index 3cd04ce7b4c..00000000000 --- a/spec/workers/push_encrypted_message_worker_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe PushEncryptedMessageWorker do - let(:worker) { described_class.new } - - describe 'perform' do - it 'runs without error for missing record' do - expect { worker.perform(nil) }.to_not raise_error - end - end -end diff --git a/streaming/index.js b/streaming/index.js index dd9ea0c7f68..634ce7314a9 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -45,7 +45,6 @@ initializeLogLevel(process.env, environment); * @property {string[]} scopes * @property {string} accountId * @property {string[]} chosenLanguages - * @property {string} deviceId */ /** @@ -525,7 +524,7 @@ const startServer = async () => { * @returns {Promise} */ const accountFromToken = async (token, req) => { - const result = await pgPool.query('SELECT oauth_access_tokens.id, oauth_access_tokens.resource_owner_id, users.account_id, users.chosen_languages, oauth_access_tokens.scopes, devices.device_id FROM oauth_access_tokens INNER JOIN users ON oauth_access_tokens.resource_owner_id = users.id LEFT OUTER JOIN devices ON oauth_access_tokens.id = devices.access_token_id WHERE oauth_access_tokens.token = $1 AND oauth_access_tokens.revoked_at IS NULL LIMIT 1', [token]); + const result = await pgPool.query('SELECT oauth_access_tokens.id, oauth_access_tokens.resource_owner_id, users.account_id, users.chosen_languages, oauth_access_tokens.scopes FROM oauth_access_tokens INNER JOIN users ON oauth_access_tokens.resource_owner_id = users.id WHERE oauth_access_tokens.token = $1 AND oauth_access_tokens.revoked_at IS NULL LIMIT 1', [token]); if (result.rows.length === 0) { throw new AuthenticationError('Invalid access token'); @@ -535,14 +534,12 @@ const startServer = async () => { req.scopes = result.rows[0].scopes.split(' '); req.accountId = result.rows[0].account_id; req.chosenLanguages = result.rows[0].chosen_languages; - req.deviceId = result.rows[0].device_id; return { accessTokenId: result.rows[0].id, scopes: result.rows[0].scopes.split(' '), accountId: result.rows[0].account_id, chosenLanguages: result.rows[0].chosen_languages, - deviceId: result.rows[0].device_id }; }; @@ -1153,10 +1150,6 @@ const startServer = async () => { const channelsForUserStream = req => { const arr = [`timeline:${req.accountId}`]; - if (isInScope(req, ['crypto']) && req.deviceId) { - arr.push(`timeline:${req.accountId}:${req.deviceId}`); - } - if (isInScope(req, ['read', 'read:notifications'])) { arr.push(`timeline:${req.accountId}:notifications`); }