Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
基于Flask的路由工具库,集成登录验证、权限控制、日志记录、RESTful API快速构建等功能。
pip install zrouter
# 定义路由器
router = Router('body', __name__, url_prefix='/body')
# 添加单一路由
@router.add('/article', methods=['GET'])
def get_article(article_id: int):
return ArticleMapper.get_json(article_id)
@ router.add('/article', methods=['POST'])
def post_article(article_id: int, data: dict):
return ArticleMapper.update(article_id, data)
# 添加REST资源
router.add_resource('/metric', MetricResource)
# 批量添加REST资源
router.add_resources({
'/metric': MetricResource,
'/sport': SportResource,
'/entry': EntryResource,
'/entry/stat': EntryStatResource,
'/punch': PunchResource,
'/punch/stat': PunchStatResource
})
通过继承实现用户验证方法、错误处理方法。
from zrouter import Router as Router_
class Router(Router_):
def verify_user(self):
# 通过继承在此添加代码,实现用户验证、日志记录
def handle_error(self, e):
# 通过继承在此添加代码,实现错误处理
FAQs
zen router library
We found that zrouter 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.