Use abstract base class for auth handler

Use the abc module for managing abstract base classes in the driver
layer.

bp abstract-base-class-drivers

Change-Id: I302a9bf0ac3aea2a2f687e0ceda7e107c0c11539
This commit is contained in:
Doug Hellmann 2013-10-06 12:47:04 -04:00
parent 8c1899cc8f
commit 8285cd5065

View File

@ -14,17 +14,23 @@
# License for the specific language governing permissions and limitations
# under the License.
import abc
import six
from keystone.common import dependency
from keystone import exception
@dependency.requires('identity_api')
@six.add_metaclass(abc.ABCMeta)
class AuthMethodHandler(object):
"""Abstract base class for an authentication plugin."""
def __init__(self):
pass
@abc.abstractmethod
def authenticate(self, context, auth_payload, auth_context):
"""Authenticate user and return an authentication context.