Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
.. image:: https://travis-ci.org/lucianoratamero/apistar_cors_hooks.svg?branch=master :target: https://travis-ci.org/lucianoratamero/apistar_cors_hooks
This project enables CORS on API Star
_\ apps via event hooks.
Suppports:
Installation
Install via PyPI:
.. code:: shell
pip install apistar_cors_hooks
After installing, we need to add and instance of ``CORSRequestHooks`` to your ``event_hooks`` in your app:
.. code:: python
from apistar import App, Route
from apistar_cors_hooks import CORSRequestHooks
def homepage() -> str:
return '<html><body><h1>Homepage</h1></body></html>'
routes = [
Route('/', method='GET', handler=homepage),
]
event_hooks = [CORSRequestHooks()]
app = App(routes=routes, event_hooks=event_hooks)
If you want to customize WSGICORS options, you just need to pass a dict via the ``options`` kwarg:
.. code:: python
custom_options = {"origin": "your_host_server"}
event_hooks = [CORSRequestHooks(options=custom_options)]
app = App(routes=routes, event_hooks=event_hooks)
Contributing
Since I'm a WSGI/CORS noob, I may have left a bug or two, or didn't think of better ways to implement this.
Be free to open an issue, contribute with PRs and contact me at luciano@ratamero.com
.
.. _API Star: https://github.com/encode/apistar
Changelog
0.1.1
'''''
- adds README.rst as long description on PyPI
0.1.0
'''''
- initial version
FAQs
CORS support for API Star via event hooks.
We found that apistar-cors-hooks demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.