z_replay_token (zotonic_core v1.0.0-rc.17)

Track onetime anti replay tokens, prevent re-use within a period after being invalidated.

Summary

Functions

Invalidate a token, garbage collected at the given timestamp.

Check if a token is registered as being invalidated.

Return a new token, assume random is good enough to generate an unique token.

Starts the MQTT ticket server server

Functions

code_change(OldVersion, State, Extra)

handle_call(Msg, From, State)

handle_cast(Msg, State)

handle_info(Msg, State)

init(_)

invalidate_token(Token, Timestamp, Context)

-spec invalidate_token(Token, Timestamp, Context) -> ok
                          when Token :: binary(), Timestamp :: non_neg_integer(), Context :: z:context().

Invalidate a token, garbage collected at the given timestamp.

is_spent_token(Token, Context)

-spec is_spent_token(Token, Context) -> boolean() when Token :: binary(), Context :: z:context().

Check if a token is registered as being invalidated.

new_token()

-spec new_token() -> binary().

Return a new token, assume random is good enough to generate an unique token.

start_link(Site)

Starts the MQTT ticket server server

terminate(Reason, State)