MCPcopy Create free account
hub / github.com/gogs/gogs / deletePublicKeys

Function deletePublicKeys

internal/database/ssh_key.go:473–480  ·  view source on GitHub ↗

deletePublicKeys does the actual key deletion but does not update authorized_keys file.

(e *xorm.Session, keyIDs ...int64)

Source from the content-addressed store, hash-verified

471
472// deletePublicKeys does the actual key deletion but does not update authorized_keys file.
473func deletePublicKeys(e *xorm.Session, keyIDs ...int64) error {
474 if len(keyIDs) == 0 {
475 return nil
476 }
477
478 _, err := e.In("id", keyIDs).Delete(new(PublicKey))
479 return err
480}
481
482// DeletePublicKey deletes SSH key information both in database and authorized_keys file.
483func DeletePublicKey(doer *User, id int64) (err error) {

Callers 2

DeletePublicKeyFunction · 0.85
DeleteDeployKeyFunction · 0.85

Calls 2

DeleteMethod · 0.80
InMethod · 0.80

Tested by

no test coverage detected