]> git.siccegge.de Git - tooling/letool.git/blob - sicceggetools/acme/settings.py
Change everything
[tooling/letool.git] / sicceggetools / acme / settings.py
1 #!/usr/bin/python
2
3 import logging
4 import yaml
5
6
7
8 class Settings:
9 def __init__(self, path='config/settings.yaml'):
10 with open(path) as invfd:
11 self._settings = yaml.load(invfd.read())
12
13
14 def use_method(self, method, san, settings):
15 authmethods = self._settings['authorization']
16
17 for thismethod, data in authmethods.items():
18 for host in data['hosts']:
19 if not san.endswith(host):
20 continue
21
22 return thismethod == method
23
24 if '*' in authmethods[method]['hosts']:
25 return True
26
27 return False
28
29