Documentation ¶
Overview ¶
Package alias sets up the shell alias for Granted. The alias is required so that the Granted wrapper script (scripts/granted in this repository) is sourced rather than executed. By sourcing the wrapper script we can export environment variables into the user's shell after they call the Granted CLI. These variables are typically used for cloud provider session credentials.
Index ¶
- func GetDefaultAlias() string
- func GetFishAlias() string
- func GetShellFromShellEnv(shellEnv string) (string, error)
- func Install(cfg Config) error
- func IsConfigured() bool
- func MustBeConfigured(autoConfigure bool) error
- func SetupShellWizard(autoConfigure bool) error
- func Uninstall(cfg Config) error
- func UninstallDefaultShellAlias() error
- type Config
- type ErrAlreadyInstalled
- type ErrNotInstalled
- type ErrShellNotSupported
- type UninstallShellResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultAlias ¶
func GetDefaultAlias() string
func GetFishAlias ¶
func GetFishAlias() string
func GetShellFromShellEnv ¶ added in v0.2.1
GetShellFromShellEnv returns the shell from the SHELL environment variable
func IsConfigured ¶
func IsConfigured() bool
IsConfigured returns whether the shell alias is correctly set up for Granted.
func MustBeConfigured ¶
MustBeConfigured displays a helpful error message and exits the CLI if the alias is detected as not being configured properly.
func SetupShellWizard ¶
func UninstallDefaultShellAlias ¶
func UninstallDefaultShellAlias() error
UninstallDefaultShellAlias tries to uninstall the Granted aliases from the user's default shell bindings
Types ¶
type Config ¶
func GetShellAlias ¶ added in v0.2.1
GetShellAlias returns the alias config for a shell
type ErrAlreadyInstalled ¶
type ErrAlreadyInstalled struct {
File string
}
func (*ErrAlreadyInstalled) Error ¶
func (e *ErrAlreadyInstalled) Error() string
type ErrNotInstalled ¶
type ErrNotInstalled struct {
File string
}
func (*ErrNotInstalled) Error ¶
func (e *ErrNotInstalled) Error() string
type ErrShellNotSupported ¶
type ErrShellNotSupported struct {
Shell string
}
func (*ErrShellNotSupported) Error ¶
func (e *ErrShellNotSupported) Error() string
type UninstallShellResults ¶
type UninstallShellResults struct {
ConfigFile string
}