Class: DiasporaFederation::Entities::AccountMigration
- Inherits:
-
DiasporaFederation::Entity
- Object
- DiasporaFederation::Entity
- DiasporaFederation::Entities::AccountMigration
- Includes:
- Signable
- Defined in:
- lib/diaspora_federation/entities/account_migration.rb,
lib/diaspora_federation/entities/account_migration/signable.rb
Overview
This entity is sent when a person changes their diaspora* ID (e.g. when a user migration from one to another pod happens).
Defined Under Namespace
Modules: Signable Classes: PrivateKeyNotFound
Constant Summary
Constants included from Signable
Constants inherited from DiasporaFederation::Entity
DiasporaFederation::Entity::ENTITY_NAME_REGEX, DiasporaFederation::Entity::INVALID_XML_REGEX
Instance Attribute Summary collapse
-
#author ⇒ String
readonly
Sender of the AccountMigration message.
-
#old_identity ⇒ String
readonly
Returns diaspora* ID of the old person identity.
-
#profile ⇒ Person
readonly
Holds new updated profile of a person, including diaspora* ID.
-
#remote_photo_path ⇒ String
readonly
The url to the path of the photos on the new pod.
-
#signature ⇒ String
readonly
Signature that validates original and target diaspora* IDs with the private key of the second identity, other than the entity author.
Class Method Summary collapse
-
.from_hash(*args) ⇒ Object
Calls super and additionally does signature verification for the instantiated entity.
Instance Method Summary collapse
-
#new_identity ⇒ String
Returns diaspora* ID of the new person identity.
-
#verify_signature ⇒ Object
Shortcut for calling super method with sensible arguments.
Methods included from Signable
#signature_data, #unique_migration_descriptor
Methods included from Signable
#sign_with_key, #signature_data
Methods included from Logging
Methods inherited from DiasporaFederation::Entity
class_name, entity_class, entity_name, from_json, from_xml, #initialize, #to_h, #to_json, #to_xml
Methods included from PropertiesDSL
#class_props, #default_values, #entity, #missing_props, #optional_props, #property, #resolv_aliases
Constructor Details
This class inherits a constructor from DiasporaFederation::Entity
Instance Attribute Details
#author ⇒ String (readonly)
Sender of the AccountMigration message. Usually it is the old diaspora* ID of the person who changes their ID. This property is also allowed to be the new diaspora* ID, which is equal to the author of the included profile.
18 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 18 property :author, :string |
#old_identity ⇒ String (readonly)
Returns diaspora* ID of the old person identity.
36 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 36 property :old_identity, :string, default: nil |
#profile ⇒ Person (readonly)
Holds new updated profile of a person, including diaspora* ID
23 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 23 entity :profile, Entities::Profile |
#remote_photo_path ⇒ String (readonly)
The url to the path of the photos on the new pod. Can be empty if photos weren’t migrated.
41 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 41 property :remote_photo_path, :string, optional: true |
#signature ⇒ String (readonly)
Signature that validates original and target diaspora* IDs with the private key of the second identity, other than the entity author. So if the author is the old identity then this signature is made with the new identity key, and vice versa.
30 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 30 property :signature, :string, default: nil |
Class Method Details
.from_hash(*args) ⇒ Object
Calls super and additionally does signature verification for the instantiated entity.
70 71 72 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 70 def self.from_hash(*args) super.tap(&:verify_signature) end |
Instance Method Details
#new_identity ⇒ String
Returns diaspora* ID of the new person identity.
53 54 55 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 53 def new_identity profile&. end |
#verify_signature ⇒ Object
Shortcut for calling super method with sensible arguments
63 64 65 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 63 def verify_signature super(signer_id, :signature) end |