保存内置DNS续期与证书同步接续修复前基线
This commit is contained in:
1 parent
7fec05650f
commit
d6ea80a040
23 files changed
+704
-13
No files matched your search
@@ -498,7 +498,13 @@ func publicConfigSection(runtime config.RuntimeConfig, section config.Section) (
|
||||
case config.SectionSSL:
|
||||
value := runtime.SSL
|
||||
value.TLS.Management = config.EffectiveSSLManagement(value.TLS)
|
||||
return value, nil
|
||||
accessStatus, secretStatus := value.TLS.DNSAccessKey.Status(), value.TLS.DNSSecretKey.Status()
|
||||
value.TLS.DNSAccessKey, value.TLS.DNSSecretKey = config.StoredSecret{}, config.StoredSecret{}
|
||||
return struct {
|
||||
config.SSLSectionConfig
|
||||
DNSAccessKeyStatus config.SecretStatus `json:"dnsAccessKeyStatus"`
|
||||
DNSSecretKeyStatus config.SecretStatus `json:"dnsSecretKeyStatus"`
|
||||
}{value, accessStatus, secretStatus}, nil
|
||||
case config.SectionPlugins:
|
||||
plugins := make(map[string]any, len(runtime.Plugins.Plugins))
|
||||
for id, item := range runtime.Plugins.Plugins {
|
||||
|
||||
@@ -39,7 +39,14 @@ func TestPublicConfigSectionsDoNotExposeSecretsAndRemainStrictlyDecodable(t *tes
|
||||
},
|
||||
},
|
||||
Email: config.EmailSectionConfig{Meta: config.SectionMeta{Schema: config.CurrentSectionSchema, Generation: 7}},
|
||||
SSL: config.SSLSectionConfig{Meta: config.SectionMeta{Schema: config.CurrentSectionSchema, Generation: 7}},
|
||||
SSL: config.SSLSectionConfig{
|
||||
Meta: config.SectionMeta{Schema: config.CurrentSectionSchema, Generation: 7},
|
||||
TLS: config.SSLConfig{
|
||||
DNSProvider: config.DNSProviderAliDNS,
|
||||
DNSAccessKey: config.StoredSecret{Ciphertext: "enc:v1:dns-access", Version: credential.CurrentVersion, UpdatedAt: time.Now().UTC()},
|
||||
DNSSecretKey: config.StoredSecret{Ciphertext: "enc:v1:dns-secret", Version: credential.CurrentVersion, UpdatedAt: time.Now().UTC()},
|
||||
},
|
||||
},
|
||||
Plugins: config.PluginsSectionConfig{
|
||||
Meta: config.SectionMeta{Schema: config.CurrentSectionSchema, Generation: 7},
|
||||
Plugins: map[string]config.PluginInstance{
|
||||
@@ -103,6 +110,14 @@ func TestPublicConfigSectionsDoNotExposeSecretsAndRemainStrictlyDecodable(t *tes
|
||||
}
|
||||
delete(writableData, "databasePasswordStatus")
|
||||
delete(writableData, "relayPasswordStatus")
|
||||
if test.section == config.SectionSSL {
|
||||
for _, name := range []string{"dnsAccessKeyStatus", "dnsSecretKeyStatus"} {
|
||||
if !strings.Contains(string(writableData[name]), `"configured":true`) {
|
||||
t.Fatalf("DNS secret status missing: %s", name)
|
||||
}
|
||||
delete(writableData, name)
|
||||
}
|
||||
}
|
||||
if test.section == config.SectionMail {
|
||||
var relay map[string]json.RawMessage
|
||||
if err := json.Unmarshal(writableData["relay"], &relay); err != nil {
|
||||
|
||||
Reference in new issue
Block a user