mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
add publickey list
This commit is contained in:
1 parent
e246f2188e
commit
8e821c75d7
6 files changed
+45
-6
No files matched your search
@@ -77,6 +77,12 @@ func AddPublicKey(key *PublicKey) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func ListPublicKey(userId int64) ([]PublicKey, error) {
|
||||
keys := make([]PublicKey, 0)
|
||||
err := orm.Find(&keys, &PublicKey{OwnerId: userId})
|
||||
return keys, err
|
||||
}
|
||||
|
||||
func SaveAuthorizedKeyFile(key *PublicKey) error {
|
||||
p := filepath.Join(sshPath, "authorized_keys")
|
||||
f, err := os.OpenFile(p, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)
|
||||
|
||||
Reference in new issue
Block a user