fix(FastAPI): use configured letter case for SSH fingerprints

Currently, the config parser converts all keys to lowercase which is
inconsistent with the old PHP behavior. This has been fixed and relevant
fingerprint-getting functions have been simplified without changes in
behavior.

Signed-off-by: Steven Guikal <void@fluix.one>
This commit is contained in:
Steven Guikal 2021-10-04 13:30:25 -04:00
parent 7bfc2bf9b4
commit 08068e0a5c
3 changed files with 8 additions and 12 deletions

View file

@ -17,6 +17,7 @@ def _get_parser():
defaults = os.environ.get('AUR_CONFIG_DEFAULTS', path + '.defaults')
_parser = configparser.RawConfigParser()
_parser.optionxform = lambda option: option
if os.path.isfile(defaults):
with open(defaults) as f:
_parser.read_file(f)
@ -48,7 +49,6 @@ def getint(section, option, fallback=None):
return _get_parser().getint(section, option, fallback=fallback)
def get_section(section_name):
for section in _get_parser().sections():
if section == section_name:
return _get_parser()[section]
def get_section(section):
if section in _get_parser().sections():
return _get_parser()[section]