Files
Ryan LeiandEhab Younes bc65edc737 fix(cli): scope keyring credentials to the deployment origin (#29764)
Keyring entries were keyed by host alone, so http://host and https://host
shared one entry: the https token was sent in plaintext to the http URL,
and `coder logout` over http removed the https session.

Credentials are now keyed by origin:

- https: bare host, with :443 dropped. Older CLIs write the same key, so
  existing https sessions keep working.
- http: http://host, with :80 dropped.
- Any other scheme is rejected.

coder_url stores the normalized origin. A token stored for the other
scheme reads as os.ErrNotExist, so the CLI treats you as not logged in.
Users who logged in to an http deployment with an older CLI, or with an
explicit https://host:443, must log in again.

Fixes #29290

Co-authored-by: Ehab Younes <ehab@alyounes.com>
2026-10-27 17:36:23 +00:00
..