Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
@advanced-rest-client/arc-request-logic
Advanced tools
Changelog
3.0.3 (2020-01-08)
Readme
A request logic for Advanced REST Client excluding HTTP transport.
This component is responsible for handing api-request
event, handing variables processing, request actions, before-request
event, dispatching URL history store event, communicating with transport library, and finally dispatching api-response
event. If the transport library it the hearth of the application then this component is it's brain.
This components is a part of API components ecosystem
npm install --save @advanced-rest-client/arc-request-logic
This library uses @advanced-rest-client/arc-request-logic
which depend on Jexl
and this library is not included by default in the element.
You need to add this dependency manually.
You must install Jexl on your project, and build it for browser. See dev-lib/
folder for an example of such a build.
Finally you have to either pass the pointer to Jexl library to jexl
property or point to a relative in the window
object.
Setting Jexl reference:
const eval = document.querySelector('arc-request-logic');
eval.jexl = myJexlVariable;
Setting path to Jexl:
<arc-request-logic jexlpath="ArcVariables.JexlDev"></arc-request-logic>
This expects the Jexl library to be under window.ArcVariables.JexlDev
variable.
git clone https://github.com/advanced-rest-client/arc-request-logic
cd arc-request-logic
npm install
npm test
Handle before-request
custom event to alter request properties before send.
When the handler is synchronous then there's no need for additional steps.
If the handler is asynchronous then add a Promise
to the promises
array on detail object and resolve it when ready. It is possible to set timeout
property on the promise to extend default timeout for before-request
event processing which is set to 2000ms.
document.body.addEventListener('before-request', (e) => {
cont p = new Promise((resolve) => {
sync processUrl(e.detail); // set new URL on the detail object as objects are passed by reference
resolve();
});
p.timeout = 3500;
e.detail.promises.push(p);
});
document.body.dispatchEvent(new CustomEvent('api-request', {
bubbles: true,
cancelable: true,
detail: request
});
Mind that other handlers may interact with the same properties. Even though there's no race conditions per so in JavaScript you may get different values between processing different parts of request if the event loop is releases.
FAQs
A request logic for Advanced REST Client excluding HTTP transport.
We found that @advanced-rest-client/arc-request-logic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.