Documentation
¶
Overview ¶
Package setup provides interactive setup flows for configuring TOTP and AWS MFA credentials.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSSetupHandler ¶
type AWSSetupHandler struct {
// contains filtered or unexported fields
}
AWSSetupHandler implements SetupHandler for AWS
func NewAWSSetupHandler ¶
func NewAWSSetupHandler(provider keychain.Provider) *AWSSetupHandler
NewAWSSetupHandler creates a new AWS setup handler
func (*AWSSetupHandler) ServiceName ¶
func (h *AWSSetupHandler) ServiceName() string
ServiceName returns the name of the service
func (*AWSSetupHandler) Setup ¶
func (h *AWSSetupHandler) Setup() error
Setup performs the AWS MFA setup process through an interactive CLI flow. The method guides users through the following steps:
- Verifies AWS CLI is installed
- Collects the AWS profile name (or uses default)
- Verifies AWS credentials by checking caller identity
- Guides the user through setting up a virtual MFA device in AWS Console
- Captures the MFA secret (either manually or via QR code)
- Generates TOTP codes and helps with AWS Console MFA setup
- Helps identify and select the newly created MFA device, with retry and refresh options
- Stores the MFA secret and serial number securely in system keychain
- Provides instructions for using the setup with the sesh command
The flow includes multiple validation steps, error handling, and user guidance for common issues that might occur during setup, such as delayed MFA device registration in the AWS API.
Returns an error if any step in the setup process fails. If successful, the user will be able to generate temporary AWS credentials with MFA protection using the 'sesh' command.
type SetupHandler ¶
SetupHandler defines a handler for a specific service setup
type SetupService ¶
type SetupService interface {
// RegisterHandler registers a setup handler for a service
RegisterHandler(handler SetupHandler)
// SetupService initiates the setup process for a specific service
SetupService(serviceName string) error
// GetAvailableServices returns a list of services that can be set up
GetAvailableServices() []string
}
SetupService is the main service for setting up credentials
func NewSetupService ¶
func NewSetupService(provider keychain.Provider) SetupService
NewSetupService creates a new SetupService
type TOTPSetupHandler ¶
type TOTPSetupHandler struct {
// contains filtered or unexported fields
}
TOTPSetupHandler implements SetupHandler for TOTP
func NewTOTPSetupHandler ¶
func NewTOTPSetupHandler(provider keychain.Provider) *TOTPSetupHandler
NewTOTPSetupHandler creates a new TOTP setup handler
func (*TOTPSetupHandler) ServiceName ¶
func (h *TOTPSetupHandler) ServiceName() string
ServiceName returns the name of the service
func (*TOTPSetupHandler) Setup ¶
func (h *TOTPSetupHandler) Setup() error
Setup performs the TOTP setup