Class: Skyfall::Jetstream::IdentityMessage
- Defined in:
- lib/skyfall/jetstream/identity_message.rb
Overview
Jetstream message sent when a new DID is created or when the details of someone’s DID document are changed (usually either a handle change or a migration to a different PDS). The message should include currently assigned handle (though the field is not required).
Note: the message is originally emitted from the account’s PDS and is passed as is by relays, which means you can’t fully trust that the handle is actually correctly assigned to the DID and verified by DNS or well-known. To confirm that, use DID.resolve_handle from [DIDKit](ruby.sdk.blue/didkit/).
Instance Attribute Summary
Attributes inherited from Message
Instance Method Summary collapse
-
#handle ⇒ String?
Current handle assigned to the DID.
-
#initialize(json) ⇒ IdentityMessage
constructor
A new instance of IdentityMessage.
Methods inherited from Message
new, #operation, #operations, #time, #unknown?
Constructor Details
#initialize(json) ⇒ IdentityMessage
Returns a new instance of IdentityMessage.
26 27 28 29 |
# File 'lib/skyfall/jetstream/identity_message.rb', line 26 def initialize(json) raise DecodeError.new("Missing event details (identity)") if json['identity'].nil? super end |
Instance Method Details
#handle ⇒ String?
Returns current handle assigned to the DID.
32 33 34 |
# File 'lib/skyfall/jetstream/identity_message.rb', line 32 def handle @json['identity']['handle'] end |