semvec/pypi-packages huggingface dataset:
djangorestframework-api-gateway-auth 0.2.0
Provides DRF auth classes that are ultimately backed by API Gateway
Requires Python: >=3.8,<4.0
Keywords: django,djangorestframework,drf,aws,apigateway

# Installation

```
pip install djangorestframework-api-gateway-auth
```

Or with poetry

```
poetry add djangorestframework-api-gateway-auth
```

# Usage

## BasicApiGatewayApiKeyAuth

```python
from djangorestframework_api_gateway_auth import BasicApiGatewayApiKeyAuth

@authentication_classes([BasicApiGatewayApiKeyAuth])
def endpoint(request: HttpRequest):
    # ...
```

This authenticator reads basic auth and ensures the username and password
match an API Gateway key

```
curl -u username:password -v localhost:8000/api/your/endpoint
```

Where `username` is the name of your API key and `password` is the API key
awsenv-MohamedKari 0.0.1
Simple CLI to source and cache AWS credentials
Requires Python: >=3.6

# Usage of awsenv

1. Install `boto3` to your base env

2. Add the following awsenv function to your shell resource config (e. g. .zshrc or .oh-my-zsh/custom/awsenv.zsh)

```sh
awsenv(){
  path_to_awsenv_py="$HOME/code/awsenv/awsenv.py"
  eval $(python $path_to_awsenv_py $@)
}
```

3. Add a `config.jsonc` (note the c for comment) with the following strutucture under `~/.awsenv/config.json`

```json
{
    "AWS_DEFAULT_REGION": "eu-central-1",
    "AWS_DEFAULT_OUTPUT": "json",
    "AWS_PAGER": "",

    "defaultUser": "<your-name-you-want-to-login-with-by-default,must-match-a-name-below-in-users>",
    "defaultRole": "<some-role-name>",
    "defaultAccount": "<some-account-id>",
    "defaultDuration": 3600,

    "users": {
        "<your-name-1>": {
            "AWS_ACCESS_KEY_ID": "<your-access-key>",
            "AWS_SECRET_ACCESS_KEY": "<your-secret-access-key>",
            "SERIAL_NUMBER": "<your-mfa-serial>"
        }
    },

    "predefinedShortcuts": {
        "<some-shortcut-1>": {
            "user": "<your-name>",
            "role": "<some-role-name>",
            "account": "617095144398",
            "duration": 43200
        },
        "<some-shortcut-2>": {
            "user": "<your-name>",
            "role": "<some-role-name>",
            "account": "<some-account-id>",
            "duration": 3600
        }
    }
}
```

# Development of awsenv