Forcastio weather module API key field

Hi all,
Second post, many searches; I’ve been working with a bit with the builtin forcastio weather module and found an issue where I accidentally pasted an extra space at the beginning of my Dark Sky API key. I only happened to notice this when troubleshooting the module not displaying the key.

Given this situation and the apparent hexadecimal standard for Dark Sky’s API key, would it be feasible to add a .trim() function to the input validation? Maybe even possibly field validation that all characters are from the hexadecimal set or at least not characters that require special html encoding?

Adding this kind of santization seems like it would improve the user experience of the product by not storing an obviously invalid key that will be rejected by the server.

I guess it wouldn’t hurt to that have that indeed, @dan shall we create an enhancement for it?

There isn’t anything to say that API keys cannot start/end with spaces (although I see this as being highly unlikely). Perhaps a better approach would be to show a warning on the form, toast and grid that the key starts/ends with a space.

@peter feel free to create that in github