-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support verifying with minisign (#2994)
* feat: support verifying with minisign * fix: fix minisign exe path * fix: use GetFiles * fix: download minisign signature * fix: make public_key optional
- Loading branch information
1 parent
22e2139
commit f2b5196
Showing
25 changed files
with
653 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package registry | ||
|
||
type Minisign struct { | ||
Enabled *bool `json:"enabled,omitempty"` | ||
Type string `json:"type,omitempty" jsonschema:"enum=github_release,enum=http"` | ||
RepoOwner string `yaml:"repo_owner,omitempty" json:"repo_owner,omitempty"` | ||
RepoName string `yaml:"repo_name,omitempty" json:"repo_name,omitempty"` | ||
Asset *string `json:"asset,omitempty" yaml:",omitempty"` | ||
URL *string `json:"url,omitempty" yaml:",omitempty"` | ||
PublicKey string `json:"public_key,omitempty" yaml:"public_key,omitempty"` | ||
} | ||
|
||
func (m *Minisign) ToDownloadedFile() *DownloadedFile { | ||
return &DownloadedFile{ | ||
Type: m.Type, | ||
RepoOwner: m.RepoOwner, | ||
RepoName: m.RepoName, | ||
Asset: m.Asset, | ||
URL: m.URL, | ||
} | ||
} | ||
|
||
func (m *Minisign) GetEnabled() bool { | ||
if m == nil { | ||
return false | ||
} | ||
if m.Enabled != nil { | ||
return *m.Enabled | ||
} | ||
return true | ||
} | ||
|
||
func (m *Minisign) GetDownloadedFile() *DownloadedFile { | ||
return &DownloadedFile{ | ||
Type: m.Type, | ||
RepoOwner: m.RepoOwner, | ||
RepoName: m.RepoName, | ||
Asset: m.Asset, | ||
URL: m.URL, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.