Skip to content

Commit b0005d5

Browse files
committed
Fix upstream api changes to asymkey_model
1 parent 8612a72 commit b0005d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

services/auth/httpsign.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"net/http"
1313
"strings"
1414

15-
"code.gitea.io/gitea/models"
15+
asymkey_model "code.gitea.io/gitea/models/asymkey"
1616
user_model "code.gitea.io/gitea/models/user"
1717
"code.gitea.io/gitea/modules/log"
1818
"code.gitea.io/gitea/modules/setting"
@@ -79,8 +79,8 @@ func (h *HTTPSign) Verify(req *http.Request, w http.ResponseWriter, store DataSt
7979
// VerifyCert verifies the validity of the ssh certificate and returns the publickey of the signer
8080
// We verify that the certificate is signed with the correct CA
8181
// We verify that the http request is signed with the private key (of the public key mentioned in the certificate)
82-
func VerifyCert(r *http.Request) (*models.PublicKey, error) {
83-
var validpk *models.PublicKey
82+
func VerifyCert(r *http.Request) (*asymkey_model.PublicKey, error) {
83+
var validpk *asymkey_model.PublicKey
8484

8585
// Get our certificate from the header
8686
bcert, err := base64.RawStdEncoding.DecodeString(r.Header.Get("x-ssh-certificate"))
@@ -101,13 +101,13 @@ func VerifyCert(r *http.Request) (*models.PublicKey, error) {
101101
cert := pk.(*ssh.Certificate)
102102

103103
for _, principal := range cert.ValidPrincipals {
104-
validpk, err = models.SearchPublicKeyByContentExact(principal)
104+
validpk, err = asymkey_model.SearchPublicKeyByContentExact(principal)
105105
if err != nil {
106106
log.Error("SearchPublicKeyByContentExact: %v", err)
107107
return validpk, err
108108
}
109109

110-
if models.IsErrKeyNotExist(err) {
110+
if asymkey_model.IsErrKeyNotExist(err) {
111111
continue
112112
}
113113

0 commit comments

Comments
 (0)