express-audit-broadcast

1.0.4 • Public • Published

About

This is a express middleware to send audit-broadcast messages on resource change. The middleware expects you are using a sri-audit-broadcast server.

How to use

var getPersonHref = function (req, res) {
  if(req.user) {
    return '/persons/' + req.user.uuid;
  } else {
    return null
  }
};

audit.config({
  person: getPersonHref,
  api: {
    host: "https://hostToAudit.com",
    user: "",
    password: "",
    headers: {}
  },
  component: "/security/components/test-component",
  resources: [
    {
        resource: '/store/products',
        type: "PRODUCTS"
    },
    {
        resource: '/schools',
        type: "SCHOOL"
    }
  ]
});

person: Is a function that returns the current user.

resources: Configures the resources that need to have versions.

compontent: What is the component

api: How to connect to the api

MERGE

The merge operation is not yet supported

Readme

Keywords

none

Package Sidebar

Install

npm i express-audit-broadcast

Weekly Downloads

6

Version

1.0.4

License

private

Last publish

Collaborators

  • feelitloveit