Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@eclipse-emfcloud/coffee-triggers-example
Advanced tools
Example server-side triggers plug-in for the Model Server.
This package provides an example of a trigger provider plug-in for the Model Server.
It provides a trigger that ensures the duration
of a workflow Task
in a Coffee model is always a multiple of ten.
See the parent readme for details of how to set up and build the project.
For detailed instructions how to run the example server configuration that includes this plug-in example, see the Example Server readme.
There are a variety of tools available for ad hoc REST interactions with services such as the Model Server. A recommended option is the Postman application.
Start by fetching the current state of the model.
Send a GET
request to
http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee
The result should look something like this:
{
"type": "success",
"data": {
"$type": "http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine",
"$id": "/",
"children": [
// ... structural components here ...
],
"name": "Super Brewer 3000",
"workflows": [
{
"$id": "//@workflows.0",
"name": "Simple Workflow",
"nodes": [
{
"$type": "http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask",
"$id": "//@workflows.0/@nodes.0",
"name": "PreHeat",
"component": {
"$type": "http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit",
"$ref": "//@children.0"
}
}
]
}
]
}
}
Make note of the EMF-style URI fragment $id
of the PreHeat task, which must be inferred from the model structure.
The URI fragment is //@workflows.0/@nodes.0
: the first node of the first workflow in the root Machine
object.
This will be used to build requests to edit the duration
.
Next, send a request to change the duration
property of this task.
For example, this could be the example custom increment-duration
command or a simple SetCommand
or replace
JSON Patch operation.
For example, send a PATCH
request to
http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee&format=json-v2
with the following body:
{
"data": {
"type": "modelserver.patch",
"data": [
{
"op": "replace",
"path": "SuperBrewer3000.coffee#//@workflows.0/@nodes.0/duration",
"value": 37
}
]
}
}
You also need to set the following two headers for the request to work:
Observe in the response that there is a final change to the duration
that rounds it up to the next multiple of ten.
A typical response looks something like this:
{
"type": "success",
"data": {
"success": true,
"patch": [
{
"op": "replace",
"path": "/workflows/0/nodes/0/duration",
"value": 37
},
{
"op": "replace",
"path": "/workflows/0/nodes/0/duration",
"value": 40
}
]
}
}
Fetch the model again with a GET request to see that the final value of the duration
of the PreHeat task is a nice round multiple of ten.
A critical component of this trigger provider framework is that the changes made by triggers are included in undo/redo of whatever changes triggered them.
To send an undo command to the Model Server, simply send a GET
request to
http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee
Follow that up with a GET
on the /api/v2/models
endpoint to see how the duration
of the PreHeat Task
is reverted.
The intermediate values that are not multiples of ten are not evident because all changes are undone at each step.
FAQs
Example server-side triggers plug-in for the Model Server.
The npm package @eclipse-emfcloud/coffee-triggers-example receives a total of 1 weekly downloads. As such, @eclipse-emfcloud/coffee-triggers-example popularity was classified as not popular.
We found that @eclipse-emfcloud/coffee-triggers-example demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.