Documentation ¶
Index ¶
- Variables
- func NewRootCmd() (cmd *cobra.Command)
- type CmdCtx
- func (ctx *CmdCtx) AccessControlCheckRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) BuildInfoRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) ChainRunE(cmdRunEs ...CobraRunECmd) CobraRunECmd
- func (ctx *CmdCtx) CheckSchema() (err error)
- func (ctx *CmdCtx) CheckSchemaVersion() (err error)
- func (ctx *CmdCtx) ConfigEnsureExistsRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) ConfigStorageCommandLineConfigRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) ConfigTemplateRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) ConfigValidateLogRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) ConfigValidateRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) ConfigValidateSectionPasswordRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) ConfigValidateStorageRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) CryptoCertificateGenerateRunE(cmd *cobra.Command, _ []string, privateKey any) (err error)
- func (ctx *CmdCtx) CryptoCertificateRequestRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) CryptoGenerateRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) CryptoHashGenerateMapFlagsRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) CryptoHashGenerateRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) CryptoHashValidateRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) CryptoPairGenerateRunE(cmd *cobra.Command, _ []string, privateKey any) (err error)
- func (ctx *CmdCtx) CryptoRandFilesRunE(cmd *cobra.Command, args []string, out *os.File, files []string) (err error)
- func (ctx *CmdCtx) CryptoRandPrintRunE(cmd *cobra.Command, args []string, out *os.File) (err error)
- func (ctx *CmdCtx) CryptoRandRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) HelperConfigLoadRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) HelperConfigSetDefaultsRunE(defaults map[string]any) CobraRunECmd
- func (ctx *CmdCtx) HelperConfigSetFlagsMapRunE(flags *pflag.FlagSet, flagsMap map[string]string, ...) (err error)
- func (ctx *CmdCtx) HelperConfigValidateKeysRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) HelperConfigValidateRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) LoadProviders() (warns, errs []error)
- func (ctx *CmdCtx) LoadProvidersStorageRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) LoadTrustedCertificates() (warns, errs []error)
- func (ctx *CmdCtx) LogConfigure(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) LogProcessCurrentUserRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) NewStorageMigrateListRunE(up bool) func(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) NewStorageMigrationRunE(up bool) func(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) RootRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageMigrateHistoryRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageSchemaEncryptionChangeKeyRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageSchemaEncryptionCheckRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageSchemaInfoRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserIdentifiersAddRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserIdentifiersExportRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserIdentifiersGenerateRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserIdentifiersImportRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserTOTPDeleteRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserTOTPExportCSVRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserTOTPExportPNGRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserTOTPExportRunE(cmd *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserTOTPExportURIRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserTOTPGenerateRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserTOTPImportRunE(_ *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserWebAuthnDeleteRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserWebAuthnExportRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserWebAuthnImportRunE(cmd *cobra.Command, args []string) (err error)
- func (ctx *CmdCtx) StorageUserWebAuthnListAllRunE(_ *cobra.Command, _ []string) (err error)
- func (ctx *CmdCtx) StorageUserWebAuthnListRunE(cmd *cobra.Command, args []string) (err error)
- type CmdCtxConfig
- type CobraRunECmd
- type FileWatcherService
- type ProviderReload
- type ServerService
- type Service
- type XEnvCLIResult
Constants ¶
This section is empty.
Variables ¶
var ErrConfirmationMismatch = errors.New("user input didn't match the confirmation prompt")
ErrConfirmationMismatch is returned when user input does not match the confirmation prompt.
var ErrStdinIsNotTerminal = errors.New("stdin is not a terminal")
ErrStdinIsNotTerminal is returned when Stdin is not an interactive terminal.
Functions ¶
Types ¶
type CmdCtx ¶ added in v4.38.0
CmdCtx is a context.Context used for the root command.
func (*CmdCtx) AccessControlCheckRunE ¶ added in v4.38.0
func (*CmdCtx) BuildInfoRunE ¶ added in v4.38.0
BuildInfoRunE is the RunE for the authelia build-info command.
func (*CmdCtx) ChainRunE ¶ added in v4.38.0
func (ctx *CmdCtx) ChainRunE(cmdRunEs ...CobraRunECmd) CobraRunECmd
ChainRunE runs multiple CobraRunECmd funcs one after the other returning errors.
func (*CmdCtx) CheckSchema ¶ added in v4.38.0
CheckSchema is a utility function which checks the schema version and encryption key.
func (*CmdCtx) CheckSchemaVersion ¶ added in v4.38.0
func (*CmdCtx) ConfigEnsureExistsRunE ¶ added in v4.38.0
ConfigEnsureExistsRunE logs the warnings and errors detected during the validations that have ran.
func (*CmdCtx) ConfigStorageCommandLineConfigRunE ¶ added in v4.38.0
ConfigStorageCommandLineConfigRunE configures the storage command mapping.
func (*CmdCtx) ConfigTemplateRunE ¶ added in v4.38.0
ConfigTemplateRunE is the RunE for the authelia validate-config command.
func (*CmdCtx) ConfigValidateLogRunE ¶ added in v4.38.0
ConfigValidateLogRunE logs the warnings and errors detected during the validations that have ran.
func (*CmdCtx) ConfigValidateRunE ¶ added in v4.38.0
ConfigValidateRunE is the RunE for the authelia validate-config command.
func (*CmdCtx) ConfigValidateSectionPasswordRunE ¶ added in v4.38.0
ConfigValidateSectionPasswordRunE validates the configuration (structure, password section).
func (*CmdCtx) ConfigValidateStorageRunE ¶ added in v4.38.0
ConfigValidateStorageRunE validates the storage config before running commands using it.
func (*CmdCtx) CryptoCertificateGenerateRunE ¶ added in v4.38.0
func (ctx *CmdCtx) CryptoCertificateGenerateRunE(cmd *cobra.Command, _ []string, privateKey any) (err error)
CryptoCertificateGenerateRunE is the RunE for the authelia crypto certificate [rsa|ecdsa|ed25519] commands.
func (*CmdCtx) CryptoCertificateRequestRunE ¶ added in v4.38.0
CryptoCertificateRequestRunE is the RunE for the authelia crypto certificate request command.
func (*CmdCtx) CryptoGenerateRunE ¶ added in v4.38.0
CryptoGenerateRunE is the RunE for the authelia crypto [pair|certificate] [rsa|ecdsa|ed25519] commands.
func (*CmdCtx) CryptoHashGenerateMapFlagsRunE ¶ added in v4.38.0
CryptoHashGenerateMapFlagsRunE is the RunE which configures the flags map configuration source for the authelia crypto hash generate commands.
func (*CmdCtx) CryptoHashGenerateRunE ¶ added in v4.38.0
CryptoHashGenerateRunE is the RunE for the authelia crypto hash generate commands.
func (*CmdCtx) CryptoHashValidateRunE ¶ added in v4.38.0
CryptoHashValidateRunE is the RunE for the authelia crypto hash validate command.
func (*CmdCtx) CryptoPairGenerateRunE ¶ added in v4.38.0
func (ctx *CmdCtx) CryptoPairGenerateRunE(cmd *cobra.Command, _ []string, privateKey any) (err error)
CryptoPairGenerateRunE is the RunE for the authelia crypto pair [rsa|ecdsa|ed25519] commands.
func (*CmdCtx) CryptoRandFilesRunE ¶ added in v4.38.18
func (*CmdCtx) CryptoRandPrintRunE ¶ added in v4.38.18
func (*CmdCtx) CryptoRandRunE ¶ added in v4.38.0
CryptoRandRunE is the RunE for the authelia crypto rand command.
func (*CmdCtx) HelperConfigLoadRunE ¶ added in v4.38.0
HelperConfigLoadRunE loads the configuration into the CmdCtx.
func (*CmdCtx) HelperConfigSetDefaultsRunE ¶ added in v4.38.0
func (ctx *CmdCtx) HelperConfigSetDefaultsRunE(defaults map[string]any) CobraRunECmd
HelperConfigSetDefaultsRunE adds a defaults configuration source.
func (*CmdCtx) HelperConfigSetFlagsMapRunE ¶ added in v4.38.0
func (ctx *CmdCtx) HelperConfigSetFlagsMapRunE(flags *pflag.FlagSet, flagsMap map[string]string, includeInvalidKeys, includeUnchangedKeys bool) (err error)
HelperConfigSetFlagsMapRunE adds a command line source with flags mapping.
func (*CmdCtx) HelperConfigValidateKeysRunE ¶ added in v4.38.0
HelperConfigValidateKeysRunE validates the configuration (keys).
func (*CmdCtx) HelperConfigValidateRunE ¶ added in v4.38.0
HelperConfigValidateRunE validates the configuration (structure).
func (*CmdCtx) LoadProviders ¶ added in v4.38.0
LoadProviders loads all providers into the CmdCtx.
func (*CmdCtx) LoadProvidersStorageRunE ¶ added in v4.38.0
LoadProvidersStorageRunE is a special PreRunE that loads the storage provider into the CmdCtx.
func (*CmdCtx) LoadTrustedCertificates ¶ added in v4.38.0
LoadTrustedCertificates loads the trusted certificates into the CmdCtx.
func (*CmdCtx) LogConfigure ¶ added in v4.38.0
func (*CmdCtx) LogProcessCurrentUserRunE ¶ added in v4.38.0
func (*CmdCtx) NewStorageMigrateListRunE ¶ added in v4.38.0
func (ctx *CmdCtx) NewStorageMigrateListRunE(up bool) func(cmd *cobra.Command, args []string) (err error)
NewStorageMigrateListRunE creates the RunE for the authelia storage migrate list command.
func (*CmdCtx) NewStorageMigrationRunE ¶ added in v4.38.0
func (ctx *CmdCtx) NewStorageMigrationRunE(up bool) func(cmd *cobra.Command, args []string) (err error)
NewStorageMigrationRunE creates the RunE for the authelia storage migrate command.
func (*CmdCtx) StorageMigrateHistoryRunE ¶ added in v4.38.0
StorageMigrateHistoryRunE is the RunE for the authelia storage migrate history command.
func (*CmdCtx) StorageSchemaEncryptionChangeKeyRunE ¶ added in v4.38.0
func (ctx *CmdCtx) StorageSchemaEncryptionChangeKeyRunE(cmd *cobra.Command, args []string) (err error)
StorageSchemaEncryptionChangeKeyRunE is the RunE for the authelia storage encryption change-key command.
func (*CmdCtx) StorageSchemaEncryptionCheckRunE ¶ added in v4.38.0
func (*CmdCtx) StorageSchemaInfoRunE ¶ added in v4.38.0
StorageSchemaInfoRunE is the RunE for the authelia storage schema info command.
func (*CmdCtx) StorageUserIdentifiersAddRunE ¶ added in v4.38.0
StorageUserIdentifiersAddRunE is the RunE for the authelia storage user identifiers add command.
func (*CmdCtx) StorageUserIdentifiersExportRunE ¶ added in v4.38.0
StorageUserIdentifiersExportRunE is the RunE for the authelia storage user identifiers export command.
func (*CmdCtx) StorageUserIdentifiersGenerateRunE ¶ added in v4.38.0
StorageUserIdentifiersGenerateRunE is the RunE for the authelia storage user identifiers generate command.
func (*CmdCtx) StorageUserIdentifiersImportRunE ¶ added in v4.38.0
StorageUserIdentifiersImportRunE is the RunE for the authelia storage user identifiers import command.
func (*CmdCtx) StorageUserTOTPDeleteRunE ¶ added in v4.38.0
StorageUserTOTPDeleteRunE is the RunE for the authelia storage user totp delete command.
func (*CmdCtx) StorageUserTOTPExportCSVRunE ¶ added in v4.38.0
func (*CmdCtx) StorageUserTOTPExportPNGRunE ¶ added in v4.38.0
func (*CmdCtx) StorageUserTOTPExportRunE ¶ added in v4.38.0
StorageUserTOTPExportRunE is the RunE for the authelia storage user totp export command.
func (*CmdCtx) StorageUserTOTPExportURIRunE ¶ added in v4.38.0
func (*CmdCtx) StorageUserTOTPGenerateRunE ¶ added in v4.38.0
StorageUserTOTPGenerateRunE is the RunE for the authelia storage user totp generate command.
func (*CmdCtx) StorageUserTOTPImportRunE ¶ added in v4.38.0
func (*CmdCtx) StorageUserWebAuthnDeleteRunE ¶ added in v4.38.0
StorageUserWebAuthnDeleteRunE is the RunE for the authelia storage user webauthn delete command.
func (*CmdCtx) StorageUserWebAuthnExportRunE ¶ added in v4.38.0
func (*CmdCtx) StorageUserWebAuthnImportRunE ¶ added in v4.38.0
func (*CmdCtx) StorageUserWebAuthnListAllRunE ¶ added in v4.38.0
StorageUserWebAuthnListAllRunE is the RunE for the authelia storage user webauthn list command when no args are specified.
type CmdCtxConfig ¶ added in v4.38.0
type CmdCtxConfig struct {
// contains filtered or unexported fields
}
CmdCtxConfig is the configuration for the CmdCtx.
func NewCmdCtxConfig ¶ added in v4.38.0
func NewCmdCtxConfig() *CmdCtxConfig
NewCmdCtxConfig returns a new CmdCtxConfig.
type CobraRunECmd ¶ added in v4.38.0
CobraRunECmd describes a function that can be used as a *cobra.Command RunE, PreRunE, or PostRunE.
type FileWatcherService ¶ added in v4.38.0
type FileWatcherService struct {
// contains filtered or unexported fields
}
FileWatcherService is a Service that watches files for changes.
func NewFileWatcherService ¶ added in v4.38.0
func NewFileWatcherService(name, path string, reload ProviderReload, log *logrus.Logger) (service *FileWatcherService, err error)
NewFileWatcherService creates a new FileWatcherService with the appropriate logger etc.
func (*FileWatcherService) Log ¶ added in v4.38.0
func (service *FileWatcherService) Log() *logrus.Entry
Log returns the *logrus.Entry of the FileWatcherService.
func (*FileWatcherService) Run ¶ added in v4.38.0
func (service *FileWatcherService) Run() (err error)
Run the FileWatcherService.
func (*FileWatcherService) ServiceName ¶ added in v4.38.0
func (service *FileWatcherService) ServiceName() string
ServiceName returns the individual name for this service.
func (*FileWatcherService) ServiceType ¶ added in v4.38.0
func (service *FileWatcherService) ServiceType() string
ServiceType returns the service type for this service, which is always 'watcher'.
func (*FileWatcherService) Shutdown ¶ added in v4.38.0
func (service *FileWatcherService) Shutdown()
Shutdown the FileWatcherService.
type ProviderReload ¶ added in v4.37.0
ProviderReload represents the required methods to support reloading a provider.
type ServerService ¶ added in v4.38.0
type ServerService struct {
// contains filtered or unexported fields
}
ServerService is a Service which runs a web server.
func NewServerService ¶ added in v4.38.0
func NewServerService(name string, server *fasthttp.Server, listener net.Listener, paths []string, isTLS bool, log *logrus.Logger) (service *ServerService)
NewServerService creates a new ServerService with the appropriate logger etc.
func (*ServerService) Log ¶ added in v4.38.0
func (service *ServerService) Log() *logrus.Entry
Log returns the *logrus.Entry of the ServerService.
func (*ServerService) Run ¶ added in v4.38.0
func (service *ServerService) Run() (err error)
Run the ServerService.
func (*ServerService) ServiceName ¶ added in v4.38.0
func (service *ServerService) ServiceName() string
ServiceName returns the individual name for this service.
func (*ServerService) ServiceType ¶ added in v4.38.0
func (service *ServerService) ServiceType() string
ServiceType returns the service type for this service, which is always 'server'.
func (*ServerService) Shutdown ¶ added in v4.38.0
func (service *ServerService) Shutdown()
Shutdown the ServerService.
type Service ¶ added in v4.38.0
type Service interface { // ServiceType returns the type name for the Service. ServiceType() string // ServiceName returns the individual name for the Service. ServiceName() string // Run performs the running operations for the Service. Run() (err error) // Shutdown perform the shutdown cleanup and termination operations for the Service. Shutdown() // Log returns the logger configured for the service. Log() *logrus.Entry }
Service represents the required methods to support handling a service.
type XEnvCLIResult ¶ added in v4.38.0
type XEnvCLIResult int
const ( XEnvCLIResultCLIExplicit XEnvCLIResult = iota XEnvCLIResultCLIImplicit XEnvCLIResultEnvironment )