Commit Graph

2 Commits

Author SHA1 Message Date
Lrifton92 d1b8989e5e fix: resolve version from build info when not set via ldflags
When oauth2-proxy is built without the Makefile/dist.sh ldflags (for example
via `go install github.com/oauth2-proxy/oauth2-proxy/v7@latest`), the VERSION
variable kept its default "undefined" value, so `oauth2-proxy --version`
reported "oauth2-proxy undefined (built with ...)".

Fall back to the module version recorded in runtime/debug build info when
VERSION has not been overridden at build time. The ldflags-injected value
still takes precedence, so official release builds are unchanged.

Closes #3451

Signed-off-by: Lrifton92 <Lrifton92@users.noreply.github.com>
2026-06-09 15:56:45 +02:00
Jacob Middag 3045392c17
feat: Replace default Go user-agent with oauth2-proxy and version (#2570)
* feat: Replace default Go user-agent with oauth2-proxy and version

* Add to CHANGELOG

* Make userAgentTransport configurable and composable

* Use correct naming convention for DefaultHTTPClient

* Move version to own package and use named arguments

* Update version path in Makefile

* Fix import path in Makefile

* Change importpath in dist.sh

* Minor style issues
2024-07-14 21:09:17 +01:00