Add numeric_ap_ids feature flag to switch new accounts to numeric AP identifiers (#36316)

This commit is contained in:
Claire authored and GitHub committed 2025-10-01 13:09:56 +00:00
1 parent 669738ef3b
commit f03d1bb21f
1 file changed
+7
+7
View File
@@ -446,6 +446,7 @@ class Account < ApplicationRecord
before_validation :prepare_contents, if: :local?
before_create :generate_keys
before_create :set_id_scheme
before_destroy :clean_feed_manager
def ensure_keys!
@@ -470,6 +471,12 @@ class Account < ApplicationRecord
self.public_key = keypair.public_key.to_pem
end
def set_id_scheme
return unless local? && Mastodon::Feature.numeric_ap_ids_enabled?
self.id_scheme = :numeric_ap_id
end
def normalize_domain
return if local?