View Source ExUid2.Uid2 (ex_uid2 v0.2.1)

Struct holding the decrypted and parsed UID2 token.

Summary

Types

t()

Struct holding the decrypted and parsed UID2 token.

Types

@type t() :: %ExUid2.Uid2{
  established_ms: non_neg_integer(),
  expires_ms: non_neg_integer(),
  identity_scope: binary(),
  identity_type: :phone | :email | :unknown,
  site_id: non_neg_integer(),
  site_key: ExUid2.Keyring.Key.t(),
  uid: binary(),
  version: non_neg_integer()
}

Struct holding the decrypted and parsed UID2 token.

  • :uid - User's unique ID. This should always be a 44 bytes base64-encoded hashed ID.

  • :established_ms - The time when the token was first created (Unix timestamp in milliseconds)

  • :site_id - The site's ID used for finding the right decryption key.

  • site_key - The key found in the Keyring for the given site_id

  • identity_scope - The identity scope found in the keyring (should probably always be "UID2").

  • identity_type - Whether this is an hashed email or phone number. Will be :unknown for V2 tokens.

  • version - The advertising token version.

  • expires_ms - The time after which the token will be expired (Unix timestamp in milliseconds).

Functions