mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Refactor GPG signer/verifier
Goal is to make it easier to plug in another implementation.
This commit is contained in:
+3
-2
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/DisposaBoy/JsonConfigReader"
|
||||
"github.com/smira/aptly/pgp"
|
||||
"github.com/smira/aptly/utils"
|
||||
)
|
||||
|
||||
@@ -85,7 +86,7 @@ func (u *Uploaders) IsAllowed(changes *Changes) error {
|
||||
deny := u.ExpandGroups(rule.Deny)
|
||||
for _, key := range changes.SignatureKeys {
|
||||
for _, item := range deny {
|
||||
if item == "*" || key.Matches(utils.GpgKey(item)) {
|
||||
if item == "*" || key.Matches(pgp.Key(item)) {
|
||||
return fmt.Errorf("denied according to rule: %s", rule)
|
||||
}
|
||||
}
|
||||
@@ -94,7 +95,7 @@ func (u *Uploaders) IsAllowed(changes *Changes) error {
|
||||
allow := u.ExpandGroups(rule.Allow)
|
||||
for _, key := range changes.SignatureKeys {
|
||||
for _, item := range allow {
|
||||
if item == "*" || key.Matches(utils.GpgKey(item)) {
|
||||
if item == "*" || key.Matches(pgp.Key(item)) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user