Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateKey = errors.New("Duplicate key") ErrInvalidKey = errors.New("Invalid key") ErrKeyNotFound = errors.New("Key not found") )
View Source
var ErrUserNotFound = errors.New("User not found")
Functions ¶
func AddKey ¶
Adds a key into a user.
Stores the key in the user's document and write it in authorized_keys.
Returns an error in case the user does not exist.
func Remove ¶
Removes a user. Also removes it's associated keys from authorized_keys and repositories It handles user with repositories specially when: - a user has at least one repository:
- if he/she is the only one with access to the repository, the removal will stop and return an error
- if there are more than one user with access to the repository, gandalf will first revoke user's access and then remove the user permanently
- a user has no repositories: gandalf will simply remove the user
Types ¶
Click to show internal directories.
Click to hide internal directories.