Parrhesia.Policy.EventPolicy
(parrhesia v0.12.0)
Copy Markdown
Write/read policy checks for relay operations.
Summary
Types
@type policy_error() ::
:auth_required
| :pubkey_not_allowed
| :restricted_giftwrap
| :sync_read_not_allowed
| :sync_write_not_allowed
| :marmot_group_h_tag_required
| :marmot_group_h_values_exceeded
| :marmot_group_filter_window_too_wide
| :media_metadata_tags_exceeded
| :media_metadata_tag_value_too_large
| :media_metadata_url_too_long
| :media_metadata_invalid_url
| :media_metadata_invalid_hash
| :media_metadata_invalid_mime
| :media_metadata_mime_not_allowed
| :media_metadata_unsupported_version
| :push_notification_relay_tags_exceeded
| :push_notification_payload_too_large
| :push_notification_replay_window_exceeded
| :push_notification_missing_expiration
| :push_notification_expiration_too_far
| :push_notification_server_recipients_exceeded
| :protected_event_requires_auth
| :protected_event_pubkey_mismatch
| :pow_below_minimum
| :pubkey_banned
| :event_banned
Functions
@spec authorize_read([map()], MapSet.t(String.t())) :: :ok | {:error, policy_error()}
@spec authorize_read([map()], MapSet.t(String.t()), Parrhesia.API.RequestContext.t()) :: :ok | {:error, policy_error()}
@spec authorize_write(map(), MapSet.t(String.t())) :: :ok | {:error, policy_error()}
@spec authorize_write(map(), MapSet.t(String.t()), Parrhesia.API.RequestContext.t()) :: :ok | {:error, policy_error()}
@spec error_message(policy_error()) :: String.t()