From 09fd8c14031df1049b3563c64de90a01b8c19872 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 6 Mar 2017 10:30:11 +0100 Subject: [PATCH] Mark noauth authentication as deprecated Change-Id: Iac5a286ed171b5be303b8c4ba8ad1e2a4071cbf9 --- gnocchi/rest/app.py | 6 ++++++ releasenotes/notes/deprecate-noauth-01b7e961d9a17e9e.yaml | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 releasenotes/notes/deprecate-noauth-01b7e961d9a17e9e.yaml diff --git a/gnocchi/rest/app.py b/gnocchi/rest/app.py index 05658a4b..e5ee7c14 100644 --- a/gnocchi/rest/app.py +++ b/gnocchi/rest/app.py @@ -15,6 +15,7 @@ # under the License. import os import uuid +import warnings from oslo_config import cfg from oslo_log import log @@ -107,6 +108,11 @@ def load_app(conf, indexer=None, storage=None, APPCONFIGS[configkey] = config LOG.info("WSGI config used: %s", cfg_path) + + if conf.api.auth_mode == "noauth": + warnings.warn("The `noauth' authentication mode is deprecated", + category=DeprecationWarning) + appname = "gnocchi+" + conf.api.auth_mode app = deploy.loadapp("config:" + cfg_path, name=appname, global_conf={'configkey': configkey}) diff --git a/releasenotes/notes/deprecate-noauth-01b7e961d9a17e9e.yaml b/releasenotes/notes/deprecate-noauth-01b7e961d9a17e9e.yaml new file mode 100644 index 00000000..635097c6 --- /dev/null +++ b/releasenotes/notes/deprecate-noauth-01b7e961d9a17e9e.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - The `noauth` authentication mechanism is deprecated and will be removed in + a next version.