X-Git-Url: https://git.siccegge.de//index.cgi?p=tooling%2Fletool.git;a=blobdiff_plain;f=sicceggetools%2Facme%2Fsettings.py;fp=sicceggetools%2Facme%2Fsettings.py;h=5c0f2462a69bc5ba5905ccd7589729ffd14ed216;hp=0000000000000000000000000000000000000000;hb=51cfaa176a021af7f611f3ffe024bafc99b696d0;hpb=e1de0bea6b56b5245178cedf4610f3d19e20f894 diff --git a/sicceggetools/acme/settings.py b/sicceggetools/acme/settings.py new file mode 100644 index 0000000..5c0f246 --- /dev/null +++ b/sicceggetools/acme/settings.py @@ -0,0 +1,29 @@ +#!/usr/bin/python + +import logging +import yaml + + + +class Settings: + def __init__(self, path='config/settings.yaml'): + with open(path) as invfd: + self._settings = yaml.load(invfd.read()) + + + def use_method(self, method, san, settings): + authmethods = self._settings['authorization'] + + for thismethod, data in authmethods.items(): + for host in data['hosts']: + if not san.endswith(host): + continue + + return thismethod == method + + if '*' in authmethods[method]['hosts']: + return True + + return False + +