Documentation
¶
Index ¶
- Constants
- func CreateAuthorizedKeysFile(filePath string, content string) error
- func GenerateAuthorizedKeysFile(principal string, userKey string) string
- type Interface
- type SystemOperator
- func (s *SystemOperator) CreateAuthorizedKeysFile(homeDir string, principal string) error
- func (s *SystemOperator) CreateHomeDir(dir string, uid, gid int) error
- func (s *SystemOperator) DeleteHomeDir(dir string) error
- func (s *SystemOperator) FixChown(homeDir string, uid, gid int) error
- func (s *SystemOperator) PurgeUserLegacy(username string) error
Constants ¶
View Source
const AuthorizedKeysTemplate = `cert-authority,principals="PRINCIPAL" USER_KEY`
View Source
const DefaultUserKey = `` /* 380-byte string literal not displayed */
TODO update this and it can be several keys
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Interface ¶
type Interface interface { // Create home directory for new user CreateHomeDir(dir string, uid, gid int) error CreateAuthorizedKeysFile(homeDir string, principal string) error FixChown(homeDir string, uid, gid int) error // Recursively delete home directory if exists. DeleteHomeDir(dir string) error // Kill all user processes. PurgeUserLegacy(username string) error }
type SystemOperator ¶
type SystemOperator struct {
// contains filtered or unexported fields
}
func NewSystemOperator ¶
func NewSystemOperator() *SystemOperator
func (*SystemOperator) CreateAuthorizedKeysFile ¶
func (s *SystemOperator) CreateAuthorizedKeysFile(homeDir string, principal string) error
func (*SystemOperator) CreateHomeDir ¶
func (s *SystemOperator) CreateHomeDir(dir string, uid, gid int) error
func (*SystemOperator) DeleteHomeDir ¶
func (s *SystemOperator) DeleteHomeDir(dir string) error
func (*SystemOperator) FixChown ¶
func (s *SystemOperator) FixChown(homeDir string, uid, gid int) error
func (*SystemOperator) PurgeUserLegacy ¶
func (s *SystemOperator) PurgeUserLegacy(username string) error
Click to show internal directories.
Click to hide internal directories.