
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Hierarchical YAML config reader that reads from multiple files and an environment variable
A library that makes it easy to load YAML config files in a hierarchical
manner. Also loads YAML content from CONFIG
environment variable.
Minimal Python version is Python 3.5.
pip install magnet
Consider the following yaml file config/default.yml
:
app:
url: https://www.example.com/app
certs:
pem: /path/to/cert.pem
key: /path/to/cert.key
clients:
- a
- b
And the following config/local.yml
file:
app:
url: https://app.example.com/
from magnet import Config
config = Config().read_all()
config['app.url'] # ==> "https://app.example.com"
config['app.certs.pem'] # ==> "/path/to/cert.pem"
config['non.existing.key'] # ==> raises KeyError
from magnet import Config
# Listed below are the default parameters
config = Config(
config={
# set default configuration here
},
filenames=(
'config/default.yml',
'config/local.yml',
),
env_variable='CONFIG',
separator='.',
)
config.read_all(
filename=None, # string, can be set to load an additional file
)
This will load the configuration in the following order:
./config/default.yml
- can be committed to the repository./config/local.yml
- should not be committed to allow custom config for devsfilename
argument is defined)CONFIG
environment variable (if env_variable
is defined)All of these files are optional, but the key lookups will result with
KeyError
if a key is missing. If filename
is defined, but the file is not
found, it will raise a FileNotFoundError
.
make ci - Run the CI pipeline (deps, lint, test-coverage)
make lint - Lint all project files
make test - Run all tests
make test-watch - Run all tests and re-run on file changes
make test-coverage - Run all tests and calculate test coverage
make deps - Create a virtual environment and install dependencies
make freeze - Freeze the requirements
make env - Create a virtual environment
FAQs
Hierarchical YAML config reader that reads from multiple files and an environment variable
We found that magnet 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 flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.