Skip to content

Commit

Permalink
♻️ Drop External Libraries in favour of authx-extra (#506)
Browse files Browse the repository at this point in the history
♻️ Drop External Libraries in favour of `authx-extra`
  • Loading branch information
yezz123 authored Jan 14, 2024
2 parents e71ed1a + 860fd46 commit 64630b5
Show file tree
Hide file tree
Showing 51 changed files with 171 additions and 2,488 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/cache.yml

This file was deleted.

50 changes: 23 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,46 @@ jobs:
- uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files --verbose
test:
name: test on python ${{ matrix.python-version }}
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

tests:

name: test py${{ matrix.python-version }} on ${{ matrix.os }}

runs-on: ${{ matrix.os }}-latest


strategy:
fail-fast: false

matrix:
python-version: ["3.8","3.9", "3.10", "3.11", "3.12"]

python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

os: [ubuntu, macos, windows]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/all.txt
- name: Test
env:
ENV: test
REDIS_URL: "redis://0.0.0.0:6379"
run: pytest --cov=authx --cov-report=html -xv --color=yes --disable-warnings --cov-fail-under=80

- name: Freeze Dependencies
run: pip freeze

- name: Test with pytest
run: bash scripts/test.sh

- name: Upload coverage
uses: codecov/codecov-action@v3

# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check:
if: always()
needs: [lint, test]
needs: [lint, tests]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache-dependency-path: pyproject.toml
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install build
- name: check GITHUB_REF matches package version
uses: samuelcolvin/check-python-version@v4.1
with:
version_file_path: authx/__init__.py
- name: Build distribution
run: python -m build
- name: Publish
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.6
rev: v0.1.13
hooks:
- id: ruff
args:
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Add a Fully registration and authentication or authorization system to your
[FastAPI](https://fastapi.tiangolo.com/) project. **AuthX** is designed to be as
customizable and adaptable as possible.

## [Authx V0.9.x](https://authx-v0.yezz.me/)

This branch relates to development of authx V1 which is not yet ready for production use.

If you're a Authx user, you probably want either Authx V0.9 [Documentation](https://authx-v0.yezz.me/) or, [0.X.X-fix](https://github.com/yezz123/authx/tree/0.X.X-fix) git branch.
> **Notes**:
>
> [Authx V0.9.x](https://authx-v0.yezz.me/) This branch relates to development of authx V1 which is not yet ready for production use.
>
>If you're a Authx user, you probably want either Authx V0.9 [Documentation](https://authx-v0.yezz.me/) or, [0.X.X-fix](https://github.com/yezz123/authx/tree/0.X.X-fix) git branch.
## Features 🔧

Expand All @@ -55,6 +55,13 @@ If you're a Authx user, you probably want either Authx V0.9 [Documentation](http
- [x] Cookie authentication backend included
- [x] middleware for authentication and authorization through JWT.
- [x] Extensible Error Handling System.

### Extra Features 🎁

AuthX is designed to be as customizable and adaptable as possible.

So you need to install [`authx-extra`](https://github.com/yezz123/authx-extra) to get extra features.

- [x] Using Redis as a session store & cache.
- [x] Support HTTPCache.
- [x] Support Sessions and Pre-built CRUD functions and Instance to launch Redis.
Expand Down Expand Up @@ -98,7 +105,7 @@ def get_protected(token: RequestToken = Depends()):
raise HTTPException(401, detail={"message": str(e)}) from e
```

## Contributors and sponsors ✨☕️
## Contributors and sponsors 👏

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

Expand Down Expand Up @@ -150,7 +157,7 @@ This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome!

## Links 🚧
## Links 🔗

- [Homepage](https://authx.yezz.me/)
- [FAQ](https://authx.yezz.me/faq/)
Expand All @@ -160,6 +167,6 @@ specification. Contributions of any kind welcome!
- [Contributing](https://authx.yezz.me/contributing/)
- [Help - Sponsors](https://authx.yezz.me/help/)

## License 📝
## License 📄

This project is licensed under the terms of the MIT License.
2 changes: 1 addition & 1 deletion authx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Ready to use and customizable Authentications and Oauth2 management for FastAPI and Starlette."""

__version__ = "1.0.0"
__version__ = "1.0.0b0"

from authx.config import AuthXConfig
from authx.dependencies import AuthXDependency
Expand Down
2 changes: 0 additions & 2 deletions authx/_internal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from authx._internal._cache import HTTPCache
from authx._internal._callback import _CallbackHandler
from authx._internal._error import _ErrorHandler
from authx._internal._logger import get_logger, log_debug, log_error, log_info, set_log_level
Expand All @@ -13,7 +12,6 @@
"get_uuid",
"_CallbackHandler",
"_ErrorHandler",
"HTTPCache",
"get_logger",
"set_log_level",
"log_debug",
Expand Down
29 changes: 0 additions & 29 deletions authx/_internal/_cache.py

This file was deleted.

Loading

1 comment on commit 64630b5

@vercel
Copy link

@vercel vercel bot commented on 64630b5 Jan 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

authx – ./

authx-psi.vercel.app
authx.yezz.me
authx-yezz123.vercel.app
authx-git-main-yezz123.vercel.app

Please sign in to comment.