Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpg api: allow self signed and use default gpg version #1246

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions api/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}

var err error
args := []string{"--no-default-keyring"}
args := []string{"--no-default-keyring", "--allow-non-selfsigned-uid"}
keyring := "trustedkeys.gpg"
if len(b.Keyring) > 0 {
keyring = b.Keyring
Expand Down Expand Up @@ -73,11 +73,11 @@
// there is no error handling for such as gpg will do this for us
cmd := exec.Command(gpg, args...)
fmt.Printf("running %s %s\n", gpg, strings.Join(args, " "))
cmd.Stdout = os.Stdout
if err = cmd.Run(); err != nil {
AbortWithJSONError(c, 400, err)
out, err := cmd.CombinedOutput()
if err != nil {
c.JSON(400, string(out))

Check warning on line 78 in api/gpg.go

View check run for this annotation

Codecov / codecov/patch

api/gpg.go#L78

Added line #L78 was not covered by tests
return
}

c.JSON(200, gin.H{})
c.JSON(200, string(out))
}
Loading