thorn.generic.models
¶
Generic base model mixins.
-
class
thorn.generic.models.
AbstractSubscriber
[source]¶ Abstract class for Subscriber identity.
-
event
¶ Event pattern this subscriber is subscribed to (e.g.
article.*
).
-
from_dict
(*args, **kwargs)[source]¶ Create subscriber from dictionary representation.
Note
Accepts the same arguments as
dict
.
-
hmac_digest
¶ HMAC digest type (e.g.
"sha512"
).The value used must be a member of
hashlib.algorithms_available
.
-
hmac_secret
¶ HMAC secret key, of arbitrary length.
-
sign
(message)[source]¶ Sign message using HMAC.
Note
hmac_secret
and the currenthmac_digest
type must be set.
-
url
¶ Destination URL to dispatch this event.
-
user
¶ User filter – when set only dispatch if the event sender matches.
-
user_ident
()[source]¶ Return
user
identity.Note
Value must be json serializable like a database primary key.
-
uuid
¶ Unique identifier.
-