Skip to content

Commit 9dcbe0b

Browse files
committed
Restructure project
1 parent 54a2b62 commit 9dcbe0b

File tree

19 files changed

+65
-48
lines changed

19 files changed

+65
-48
lines changed

.github/workflows/python-publish.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ name: pypi-publish
22

33
on:
44
release:
5-
types: [
6-
"published",
7-
"edited",
8-
]
5+
types: [ published ]
96
workflow_dispatch:
107

118
jobs:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ venv
44
dist/
55
.DS_Store
66
__pycache__/
7-
FastAPIAuthenticator.egg-info/
7+
FastAPI_UI_Auth.egg-info/

README.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FastAPIAuthenticator
1+
# FastAPIUIAuth
22

33
Python module to add username and password authentication to specific FastAPI routes
44

@@ -8,20 +8,24 @@ Python module to add username and password authentication to specific FastAPI ro
88

99
![Platform][label-platform]
1010

11-
## Installation
11+
**Deployments**
1212

13-
```shell
14-
repo="thevickypedia/FastAPIAuthenticator"
13+
[![pypi][label-actions-pypi]][gha_pypi]
1514

16-
latest=$(curl -s https://api.github.com/repos/${repo}/tags | jq -r '.[0].name')
15+
[![Pypi][label-pypi]][pypi]
16+
[![Pypi-format][label-pypi-format]][pypi-files]
17+
[![Pypi-status][label-pypi-status]][pypi]
1718

18-
pip install "git+https://github.com/${repo}.git@${latest}"
19+
## Installation
20+
21+
```shell
22+
pip install FastAPI-UI-Auth
1923
```
2024

2125
## Usage
2226

2327
```python
24-
import fastapiauthenticator as api
28+
import uiauth
2529

2630
from fastapi import FastAPI
2731

@@ -34,16 +38,16 @@ async def public_route():
3438
async def private_route():
3539
return {"message": "This is a private route"}
3640

37-
api.protect(
41+
uiauth.protect(
3842
app=app,
39-
params=api.Parameters(
43+
params=uiauth.Parameters(
4044
path="/private",
4145
function=private_route
4246
)
4347
)
4448
```
4549

46-
> `FastAPIAuthenticator` supports both `APIRoute` and `APIWebSocketRoute` routes.<br>
50+
> `FastAPI-UI-Auth` supports both `APIRoute` and `APIWebSocketRoute` routes.<br>
4751
> Refer [samples] directory for different use-cases.
4852
4953
## Coding Standards
@@ -73,6 +77,11 @@ python -m pip install sphinx==5.1.1 pre-commit recommonmark
7377
pre-commit run --all-files
7478
```
7579

80+
## Pypi Package
81+
[![pypi-module][label-pypi-package]][pypi-repo]
82+
83+
[https://pypi.org/project/FastAPI-UI-Auth/][pypi]
84+
7685
## License & copyright
7786

7887
&copy; Vignesh Rao
@@ -82,12 +91,23 @@ Licensed under the [MIT License][license]
8291
[//]: # (Labels)
8392

8493
[3.11]: https://docs.python.org/3/whatsnew/3.11.html
85-
[license]: https://github.com/thevickypedia/FastAPIAuthenticator/blob/main/LICENSE
94+
[license]: https://github.com/thevickypedia/FastAPI-UI-Auth/blob/main/LICENSE
8695
[google-docs]: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
8796
[pep8]: https://www.python.org/dev/peps/pep-0008/
8897
[isort]: https://pycqa.github.io/isort/
89-
[samples]: https://github.com/thevickypedia/FastAPIAuthenticator/tree/main/samples
98+
[samples]: https://github.com/thevickypedia/FastAPI-UI-Auth/tree/main/samples
9099

100+
[label-actions-pypi]: https://github.com/thevickypedia/FastAPI-UI-Auth/actions/workflows/python-publish.yml/badge.svg
101+
[label-pypi]: https://img.shields.io/pypi/v/FastAPI-UI-Auth
102+
[label-pypi-format]: https://img.shields.io/pypi/format/FastAPI-UI-Auth
103+
[label-pypi-status]: https://img.shields.io/pypi/status/FastAPI-UI-Auth
104+
[label-pypi-package]: https://img.shields.io/badge/Pypi%20Package-FastAPI-UI-Auth-blue?style=for-the-badge&logo=Python
91105
[label-pyversion]: https://img.shields.io/badge/python-3.11%20%7C%203.12-blue
92106
[label-platform]: https://img.shields.io/badge/Platform-Linux|macOS|Windows-1f425f.svg
93-
[release-notes]: https://github.com/thevickypedia/FastAPIAuthenticator/blob/main/release_notes.rst
107+
[release-notes]: https://github.com/thevickypedia/FastAPI-UI-Auth/blob/main/release_notes.rst
108+
109+
[gha_pypi]: https://github.com/thevickypedia/FastAPI-UI-Auth/actions/workflows/python-publish.yml
110+
111+
[pypi]: https://pypi.org/project/FastAPI-UI-Auth
112+
[pypi-files]: https://pypi.org/project/FastAPI-UI-Auth/#files
113+
[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/

fastapiauthenticator/__init__.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ readme = "README.md"
66
requires-python = ">=3.11"
77

88
[tool.setuptools]
9-
packages = ["fastapiauthenticator", "fastapiauthenticator.templates"]
9+
packages = ["uiauth", "uiauth.templates"]
1010
[tool.setuptools.package-data]
11-
"fastapiauthenticator.templates" = ["*.html"]
11+
"uiauth.templates" = ["*.html"]
1212

1313
[tool.setuptools.dynamic]
1414
dependencies = { file = ["requirements.txt"] }
15-
version = { attr = "fastapiauthenticator.version.version" }
15+
version = { attr = "uiauth.version.version" }
1616

1717
[project.optional-dependencies]
1818
dev = [

release_notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ v0.0.1 (06/22/2025)
1818
-------------------
1919
- Create a base python module to enable ``username``/``password`` authentication for any specific route
2020
- Transmits ``username`` and ``password`` securely by encrypting ``credentials`` → ``hex`` → ``hash + timestamp``
21-
- Includes basic UI templates for login
21+
- Includes basic templates for UI authentication
2222
- **Full Changelog**: https://github.com/thevickypedia/FastAPIAuthenticator/compare/v0.0.0-a...v0.0.1
2323

2424
v0.0.0-a (06/21/2025)

samples/sample1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
55
from fastapi.routing import APIRoute
66

7-
import fastapiauthenticator as auth
7+
import uiauth
88

99

1010
def root_page() -> RedirectResponse:
@@ -38,9 +38,9 @@ def secure_function(_: Request) -> HTMLResponse:
3838
),
3939
]
4040
)
41-
auth.protect(
41+
uiauth.protect(
4242
app=app,
43-
params=auth.Parameters(
43+
params=uiauth.Parameters(
4444
path="/sensitive-data",
4545
function=secure_function,
4646
),

samples/sample2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from fastapi.responses import FileResponse, HTMLResponse
66
from fastapi.routing import APIWebSocketRoute
77

8-
import fastapiauthenticator as auth
8+
import uiauth
99

1010
app = FastAPI()
1111

@@ -81,18 +81,18 @@ async def send_wave_command(command: str):
8181
return {"status": f"Command '{command}' sent."}
8282

8383

84-
auth.protect(
84+
uiauth.protect(
8585
app=app,
8686
params=[
87-
auth.Parameters(
87+
uiauth.Parameters(
8888
function=get_siriwave_js,
8989
path="/siriwave.js",
9090
),
91-
auth.Parameters(
91+
uiauth.Parameters(
9292
function=index,
9393
path="/",
9494
),
95-
auth.Parameters(
95+
uiauth.Parameters(
9696
function=websocket_endpoint,
9797
route=APIWebSocketRoute,
9898
path="/ws",

uiauth/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from uiauth.enums import APIEndpoints, APIMethods # noqa: F401,E402
2+
from uiauth.models import Parameters # noqa: F401,E402
3+
from uiauth.service import FastAPIUIAuth # noqa: F401,E402
4+
from uiauth.version import version # noqa: F401,E402
5+
6+
protect = FastAPIUIAuth
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from fastapi.requests import Request
22
from fastapi.responses import HTMLResponse
33

4-
from fastapiauthenticator import enums, models, utils
5-
from fastapiauthenticator.version import version
4+
from uiauth import enums, models, utils
5+
from uiauth.version import version
66

77

88
def session(request: Request) -> HTMLResponse:

0 commit comments

Comments
 (0)