Documentation
¶
Overview ¶
Package config provides functions to store and retrieve configuration data such as GitHub tokens, repository info, and password hashes using the system keychain for secure storage.
Index ¶
- Constants
- func ConfigDir() string
- func DeleteGitLabProjectID() error
- func DeleteGlobalMasterPassword() error
- func DeletePasswordHash() error
- func DeleteProviderType() error
- func DeleteRepoInfo() error
- func DeleteToken() error
- func EnsureConfigDir() error
- func GetGitLabProjectID() (int, error)
- func GetGlobalMasterPassword() (string, error)
- func GetKeyring() keyring.Keyring
- func GetPasswordHash() (string, error)
- func GetProviderType() (string, error)
- func GetRepoName() (string, error)
- func GetRepoOwner() (string, error)
- func GetRepoURL() (string, error)
- func GetToken() (string, error)
- func HasGlobalMasterPassword() bool
- func SetKeyring(k keyring.Keyring)
- func StoreGitLabProjectID(projectID int) error
- func StoreGlobalMasterPassword(password string) error
- func StorePasswordHash(hash string) error
- func StoreProviderType(provider string) error
- func StoreRepoInfo(url, owner, name string) error
- func StoreToken(token string) error
Constants ¶
const ( ServiceName = "ostrakon" TokenKey = "token" RepoURLKey = "repo_url" RepoOwnerKey = "repo_owner" RepoNameKey = "repo_name" PasswordHashKey = "password_hash" GlobalMasterPasswordKey = "global_master_password" ProviderTypeKey = "provider_type" GitLabProjectIDKey = "gitlab_project_id" )
const ( ProviderGitHub = "github" ProviderGitLab = "gitlab" )
ProviderType constants for storage.
Variables ¶
This section is empty.
Functions ¶
func DeleteGitLabProjectID ¶ added in v0.1.0
func DeleteGitLabProjectID() error
DeleteGitLabProjectID removes the GitLab project ID from the keychain.
func DeleteGlobalMasterPassword ¶
func DeleteGlobalMasterPassword() error
DeleteGlobalMasterPassword removes the global master password from the keyring.
func DeletePasswordHash ¶
func DeletePasswordHash() error
DeletePasswordHash removes the password hash from the keychain.
func DeleteProviderType ¶ added in v0.1.0
func DeleteProviderType() error
DeleteProviderType removes the provider type from the keychain.
func DeleteRepoInfo ¶
func DeleteRepoInfo() error
DeleteRepoInfo removes all repo info from the keychain.
func DeleteToken ¶
func DeleteToken() error
DeleteToken removes the GitHub token from the system keychain.
func EnsureConfigDir ¶
func EnsureConfigDir() error
EnsureConfigDir ensures the config directory exists.
func GetGitLabProjectID ¶ added in v0.1.0
GetGitLabProjectID retrieves the stored GitLab project ID.
func GetGlobalMasterPassword ¶
GetGlobalMasterPassword retrieves the stored master password from the keyring.
func GetKeyring ¶
GetKeyring returns the current keyring implementation.
func GetPasswordHash ¶
GetPasswordHash retrieves the stored password hash for validation.
func GetProviderType ¶ added in v0.1.0
GetProviderType retrieves the stored provider type.
func GetRepoName ¶
GetRepoName retrieves the stored repository name.
func GetRepoOwner ¶
GetRepoOwner retrieves the stored repository owner.
func HasGlobalMasterPassword ¶
func HasGlobalMasterPassword() bool
HasGlobalMasterPassword checks if a global master password is stored.
func SetKeyring ¶
SetKeyring sets a custom keyring implementation (for testing).
func StoreGitLabProjectID ¶ added in v0.1.0
StoreGitLabProjectID stores the numeric project ID for GitLab.
func StoreGlobalMasterPassword ¶
StoreGlobalMasterPassword stores the master password directly in the keyring.
func StorePasswordHash ¶
StorePasswordHash stores the hashed password validation checksum.
func StoreProviderType ¶ added in v0.1.0
StoreProviderType stores the provider type (github or gitlab).
func StoreRepoInfo ¶
StoreRepoInfo stores the repository URL and parsed owner/repo name.
func StoreToken ¶
StoreToken stores the GitHub access token in the system keychain.
Types ¶
This section is empty.