swh.coarnotify.server.handlers module#

Module dedicated to the handlers of COAR Notifications.

swh.coarnotify.server.handlers.get_handler(notification: InboundNotification) Callable[[InboundNotification], None] | None[source]#

Get a CN handler from its type.

The list of handlers by type is defined in the handlers dict.

Parameters:

notification – an inbound CN

Raises:

UnprocessableException – no handler available for cn

Returns:

A COAR Notification handler if one matches

swh.coarnotify.server.handlers.mention(notification: InboundNotification) None[source]#

Handle a mention COAR Notification.

Validates the payload and send an Accept CN.

Parameters:

cn – an inbound CN

Raises:

RejectException – invalid payload