Closed IBBoard closed 1 year ago
I'm not completely sure about checking that the key is exactly 34 characters long. I haven't seen it documented that a key is always that long. So there could be the possibility that this would block valid keys if they happen to be a bit longer or shorter...
Maybe we could just check that it is longer than a reasonable minimum, like 32? This should rule out old OAuth 1 keys but be more flexible should Twitter not always provide 34-long keys.
Yeah, I am making an assumption on length. But something that says "sorry, that's an old key" would be helpful.
Maybe if I switch it around and say "if key is less than 30 characters"? Which would just be:
if twitter_key.substring(0, 29) == twitter_key.substring(0, 30)
Yes, I think this could work.
Looks good to me, merging this.
Maybe you could add a small script that validates the key contents for well-formedness -- not limited to just length -- and check it with run_command()?
Presumably there is some standard definition to what they look like, so we could do a regex pattern. I could guess at one, but I wouldn't be confident that it wouldn't block valid values. It would be nice not to shell out, but it looks like Meson is too constrained for that.
Meson seems to have limited tools for checking string lengths.
Hopefully helps with people hitting #57 in future