mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
28 lines
671 B
Python
28 lines
671 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import logging
|
|
from moulinette.core import MoulinetteError
|
|
from moulinette.authenticators import BaseAuthenticator
|
|
|
|
logger = logging.getLogger('moulinette.authenticator.dummy')
|
|
|
|
# Dummy authenticator implementation
|
|
|
|
|
|
class Authenticator(BaseAuthenticator):
|
|
|
|
"""Dummy authenticator used for tests
|
|
"""
|
|
|
|
vendor = 'dummy'
|
|
|
|
def __init__(self, name, vendor, parameters, extra):
|
|
logger.debug("initialize authenticator '%s")
|
|
super(Authenticator, self).__init__(name)
|
|
|
|
def authenticate(self, password):
|
|
|
|
if not password == "Yoloswag":
|
|
raise MoulinetteError("Invalid password!")
|
|
|
|
return self
|