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.
evirons-serviceurl: Add service URL parsing support for environs
.. image:: https://travis-ci.org/flowroute/environs-serviceurl.svg?branch=master :target: https://travis-ci.org/flowroute/environs-serviceurl :alt: Travis-CI
environs-serviceurl is a Python library that extends the
environs <https://github.com/sloria/environs>
_ library with support for
turning service urls like postgres://user:pass@host:port/database
into
Python dictionaries.
::
$ pip install environs-serviceurl
.. code-block:: python
# export DATABASE_URL=postgres://me:sekrit@postgres.example.com:5432/catpics
# export REDIS_URL=redis://redis.example.com?dbid=3
from environs import Env
from environs_serviceurl import service_url
env = Env()
env.add_parser('service_url', service_url)
# Parse a service url.
postgres_config = env.service_url('DATABASE_URL')
# {'host': 'postgres.example.com',
# 'port': 5432,
# 'user': 'me',
# 'password': 'sekrit',
# 'extras': 'catpics'}
# Give the extras a specific name
postgres_config = env.service_url('DATABASE_URL', extras_name='database')
# {'host': 'postgres.example.com',
# 'port': 5432,
# 'user': 'me',
# 'password': 'sekrit',
# 'database': 'catpics'}
# Parse a service url with defaults, using query params for extra values.
redis_config = env.service_url('REDIS_URL', 'redis://localhost/', defaults={
'host': 'service.example.com', 'port': 6379, 'dbid': 0})
# {'host': 'redis.example.com',
# 'port': 6379,
# 'user': None,
# 'password': None,
# 'extras': None,
# 'dbid': '3'}
There's currently no way to do casting on any extras or query string paramaters. They will always be returned as string types.
MIT. See the LICENSE <https://github.com/flowroute/environs-serviceurl/blob/master/LICENSE>
_ file for details.
FAQs
Add service URL parsing support for environs
We found that environs-serviceurl 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.