Small connexion extension to add authentication into spec routes
Project description
Connexion Auth Paths Extended
Small connexion extension to add authentication into spec routes
The connexion framework
it's possible to use an parameter called auth_all_paths
(in FlaskApp
and AioHttpApp
), which in your docuemntation (link) is defined as:
:param auth_all_paths: whether to authenticate not defined paths
:type auth_all_paths: bool
And it can be used this way, during app initialization:
connexion_app = FlaskApp(
__name__,
specification_dir='.',
auth_all_paths=True
)
But the only routes added to the authentication are the 404 Error route
(link) routes, but there are other routes that should also be treated:
/openapi.json
/openapi.yaml
openapi_spec_path
The idea of this extension is to apply the default authentication on these routes, without changing the behavior of anything else.
Installation
Install connexion-auth-paths-extd
with pip
:
pip install connexion-auth-paths-extd
Usage/Examples
from connexion.extended.auth_paths_extd import FlaskApp
def create_app():
connexion_app = FlaskApp(
__name__,
specification_dir='.',
auth_all_paths=True
)
A better exemple is on examples folder.
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
Hashes for connexion_auth_paths_extd-0.0.2.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 184e33427600d84bc99be1f02a50d183dbcb578688d2c912b3f75810e18cb8f9 |
|
MD5 | 1328443375de645e06f82ef3f4e60e7e |
|
BLAKE2b-256 | eb830cf99e7089fc85127e18205b240859739faf5a39ede70c44161f2a99c440 |
Hashes for connexion_auth_paths_extd-0.0.2.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb770289ef7be145663781e1c45c00a9fc936f3159807ae62aa14697af650134 |
|
MD5 | eac7b1745ff1f47aa1556a4f0dd5e3a5 |
|
BLAKE2b-256 | fcaf934378cb62d8744fd826d00a010310f80dfcd8a65c9659de48ecca406cff |