View Source ActivityPub.Safety.Containment (Bonfire v0.9.11-social-beta.6)

This module contains some useful functions for containing objects to specific origins and determining those origins. They previously lived in the ActivityPub Transformer module.

Object containment is an important step in validating remote objects to prevent spoofing, therefore removal of object containment functions is NOT recommended.

Summary

Functions

contain_child(arg1)

contain_origin(id, params)

Checks that an imported AP object's actor matches the host it came from.

contain_origin_from_id(id, params)

contain_uri(id, data)

get_object(arg1)

restrict_unauthenticated_access?(object)

restrict_unauthenticated_access?(resource, kind)

visible_for_user?(object, actor)

@spec visible_for_user?(ActivityPub.Object.t() | nil, User.t() | nil) :: boolean()