ActivityPub.Web.ProxyRemoteObjectController (Bonfire v1.0.1-social-alpha.28)

View Source

Summary

Functions

Proxies a remote ActivityStreams object given by the id parameter.

Rate limit plug for controllers.

Functions

proxy(conn, arg2)

Proxies a remote ActivityStreams object given by the id parameter.

Examples

POST /proxy
Content-Type: application/x-www-form-urlencoded

id=https://remote.server/object/123

Returns the fetched object as JSON, or an error if not found or fetch fails.

rate_limit(conn, opts)

Rate limit plug for controllers.

Reads configuration from Application.get_env(:activity_pub, :rate_limit)[key_prefix] with fallback to default options provided in the plug call.

Options

  • :key_prefix - Prefix for the rate limit bucket key (required)
  • :scale_ms - Default time window in milliseconds (can be overridden by config)
  • :limit - Default number of requests (can be overridden by config)

Examples

plug :rate_limit, 
  key_prefix: :webfinger,
  scale_ms: 60_000,
  limit: 200