Notifications Plugin

Documentation section of notifications plugin. This plugin is part of Backstage Core.

Upstream documentation can be found in:

Frontend

The frontend UI is implemented as a side bar item.
The following screenshots show how to use the notifications UI.
Whenever a new notification is detected the frontend pops an alert to the user.

The Frontend UI

Notifications page

Frontend UI

Notifications list

Notifications list

Backend

The backend plugin provides the backend application for reading and writing notifications.

Authentication

Two kinds of authentation are in place with Notifications Plugin:

  1. For reading notifications the JWT token generated by backstage IDP with typ vnd.backstage.user is used. The JWT claim sub will be the one used to filter the notifications.

  2. For creating the notifications, the Backstage Static Tokens will be used, the following configuration is needed on app-config.yaml

backend:
  auth:
    externalAccess:
      - type: static
        options:
          token: lBb9+r50NUNYxKicBZob0NjespLBAb9C
          subject: notifications-access

The definition of the POST request is defined upstream and example can be found in upstream repo. And here is an example on how to push a notification using a simple curl request:

curl https://$HOST/api/notifications \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer lBb9+r50NUNYxKicBZob0NjespLBAb9C" \
       -d '{ "recipients": { "type": "entity", "entityRef": [ "user:default/alice" ] }, "payload": { "title": "important message", "link": "http://redhat.com/", "severity": "high", "topic": "Notification" }}'

Authorization

The plugin support the standard way to deny or allow request for an specific token. The configuration is explained in the Backstage docs

REST endpoints and OpenAPI

The plugin provide an OpenAPI spec which is explained here

Forward to Email

It is possible to forward notification content to email address. In order to do that you must add the Email Processor Module to your backstage backend. The email title is taken from the notification title and the email body is taken from the notification’s description and link.

Configuration

An example configuration, as well as a link to all configuration options, can be found in the module’s readme.

Ignoring unwanted notifications

The configuration of the module explains how to configure filters. Filters are used to ignore notifications that should not be forwarded to email. The supported filters include minimum/maximum severity and list of excluded topics.

User notifications

Each user notification has a list of recipients. The recipient is an entity in backstage catalog. The notification will be sent to the email addresses of the recipients.

Broadcast notifications

In broadcast notifications we do not have recipients. The module’s configuration supports a few options for broadcast notifications:

  • Ignoring broadcast notifications
  • Sending to predefined address list
  • Sending to all users