fix: map 'user' config key to GLAB_USER to prevent $USER shadowing
What does this MR do and why?
The user key in host config (written by glab auth login) was not explicitly mapped in EnvKeyEquivalence, so it fell through to the default case which uppercases the key to USER. On Unix, $USER is always set to the OS username, meaning it always shadowed the GitLab username stored in config.
This affected:
glab config get user --host <host>returning the OS username instead of the configured GitLab username- The git credential helper using the wrong username when the OS username differed from the GitLab username (common on self-managed instances with different naming conventions)
The Docker credential helper already worked around this by calling GetWithSource(..., false) to bypass env var lookup, with a comment explaining the $USER collision. That workaround is removed now that the root cause is fixed.
MR acceptance checklist
- This MR does not contain any breaking changes
- Relevant documentation is updated
- Sufficient test coverage added
Closes #8237 (closed)