Move documentation to correct method

This commit is contained in:
Unrud 2017-09-17 14:03:46 +02:00
parent c9a78908e8
commit 1065c0b359

View File

@ -99,11 +99,7 @@ class BaseAuth:
return () return ()
def is_authenticated(self, user, password): def is_authenticated(self, user, password):
"""Validate credentials. """Validate credentials."""
Iterate through htpasswd credential file until user matches, extract
hash (encrypted password) and check hash against user-given password,
using the method specified in the Radicale config.
""" """
raise NotImplementedError raise NotImplementedError
@ -209,9 +205,17 @@ class Auth(BaseAuth):
return md5_apr1.verify(password, hash_value) return md5_apr1.verify(password, hash_value)
def is_authenticated(self, user, password): def is_authenticated(self, user, password):
# The content of the file is not cached because reading is generally a """Validate credentials.
# very cheap operation, and it's useful to get live updates of the
# htpasswd file. Iterate through htpasswd credential file until user matches, extract
hash (encrypted password) and check hash against user-given password,
using the method specified in the Radicale config.
The content of the file is not cached because reading is generally a
very cheap operation, and it's useful to get live updates of the
htpasswd file.
"""
try: try:
with open(self.filename) as f: with open(self.filename) as f:
for line in f: for line in f: