go-import meta should point to final VCS host, not a redirect target #5
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
heiko/gometa#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
go-importmeta tag currently points tohttps://git.schlittermann.de/...as the VCS URL:However,
git.schlittermann.deredirects (HTTP 301/302) toforgejo.schlittermann.de:Why this is a problem
Git does not forward credentials across redirected hosts. When a tool (like
go mod downloador gogogo) injects authentication forgit.schlittermann.de, the credentials are dropped when Git follows the redirect toforgejo.schlittermann.de. This causes authentication failures for private repositories.The workaround is to resolve the redirect chain first and then inject credentials targeting the final host — but this adds complexity and an extra HTTP round-trip that shouldn't be necessary.
Suggested fix
The
go-importmeta tag should point directly to the final, canonical VCS host:This way, tools and the Go toolchain connect directly to the host that actually serves Git, and credentials work without redirect resolution.
Context
Discovered while implementing private repo support in gogogo (PR gogogo#37). gogogo now works around this by resolving redirects before injecting credentials, but other tools may not.
The workaround in gogogo is in commit
8e61a60— specificallyinternal/cmd/release/release.goline 983, wherebuilder.ResolveRedirect()resolves the redirect chain before building theinsteadOfcredential env vars.