X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2app%2Fentrypoints%2Fflask_application.py;h=d55b50ad24beaab10ecbf3df1141d1d3fc17ae28;hb=1abc5e828314695ea32221c28e8540453794239b;hp=e464de302fa69516590ca05e26feec946b4e660c;hpb=9c9fde8a0fd391b71753e51ae8b8bdd4531d79aa;p=pti%2Fo2.git diff --git a/o2app/entrypoints/flask_application.py b/o2app/entrypoints/flask_application.py index e464de3..d55b50a 100644 --- a/o2app/entrypoints/flask_application.py +++ b/o2app/entrypoints/flask_application.py @@ -25,8 +25,10 @@ from o2common.authmw import authprov from o2common.config.config import get_review_url from o2common.helper import o2logging +AUTH_ENABLED = True +FLASK_API_VERSION = '1.0.0' + # apibase = config.get_o2ims_api_base() -auth = True app = Flask(__name__) logger = o2logging.get_logger(__name__) @@ -39,9 +41,7 @@ def _get_k8s_url(): raise Exception('Get k8s token review url failed') -FLASK_API_VERSION = '1.0.0' - -if auth: +if AUTH_ENABLED: # perform service account identity&privilege check. _get_k8s_url() ad = authprov.auth_definer('ad') @@ -52,9 +52,11 @@ app.config.SWAGGER_UI_DOC_EXPANSION = 'list' # app.config['RESTX_MASK_HEADER'] = 'fields' app.config['RESTX_MASK_SWAGGER'] = False app.config['ERROR_INCLUDE_MESSAGE'] = False -api = Api(app, version=FLASK_API_VERSION, - title='INF O2 Services API', - description='Swagger OpenAPI document for the INF O2 Services', +api = Api( + app, version=FLASK_API_VERSION, + catch_all_404s=True, + title='INF O2 Services API', + description='Swagger OpenAPI document for the INF O2 Services', ) bus = bootstrap.bootstrap()