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.
.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square :target: LICENSE .. image:: https://travis-ci.org/Darkheir/falcon-pagination-hook.svg?branch=master :target: https://travis-ci.org/Darkheir/falcon-pagination-hook .. image:: https://codecov.io/gh/Darkheir/falcon-pagination-hook/branch/master/graph/badge.svg :target: https://codecov.io/gh/Darkheir/falcon-pagination-hook .. image:: https://api.codacy.com/project/badge/Grade/5617fd2a2b724aaea2c0b5f440da7d3f :alt: Codacy Badge :target: https://app.codacy.com/app/Darkheir/falcon-pagination-hook?utm_source=github.com&utm_medium=referral&utm_content=Darkheir/falcon-pagination-hook&utm_campaign=Badge_Grade_Dashboard .. image:: https://pyup.io/repos/github/Darkheir/falcon-pagination-hook/shield.svg :target: https://pyup.io/repos/github/Darkheir/falcon-pagination-hook/ :alt: Updates
A small falcon hook to parse pagination elements from the request.
For now it parses an Offset based pagination.
The easiest way to use this hook is the following:
.. code:: python
@falcon.before(PaginationFromRequestHook())
def on_get(self, req, resp, user):
# Here req['context']['pagination'] is set
# with 2 keys: 'offset' and 'limit'
The Hook will look in the query parameters for 2 keys:
It will create a pagination dict into the request context accessible at :code:req.context['pagination']
.
This pagination dict will contain 2 values:
A few parameters can be passed to the hook:
Here's an example setting a default limit to 10, a maximum limit to 500 the offset key to 'page_offset' and the limit key to 'result_limit':
.. code:: python
@falcon.before(PaginationFromRequestHook(
default_limit=10,
max_limit=500,
offset_key='page_offset',
limit_key='result_limit'
))
def on_get(self, req, resp, user):
# Get request
FAQs
Falcon pagination helper
We found that falcon-pagination 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
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.