
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).
A Python library for managing exit handlers with enhanced features like decorators, UUID tracking, and LIFO execution.
A Python library for managing exit handlers with enhanced features like decorators, UUID tracking, and LIFO execution.
pip install easy-exit-calls
from easy_exit_calls import register_exit_handler
@register_exit_handler
def cleanup():
print("Cleaning up resources...")
# Exiting the program will automatically trigger this handler.
from easy_exit_calls import register_exit_handler
@register_exit_handler("arg1", key="value")
def cleanup_with_args(arg1, key=None):
print(f"Cleaning up with {arg1} and {key}")
# Handler called with provided args/kwargs on exit.
from easy_exit_calls import ExitCallHandler
def manual_cleanup():
print("Manual cleanup")
ExitCallHandler().register_handler(manual_cleanup)
# Exiting the program will manually trigger this handler.
from easy_exit_calls import ExitCallHandler
def cleanup():
print("Cleaning up resources...")
handler_uuid = ExitCallHandler().register_handler(cleanup)
# Unregister the handler by UUID.
ExitCallHandler().unregister_by_uuid(handler_uuid)
from easy_exit_calls import register_exit_handler
@register_exit_handler
def first_handler():
print("First handler")
@register_exit_handler
def second_handler():
print("Second handler")
# Output on exit:
# Second handler
# First handler
# (LIFO execution order)
ExitCallHandler
Singleton class managing exit handlers.
register_handler(func: Callable, *args, **kwargs) -> str
:
Register a new exit handler with optional args/kwargs. Returns the UUID of the handler.unregister_by_uuid(uuid)
:
Unregister a handler by UUID.unregister_handler(func, *args, **kwargs)
:
Unregister a handler by function reference and optional args/kwargs.call_handlers()
:
Manually call all registered handlers.register_exit_handler
Decorator for registering a function as an exit handler.
*handler_args
:
Optional arguments to pass to the handler function.**handler_kwargs
:
Optional keyword arguments to pass to the handler function.Contributions are welcome! Here's how you can get started:
git checkout -b feature-branch
).git commit -m 'Add feature'
).git push origin feature-branch
).This project is released under the MIT License.
FAQs
A Python library for managing exit handlers with enhanced features like decorators, UUID tracking, and LIFO execution.
We found that easy-exit-calls 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.