mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
26 lines
562 B
Python
26 lines
562 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import logging
|
|
from moulinette.core import MoulinetteError
|
|
from moulinette.authentication import BaseAuthenticator
|
|
|
|
logger = logging.getLogger("moulinette.authenticator.dummy")
|
|
|
|
# Dummy authenticator implementation
|
|
|
|
|
|
class Authenticator(BaseAuthenticator):
|
|
|
|
"""Dummy authenticator used for tests"""
|
|
|
|
name = "dummy"
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
pass
|
|
|
|
def authenticate(self, credentials=None):
|
|
|
|
if not credentials == self.name:
|
|
raise MoulinetteError("invalid_password")
|
|
|
|
return
|