Skip to content

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

Steven Guikal requested to merge fluix/aurweb:fix-key-case into pu

The default configparser converts keys to lowercase which we don't want because it makes the SSH fingerprint section on the homepage display

ed25519: SHA256:HQ03dn6EasJHNDlt51KpQpFkT3yBX83x7BoIkA1iv2k
ecdsa: SHA256:L71Q91yHwmHPYYkJMDgj0xmUuw16qFOhJbBr1mzsiOI
rsa: SHA256:Ju+yWiMb/2O+gKQ9RJCDqvRg7l+Q95KFAeqM5sr6l2s

when keys should be "Ed25519", "ECDSA", and "RSA" according to the config.

This has been corrected[1] alongside some code simplification in relevant sections and very slightly improved testing (check keys and values instead of just values), though for this to be fully tested the config would have to be spoofed. Let me know if that's necessary.

[1]: Python docs here, under ConfigParser.optionxform(option)

Edited by Steven Guikal

Merge request reports