Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion go/cmd/bazelcredswrapper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ func main() {
log.Error(err)
os.Exit(1)
}

// Time format conversion note: Converting from time.RFC3339 to time.UnixDate is
// problematic because RFC3339 is a standardized, unambiguous format with timezone
// information (e.g., "2023-01-01T12:00:00Z"), while UnixDate is a human-readable
// format without explicit timezone indicators (e.g., "Sun Jan 1 12:00:00 GMT 2023").
// This conversion can lead to timezone ambiguity and parsing errors and potentially
// causing authentication failures.
// Convert to UTC to avoid parsing errors when timezone can't be determined.
fmt.Printf(`{"headers":%s, "token":"%s", "expiry":"%s"}`, jsonHdrs,
"", expiry.Format(time.UnixDate))
"", expiry.UTC().Format(time.UnixDate))
}

type CredshelperOut struct {
Expand Down