Class: Skyfall::Firehose::IdentityMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/skyfall/firehose/identity_message.rb

Overview

Firehose 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 may include currently assigned handle, though it’s not required that this field is set.

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 collapse

Attributes inherited from Message

#data_object, #did, #seq, #type, #type_object

Instance Method Summary collapse

Methods inherited from Message

#inspect, new, #operations, #time, #unknown?

Constructor Details

#initialize(type_object, data_object) ⇒ IdentityMessage

Returns a new instance of IdentityMessage.

Parameters:

  • type_object (Hash)

    first decoded CBOR frame with metadata

  • data_object (Hash)

    second decoded CBOR frame with payload

Raises:

  • (DecodeError)

    if the message doesn’t include required data



27
28
29
30
31
32
# File 'lib/skyfall/firehose/identity_message.rb', line 27

def initialize(type_object, data_object)
  super
  check_if_not_nil 'seq', 'did', 'time'

  @handle = @data_object['handle']
end

Instance Attribute Details

#handleString? (readonly)

Returns current handle assigned to the DID.

Returns:

  • (String, nil)

    current handle assigned to the DID



35
36
37
# File 'lib/skyfall/firehose/identity_message.rb', line 35

def handle
  @handle
end