Skip to content

Commit 9f7fe48

Browse files
committed
Added JWT Module for Ellar
0 parents  commit 9f7fe48

28 files changed

+1507
-0
lines changed

.dockerignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.pyc
2+
.venv*
3+
.vscode
4+
.mypy_cache
5+
.coverage
6+
htmlcov
7+
8+
dist
9+
test.py

.flake8

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
max-line-length = 88
3+
ignore = E203, E241, E501, W503, F811
4+
exclude =
5+
.git,
6+
__pycache__
7+
.history
8+
tests/demo_project

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: monthly

.github/workflows/publish.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: 3.8
17+
- name: Install Flit
18+
run: pip install flit
19+
- name: Install Dependencies
20+
run: flit install --symlink
21+
- name: Publish
22+
env:
23+
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
24+
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
25+
run: flit publish

.github/workflows/test.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [assigned, opened, synchronize, reopened]
7+
8+
jobs:
9+
test_coverage:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.8
18+
- name: Install Flit
19+
run: pip install flit
20+
- name: Install Dependencies
21+
run: flit install --symlink
22+
- name: Test
23+
run: make test-cov
24+
- name: Coverage
25+
uses: codecov/[email protected]

.github/workflows/test_full.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Full Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [assigned, opened, synchronize, reopened]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ['3.8', '3.9', '3.10', '3.11']
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install Flit
22+
run: pip install flit
23+
- name: Install Dependencies
24+
run: flit install --symlink
25+
- name: Test
26+
run: pytest tests
27+
28+
codestyle:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Set up Python
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: 3.8
36+
- name: Install Flit
37+
run: pip install flit
38+
- name: Install Dependencies
39+
run: flit install --symlink
40+
- name: Black
41+
run: black --check ellar_jwt tests
42+
- name: isort
43+
run: isort --check ellar_jwt tests
44+
- name: Flake8
45+
run: flake8 ellar_jwt tests
46+
- name: mypy
47+
run: mypy ellar_jwt

.gitignore

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
*.pyc
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
cover/
55+
56+
# Translations
57+
# *.mo Needs to come with the package
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
.pybuilder/
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
.python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
100+
__pypackages__/
101+
102+
# Celery stuff
103+
celerybeat-schedule
104+
celerybeat.pid
105+
106+
# SageMath parsed files
107+
*.sage.py
108+
109+
# Environments
110+
.env
111+
.venv
112+
.vscode
113+
.mypy_cache
114+
.coverage
115+
htmlcov
116+
117+
dist
118+
test.py
119+
120+
docs/site
121+
122+
.DS_Store
123+
.idea
124+
local_install.sh
125+
dist
126+
test.py
127+
128+
docs/site
129+
site/

.isort.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
profile = black
3+
combine_as_imports = true

.pre-commit-config.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- repo: https://github.com/asottile/yesqa
7+
rev: v1.3.0
8+
hooks:
9+
- id: yesqa
10+
- repo: local
11+
hooks:
12+
- id: code_formatting
13+
args: []
14+
name: Code Formatting
15+
entry: "make fmt"
16+
types: [python]
17+
language_version: python3.8
18+
language: python
19+
- id: code_linting
20+
args: [ ]
21+
name: Code Linting
22+
entry: "make lint"
23+
types: [ python ]
24+
language_version: python3.8
25+
language: python
26+
- repo: https://github.com/pre-commit/pre-commit-hooks
27+
rev: v2.3.0
28+
hooks:
29+
- id: end-of-file-fixer
30+
exclude: >-
31+
^examples/[^/]*\.svg$
32+
- id: requirements-txt-fixer
33+
- id: trailing-whitespace
34+
types: [python]
35+
- id: check-case-conflict
36+
- id: check-json
37+
- id: check-xml
38+
- id: check-executables-have-shebangs
39+
- id: check-toml
40+
- id: check-xml
41+
- id: check-yaml
42+
- id: debug-statements
43+
- id: check-added-large-files
44+
- id: check-symlinks
45+
- id: debug-statements
46+
exclude: ^tests/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2023 Ezeudoh Tochukwu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

Makefile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.PHONY: help docs
2+
.DEFAULT_GOAL := help
3+
4+
help:
5+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6+
7+
clean: ## Removing cached python compiled files
8+
find . -name \*pyc | xargs rm -fv
9+
find . -name \*pyo | xargs rm -fv
10+
find . -name \*~ | xargs rm -fv
11+
find . -name __pycache__ | xargs rm -rfv
12+
13+
install: ## Install dependencies
14+
flit install --deps develop --symlink
15+
16+
install-full: ## Install dependencies
17+
make install
18+
pre-commit install -f
19+
20+
lint: ## Run code linters
21+
black --check ellar_jwt tests
22+
isort --check ellar_jwt tests
23+
autoflake --remove-unused-variables --remove-unused-variables -r ellar_jwt tests
24+
flake8 ellar_jwt tests
25+
mypy ellar_jwt
26+
27+
fmt format: ## Run code formatters
28+
black ellar_jwt tests
29+
isort ellar_jwt tests
30+
31+
test: ## Run tests
32+
pytest tests
33+
34+
test-cov: ## Run tests with coverage
35+
pytest --cov=ellar_jwt --cov-report term-missing tests
36+
37+
pre-commit-lint: ## Runs Requires commands during pre-commit
38+
make clean
39+
make fmt
40+
make lint

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<p align="center">
2+
<a href="#" target="blank"><img src="https://eadwincode.github.io/ellar/img/EllarLogoB.png" width="200" alt="Ellar Logo" /></a>
3+
</p>
4+
5+
<p align="center">A rate limiting module for Ellar</p>
6+
7+
![Test](https://github.com/eadwinCode/ellar-jwt/actions/workflows/test_full.yml/badge.svg)
8+
![Coverage](https://img.shields.io/codecov/c/github/eadwinCode/ellar-jwt)
9+
[![PyPI version](https://badge.fury.io/py/ellar-throttler.svg)](https://badge.fury.io/py/ellar-jwt)
10+
[![PyPI version](https://img.shields.io/pypi/v/ellar-throttler.svg)](https://pypi.python.org/pypi/ellar-jwt)
11+
[![PyPI version](https://img.shields.io/pypi/pyversions/ellar-throttler.svg)](https://pypi.python.org/pypi/ellar-jwt)
12+
13+
14+
## Introduction
15+
JWT utilities module for Ellar.
16+
17+
18+
## Installation
19+
```shell
20+
$(venv) pip install ellar-jwt
21+
```

0 commit comments

Comments
 (0)