16.2.1.7.2. User Notification Event Handler

class privacyidea.lib.eventhandler.usernotification.UserNotificationEventHandler[source]

An Eventhandler needs to return a list of actions, which it can handle.

It also returns a list of allowed action and conditions

It returns an identifier, which can be used in the eventhandling definitions

property actions

This method returns a dictionary of allowed actions and possible options in this handler module.

Returns:

dict with actions

property allowed_positions

This returns the allowed positions of the event handler definition. :return: list of allowed positions

static attach_qr(body, url_img, mimetype, serial)[source]

Attach the QR-Code image to the email body.

Parameters:
  • body – email body

  • url_img – URL of the QR-Code image

  • mimetype – mimetype of the email

  • serial – serial number of the token

Returns:

body with the attached QR-Code image

description = 'This eventhandler notifies the user about actions on his tokens'
do(action, options=None)[source]

This method executes the defined action in the given event.

Parameters:
  • action

  • options (dict) – Contains the flask parameters g, request, response and the handler_def configuration

Returns:

static get_admin_realm_emails(admin_realm)[source]

Collect the email addresses of all users in the given admin realm.

A broken resolver in the realm would otherwise silently drop its admins from the result, so skipped resolvers are captured and warn-logged – the returned list may be incomplete.

Parameters:

admin_realm – the name of the admin realm

Returns:

a list of email addresses of users that have an email

identifier = 'UserNotification'