for data authentication by middleware
Project description
Middleware Service Package
Middleware Service Package to manage the validation of client or server side requests.
- Note: Please populate the .env file with own SECRET_KEY value into your local development root directory then import the Middleware Service Package for use in local development.
set the secret key value in .env file in following way, and changes the value in place of set_own_key_value
- SECRET_KEY = set_own_key_value
For Local Development Setup
System Requirements for Middleware Service package
- Python 3.9+
- Pip 21.2.4+
Install and Create the virtual environment on current Operating System
$ pip install virtualenv
$ virtualenv myenv
Note: Above command create the myenv virtual environment folder and we can also set another name instead of myenv. then activate your virtual environment.
Check and Upgrade the pip and setuptool packages
$ python -m pip install --upgrade pip setuptools wheel
Install the Middleware Service Package in your virtual environment
$ pip3 install git+https://github.com/adcuratio/folks-middleware-service
For Succesfully Uninstall the Middleware Package
$ pip3 uninstall middleware_service
For Use Middleware Package In Local Developement
Use Middleware Package for all the api endpoints.
1. Import Middleware Package in following way
- import middleware_service
- from middleware_service import CustomMiddleware
2. Add the Middleware package with your FastApi app inside main.py File, like this
- app = FastAPI()
- app.add_middleware(CustomMiddleware)
3. Add all api router in main.py file by using ,
- app.include_router(add_api_router)
Note: If you want to use Middleware Package for the particular router of the FastApi, then use mount option inside main.py file and add middleware inside sub_main.py file in following way:
Use Middleware Package for Paticular api endpoints.
1. Import Middleware Package in following way
- import middleware_service
- from middleware_service import CustomMiddleware
2. Add the Middleware package with your FastApi app inside main.py File if you wants to add for particular api routes, like this
- app = FastAPI()
- middleware_object = CustomMiddleware
- middleware_object.add_router(router=add_api_router_name)
- app.add_middleware(middleware_object)
3. Add all api router in main.py file by using ,
- app.include_router(add_api_router)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file middleware_service-0.1.1.tar.gz.
File metadata
- Download URL: middleware_service-0.1.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58a8b6f15c7de35eec509ab6cfa28e92481e47b8fa82bc5f96a9af5b8cdc8276
|
|
| MD5 |
c144a4d1e7fd25a0dffd754cb8b787eb
|
|
| BLAKE2b-256 |
50939c02bec03cd237badf455170c8c1d4b13dd6e03b717f7d7fec67717c9e92
|
File details
Details for the file middleware_service-0.1.1-py3-none-any.whl.
File metadata
- Download URL: middleware_service-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc9b87920a9a81d890dd964e300e979ed080d11259c5a2774a8c2ddf92fee37c
|
|
| MD5 |
c94008fc2e98ce776fe758adbe8914a6
|
|
| BLAKE2b-256 |
16c554193169bb9767a772c8295693523806b82ba5504910c61b9516cb826a02
|