Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
All apis resources are by default fully CORS and JSONP available. You must use CSRF protection for all your authenticated requests (even for GET requests) and apis supports such protection by default too. Optionally, you can check Origin of your requests or disable CORS/JSONP functionality (completely or for choosen request handlers).
By default, apis philosophy is to allow cross-origin requests and be ready for them.
Also, by default, every resource will have 'options' handler providing resource description and it will not be protected by authentication or something. You can allways override this handler with null or your own variant.
Handler interface:
setup(chain)
- can be used to perform some interaction between handlers of chain, used by Impl
and Ret
handle(ctx)
- async handle, must not throw any exceptions, use ctx.error()
instead, usually must call ctx.next()
at some pointTo get test page on /test_page
add to your contract:
cont('/test', [apis.testPage.contract])
For any app, if it cannot be found, apis default will be used.
core.app - known by app actually (which also is loader), the app itself
core.uncaught - uncaught exception handler
core.logging - logging subsystem
core.mechanics.web - web mechanics, enables responding on HTTP requests
core.mechanics.socket - socket mechanics, enables web socket communications, runs on top of web mechanics
core.settings - settings, will be searched at cwd()+'/lib/settings'
core.handler - main app contract, will be searched at cwd()+'/lib/contract'
For both core.settings and core.handler units, if unit cannot be found, apis default will be used.
MIT
FAQs
Library for creation web and websocket restful APIs
The npm package apis receives a total of 106 weekly downloads. As such, apis popularity was classified as not popular.
We found that apis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.