diff --git a/barbican/wsgi/__init__.py b/barbican/wsgi/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/barbican/wsgi/api.py b/barbican/wsgi/api.py new file mode 100644 index 000000000..199ab2df1 --- /dev/null +++ b/barbican/wsgi/api.py @@ -0,0 +1,23 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""WSGI application entry-point for Barbican API.""" +import threading + +from barbican.api import app + +application = None + + +with threading.Lock(): + if application is None: + application = app.get_api_wsgi_script() diff --git a/devstack/lib/barbican b/devstack/lib/barbican index 8096e0567..45611c6e2 100644 --- a/devstack/lib/barbican +++ b/devstack/lib/barbican @@ -172,7 +172,7 @@ function configure_barbican { # SimpleCryptoPlugin settings iniset $BARBICAN_CONF simple_crypto_plugin kek "$(python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode('UTF-8'))")" - write_uwsgi_config "$BARBICAN_UWSGI_CONF" "$BARBICAN_WSGI" "/key-manager" + write_uwsgi_config "$BARBICAN_UWSGI_CONF" "$BARBICAN_WSGI" "/key-manager" "" "barbican-api" ## Set up keystone # Turn on the middleware diff --git a/devstack/settings b/devstack/settings index 4b2be521c..d164c763e 100644 --- a/devstack/settings +++ b/devstack/settings @@ -22,7 +22,7 @@ else BARBICAN_BIN_DIR=$(get_python_exec_prefix) fi # WSGI variables -BARBICAN_WSGI=$BARBICAN_BIN_DIR/barbican-wsgi-api +BARBICAN_WSGI=barbican.wsgi.api:application BARBICAN_UWSGI_CONF=$BARBICAN_CONF_DIR/barbican-uwsgi.ini # Set Barbican repository diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..5e862a959 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["pbr>=6.0.0", "setuptools>=64.0.0"] +build-backend = "pbr.build" diff --git a/setup.cfg b/setup.cfg index 673ac4bc9..4d1e9515c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,6 @@ classifier = Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12