Documentation
¶
Overview ¶
Package oauth provides OAuth 2.0 PKCE authentication flow for CLI applications
Index ¶
Constants ¶
View Source
const ( DefaultHost = "buildkite.com" // DefaultScopes are the default OAuth scopes to request DefaultScopes = "read_user read_organizations read_pipelines read_builds write_builds read_agents read_artifacts read_clusters read_teams" )
Variables ¶
View Source
var DefaultClientID = ""
DefaultClientID is the OAuth client ID for the Buildkite CLI This is blank so we can use ldflags
Functions ¶
This section is empty.
Types ¶
type CallbackResult ¶
CallbackResult holds the result from the OAuth callback
type Config ¶
type Config struct {
Host string // e.g., "buildkite.com"
ClientID string // OAuth client ID
OrgSlug string // Organization slug (used for organization_uuid lookup)
OrgUUID string // Organization UUID
CallbackURL string // e.g., "http://127.0.0.1:8080/callback"
Scopes string // Space-separated OAuth scopes
}
Config holds OAuth configuration
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
Flow manages an OAuth authentication flow
func (*Flow) AuthorizationURL ¶
AuthorizationURL returns the URL to open in the browser
func (*Flow) ExchangeCode ¶
ExchangeCode exchanges the authorization code for an access token
func (*Flow) WaitForCallback ¶
func (f *Flow) WaitForCallback(ctx context.Context) (*CallbackResult, error)
WaitForCallback waits for the OAuth callback and returns the authorization code
Click to show internal directories.
Click to hide internal directories.