| Name | gspot-fastapi-auth JSON |
| Version |
0.0.6
|
| download | |
| home_page | |
| Summary | GSpot authentication package for FastApi |
| upload_time | 2023-07-21 12:33:35 |
| maintainer | |
| docs_url | None |
| author | |
| requires_python | >=3.10 |
| license | |
| keywords | |
| VCS | ![]() |
| bugtrack_url | |
| requirements | add-trailing-comma anyio black bleach certifi cffi charset-normalizer click cryptography docutils factory-boy faker fastapi flake8 gspot-fastapi-auth h11 httpcore httpx idna importlib-metadata isort jaraco-classes jeepney keyring markdown-it-py mccabe mdurl more-itertools mypy-extensions packaging pathspec pkginfo platformdirs pycodestyle pycparser pydantic pyflakes pygments python-dateutil readme-renderer redis requests requests-toolbelt rfc3986 rich secretstorage six sniffio starlette tokenize-rt twine typing-extensions urllib3 uvicorn webencodings zipp |
| Travis-CI | No Travis. |
| coveralls test coverage | No coveralls. |
# GSpot authentication package
This package allows you to authorize users through a shared redis
## Install package
```shell
pip install gspot-fastapi-auth
```
## Define env variables
- `REDIS_AUTH_ACCESS_PREFIX` default ''
- `REDIS_AUTH_DB` default 0
- `REDIS_AUTH_HOST` default 127.0.0.1
- `REDIS_AUTH_PORT` default 6379
- `REDIS_AUTH_PASSWORD` default None
- `REDIS_AUTH_TOKEN_STORAGE` default 'headers' should be 'cookies'
## Define startapp and shutdown logic
```python
from contextlib import asynccontextmanager
from fastapi import FastAPI
from src.gspot_fastapi_auth import token_config
from gspot_fastapi_auth.providers import RedisSingleton
@asynccontextmanager
async def lifespan(app: FastAPI):
RedisSingleton.init_redis(
token_config.HOST,
token_config.PORT,
token_config.DB,
token_config.PASSWORD
)
yield
await RedisSingleton().close()
app = FastAPI(lifespan=lifespan)
```
## Use in view
```python
from gspot_fastapi_auth import UserRedisAuth
@app.get("/")
async def read_root(user=Depends(UserRedisAuth())):
return user.to_dict()
```
{
"_id": null,
"home_page": "",
"name": "gspot-fastapi-auth",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "",
"author": "",
"author_email": "gravity48 <gravity4849@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/51/41/6079191dc4e42cd9f18180379f1452fc9d31522b5718b6eeb12b2b100bcc/gspot_fastapi_auth-0.0.6.tar.gz",
"platform": null,
"description": "# GSpot authentication package\n\nThis package allows you to authorize users through a shared redis\n\n## Install package\n```shell\npip install gspot-fastapi-auth\n```\n\n## Define env variables\n\n- `REDIS_AUTH_ACCESS_PREFIX` default ''\n- `REDIS_AUTH_DB` default 0\n- `REDIS_AUTH_HOST` default 127.0.0.1\n- `REDIS_AUTH_PORT` default 6379\n- `REDIS_AUTH_PASSWORD` default None\n- `REDIS_AUTH_TOKEN_STORAGE` default 'headers' should be 'cookies'\n\n## Define startapp and shutdown logic\n\n```python\nfrom contextlib import asynccontextmanager\n\nfrom fastapi import FastAPI\n\nfrom src.gspot_fastapi_auth import token_config\nfrom gspot_fastapi_auth.providers import RedisSingleton\n\n@asynccontextmanager\nasync def lifespan(app: FastAPI):\n RedisSingleton.init_redis(\n token_config.HOST,\n token_config.PORT,\n token_config.DB,\n token_config.PASSWORD\n )\n yield\n await RedisSingleton().close()\n\n\napp = FastAPI(lifespan=lifespan)\n\n```\n\n## Use in view\n```python\nfrom gspot_fastapi_auth import UserRedisAuth\n\n@app.get(\"/\")\nasync def read_root(user=Depends(UserRedisAuth())):\n return user.to_dict()\n\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "GSpot authentication package for FastApi",
"version": "0.0.6",
"project_urls": {
"Bug Tracker": "https://github.com/gravity48/gspot_fastapi_auth/issues",
"Homepage": "https://github.com/gravity48/gspot_fastapi_auth"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4c736bdb719ed36596233e87dfe37c2e9f5c12e6e9cef2dfe93bc9dcdef8c27e",
"md5": "daf4a3a38eb390ee77a993c4b8b557be",
"sha256": "771642ba79702c47fba7ef848822457916300b6b0ecbe4beab6e66e3733c0437"
},
"downloads": -1,
"filename": "gspot_fastapi_auth-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "daf4a3a38eb390ee77a993c4b8b557be",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 6859,
"upload_time": "2023-07-21T12:33:34",
"upload_time_iso_8601": "2023-07-21T12:33:34.397451Z",
"url": "https://files.pythonhosted.org/packages/4c/73/6bdb719ed36596233e87dfe37c2e9f5c12e6e9cef2dfe93bc9dcdef8c27e/gspot_fastapi_auth-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "51416079191dc4e42cd9f18180379f1452fc9d31522b5718b6eeb12b2b100bcc",
"md5": "db7d68597d79afaca1154488ea02c1d5",
"sha256": "4f6f72c6375cdcbf05f60e938de4ba875c4d6b03a2d8b0d93e51fe329515aa66"
},
"downloads": -1,
"filename": "gspot_fastapi_auth-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "db7d68597d79afaca1154488ea02c1d5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 7241,
"upload_time": "2023-07-21T12:33:35",
"upload_time_iso_8601": "2023-07-21T12:33:35.699826Z",
"url": "https://files.pythonhosted.org/packages/51/41/6079191dc4e42cd9f18180379f1452fc9d31522b5718b6eeb12b2b100bcc/gspot_fastapi_auth-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-21 12:33:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gravity48",
"github_project": "gspot_fastapi_auth",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "add-trailing-comma",
"specs": [
[
"==",
"2.5.1"
]
]
},
{
"name": "anyio",
"specs": [
[
"==",
"3.7.0"
]
]
},
{
"name": "black",
"specs": [
[
"==",
"23.3.0"
]
]
},
{
"name": "bleach",
"specs": [
[
"==",
"6.0.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2023.5.7"
]
]
},
{
"name": "cffi",
"specs": [
[
"==",
"1.15.1"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.1.0"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.3"
]
]
},
{
"name": "cryptography",
"specs": [
[
"==",
"41.0.1"
]
]
},
{
"name": "docutils",
"specs": [
[
"==",
"0.20.1"
]
]
},
{
"name": "factory-boy",
"specs": [
[
"==",
"3.2.1"
]
]
},
{
"name": "faker",
"specs": [
[
"==",
"18.11.2"
]
]
},
{
"name": "fastapi",
"specs": [
[
"==",
"0.98.0"
]
]
},
{
"name": "flake8",
"specs": [
[
"==",
"6.0.0"
]
]
},
{
"name": "gspot-fastapi-auth",
"specs": [
[
"==",
"0.0.4"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.14.0"
]
]
},
{
"name": "httpcore",
"specs": [
[
"==",
"0.17.2"
]
]
},
{
"name": "httpx",
"specs": [
[
"==",
"0.24.1"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.4"
]
]
},
{
"name": "importlib-metadata",
"specs": [
[
"==",
"6.7.0"
]
]
},
{
"name": "isort",
"specs": [
[
"==",
"5.12.0"
]
]
},
{
"name": "jaraco-classes",
"specs": [
[
"==",
"3.2.3"
]
]
},
{
"name": "jeepney",
"specs": [
[
"==",
"0.8.0"
]
]
},
{
"name": "keyring",
"specs": [
[
"==",
"24.2.0"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "mccabe",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"9.1.0"
]
]
},
{
"name": "mypy-extensions",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"23.1"
]
]
},
{
"name": "pathspec",
"specs": [
[
"==",
"0.11.1"
]
]
},
{
"name": "pkginfo",
"specs": [
[
"==",
"1.9.6"
]
]
},
{
"name": "platformdirs",
"specs": [
[
"==",
"3.8.0"
]
]
},
{
"name": "pycodestyle",
"specs": [
[
"==",
"2.10.0"
]
]
},
{
"name": "pycparser",
"specs": [
[
"==",
"2.21"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"1.10.9"
]
]
},
{
"name": "pyflakes",
"specs": [
[
"==",
"3.0.1"
]
]
},
{
"name": "pygments",
"specs": [
[
"==",
"2.15.1"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.8.2"
]
]
},
{
"name": "readme-renderer",
"specs": [
[
"==",
"40.0"
]
]
},
{
"name": "redis",
"specs": [
[
"==",
"4.6.0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.31.0"
]
]
},
{
"name": "requests-toolbelt",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "rfc3986",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.4.2"
]
]
},
{
"name": "secretstorage",
"specs": [
[
"==",
"3.3.3"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "starlette",
"specs": [
[
"==",
"0.27.0"
]
]
},
{
"name": "tokenize-rt",
"specs": [
[
"==",
"5.1.0"
]
]
},
{
"name": "twine",
"specs": [
[
"==",
"4.0.2"
]
]
},
{
"name": "typing-extensions",
"specs": [
[
"==",
"4.6.3"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.0.3"
]
]
},
{
"name": "uvicorn",
"specs": [
[
"==",
"0.22.0"
]
]
},
{
"name": "webencodings",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.15.0"
]
]
}
],
"lcname": "gspot-fastapi-auth"
}