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 DeleteGlobalMasterPassword() error
- func DeletePasswordHash() error
- func DeleteRepoInfo() error
- func DeleteToken() error
- func EnsureConfigDir() error
- func GetGlobalMasterPassword() (string, error)
- func GetKeyring() keyring.Keyring
- func GetPasswordHash() (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 StoreGlobalMasterPassword(password string) error
- func StorePasswordHash(hash string) error
- func StoreRepoInfo(url, owner, name string) error
- func StoreToken(token string) error
Constants ¶
const ( ServiceName = "ostrakon" TokenKey = "github_token" RepoURLKey = "repo_url" RepoOwnerKey = "repo_owner" RepoNameKey = "repo_name" PasswordHashKey = "password_hash" GlobalMasterPasswordKey = "global_master_password" )
Variables ¶
This section is empty.
Functions ¶
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 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 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 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 StoreGlobalMasterPassword ¶
StoreGlobalMasterPassword stores the master password directly in the keyring.
func StorePasswordHash ¶
StorePasswordHash stores the hashed password validation checksum.
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.