From 5405bdd344ff140e4e9cf9782770e7180794edec Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 18 Sep 2024 05:27:43 -0400 Subject: [PATCH] Remove unused E2EE messaging code (#31193) --- 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 | 1 - config/locales/ar.yml | 1 - config/locales/ast.yml | 1 - config/locales/be.yml | 1 - config/locales/bg.yml | 1 - config/locales/ca.yml | 1 - config/locales/ckb.yml | 1 - config/locales/co.yml | 1 - config/locales/cs.yml | 1 - config/locales/cy.yml | 1 - config/locales/da.yml | 1 - config/locales/de.yml | 1 - config/locales/el.yml | 1 - config/locales/en-GB.yml | 1 - config/locales/en.yml | 1 - config/locales/eo.yml | 1 - config/locales/es-AR.yml | 1 - config/locales/es-MX.yml | 1 - config/locales/es.yml | 1 - config/locales/et.yml | 1 - config/locales/eu.yml | 1 - config/locales/fa.yml | 1 - config/locales/fi.yml | 1 - config/locales/fo.yml | 1 - config/locales/fr-CA.yml | 1 - config/locales/fr.yml | 1 - config/locales/fy.yml | 1 - config/locales/ga.yml | 1 - config/locales/gd.yml | 1 - config/locales/gl.yml | 1 - config/locales/he.yml | 1 - config/locales/hu.yml | 1 - config/locales/hy.yml | 1 - config/locales/ia.yml | 1 - config/locales/id.yml | 1 - config/locales/ie.yml | 1 - config/locales/io.yml | 1 - config/locales/is.yml | 1 - config/locales/it.yml | 1 - config/locales/ja.yml | 1 - config/locales/ko.yml | 1 - config/locales/ku.yml | 1 - config/locales/lad.yml | 1 - config/locales/lv.yml | 1 - config/locales/ms.yml | 1 - config/locales/my.yml | 1 - config/locales/nl.yml | 1 - config/locales/nn.yml | 1 - config/locales/no.yml | 1 - config/locales/pl.yml | 1 - config/locales/pt-BR.yml | 1 - config/locales/pt-PT.yml | 1 - config/locales/ru.yml | 1 - config/locales/sc.yml | 1 - config/locales/sco.yml | 1 - config/locales/si.yml | 1 - config/locales/sl.yml | 1 - config/locales/sq.yml | 1 - config/locales/sr-Latn.yml | 1 - config/locales/sr.yml | 1 - config/locales/sv.yml | 1 - config/locales/ta.yml | 1 - config/locales/th.yml | 1 - config/locales/tr.yml | 1 - config/locales/uk.yml | 1 - config/locales/vi.yml | 1 - config/locales/zh-CN.yml | 1 - config/locales/zh-HK.yml | 1 - config/locales/zh-TW.yml | 1 - 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 +-- 130 files changed, 25 insertions(+), 1347 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 4cce095ec5..bcb19421ab 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 3f321c7b7e..5ed8fe78eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -214,7 +214,6 @@ GEM railties (>= 5) dotenv (3.1.4) drb (2.2.1) - ed25519 (1.3.0) elasticsearch (7.17.11) elasticsearch-api (= 7.17.11) elasticsearch-transport (= 7.17.11) @@ -937,7 +936,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 480baaf2bc..0000000000 --- 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 c25362c9bc..ab1b98e646 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 aa9df6e03b..0000000000 --- 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 93ae0e7771..0000000000 --- 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 f9d202d67b..0000000000 --- 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 ffd7151b78..0000000000 --- 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 e6ce9f9192..0000000000 --- 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 fc4abf63b3..0000000000 --- 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 a0c1781d24..18bb088b48 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' }, attribution_domains: { 'toot' => 'http://joinmastodon.org/ns#', 'attributionDomains' => { '@id' => 'toot:attributionDomains', '@type' => '@id' } }, }.freeze diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index d539ce41a0..aae73e01e0 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 0aebb13fce..af967ac215 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 ceee2fd164..0000000000 --- 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 a4cab99f7b..078d7aaa05 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 @@ -56,11 +55,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 1c67b07e51..637e785953 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 5dc6cf1e66..0000000000 --- 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 3e7e95594c..0000000000 --- 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 c72bd1ccac..0000000000 --- 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 23604e2f7d..0000000000 --- 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 1be399dd68..0000000000 --- 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 5bdf53f032..23a5b42bc7 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 a6281e23b9..f698e758e8 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, :attribution_domains 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? @@ -72,10 +71,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 34026a6b5b..1b410cecae 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 5f0fdc8af9..0000000000 --- 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 3c525d23e5..0000000000 --- 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 5932eb5b55..0000000000 --- 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 80c26d060e..0000000000 --- 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 145044f557..0000000000 --- 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 f9b821b79c..0000000000 --- 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 8f8bdde289..0000000000 --- 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 1e2d614d72..a7422b5d02 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 328d8ae8f8..0c03267d43 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 71711945c0..0000000000 --- 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 ebce9cce7d..0000000000 --- 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 33e13293f3..0000000000 --- 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 adf49296b2..0000000000 --- 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 0e74c231ec..0000000000 --- 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 6bee12675b..0000000000 --- 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 86fde3cacf..b47e76c08b 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 ba459e19f2..2b0563f4d3 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 589bb39836..2f181e0757 100644 --- a/config/locales/an.yml +++ b/config/locales/an.yml @@ -953,7 +953,6 @@ an: 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 7512e03fd5..81705acba0 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1178,7 +1178,6 @@ ar: 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 be3441507e..a7d4a9917e 100644 --- a/config/locales/ast.yml +++ b/config/locales/ast.yml @@ -486,7 +486,6 @@ ast: 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 48ca5751cc..d45f443b75 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -1189,7 +1189,6 @@ be: 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 604eeca480..e2c246827a 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1115,7 +1115,6 @@ bg: 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 d985a2ac42..33a1d4e88f 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1171,7 +1171,6 @@ ca: 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 8af3d86388..bc668d2ce4 100644 --- a/config/locales/ckb.yml +++ b/config/locales/ckb.yml @@ -608,7 +608,6 @@ ckb: 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 b072e5e4ef..58ddd7d01b 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -569,7 +569,6 @@ co: 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 1000442870..b7fc8ab1b0 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1149,7 +1149,6 @@ cs: 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 9d3c0c82f3..c2c193d943 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -1246,7 +1246,6 @@ cy: 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 6f781742a8..a177b97de7 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1174,7 +1174,6 @@ da: 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 040ddaaf69..85e24c230e 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1174,7 +1174,6 @@ de: 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 1f408e26ea..0da957cdb2 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -1128,7 +1128,6 @@ el: 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 56255f5d7a..577978ce88 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1174,7 +1174,6 @@ en-GB: 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 b1c100da0c..625f53f2e5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1174,7 +1174,6 @@ en: 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 46c6cbcf86..7ebf074819 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -1041,7 +1041,6 @@ eo: 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 4d60d080a2..9f1dc46c9d 100644 --- a/config/locales/es-AR.yml +++ b/config/locales/es-AR.yml @@ -1174,7 +1174,6 @@ es-AR: 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 1ea346a00c..b39b23c617 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -1174,7 +1174,6 @@ es-MX: 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 c652876f3a..2815ada779 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1174,7 +1174,6 @@ es: 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 aca4f93c4d..60f98a471e 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -1174,7 +1174,6 @@ et: 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 6260033990..7c7f995a71 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1091,7 +1091,6 @@ eu: 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 996c8d6cd2..c2c22af4c4 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -971,7 +971,6 @@ fa: 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 b48b499bbe..5df82bff9f 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1174,7 +1174,6 @@ fi: 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 266b73bb10..ce21aa3be7 100644 --- a/config/locales/fo.yml +++ b/config/locales/fo.yml @@ -1174,7 +1174,6 @@ fo: 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 b70a515fd1..3f9252ffab 100644 --- a/config/locales/fr-CA.yml +++ b/config/locales/fr-CA.yml @@ -1175,7 +1175,6 @@ fr-CA: 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 bc616d2896..cb76ae2243 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1175,7 +1175,6 @@ fr: 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 6afdecd556..8b854494d4 100644 --- a/config/locales/fy.yml +++ b/config/locales/fy.yml @@ -1164,7 +1164,6 @@ fy: 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 1071871c95..a6369354cd 100644 --- a/config/locales/ga.yml +++ b/config/locales/ga.yml @@ -1228,7 +1228,6 @@ ga: 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 5e63b5bd23..b5cbc4a73e 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -1210,7 +1210,6 @@ gd: 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 58fd2d9bab..9813514a7b 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1174,7 +1174,6 @@ gl: 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 7a2d0a1d98..13a1f6f05d 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1210,7 +1210,6 @@ he: 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 10c7506b01..9767c48834 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1174,7 +1174,6 @@ hu: 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 80dbc77991..1fda020c07 100644 --- a/config/locales/hy.yml +++ b/config/locales/hy.yml @@ -495,7 +495,6 @@ hy: 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 957bae3991..6632af061e 100644 --- a/config/locales/ia.yml +++ b/config/locales/ia.yml @@ -1158,7 +1158,6 @@ ia: 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 222d2b5680..96a5022a7c 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -936,7 +936,6 @@ id: 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 6a79686f48..513a8eda7e 100644 --- a/config/locales/ie.yml +++ b/config/locales/ie.yml @@ -1089,7 +1089,6 @@ ie: 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 dbbe228e72..97cc417df0 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -1064,7 +1064,6 @@ io: 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 78dfd6048f..590805ad30 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -1178,7 +1178,6 @@ is: 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 792add14e3..fe6fec17d7 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1176,7 +1176,6 @@ it: 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 13f59e981b..ed6293e1ca 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1146,7 +1146,6 @@ ja: crypto: errors: invalid_key: 有効なEd25519またはCurve25519キーではありません - invalid_signature: 有効なEd25519署名ではありません date: formats: default: "%Y年%m月%d日" diff --git a/config/locales/ko.yml b/config/locales/ko.yml index cbcc09a4da..3217a8e49a 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1151,7 +1151,6 @@ ko: 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 6b80e32ba8..08843f645e 100644 --- a/config/locales/ku.yml +++ b/config/locales/ku.yml @@ -950,7 +950,6 @@ ku: 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 2f5eb1553e..3d1f1a61e2 100644 --- a/config/locales/lad.yml +++ b/config/locales/lad.yml @@ -1122,7 +1122,6 @@ lad: 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 88faeae82b..be6555a386 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1140,7 +1140,6 @@ lv: 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 39c695a539..0c0ffb69bf 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -1051,7 +1051,6 @@ ms: 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 92464523a0..6acaa34cdc 100644 --- a/config/locales/my.yml +++ b/config/locales/my.yml @@ -1044,7 +1044,6 @@ my: 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 63656991a8..afc4652bf6 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1174,7 +1174,6 @@ nl: 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 b7beeb4263..dcf571a792 100644 --- a/config/locales/nn.yml +++ b/config/locales/nn.yml @@ -1174,7 +1174,6 @@ nn: 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 635ceedde4..1f0b6bacce 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -1083,7 +1083,6 @@ 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 f0d09cb2d3..314adf885f 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1210,7 +1210,6 @@ pl: 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 d1140f3645..7742a80569 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1174,7 +1174,6 @@ pt-BR: 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 f155490eb5..d6c5c4a6ff 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/pt-PT.yml @@ -1174,7 +1174,6 @@ pt-PT: 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 d66dded89b..f1198c3f16 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1129,7 +1129,6 @@ ru: 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 435749f470..780270ddf1 100644 --- a/config/locales/sc.yml +++ b/config/locales/sc.yml @@ -693,7 +693,6 @@ sc: 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 70143a968e..97eaa21ed6 100644 --- a/config/locales/sco.yml +++ b/config/locales/sco.yml @@ -940,7 +940,6 @@ sco: 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 135a99ceb2..8460de01da 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -829,7 +829,6 @@ si: 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 ef6d00b8d3..c8e806bf35 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1196,7 +1196,6 @@ sl: 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 70d20592a5..294c8a888f 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1166,7 +1166,6 @@ sq: 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 91f0933398..bfb52c275b 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -1110,7 +1110,6 @@ sr-Latn: 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 67aee931be..af7e7ab8d6 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1140,7 +1140,6 @@ sr: 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 99b7ec9b3a..6146cfc8d7 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1128,7 +1128,6 @@ sv: 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 3a98b6a25d..56b2895c74 100644 --- a/config/locales/ta.yml +++ b/config/locales/ta.yml @@ -188,7 +188,6 @@ ta: 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 65424f4eb6..d56385f261 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1156,7 +1156,6 @@ th: 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 d6ca6b4276..16dd4c899d 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1174,7 +1174,6 @@ tr: 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 e8c4e68998..0ef08a1555 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1210,7 +1210,6 @@ uk: 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 8f047a2cb7..98696aef7c 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1156,7 +1156,6 @@ vi: 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 277785f683..8b34da076a 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1156,7 +1156,6 @@ zh-CN: 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 7682712759..598c65d049 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -1071,7 +1071,6 @@ zh-HK: 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 35f000b601..41c4c8a534 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1158,7 +1158,6 @@ zh-TW: 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 3ac619519d..ad607e537b 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 b237791736..39c699b9a3 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 0000000000..dd5662885c --- /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 540a971333..e9aa78c205 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -193,7 +193,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_09_014637) 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" @@ -412,19 +411,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_09_014637) 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 @@ -454,20 +440,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_09_014637) 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 @@ -781,17 +753,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_09_014637) 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" @@ -1104,12 +1065,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_09_014637) 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 @@ -1306,11 +1261,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_09_014637) 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 @@ -1353,7 +1304,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_09_09_014637) 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 e887be2cbe..0000000000 --- a/spec/controllers/activitypub/claims_controller_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 37a2e8977d..0000000000 --- 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 349b659c2f..0000000000 --- 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 505282e05d..0000000000 --- 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 bcb3bd5577..0000000000 --- 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 dec17b916b..0986ae1715 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 84cae30411..0000000000 --- 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 17fcdf3788..0000000000 --- a/spec/models/one_time_key_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 226e136446..0000000000 --- a/spec/serializers/activitypub/device_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 b9792ebae3..0000000000 --- a/spec/serializers/activitypub/one_time_key_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 a4b8ee83b2..0000000000 --- a/spec/serializers/rest/encrypted_message_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 e45112705b..0000000000 --- a/spec/serializers/rest/keys/claim_result_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 b8370beac7..0000000000 --- a/spec/serializers/rest/keys/device_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 41492f5e78..0000000000 --- a/spec/serializers/rest/keys/query_result_serializer_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 311545cf56..0000000000 --- a/spec/workers/push_encrypted_message_worker_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.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 b302565a4e..48ed56b29b 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -44,7 +44,6 @@ initializeLogLevel(process.env, environment); * @property {string[]} scopes * @property {string} accountId * @property {string[]} chosenLanguages - * @property {string} deviceId */ @@ -355,7 +354,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'); @@ -365,14 +364,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 }; }; @@ -983,10 +980,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`); }