flask_more_smorest.perms.api
Extended Flask-Smorest API with authentication and permission support.
This module provides an Api class that extends Flask-Smorest’s Api with JWT authentication, permission checking, custom schema name resolution, and health check endpoint.
Functions
|
Custom schema name resolver for OpenAPI spec. |
Classes
|
Extended Api with JWT authentication and permission checking. |
- class flask_more_smorest.perms.api.Api(app=None, *, spec_kwargs=None)[source]
Extended Api with JWT authentication and permission checking.
This class extends Flask-Smorest’s Api to automatically: - Configure JWT authentication in OpenAPI spec - Enforce authentication on non-public endpoints - Check admin permissions on admin-only endpoints - Customize schema naming for OpenAPI
Example
>>> from flask import Flask >>> from flask_more_smorest.perms import Api >>> >>> app = Flask(__name__) >>> api = Api(app)