Documentation
¶
Index ¶
- Constants
- Variables
- func GlobalPath() (string, error)
- func IsIndividualCredentialKeyType(value string) bool
- func IsValidCredentialKeyType(value string) bool
- func LocalPath() (string, error)
- func NormalizeCredentialKeyType(value string) string
- func Path() (string, error)
- func Remove() error
- func RemoveAt(path string) error
- func Save(cfg *Config) error
- func SaveAt(path string, cfg *Config) error
- type AdsConfig
- type AdsCredential
- type AdsKeychainMetadata
- type Config
- type Credential
- type DurationValue
- type KeychainMetadata
- type StoreKitConfig
- type StoreKitCredential
Constants ¶
const ( // CredentialKeyTypeTeam is the default App Store Connect API key type. CredentialKeyTypeTeam = "team" // CredentialKeyTypeIndividual signs JWTs with sub:"user" and no issuer. CredentialKeyTypeIndividual = "individual" )
Variables ¶
var ErrInvalidConfig = errors.New("invalid configuration")
ErrInvalidConfig is returned when config values fail validation.
var ErrInvalidPath = errors.New("invalid config path")
ErrInvalidPath is returned when the config path is invalid.
var ErrNotFound = fmt.Errorf("configuration not found")
ErrNotFound is returned when the config file doesn't exist
Functions ¶
func GlobalPath ¶
GlobalPath returns the global configuration file path.
func IsIndividualCredentialKeyType ¶ added in v1.260613.0
IsIndividualCredentialKeyType reports whether value names an individual key.
func IsValidCredentialKeyType ¶ added in v1.260613.0
IsValidCredentialKeyType reports whether value names a supported key type.
func NormalizeCredentialKeyType ¶ added in v1.260613.0
NormalizeCredentialKeyType returns the canonical credential key type.
Types ¶
type AdsConfig ¶ added in v1.260601.0
type AdsConfig struct {
DefaultKeyName string `json:"default_key_name,omitempty"`
Keys []AdsCredential `json:"keys,omitempty"`
KeychainMetadata []AdsKeychainMetadata `json:"keychain_metadata,omitempty"`
OrgID string `json:"org_id,omitempty"`
}
AdsConfig stores Apple Ads-specific auth configuration.
type AdsCredential ¶ added in v1.260601.0
type AdsCredential struct {
Name string `json:"name"`
ClientID string `json:"client_id"`
TeamID string `json:"team_id"`
KeyID string `json:"key_id"`
PrivateKeyPath string `json:"private_key_path"`
OrgID string `json:"org_id,omitempty"`
}
AdsCredential stores a named Apple Ads API credential in config.json.
type AdsKeychainMetadata ¶ added in v1.260601.0
type AdsKeychainMetadata struct {
Name string `json:"name"`
ClientID string `json:"client_id"`
TeamID string `json:"team_id"`
KeyID string `json:"key_id"`
OrgID string `json:"org_id,omitempty"`
ModifiedAt string `json:"modified_at,omitempty"`
}
AdsKeychainMetadata stores non-secret metadata for keychain-backed Apple Ads credentials.
type Config ¶
type Config struct {
KeyID string `json:"key_id"`
IssuerID string `json:"issuer_id"`
PrivateKeyPath string `json:"private_key_path"`
PrivateKeyPEM string `json:"-"`
KeyType string `json:"key_type,omitempty"`
DefaultKeyName string `json:"default_key_name"`
Keys []Credential `json:"keys,omitempty"`
KeychainMetadata []KeychainMetadata `json:"keychain_metadata,omitempty"`
AppID string `json:"app_id"`
VendorNumber string `json:"vendor_number"`
AnalyticsVendorNumber string `json:"analytics_vendor_number"`
SkillsCheckedAt string `json:"skills_checked_at,omitempty"`
Timeout DurationValue `json:"timeout"`
TimeoutSeconds DurationValue `json:"timeout_seconds"`
UploadTimeout DurationValue `json:"upload_timeout"`
UploadTimeoutSeconds DurationValue `json:"upload_timeout_seconds"`
MaxRetries string `json:"max_retries"`
BaseDelay string `json:"base_delay"`
MaxDelay string `json:"max_delay"`
RetryLog string `json:"retry_log"`
Debug string `json:"debug"`
Ads AdsConfig `json:"ads,omitempty"`
StoreKit StoreKitConfig `json:"storekit,omitempty"`
}
Config holds the application configuration
type Credential ¶
type Credential struct {
Name string `json:"name"`
KeyID string `json:"key_id"`
IssuerID string `json:"issuer_id"`
PrivateKeyPath string `json:"private_key_path"`
KeyType string `json:"key_type,omitempty"`
}
Credential stores a named API credential in config.json.
type DurationValue ¶
DurationValue stores a duration with its raw string representation. It marshals to/from JSON as a string to preserve config compatibility.
func ParseDurationValue ¶
func ParseDurationValue(raw string) (DurationValue, error)
ParseDurationValue parses a duration string or seconds value into a DurationValue.
func (DurationValue) MarshalJSON ¶
func (d DurationValue) MarshalJSON() ([]byte, error)
MarshalJSON stores the raw string when available, preserving the config format.
func (DurationValue) String ¶
func (d DurationValue) String() string
String returns the raw string when available, falling back to the duration value.
func (*DurationValue) UnmarshalJSON ¶
func (d *DurationValue) UnmarshalJSON(data []byte) error
UnmarshalJSON parses duration strings or seconds values from JSON.
type KeychainMetadata ¶
type KeychainMetadata struct {
Name string `json:"name"`
KeyID string `json:"key_id"`
IssuerID string `json:"issuer_id"`
KeyType string `json:"key_type,omitempty"`
ModifiedAt string `json:"modified_at,omitempty"`
}
KeychainMetadata stores non-secret metadata for keychain-backed credentials.
type StoreKitConfig ¶ added in v1.260622.0
type StoreKitConfig struct {
DefaultKeyName string `json:"default_key_name,omitempty"`
Keys []StoreKitCredential `json:"keys,omitempty"`
}
StoreKitConfig stores StoreKit-specific authentication configuration.
type StoreKitCredential ¶ added in v1.260622.0
type StoreKitCredential struct {
Name string `json:"name"`
KeyID string `json:"key_id"`
IssuerID string `json:"issuer_id"`
PrivateKeyPath string `json:"private_key_path"`
BundleID string `json:"bundle_id"`
}
StoreKitCredential stores a named In-App Purchase API credential. Private key material stays in the keychain; config-backed credentials store only a path to the key file.