Browse Source

Merge "trivial: Mark inner method as such"

tags/16.0.0.0b2
Zuul 1 week ago
parent
commit
4f7b401fee
1 changed files with 13 additions and 13 deletions
  1. 13
    13
      openstack_auth/backend.py

+ 13
- 13
openstack_auth/backend.py View File

@@ -54,17 +54,6 @@ class KeystoneBackend(object):
54 54
 
55 55
         return self._auth_plugins
56 56
 
57
-    def check_auth_expiry(self, auth_ref, margin=None):
58
-        if not utils.is_token_valid(auth_ref, margin):
59
-            msg = _("The authentication token issued by the Identity service "
60
-                    "has expired.")
61
-            LOG.warning("The authentication token issued by the Identity "
62
-                        "service appears to have expired before it was "
63
-                        "issued. This may indicate a problem with either your "
64
-                        "server or client configuration.")
65
-            raise exceptions.KeystoneAuthException(msg)
66
-        return True
67
-
68 57
     def get_user(self, user_id):
69 58
         """Returns the current user from the session data.
70 59
 
@@ -88,6 +77,17 @@ class KeystoneBackend(object):
88 77
         else:
89 78
             return None
90 79
 
80
+    def _check_auth_expiry(self, auth_ref, margin=None):
81
+        if not utils.is_token_valid(auth_ref, margin):
82
+            msg = _("The authentication token issued by the Identity service "
83
+                    "has expired.")
84
+            LOG.warning("The authentication token issued by the Identity "
85
+                        "service appears to have expired before it was "
86
+                        "issued. This may indicate a problem with either your "
87
+                        "server or client configuration.")
88
+            raise exceptions.KeystoneAuthException(msg)
89
+        return True
90
+
91 91
     def _get_auth_backend(self, auth_url, **kwargs):
92 92
         for plugin in self.auth_plugins:
93 93
             unscoped_auth = plugin.get_plugin(auth_url=auth_url, **kwargs)
@@ -126,7 +126,7 @@ class KeystoneBackend(object):
126 126
         unscoped_auth_ref = plugin.get_access_info(unscoped_auth)
127 127
 
128 128
         # Check expiry for our unscoped auth ref.
129
-        self.check_auth_expiry(unscoped_auth_ref)
129
+        self._check_auth_expiry(unscoped_auth_ref)
130 130
 
131 131
         domain_name = kwargs.get('user_domain_name', None)
132 132
         domain_auth, domain_auth_ref = plugin.get_domain_scoped_auth(
@@ -161,7 +161,7 @@ class KeystoneBackend(object):
161 161
             raise exceptions.KeystoneAuthException(msg)
162 162
 
163 163
         # Check expiry for our new scoped token.
164
-        self.check_auth_expiry(scoped_auth_ref)
164
+        self._check_auth_expiry(scoped_auth_ref)
165 165
 
166 166
         # We want to try to use the same region we just logged into
167 167
         # which may or may not be the default depending upon the order

Loading…
Cancel
Save