@forlagshuset/audit-logging
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

[DEPRECATED]

Audit Logging

Library to facilitate constructing and sending audit log messages.

Usecase

const auditLog = new AuditLog({
  actorType: ActorType.IP;
  actionType: ActionType.Object;
  objectType: ObjectType.FacebookUser;
  service: {
    type: ServiceType.App;
    id: 'service.name';
  };
});
const auditLogger = new BaseAuditLogger("audit.subject", auditLog, console);
const req = /* any object that we can take data from, typically it should be a request */ {actor_id: 3, object_id: 4}
const params = {
  actorIdGetter: (req: any) => req.actor_id,
  objectIdGetter: (req: any) => req.object_id,
  action: ActionVerb.MODIFIED,
}
await auditLogger.log(params, req);

Readme

Keywords

none

Package Sidebar

Install

npm i @forlagshuset/audit-logging

Weekly Downloads

43

Version

2.0.0

License

MIT

Unpacked Size

38.8 kB

Total Files

35

Last publish

Collaborators

  • kemorian
  • warszk
  • iapain
  • lukaszsiromski
  • daniel.wiadro
  • shardiwal