From 62d10b1b3809e239145a5e7bbca48ca7b525afc6 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 24 Aug 2017 17:00:55 -0400 Subject: [PATCH] Deprecate Authorize class and any_auth function The Authorize class in salt.auth is not used in Salt code any where and is dead code. This puts a deprecation path on the class. The salt.utils.minions.CkMinions.any_auth functions is also marked for deprecation. This function is only called by the "rights_check" function in the Authorize class. Since the Authorize class will be removed in Salt Neon, then the any_auth function should be removed in Neon as well. --- salt/auth/__init__.py | 8 ++++++++ salt/utils/minions.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index 0abd532388b1..96a8786daa20 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -31,6 +31,7 @@ import salt.utils import salt.utils.files import salt.utils.minions +import salt.utils.versions import salt.payload log = logging.getLogger(__name__) @@ -410,6 +411,13 @@ class Authorize(object): The authorization engine used by EAUTH ''' def __init__(self, opts, load, loadauth=None): + salt.utils.versions.warn_until( + 'Neon', + 'The \'Authorize\' class has been deprecated. Please use the ' + '\'LoadAuth\', \'Reslover\', or \'AuthUser\' classes instead. ' + 'Support for the \'Authorze\' class will be removed in Salt ' + '{version}.' + ) self.opts = salt.config.master_config(opts['conf_file']) self.load = load self.ckminions = salt.utils.minions.CkMinions(opts) diff --git a/salt/utils/minions.py b/salt/utils/minions.py index b0889cb1e842..43f875dc24ab 100644 --- a/salt/utils/minions.py +++ b/salt/utils/minions.py @@ -723,6 +723,13 @@ def any_auth(self, form, auth_list, fun, arg, tgt=None, tgt_type='glob'): ''' Read in the form and determine which auth check routine to execute ''' + # This function is only called from salt.auth.Authorize(), which is also + # deprecated and will be removed in Neon. + salt.utils.versions.warn_until( + 'Neon', + 'The \'any_auth\' function has been deprecated. Support for this ' + 'function will be removed in Salt {version}.' + ) if form == 'publish': return self.auth_check( auth_list,