Documentation
¶
Index ¶
- Variables
- func ExampleEnvironmentVariable(pm *PasswordManager, projectID string) error
- func ExampleUsage()
- type AuthenticatedCommand
- type PasswordManager
- func (pm *PasswordManager) ChangeEnvironmentPassword(environment string) error
- func (pm *PasswordManager) ChangePassword(projectID string) error
- func (pm *PasswordManager) ClearEnvironmentCache(environment string)
- func (pm *PasswordManager) ClearProjectCache(projectID string)
- func (pm *PasswordManager) ClearSessionCache()
- func (pm *PasswordManager) DeriveKey(password string, salt []byte) []byte
- func (pm *PasswordManager) ExportKey(projectID string, password string) (string, error)
- func (pm *PasswordManager) GenerateSalt() ([]byte, error)
- func (pm *PasswordManager) GetOrCreateEnvironmentKey(environment string) ([]byte, error)
- func (pm *PasswordManager) GetOrCreateMasterKey(projectID string) ([]byte, error)
- func (pm *PasswordManager) GetPasswordFromEnv() (string, bool)
- func (pm *PasswordManager) ImportKey(projectID string, exportData string, password string) error
- func (pm *PasswordManager) PromptEnvironmentPassword(environment, prompt string) (string, error)
- func (pm *PasswordManager) PromptNewEnvironmentPassword(environment string) (string, error)
- func (pm *PasswordManager) PromptNewPassword() (string, error)
- func (pm *PasswordManager) PromptPassword(prompt string) (string, error)
- func (pm *PasswordManager) VerifyPassword(projectID, password string) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ExampleEnvironmentVariable ¶
func ExampleEnvironmentVariable(pm *PasswordManager, projectID string) error
ExampleEnvironmentVariable shows how to use environment variable for CI/CD
func ExampleUsage ¶
func ExampleUsage()
ExampleUsage shows how to use the password manager in CLI commands
Types ¶
type AuthenticatedCommand ¶
type AuthenticatedCommand struct {
// contains filtered or unexported fields
}
ExampleCLIIntegration shows how to integrate with Cobra commands
func (*AuthenticatedCommand) Execute ¶
func (ac *AuthenticatedCommand) Execute() error
type PasswordManager ¶
type PasswordManager struct {
// contains filtered or unexported fields
}
PasswordManager handles password operations and key derivation
func InitializeAuth ¶
func InitializeAuth(dataDir, projectID string) (*PasswordManager, error)
InitializeAuth initializes the authentication system for a project
func NewPasswordManager ¶
func NewPasswordManager(ks *keystore.Keystore, cfg *config.Config) *PasswordManager
NewPasswordManager creates a new password manager instance
func (*PasswordManager) ChangeEnvironmentPassword ¶
func (pm *PasswordManager) ChangeEnvironmentPassword(environment string) error
ChangeEnvironmentPassword changes the password for a specific environment
func (*PasswordManager) ChangePassword ¶
func (pm *PasswordManager) ChangePassword(projectID string) error
ChangePassword changes the password for a project
func (*PasswordManager) ClearEnvironmentCache ¶
func (pm *PasswordManager) ClearEnvironmentCache(environment string)
ClearEnvironmentCache clears cached session key for a specific environment
func (*PasswordManager) ClearProjectCache ¶
func (pm *PasswordManager) ClearProjectCache(projectID string)
ClearProjectCache clears cached session key for a specific project
func (*PasswordManager) ClearSessionCache ¶
func (pm *PasswordManager) ClearSessionCache()
ClearSessionCache clears all cached session keys
func (*PasswordManager) DeriveKey ¶
func (pm *PasswordManager) DeriveKey(password string, salt []byte) []byte
DeriveKey derives an encryption key from a password using Argon2
func (*PasswordManager) ExportKey ¶
func (pm *PasswordManager) ExportKey(projectID string, password string) (string, error)
ExportKey exports the encryption key in a safe format for backup
func (*PasswordManager) GenerateSalt ¶
func (pm *PasswordManager) GenerateSalt() ([]byte, error)
GenerateSalt generates a new random salt
func (*PasswordManager) GetOrCreateEnvironmentKey ¶
func (pm *PasswordManager) GetOrCreateEnvironmentKey(environment string) ([]byte, error)
GetOrCreateEnvironmentKey gets the encryption key for a specific environment, creating it if necessary
func (*PasswordManager) GetOrCreateMasterKey ¶
func (pm *PasswordManager) GetOrCreateMasterKey(projectID string) ([]byte, error)
GetOrCreateMasterKey gets the master key for a project, creating it if necessary
func (*PasswordManager) GetPasswordFromEnv ¶
func (pm *PasswordManager) GetPasswordFromEnv() (string, bool)
GetPasswordFromEnv gets password from environment variable if set
func (*PasswordManager) ImportKey ¶
func (pm *PasswordManager) ImportKey(projectID string, exportData string, password string) error
ImportKey imports a key from export format
func (*PasswordManager) PromptEnvironmentPassword ¶
func (pm *PasswordManager) PromptEnvironmentPassword(environment, prompt string) (string, error)
PromptEnvironmentPassword prompts for a password for a specific environment
func (*PasswordManager) PromptNewEnvironmentPassword ¶
func (pm *PasswordManager) PromptNewEnvironmentPassword(environment string) (string, error)
PromptNewEnvironmentPassword prompts for a new password for an environment with policy validation
func (*PasswordManager) PromptNewPassword ¶
func (pm *PasswordManager) PromptNewPassword() (string, error)
PromptNewPassword prompts for a new password with confirmation
func (*PasswordManager) PromptPassword ¶
func (pm *PasswordManager) PromptPassword(prompt string) (string, error)
PromptPassword prompts the user for a password with the given prompt message
func (*PasswordManager) VerifyPassword ¶
func (pm *PasswordManager) VerifyPassword(projectID, password string) error
VerifyPassword verifies a password against stored key data