This commit is contained in:
Jabberwocky238
2026-07-16 08:42:21 -04:00
parent 3de46894d0
commit c64116069e
5 changed files with 13 additions and 45 deletions
-6
View File
@@ -29,9 +29,6 @@ import (
// (false, ErrDenied) on an unknown key, unknown repo, or insufficient grant.
// skip-auth allows all.
func (s *LocalState) AccessBySSHKey(ctx context.Context, key ssh.PublicKey, owner, name string, perm common.Perm) (bool, error) {
if s.skipAuth {
return true, nil
}
r, err := s.findRepo(owner, name)
if err != nil {
if errors.Is(err, ErrRepoNotFound) {
@@ -84,9 +81,6 @@ func (s *LocalState) AccessBySSHKey(ctx context.Context, key ssh.PublicKey, owne
//
// skip-auth admits everything (no engine).
func (s *LocalState) KnownSSHKey(key ssh.PublicKey) (bool, error) {
if s.skipAuth {
return true, nil
}
var sk SSHKey
has, err := s.engine.Where("fingerprint = ?", fingerprint(key)).Get(&sk)
if err != nil {