Rename gpgkey_urls to gpgkeys
This has never been supported in osbuild-composer, so it is safe to rename in preparation for adding repo metadata gpg signature checking.
This commit is contained in:
parent
7a1d7ae1d7
commit
a47375a10d
3 changed files with 31 additions and 31 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
// +build integration
|
//go:build integration
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
@ -171,7 +171,7 @@ type = "yum-baseurl"
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`))
|
`))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ func TestPOSTJSONSourceV0(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`
|
}`
|
||||||
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ func TestPOSTInvalidJSONSourceV0(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`
|
}`
|
||||||
|
|
||||||
resp, err := PostJSONSourceV0(testState.socket, source)
|
resp, err := PostJSONSourceV0(testState.socket, source)
|
||||||
|
|
@ -81,7 +81,7 @@ func TestPOSTInvalidJSONSourceV1(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`
|
}`
|
||||||
|
|
||||||
resp, err := PostJSONSourceV1(testState.socket, source)
|
resp, err := PostJSONSourceV1(testState.socket, source)
|
||||||
|
|
@ -103,7 +103,7 @@ func TestPOSTSystemJSONSourceV0(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`
|
}`
|
||||||
|
|
||||||
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
||||||
|
|
@ -137,7 +137,7 @@ func TestPOSTSystemJSONSourceV1(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`
|
}`
|
||||||
|
|
||||||
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
||||||
|
|
@ -165,7 +165,7 @@ func TestPOSTTOMLSourceV0(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ func TestPOSTTOMLSourceV1(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
||||||
|
|
||||||
|
|
@ -225,7 +225,7 @@ func TestPOSTInvalidTOMLSourceV0(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
|
|
||||||
resp, err := PostTOMLSourceV0(testState.socket, source)
|
resp, err := PostTOMLSourceV0(testState.socket, source)
|
||||||
|
|
@ -244,7 +244,7 @@ func TestPOSTInvalidTOMLSourceV1(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
|
|
||||||
resp, err := PostTOMLSourceV1(testState.socket, source)
|
resp, err := PostTOMLSourceV1(testState.socket, source)
|
||||||
|
|
@ -263,7 +263,7 @@ func TestPOSTWrongTOMLSourceV0(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
|
|
||||||
resp, err := PostTOMLSourceV0(testState.socket, source)
|
resp, err := PostTOMLSourceV0(testState.socket, source)
|
||||||
|
|
@ -283,7 +283,7 @@ func TestPOSTWrongTOMLSourceV1(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
|
|
||||||
resp, err := PostTOMLSourceV1(testState.socket, source)
|
resp, err := PostTOMLSourceV1(testState.socket, source)
|
||||||
|
|
@ -304,7 +304,7 @@ func TestPOSTTOMLSystemSourceV0(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
||||||
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
||||||
|
|
@ -337,7 +337,7 @@ func TestPOSTTOMLSystemSourceV1(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
||||||
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} {
|
||||||
|
|
@ -365,7 +365,7 @@ func TestListSourcesV0(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`,
|
}`,
|
||||||
`{
|
`{
|
||||||
"name": "package-repo-2",
|
"name": "package-repo-2",
|
||||||
|
|
@ -374,7 +374,7 @@ func TestListSourcesV0(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`}
|
}`}
|
||||||
|
|
||||||
for i := range sources {
|
for i := range sources {
|
||||||
|
|
@ -412,7 +412,7 @@ func TestListSourcesV1(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`,
|
}`,
|
||||||
`{
|
`{
|
||||||
"id": "package-repo-2",
|
"id": "package-repo-2",
|
||||||
|
|
@ -422,7 +422,7 @@ func TestListSourcesV1(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`}
|
}`}
|
||||||
|
|
||||||
for i := range sources {
|
for i := range sources {
|
||||||
|
|
@ -459,7 +459,7 @@ func TestGetSourceInfoV0(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
`
|
`
|
||||||
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
||||||
|
|
||||||
|
|
@ -489,7 +489,7 @@ func TestGetSourceInfoV1(t *testing.T) {
|
||||||
proxy = "https://proxy-url/"
|
proxy = "https://proxy-url/"
|
||||||
check_ssl = true
|
check_ssl = true
|
||||||
check_gpg = true
|
check_gpg = true
|
||||||
gpgkey_urls = ["https://url/path/to/gpg-key"]
|
gpgkeys = ["https://url/path/to/gpg-key"]
|
||||||
rhsm = false
|
rhsm = false
|
||||||
`
|
`
|
||||||
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1)
|
||||||
|
|
@ -560,7 +560,7 @@ func TestDeleteUserDefinedSourcesV0(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`,
|
}`,
|
||||||
`{
|
`{
|
||||||
"name": "package-repo-2",
|
"name": "package-repo-2",
|
||||||
|
|
@ -569,7 +569,7 @@ func TestDeleteUserDefinedSourcesV0(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`}
|
}`}
|
||||||
|
|
||||||
// verify test starts without user defined sources
|
// verify test starts without user defined sources
|
||||||
|
|
@ -601,7 +601,7 @@ func TestDeleteUserDefinedSourcesV1(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`,
|
}`,
|
||||||
`{
|
`{
|
||||||
"id": "package-repo-2",
|
"id": "package-repo-2",
|
||||||
|
|
@ -611,7 +611,7 @@ func TestDeleteUserDefinedSourcesV1(t *testing.T) {
|
||||||
"proxy": "https://proxy-url/",
|
"proxy": "https://proxy-url/",
|
||||||
"check_ssl": true,
|
"check_ssl": true,
|
||||||
"check_gpg": true,
|
"check_gpg": true,
|
||||||
"gpgkey_urls": ["https://url/path/to/gpg-key"]
|
"gpgkeys": ["https://url/path/to/gpg-key"]
|
||||||
}`}
|
}`}
|
||||||
|
|
||||||
// verify test starts without user defined sources
|
// verify test starts without user defined sources
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ type SourceConfig interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSourceConfigV0 converts a store.SourceConfig to a SourceConfigV0
|
// NewSourceConfigV0 converts a store.SourceConfig to a SourceConfigV0
|
||||||
// The store does not support proxy and gpgkey_urls
|
// The store does not support proxy and gpgkeys
|
||||||
func NewSourceConfigV0(s store.SourceConfig) SourceConfigV0 {
|
func NewSourceConfigV0(s store.SourceConfig) SourceConfigV0 {
|
||||||
var sc SourceConfigV0
|
var sc SourceConfigV0
|
||||||
|
|
||||||
|
|
@ -143,7 +143,7 @@ type SourceConfigV0 struct {
|
||||||
CheckSSL bool `json:"check_ssl" toml:"check_ssl"`
|
CheckSSL bool `json:"check_ssl" toml:"check_ssl"`
|
||||||
System bool `json:"system" toml:"system"`
|
System bool `json:"system" toml:"system"`
|
||||||
Proxy string `json:"proxy,omitempty" toml:"proxy,omitempty"`
|
Proxy string `json:"proxy,omitempty" toml:"proxy,omitempty"`
|
||||||
GPGUrls []string `json:"gpgkey_urls,omitempty" toml:"gpgkey_urls,omitempty"`
|
GPGKeys []string `json:"gpgkeys,omitempty" toml:"gpgkeys,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key return the key, .Name in this case
|
// Key return the key, .Name in this case
|
||||||
|
|
@ -162,7 +162,7 @@ func (s SourceConfigV0) GetType() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SourceConfig returns a SourceConfig struct populated with the supported variables
|
// SourceConfig returns a SourceConfig struct populated with the supported variables
|
||||||
// The store does not support proxy and gpgkey_urls
|
// The store does not support proxy and gpgkeys
|
||||||
func (s SourceConfigV0) SourceConfig() (ssc store.SourceConfig) {
|
func (s SourceConfigV0) SourceConfig() (ssc store.SourceConfig) {
|
||||||
ssc.Name = s.Name
|
ssc.Name = s.Name
|
||||||
ssc.Type = s.Type
|
ssc.Type = s.Type
|
||||||
|
|
@ -180,7 +180,7 @@ type SourceInfoResponseV0 struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSourceConfigV1 converts a store.SourceConfig to a SourceConfigV1
|
// NewSourceConfigV1 converts a store.SourceConfig to a SourceConfigV1
|
||||||
// The store does not support proxy and gpgkey_urls
|
// The store does not support proxy and gpgkeys
|
||||||
func NewSourceConfigV1(id string, s store.SourceConfig) SourceConfigV1 {
|
func NewSourceConfigV1(id string, s store.SourceConfig) SourceConfigV1 {
|
||||||
var sc SourceConfigV1
|
var sc SourceConfigV1
|
||||||
|
|
||||||
|
|
@ -207,7 +207,7 @@ type SourceConfigV1 struct {
|
||||||
CheckSSL bool `json:"check_ssl" toml:"check_ssl"`
|
CheckSSL bool `json:"check_ssl" toml:"check_ssl"`
|
||||||
System bool `json:"system" toml:"system"`
|
System bool `json:"system" toml:"system"`
|
||||||
Proxy string `json:"proxy,omitempty" toml:"proxy,omitempty"`
|
Proxy string `json:"proxy,omitempty" toml:"proxy,omitempty"`
|
||||||
GPGUrls []string `json:"gpgkey_urls,omitempty" toml:"gpgkey_urls,omitempty"`
|
GPGKeys []string `json:"gpgkeys,omitempty" toml:"gpgkeys,omitempty"`
|
||||||
Distros []string `json:"distros,omitempty" toml:"distros,omitempty"`
|
Distros []string `json:"distros,omitempty" toml:"distros,omitempty"`
|
||||||
RHSM bool `json:"rhsm" toml:"rhsm"`
|
RHSM bool `json:"rhsm" toml:"rhsm"`
|
||||||
}
|
}
|
||||||
|
|
@ -228,7 +228,7 @@ func (s SourceConfigV1) GetType() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SourceConfig returns a SourceConfig struct populated with the supported variables
|
// SourceConfig returns a SourceConfig struct populated with the supported variables
|
||||||
// The store does not support proxy and gpgkey_urls
|
// The store does not support proxy and gpgkeys
|
||||||
func (s SourceConfigV1) SourceConfig() (ssc store.SourceConfig) {
|
func (s SourceConfigV1) SourceConfig() (ssc store.SourceConfig) {
|
||||||
ssc.Name = s.Name
|
ssc.Name = s.Name
|
||||||
ssc.Type = s.Type
|
ssc.Type = s.Type
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue