GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Expose typed auth error for Azure DevOps `/_signin` redirects · Issue #2200 · go-git/go-git Closed Labels help wantedExtra attention is needed DescriptionWhat happened?When listing refs for a private Azure DevOps repo without auth, Azure can redirect the smart HTTP refs request to go-git currently surfaces that as a plain redirect-shape error: That makes it hard for callers to distinguish an auth-required private repo from an unexpected transport failure without string-matching the error. This came up downstream in Dagger while probing whether a git remote is public: dagger/dagger#13516 The relevant go-git code on I also verified this locally against my private Azure Repos repository with ReproductionCreate or use a private Azure Repos repository, then run this with its HTTPS clone URL: mkdir /tmp/go-git-azure-signin-repro cd /tmp/go-git-azure-signin-repro go mod init azure-signin-repro go get github.com/go-git/go-git/[email protected] Create package main import ( "context" "errors" "fmt" "os" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing/format/pktline" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/storage/memory" ) func main() { remoteURL := os.Getenv("REMOTE_URL") if remoteURL == "" { fmt.Fprintln(os.Stderr, "REMOTE_URL is required") os.Exit(2) } repo := git.NewRemote(memory.NewStorage(), &config.RemoteConfig{ Name: "origin", URLs: []string{remoteURL}, }) _, err := repo.ListContext(context.Background(), &git.ListOptions{Auth: nil}) fmt.Printf("err: %v\n", err) fmt.Printf("is auth required: %v\n", errors.Is(err, transport.ErrAuthenticationRequired)) fmt.Printf("is invalid pkt-len: %v\n", errors.Is(err, pktline.ErrInvalidPktLen)) } Run: REMOTE_URL='https://dev.azure.com/ORG/PROJECT/_git/REPO' go run . Current output from my private repo: Expected behaviorIt would be helpful if this case were classified as Activity
MetadataMetadataAssigneesLabelshelp wantedExtra attention is needed TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |