Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device agent instance node-red audit logs #3447

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

Steve-Mcl
Copy link
Contributor

@Steve-Mcl Steve-Mcl commented Feb 5, 2024

Description

Implements the pathways required to permit the logging of audit events originating from a Device Agent instance of Node-RED

  • Adds route: /logging/device/:deviceId/audit as a partner to /logging/:projectId/audit
  • Adds tests for route and logger
  • Update Audit Log UI
    • to clarify difference between a deploy and a reload
    • to show better subtitle in the node-red logout event (device agent events have no user)
    • See image below
  • Deletes duplicated entries in frontend/src/data/audit-events.json

As discussed and agreed in the issue, I am NOT inhibiting the other audit entries - this provides closer parity with the nr-launcher. To clarify, we will get some additional audit events from the device agent (in line with the instance launcher)

Screenshot

image

NOTE

This PR depends on device agent being updated to map the NR audit events through from the runtime to this new POST endpoint

Related Issue(s)

#3357

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

Attention: 51 lines in your changes are missing coverage. Please review.

Comparison is base (c0d1a39) 41.37% compared to head (1bfe91b) 2.03%.
Report is 2 commits behind head on main.

❗ Current head 1bfe91b differs from pull request most recent head 4c5d53e. Consider uploading reports for the commit 4c5d53e to get more accurate results

Files Patch % Lines
forge/routes/logging/index.js 0.00% 39 Missing ⚠️
...end/src/components/audit-log/AuditEntryVerbose.vue 0.00% 7 Missing ⚠️
forge/auditLog/formatters.js 0.00% 3 Missing ⚠️
forge/auditLog/device.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #3447       +/-   ##
==========================================
- Coverage   41.37%   2.03%   -39.34%     
==========================================
  Files         610     610               
  Lines       22946   22984       +38     
  Branches     5547    5563       +16     
==========================================
- Hits         9493     467     -9026     
- Misses      13453   22517     +9064     
Flag Coverage Δ
backend ?
frontend 2.03% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Steve-Mcl Steve-Mcl linked an issue Feb 5, 2024 that may be closed by this pull request
7 tasks
@Steve-Mcl
Copy link
Contributor Author

Steve-Mcl commented Feb 5, 2024

@knolleary as discussed, let me know if you think we should move this endpoint to /api/v1/devices/:deviceId/live/...

@Steve-Mcl Steve-Mcl requested a review from knolleary February 5, 2024 16:56
@knolleary knolleary merged commit bc79846 into main Feb 6, 2024
9 checks passed
@knolleary knolleary deleted the 3268-device-agent-node-red-audit-logs branch February 6, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit log event “Flow Deployed” for Devices
2 participants