Move realm config from server to auth

This commit is contained in:
Unrud 2018-08-16 08:00:01 +02:00
parent 6c12bba8a8
commit 6b281e1726
3 changed files with 9 additions and 9 deletions

6
config
View File

@ -48,9 +48,6 @@
# Reverse DNS to resolve client address in logs # Reverse DNS to resolve client address in logs
#dns_lookup = True #dns_lookup = True
# Message displayed in the client when a password is needed
#realm = Radicale - Password Required
[encoding] [encoding]
@ -79,6 +76,9 @@
# Incorrect authentication delay (seconds) # Incorrect authentication delay (seconds)
#delay = 1 #delay = 1
# Message displayed in the client when a password is needed
#realm = Radicale - Password Required
[rights] [rights]

View File

@ -355,7 +355,7 @@ class Application:
# Unknown or unauthorized user # Unknown or unauthorized user
logger.debug("Asking client for authentication") logger.debug("Asking client for authentication")
status = client.UNAUTHORIZED status = client.UNAUTHORIZED
realm = self.configuration.get("server", "realm") realm = self.configuration.get("auth", "realm")
headers = dict(headers) headers = dict(headers)
headers.update({ headers.update({
"WWW-Authenticate": "WWW-Authenticate":

View File

@ -101,11 +101,7 @@ INITIAL_CONFIG = OrderedDict([
("dns_lookup", { ("dns_lookup", {
"value": "True", "value": "True",
"help": "use reverse DNS to resolve client address in logs", "help": "use reverse DNS to resolve client address in logs",
"type": bool}), "type": bool})])),
("realm", {
"value": "Radicale - Password Required",
"help": "message displayed when a password is needed",
"type": str})])),
("encoding", OrderedDict([ ("encoding", OrderedDict([
("request", { ("request", {
"value": "utf-8", "value": "utf-8",
@ -129,6 +125,10 @@ INITIAL_CONFIG = OrderedDict([
"value": "bcrypt", "value": "bcrypt",
"help": "htpasswd encryption method", "help": "htpasswd encryption method",
"type": str}), "type": str}),
("realm", {
"value": "Radicale - Password Required",
"help": "message displayed when a password is needed",
"type": str}),
("delay", { ("delay", {
"value": "1", "value": "1",
"help": "incorrect authentication delay", "help": "incorrect authentication delay",