Documentation ¶
Index ¶
- func CanUserEditRepository(key string, repoName string) (bool, error)
- func DirExists(path_dir string) bool
- func GenerateKeyPair(filepath string) error
- func GetRepoName(command string) (string, error)
- func IsUserAuthorized(key string) (bool, error)
- func MkParentdir(filepath string) error
- func ParsePublicKey(key ssh.PublicKey) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanUserEditRepository ¶
Queries the database to check if the user is authorized to access the repository If the user is authorized, return true If the user is not authorized, return false
The user being authorized means that the ssh key is associated with a user that has access to the repository
func GenerateKeyPair ¶
* * This function generates a RSA Key pair * Usage: GenerateHostKey("example/key") * * it will generate: * - example/key * - example/key.pub
func GetRepoName ¶
Extract the repository name from the command
The command can be in the form of: - git-receive-pack '<repo-name>' - git-receive-pack '/<repo-name>' - git-receive-pack '<repo-name>/' - git-receive-pack '/<repo-name>/'
if the command doesn't have the right format, an error is returned
func IsUserAuthorized ¶
Queries the database to check if the user added their ssh key to the database
func MkParentdir ¶
func ParsePublicKey ¶
ParsePublicKey parses the public key to a string.
Types ¶
This section is empty.