nlewo / comin

GitOps For NixOS Machines
MIT License
484 stars 16 forks source link

Trim whitespaces from access token #58

Closed itz-Jana closed 2 weeks ago

itz-Jana commented 2 weeks ago

Some editors add a newline at the end of a file automatically, which currently is processed by comin.

This makes authentication at the remote fail.

As there are no newlines or other whitespace characters that are relevant, doing an input sanitization here makes sense.

Fixes https://github.com/nlewo/comin/issues/57 and probably also https://github.com/nlewo/comin/issues/38 (as Forgejo does not have a requirement for a specific username, when using an access token).

nlewo commented 2 weeks ago

Thank you.

Note I'm not sure modifying the content of such kind of file is a good idea, but ok, in practice it should not be harmful.