semvec/pypi-packages huggingface dataset:
is-safe-url 1.0
Django's is_safe_url() bundled as a standalone package.
License: BSD


# `is_safe_url()`

Redirecting a visitor to another URL is common. It's also common that the 
redirect target is controllable by a visitor. One can often find a `?next` or
`?on_complete` GET parameter with the redirect target.

While this form of redirection is convenient, blindly redirecting a visitor to
the given target can easily lead to [Unvalidated Redirect and Forwards](https://www.owasp.org/index.php/Unvalidated_Redirects_and_Forwards_Cheat_Sheet).
Thus, one needs to check if the redirect target is "safe" before redirecting a
visitor.

The [Django web framework](https://djangoproject.com) has a utility function
`is_safe_url()` that attempts to validate a given target against a set of valid
hosts. This package unbundles the function and easily allows other projects to
use it.

```python
>>> from is_safe_url import is_safe_url
>>> is_safe_url("/redirect/target", {"example.com", "www.example.com"})
True
>>> is_safe_url("//example.com/redirect/target", {"example.com", "www.example.com"})
True
>>> is_safe_url("//evil.net/redirect/target", {"example.com"})
False
>>> is_safe_url("http://example.com/redirect/target", {"example.com"})
True
>>> is_safe_url("http://example.com/redirect/target", {"example.com"}, require_https=True)
False
>>> is_safe_url("https://example.com/redirect/target", {"example.com"}, require_https=True)
True
```

# Security

Please report security issues **privately** to the
[Django security team](security@djangoproject.com) or
[Markus Holtermann](info+security+is-safe-url@markusholtermann.eu).
kinesisloghandler 0.0.3
Python logging handler for sending logs to AWS Kinesis
License: BSD
Requires Python: >=3.5

Kinesis Log Handler
===================

|Build Status| |codecov|

Python logging handler for sending logs to AWS Kinesis

Requirements
============

-  Python 3.5+
-  boto3

Installation
============

Install and update using pip

.. code:: bash

    pip install -U kinesisloghandler

A Simple Example
================

.. code:: python

    import logging
    from kinesis_log_handler.firehose import FirehoseHandler

    logger = logging.getLogger('neil')
    fh = FirehoseHandler(
        delivery_stream_name='your_kinesis_stream_name',
        region_name='ap-northeast-1')
    logger.addHandler(fh)

    logger.warning('Warning!')

TODO
====

    -  Emit asynchronously

.. |Build Status| image:: https://travis-ci.com/neillab/kinesis_log_handler.svg?branch=master
   :target: https://travis-ci.com/neillab/kinesis_log_handler
.. |codecov| image:: https://codecov.io/gh/neillab/kinesis_log_handler/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/neillab/kinesis_log_handler