View Source ActivityPub.Utils (Bonfire v0.9.10-classic-beta.169)

Misc functions used for federation

Summary

Functions

Link to this function

activitypub_object_headers()

View Source
Link to this function

cachex_fetch(cache, key, fallback, options \\ [])

View Source
Link to this function

error_json(conn, error, status \\ 500)

View Source
Link to this function

format_date(date \\ NaiveDateTime.utc_now(Calendar.ISO))

View Source
Link to this function

get_with_cache(get_fun, cache_bucket, key, identifier)

View Source

Takes a string and returns true if it is a valid UUID (Universally Unique Identifier)

Link to this function

json_with_cache(conn \\ nil, get_fun, cache_bucket, id, ret_fn \\ &return_json/4, opts \\ [])

View Source
Link to this function

label_in_collection?(label, collection)

View Source
@spec label_in_collection?(String.t(), map()) :: boolean()
Link to this function

make_json_ld_header(type \\ :object)

View Source
Link to this function

maybe_put(map, key, value)

View Source

conditionally update a map

Handles multiple cases where the input value is of a different type (atom, list, tuple, etc.) and returns a string representation of it.

Link to this function

ok_unwrap(val, fallback \\ nil)

View Source
Link to this function

public?(activity_data, object_data)

View Source

Determines if an object or an activity is public.

Link to this function

put_if_present(map, key, value, value_function \\ &{:ok, &1})

View Source
Link to this function

return_json(conn, meta, json, opts \\ [])

View Source
Link to this function

safe_put_in(data, keys, value)

View Source
Link to this function

single_ap_id_or_object(ap_id)

View Source
Link to this function

stringify_keys(map, recursive \\ false)

View Source

Takes a map or keyword list, and returns a map with any atom keys converted to string keys. It can optionally do so recursively.