Module m_ratelimit

Rate limiting of authentication tries and other types of requests.

Copyright © 2019 Driebit BV

Behaviours: zotonic_model.

Authors: Marc Worrell (marc@worrell.nl).

Description

Rate limiting of authentication tries and other types of requests

Data Types

device_id()

device_id() = binary() | undefined

Function Index

delete_event/3Delete all entries for an event.
init/1
insert_event/4Insert an event, use the context for extra properties.
insert_event/5Insert an event, with extra properties.
is_event_limited/4Check if the key/device is rate limited due to previous events.
list_event/3Return all entries for an event.
m_get/3
prune/1

Function Details

delete_event/3

delete_event(Type::atom(), Key::binary(), Context::z:context()) -> ok

Delete all entries for an event

init/1

init(Context::z:context()) -> ok

insert_event/4

insert_event(Type::atom(), Key::binary(), Device::device_id(), Context::z:context()) -> ok | {error, term()}

Insert an event, use the context for extra properties.

insert_event/5

insert_event(Type::atom(), Key::binary(), Device::device_id(), Props::proplists:proplist(), Context::z:context()) -> ok

Insert an event, with extra properties.

is_event_limited/4

is_event_limited(Type::atom(), Key::binary(), Device::device_id(), Context::z:context()) -> boolean()

Check if the key/device is rate limited due to previous events.

list_event/3

list_event(Type::atom(), Key::binary(), Context::z:context()) -> list()

Return all entries for an event

m_get/3

m_get(Rest, Msg, Context) -> any()

prune/1

prune(Context::z:context()) -> ok


Generated by EDoc