Cleanup setupKey to align to linear

This commit is contained in:
riccardom
2026-06-01 16:41:37 +02:00
parent 451fa5e142
commit 2d7949adfe
2 changed files with 3 additions and 6 deletions

View File

@@ -20,7 +20,6 @@ import (
// configuration field.
const (
KeyManagementURL = "managementURL"
KeySetupKey = "setupKey"
KeyDisableAdvancedSettings = "disableAdvancedSettings"
KeyDisableUpdateSettings = "disableUpdateSettings"
KeyDisableProfiles = "disableProfiles"
@@ -42,7 +41,6 @@ const (
// configuration are ignored but logged.
var AllKeys = []string{
KeyManagementURL,
KeySetupKey,
KeyDisableAdvancedSettings,
KeyDisableUpdateSettings,
KeyDisableProfiles,
@@ -62,7 +60,6 @@ var AllKeys = []string{
// SecretKeys lists keys whose values must be redacted in logs.
var SecretKeys = map[string]struct{}{
KeySetupKey: {},
KeyPreSharedKey: {},
}

View File

@@ -37,7 +37,7 @@ func TestPolicy_HasKey(t *testing.T) {
assert.False(t, p.IsEmpty())
assert.True(t, p.HasKey(KeyManagementURL))
assert.True(t, p.HasKey(KeyDisableProfiles))
assert.False(t, p.HasKey(KeySetupKey))
assert.False(t, p.HasKey(KeyPreSharedKey))
}
func TestPolicy_ManagedKeysSorted(t *testing.T) {
@@ -54,7 +54,7 @@ func TestPolicy_GetString(t *testing.T) {
p := NewPolicy(map[string]any{
KeyManagementURL: "https://corp.example.com",
KeyDisableProfiles: true, // wrong type for GetString
KeySetupKey: "", // empty rejected
KeyPreSharedKey: "", // empty rejected
})
v, ok := p.GetString(KeyManagementURL)
assert.True(t, ok)
@@ -63,7 +63,7 @@ func TestPolicy_GetString(t *testing.T) {
_, ok = p.GetString(KeyDisableProfiles)
assert.False(t, ok, "non-string value must not be reported as string")
_, ok = p.GetString(KeySetupKey)
_, ok = p.GetString(KeyPreSharedKey)
assert.False(t, ok, "empty string treated as unset")
_, ok = p.GetString("nonexistent")