auth

package
v1.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderGitHubCopilot = "github-copilot"
)

Variables

This section is empty.

Functions

func CopilotAPIBaseURL

func CopilotAPIBaseURL(enterpriseURL string) string

func DefaultPath

func DefaultPath() string

func NormalizeEnterpriseURL

func NormalizeEnterpriseURL(raw string) (string, error)

Types

type CopilotDeviceFlow

type CopilotDeviceFlow struct {
	Domain          string
	EnterpriseURL   string
	VerificationURI string
	UserCode        string
	DeviceCode      string
	Interval        time.Duration
}

func StartCopilotDeviceFlow

func StartCopilotDeviceFlow(ctx context.Context, enterpriseURL string) (*CopilotDeviceFlow, error)

type Info

type Info struct {
	ProviderID    string    `json:"provider_id"`
	Type          string    `json:"type"`
	AccessToken   string    `json:"access_token,omitempty"`
	RefreshToken  string    `json:"refresh_token,omitempty"`
	EnterpriseURL string    `json:"enterprise_url,omitempty"`
	ExpiresAt     time.Time `json:"expires_at,omitempty"`
	UpdatedAt     time.Time `json:"updated_at"`
}

func PollCopilotDeviceFlow

func PollCopilotDeviceFlow(ctx context.Context, flow *CopilotDeviceFlow) (*Info, error)

type Store

type Store struct {
	// contains filtered or unexported fields
}

func DefaultStore

func DefaultStore() *Store

func NewStore

func NewStore(path string) *Store

func (*Store) Delete

func (s *Store) Delete(providerID string) error

func (*Store) HasUsableToken

func (s *Store) HasUsableToken(providerID string) (bool, error)

func (*Store) Load

func (s *Store) Load(providerID string) (*Info, error)

func (*Store) Save

func (s *Store) Save(info *Info) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL