Tweaked project structure (#88)

This commit is contained in:
Thomas Miceli
2023-09-03 00:30:57 +02:00
committed by GitHub
parent 25316d7bf2
commit a7b346d8df
25 changed files with 122 additions and 116 deletions

View File

@ -4,7 +4,7 @@ import (
"errors"
"github.com/rs/zerolog/log"
"github.com/thomiceli/opengist/internal/config"
"github.com/thomiceli/opengist/internal/models"
"github.com/thomiceli/opengist/internal/db"
"golang.org/x/crypto/ssh"
"gorm.io/gorm"
"io"
@ -24,7 +24,7 @@ func Start() {
sshConfig := &ssh.ServerConfig{
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
strKey := strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key)))
_, err := models.SSHKeyDoesExists(strKey)
_, err := db.SSHKeyDoesExists(strKey)
if err != nil {
if !errors.Is(err, gorm.ErrRecordNotFound) {
return nil, err