semvec/pypi-packages huggingface dataset:
quickauth 0.2.21
QuickAuth: A Quick User-Password Authentication for Python
Keywords: auth,authentication

=========
QuickAuth
=========

A quick user-password authentication for Python.

Installation
------------

.. code:: bash

    pip install quickauth

Usage
-----

.. code:: python

    from quickauth.core import QuickAuth
    authenticator = QuickAuth()
    print(authenticator.register())
    print(authenticator.authorize(key='fbdca934-34c0-11e9-8bb3-685b35d08286',value='579d0f25-aed1-40c4-afa8-61e11254f47e'))
    print(authenticator.update(key='fbdca934-34c0-11e9-8bb3-685b35d08286'))

Outputs:

.. code:: json

    {'key': 'fbdca934-34c0-11e9-8bb3-685b35d08286', 'secret': '579d0f25-aed1-40c4-afa8-61e11254f47e'}
    True
    {'key': 'fbdca934-34c0-11e9-8bb3-685b35d08286', 'secret': '974bc9bb-8839-4f0c-83b7-adc78cc3247d'}


Run from terminal:

.. code:: bash

    python3 -m quickauth.core [-h] [--db DB] [-k KEY] [-s SECRET] OPERATION


Positional arguments:

`OPERATION` register, authorize, or update

Optional arguments:

-h, --help                  show this help message and exit
--db DB                     database file, default: auth.db
-k KEY, --key KEY           key
-s SECRET, --secret SECRET  secret
unittest-additions 0.1.3
Additional features to extend python unittest and mock.
Keywords: unittest mock

# unittest_additions

[![pypi-version]][pypi]

Helpful extras built to make python unittesting easier.

`pip install unittest-additions`

## Features

* Additional Asserts
* Temporary Files
* Runtime Timer
* `mock_open` Line Iteration

## Example Uses

Below are some example uses for some of the features.

### Temporary Files

```python
def test_using_temp_file(self):
    with TestFile(TEST_FILE, TEST_DATA) as tf:
    	# File TEST_FILE now exists with TEST_DATA inside.
        tf.append(MORE_TEST_DATA)
        # File TEST_FILE now has TEST_DATA with MORE_TEST_DATA appended.

    # File TEST_FILE no longer exists.
```

### RunTimer

A RunTimer is provied to help compare run times of code.

```python
with RunTimer() as t:
    t0 = t.split()
    t1 = t.split()

t2 = t.overall()
```

### mock_open Line Iteration

When mocking a file using `mock_open`, "code-under-test" using line iteration (as in the example below) will not work as expected. (`do_something` will not be called.)

```python
def my_function(fn):
    with open(fn, 'r') as f:
        for l in f:
    	    do_something(l)
```

To enable line iteration you can use `add_line_iter_to_mock_open`.

```python
    @patch('builtins.open', new_callable=mock_open, read_data='line 0\nline 1\n')
    def test_function(self, open_mock):

        add_line_iter_to_mock_open(open_mock)

        # Line iteration over the mock_open read_data will now work.
```

### Additional Asserts

To use the additional asserts, add the mixin to your `TestCase` class.

```python
class MixedTestCase(TestCase, AdditionalAssertsMixin):
    def test_a_test:
        self.assertIsEmpty([])
        self.assertIsNotEmpty(('hello',))
```

The new asserts are:

| Method                  | Checks that ...
|-------------------------|----------------
| `assertIsEmpty(c)`      | `len(c) == 0`
| `assertIsNotEmpty(c)`   | `len(c) > 0`

[pypi-version]: https://img.shields.io/pypi/v/unittest-additions.svg
[pypi]: https://pypi.org/project/unittest-additions/
ansible-modules-morpheus 0.2.0
Ansible Modules for Morpheus Data

# Ansible Modules Morpheus
[![Latest Version](https://img.shields.io/pypi/v/ansible-modules-morpheus.svg)](https://pypi.python.org/pypi/ansible-modules-morpheus/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Install this module:
* via `pip`
```python
pip install ansible-modules-morpheus
```
* via `ansible-galaxy`
```python
ansible-galaxy install 'git+https://github.com/gomorpheus/ansible-modules-morpheus.git'
```
## Environment Variables
If you choose to use env vars the following variables can be exported to the environment you are controlling with ansible in order to authenticate to your Morpheus Appliance:
* MORPH_ADDR : url for Morpheus Appliance
* MORPH_AUTHTYPE: authorization type for Morpheus (token or userpass)
* MORPH_USER: Morpheus appliance username for userpass authtype
* MORPH_PASSWORD: Morpheus appliance user password for userpass authtype
* MORPH_TOKEN: Morpheus api token for token authtype
* MORPH_SSL_VERIFY: Boolean for verifying ssl

Addition variables for specific modules:
* MORPH_SECRET: Morpheus secret key for Cypher value reads in morph_cypher module

## Arguments
Alternatively you can pass arguments to the module by using discrete variables in your task module.  Args that are supported are:
* baseurl: url for Morpheus Appliance
* authtype: authorization type for Morpheus (token or userpass)
* api_token: Morpheus api token for token authtype
* username: Morpheus appliance username for userpass authtype
* password: Morpheus appliance user password for userpass authtype
* ssl_verify: Boolean for verifying SSL

For specific modules
* secret_key: Morpheus secret key for Cypher value reads in morph_cypher module

## Module Examples
### morph_cypher
```python
- hosts: foo
  tasks:
    - name: gettoken
      morph_cypher:
        baseurl: "https://sandbox.morpheusdata.com"
        secret_key: "password/spark"
        authtype: token
        ssl_verify: False
      register: results
    - debug: var=results.secret
```
or explicitly passing the api_token as a var:
```python
- hosts: foo
  tasks:
    - name: gettoken
      morph_cypher:
        baseurl: "https://sandbox.morpheusdata.com"
        secret_key: "secret/nooneknows"
        authtype: token
        api_token: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      register: results
```

## Lookup Plugin Examples
### morph_cypher
```python
- debug:
    msg: "{{ lookup('morph_cypher', 'baseurl=https://sandbox.morpheusdata.com authtype=token api_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx secret_key=password/spark')}}"

- debug:
    msg: "{{ lookup('morph_cypher', 'baseurl=https://sandbox.morpheusdata.com authtype=userpass username=slim_shady password=password secret_key=secret/hello') }}"

- debug:
    msg: "{{ lookup('morph_cypher', 'baseurl=https://sandbox.morpheusdata.com authtype=token api_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ssl_verify=False secret_key=key/256/myKey') }}"
```

## License
[MIT](https://github.com/gomorpheus/ansible-modules-morpheus/blob/master/LICENSE)