hash stored in file adds a newline
Closed this issue · 3 comments
publicmatt commented
I'm trying to config the passwords from a file like so:
{
"plugins": {
"datasette-auth-passwords": {
"someusername_password_hash": {
"$file": "/path/to/secret"
}
}
}
}
but the hash that ultimately gets populated from that file includes a '\n' newline character at the end and fails the verify_password check.
Is this my own issue or is there something I'm going incorrectly?
simonw commented
I'm going to teach this plugin to strip the newline, though this is likely a bug in Datasette itself.
simonw commented
I'm not sure why this would happen- here's the relevant code in Datasette:
elif list(config.keys()) == ["$file"]:
return open(list(config.values())[0]).read()
publicmatt commented
Thanks Simon!