Documentation
¶
Index ¶
Constants ¶
const ( ConfigFileName = ".pipeops.json" ConfigDirName = ".pipeops" )
Variables ¶
var ( // These can be set during build using -ldflags DefaultClientID = "pipeops_public_client" // Can be overridden at build time DefaultAPIURL = "https://api.pipeops.io" // Can be overridden at build time DefaultDashboardURL = "https://console.pipeops.io" // Can be overridden at build time DefaultScopes = "user:read,project:read" // Can be overridden at build time )
Build-time configuration variables (set during compilation)
Functions ¶
func GetAPIURL ¶ added in v0.2.9
func GetAPIURL() string
GetAPIURL returns the API URL from environment or build-time default
func GetClientID ¶ added in v0.2.9
func GetClientID() string
GetClientID returns the OAuth client ID from environment or build-time default
func GetConfigDir ¶
GetConfigDir returns the configuration directory path
func GetDashboardURL ¶ added in v0.2.32
func GetDashboardURL() string
GetDashboardURL returns the Dashboard URL from environment or build-time default
func GetDefaultScopes ¶ added in v0.2.9
func GetDefaultScopes() []string
GetDefaultScopes returns the default scopes
Types ¶
type Config ¶
type Config struct {
OAuth *OAuthConfig `json:"oauth,omitempty"`
Settings *Settings `json:"settings,omitempty"`
}
Config represents the CLI configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a new config with default values
func (*Config) ClearAuth ¶
func (c *Config) ClearAuth()
ClearAuth removes authentication information
func (*Config) IsAuthenticated ¶
IsAuthenticated checks if the user has valid authentication
func (*Config) IsAuthenticatedWithServer ¶ added in v0.2.9
IsAuthenticatedWithServer validates authentication with the server
type OAuthConfig ¶
type OAuthConfig struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"` // Not used with PKCE, kept for compatibility
BaseURL string `json:"base_url"`
DashboardURL string `json:"dashboard_url"`
AccessToken string `json:"access_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
Scopes []string `json:"scopes,omitempty"`
}
OAuthConfig holds OAuth-related configuration