cli / oauth

A library for performing OAuth Device flow and Web application flow in Go client apps.
https://pkg.go.dev/github.com/cli/oauth
MIT License
460 stars 63 forks source link

Introduce safe host parsing command #62

Open williammartin opened 2 months ago

williammartin commented 2 months ago

Description

See bug report: https://github.com/cli/cli/issues/9248

TL;DR: The current host parsing function is non-idiomatic and hides errors opening the possibility for panics. We can't change the existing function without a breaking change so we will introduce a new function with signature func NewHost(hostname string) (*Host, error).

https://github.com/cli/oauth/blob/adf5f733ffd14993aad9f3ff02c757a737f7c63b/oauth.go#L28-L36