-
Notifications
You must be signed in to change notification settings - Fork 0
NinjaOne LCP Plugin #31
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "words": ["ninjarmm", "ninjaone", "bitlocker", "antivirus", "vulnerability", "vulnerabilities", "quarantined", "quarantinedthreatscount", "loggedin", "submask"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| [ | ||
| { | ||
| "name": "NinjaOne Organization", | ||
| <<<<<<< Updated upstream | ||
| "sourceType": "NinjaOne", | ||
| ======= | ||
| "sourceType": "ninja-one", | ||
| >>>>>>> Stashed changes | ||
| "icon": "building", | ||
| "singular": "Organization", | ||
| "plural": "Organizations" | ||
| }, | ||
| { | ||
| "name": "NinjaOne Device", | ||
| <<<<<<< Updated upstream | ||
|
Check failure on line 15 in plugins/NinjaOne/v1/custom_types.json
|
||
| "sourceType": "NinjaOne", | ||
| ======= | ||
| "sourceType": "ninja-one", | ||
| >>>>>>> Stashed changes | ||
| "icon": "desktop", | ||
| "singular": "Device", | ||
| "plural": "Devices" | ||
| }, | ||
| { | ||
| <<<<<<< Updated upstream | ||
| "name": "NinjaOne Ticket Board", | ||
| "sourceType": "NinjaOne", | ||
| ======= | ||
| "name": "NinjaOne Location", | ||
| "sourceType": "ninja-one", | ||
| "icon": "map-marker-alt", | ||
| "singular": "Location", | ||
| "plural": "Locations" | ||
| }, | ||
| { | ||
| "name": "NinjaOne Ticket Board", | ||
| "sourceType": "ninja-one", | ||
| >>>>>>> Stashed changes | ||
| "icon": "kanban", | ||
| "singular": "Ticket Board", | ||
| "plural": "Ticket Boards" | ||
| } | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| { | ||
| "name": "activities", | ||
| "displayName": "Activities", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "paging": { | ||
| <<<<<<< Updated upstream | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": false, | ||
| "endpointPath": "/v2/activities", | ||
| "pathToData": "activities", | ||
| "getArgs": [], | ||
| "headers": [] | ||
| }, | ||
| ======= | ||
| "mode": "token", | ||
| "pageSize": { | ||
| "realm": "queryArg", | ||
| "path": "pageSize", | ||
| "value": "1000" | ||
| }, | ||
| "in": { | ||
| "realm": "payload", | ||
| "path": "lastActivityId" | ||
| }, | ||
| "out": { | ||
| "realm": "queryArg", | ||
| "path": "olderThan" | ||
| } | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "endpointPath": "/v2/activities", | ||
| "pathToData": "activities", | ||
| "getArgs": [ | ||
| { | ||
| "key": "after", | ||
| "value": "{{timeframe.start}}" | ||
| }, | ||
| { | ||
| "key": "before", | ||
| "value": "{{timeframe.end}}" | ||
| } | ||
| ], | ||
| "headers": [] | ||
| }, | ||
| "metadata": [ | ||
| { | ||
| "name": "activityTime", | ||
| "displayName": "Activity Time", | ||
| "shape": [ | ||
| "date", | ||
| { | ||
| "timeZone": "Etc/UTC" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "activity", | ||
| "displayName": "Activity", | ||
| "shape": "string", | ||
| "role": "label" | ||
| }, | ||
| { | ||
| "name": "activityId", | ||
| "displayName": "Activity ID", | ||
| "shape": "number", | ||
| "role": "id", | ||
| "visible": false | ||
| }, | ||
| { | ||
| "name": "description", | ||
| "displayName": "Description", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "activityType", | ||
| "displayName": "Activity Type", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "source", | ||
| "displayName": "Source", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "deviceId", | ||
| "displayName": "Device ID", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "deviceName", | ||
| "displayName": "Device Name", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "organizationId", | ||
| "displayName": "Organization ID", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "organizationName", | ||
| "displayName": "Organization Name", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "userId", | ||
| "displayName": "User ID", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "userName", | ||
| "displayName": "User Name", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "pattern": ".*" | ||
| } | ||
| ], | ||
| >>>>>>> Stashed changes | ||
| "timeframes": [ | ||
| "last1hour", | ||
| "last12hours", | ||
| "last24hours", | ||
| "last7days", | ||
| "last30days", | ||
| "thisMonth", | ||
| "thisQuarter", | ||
| "thisYear", | ||
| "lastMonth", | ||
| "lastQuarter", | ||
| "lastYear", | ||
| "none" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| { | ||
| "name": "alerts", | ||
| "displayName": "Alerts", | ||
| <<<<<<< Updated upstream | ||
| ======= | ||
| "description": "Active alerts and triggered conditions", | ||
| >>>>>>> Stashed changes | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| <<<<<<< Updated upstream | ||
| "expandInnerObjects": false, | ||
| ======= | ||
| "expandInnerObjects": true, | ||
| >>>>>>> Stashed changes | ||
| "endpointPath": "/v2/alerts", | ||
| "pathToData": "", | ||
| "getArgs": [], | ||
| "headers": [] | ||
| }, | ||
| <<<<<<< Updated upstream | ||
| "timeframes": [ | ||
| "last1hour", | ||
| "last12hours", | ||
| "last24hours", | ||
| "last7days", | ||
| "last30days", | ||
| "thisMonth", | ||
| "thisQuarter", | ||
| "thisYear", | ||
| "lastMonth", | ||
| "lastQuarter", | ||
| "lastYear", | ||
| ======= | ||
| "metadata": [ | ||
| { | ||
| "name": "conditionHealthStatus", | ||
| "displayName": "Health Status", | ||
| "shape": [ | ||
| "state", | ||
| { | ||
| "map": { | ||
| "error": ["UNHEALTHY"], | ||
| "warning": ["NEEDS_ATTENTION"], | ||
| "success": ["HEALTHY"], | ||
| "unknown": ["UNKNOWN"] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "uid", | ||
| "displayName": "Alert ID", | ||
| "shape": "string", | ||
| "role": "id", | ||
| "visible": false | ||
| }, | ||
| { | ||
| "name": "sourceName", | ||
| "displayName": "Alert Name", | ||
| "shape": "string", | ||
| "role": "label" | ||
| }, | ||
| { | ||
| "name": "message", | ||
| "displayName": "Message", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "subject", | ||
| "displayName": "Subject", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "severity", | ||
| "displayName": "Severity", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "sourceType", | ||
| "displayName": "Source Type", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "createTime", | ||
| "displayName": "Created At", | ||
| "shape": [ | ||
| "date", | ||
| { | ||
| "timeZone": "Etc/UTC" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "updateTime", | ||
| "displayName": "Updated At", | ||
| "shape": [ | ||
| "date", | ||
| { | ||
| "timeZone": "Etc/UTC" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "device_id", | ||
| "displayName": "Device ID", | ||
| "shape": "string", | ||
| "visible": false | ||
| }, | ||
| { | ||
| "name": "device_displayName", | ||
| "displayName": "Device", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "device_organizationId", | ||
| "displayName": "Organization ID", | ||
| "shape": "string", | ||
| "visible": false | ||
| }, | ||
| { | ||
| "name": "device_references_organization_name", | ||
| "displayName": "Organization", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "device_locationId", | ||
| "displayName": "Location ID", | ||
| "shape": "string", | ||
| "visible": false | ||
| }, | ||
| { | ||
| "name": "device_references_location_name", | ||
| "displayName": "Location", | ||
| "shape": "string" | ||
| }, | ||
| { | ||
| "name": "device_offline", | ||
| "displayName": "Device Offline", | ||
| "shape": "boolean" | ||
| }, | ||
| { | ||
| "pattern": ".*" | ||
| } | ||
| ], | ||
| "timeframes": [ | ||
| >>>>>>> Stashed changes | ||
| "none" | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Nearly every file in this PR contains unresolved git merge conflict markers (<<<<<<< Updated upstream, =======, >>>>>>> Stashed changes), making the JSON syntactically invalid and unparseable. The entire plugin is non-functional as submitted — all data streams, dashboards, custom types, scopes, and index definitions will fail to load. The author must resolve all conflicts and recommit clean files before this PR can be merged.
Extended reasoning...
What the bug is and how it manifests
The PR introduces a new NinjaOne plugin, but the files were committed while containing unresolved git merge conflict markers. Specifically, the conflict marker lines "<<<<<<< Updated upstream", "=======", and ">>>>>>> Stashed changes" appear verbatim throughout the committed files. A JSON parser will immediately reject any file containing these markers because they are not valid JSON syntax.
The specific code path that triggers it
Every time the plugin framework attempts to parse a plugin configuration file, it will call a JSON parser on the file contents. For example, custom_types.json starts with valid JSON ("[") but lines 4-8 contain raw conflict markers. Any JSON parser will throw a parse error when it encounters the conflict marker as a token. The same pattern repeats across 36+ files including all data streams, dashboards, scopes, index definitions, metadata, and ui.json.
Why existing code does not prevent it
Git conflict markers are plain text inserted by git during a failed or unresolved merge/rebase. There is no automatic mechanism in git to prevent committing files with conflict markers unless a pre-commit hook is configured to check for them. The developer appears to have run a git stash and then merged upstream changes, resulting in conflicts that were never resolved before committing.
What the impact would be
The impact is total: the plugin cannot function at all. Affected files include custom_types.json (custom object types won't register), all 25+ data stream JSON files (no data streams available), all 9 dashboard files (no dashboards), scopes.json (no scopes), indexDefinitions/default.json (no index/import), manifest.json (default content won't load), metadata.json (plugin metadata invalid), and ui.json (configuration UI broken). Zero functionality will work.
How to fix it
The author must resolve all merge conflicts in every affected file. They should: (1) run "git grep -l" to find all files with unresolved conflicts, (2) for each file, decide which version (upstream or stashed) is correct and manually merge, (3) remove all conflict marker lines, (4) verify each JSON file parses correctly using a JSON validator, and (5) re-commit the corrected files.
Step-by-step proof
Take custom_types.json as a concrete example. A JSON parser processes the file token by token:
This happens at line 4 of the very first file in the plugin. Every other affected file fails similarly when the parser reaches a conflict marker. Verified by multiple reviewers who grepped the repository and confirmed 36 files are affected.