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

This commit is contained in:
Claire 2025-10-01 15:09:56 +02:00 committed by GitHub
parent 669738ef3b
commit f03d1bb21f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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?