Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateState ¶
GenerateState generates a random state parameter for CSRF protection
Types ¶
type AuthFlow ¶
type AuthFlow struct {
BaseURL string
CallbackPort string
NoBrowser bool
IsInteractive bool
// contains filtered or unexported fields
}
AuthFlow handles the complete OAuth2 authentication flow
type CallbackServer ¶
type CallbackServer struct {
Port string
AuthCode chan string
AuthError chan error
AuthState string
ExpectedState string
}
CallbackServer handles OAuth2 callback
func NewCallbackServer ¶
func NewCallbackServer(expectedState string) *CallbackServer
NewCallbackServer creates a new callback server
func (*CallbackServer) FindAvailablePort ¶
func (s *CallbackServer) FindAvailablePort() (string, error)
FindAvailablePort finds an available port for the callback server. The listener is bound to 127.0.0.1 so the OAuth callback is reachable only from the local machine; no LAN exposure.
func (*CallbackServer) GetCallbackURL ¶
func (s *CallbackServer) GetCallbackURL() string
GetCallbackURL returns the callback URL for this server
type Organization ¶
type Organization struct {
ID string `json:"id"` // ULID comes in ID field from API
ULID string `json:"ulid"` // Not used but kept for compatibility
Name string `json:"name"`
}
Organization represents an organization the user has access to
type OrganizationResponse ¶
type OrganizationResponse struct {
Organizations []Organization `json:"organizations"`
}
OrganizationResponse represents the API response for user organizations
type PKCEChallenge ¶
PKCEChallenge represents a PKCE challenge pair
func GeneratePKCEChallenge ¶
func GeneratePKCEChallenge() (*PKCEChallenge, error)
GeneratePKCEChallenge creates a new PKCE challenge pair