checker: report skipped rules as StatusUnknown
Skipped tests that are not problematic should be UNKNOWN rather than INFO; the affected rules cannot evaluate without their input, so they are non-evaluations, not findings.
This commit is contained in:
parent
8b38c43b8a
commit
d73502b0e2
4 changed files with 8 additions and 11 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
// Version is overridden at link time by the build, or by the plugin loader.
|
||||
var Version = "built-in"
|
||||
|
||||
func Definition() *sdk.CheckerDefinition {
|
||||
func (p *autoconfigProvider) Definition() *sdk.CheckerDefinition {
|
||||
return &sdk.CheckerDefinition{
|
||||
ID: "email-autoconfig",
|
||||
Name: "Email Autoconfiguration",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,3 @@ type autoconfigProvider struct{}
|
|||
func (p *autoconfigProvider) Key() sdk.ObservationKey {
|
||||
return ObservationKeyAutoconfig
|
||||
}
|
||||
|
||||
func (p *autoconfigProvider) Definition() *sdk.CheckerDefinition {
|
||||
return Definition()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ func (r *preferredEndpointRule) Evaluate(ctx context.Context, obs sdk.Observatio
|
|||
// When nothing works, let the presence rule drive the verdict.
|
||||
if !anyOK {
|
||||
return single(sdk.CheckState{
|
||||
Status: sdk.StatusInfo,
|
||||
Status: sdk.StatusUnknown,
|
||||
Message: "No autoconfig responded; primary endpoint not evaluated.",
|
||||
Code: "autoconfig_preferred_skip",
|
||||
})
|
||||
|
|
@ -192,7 +192,7 @@ func (r *tlsRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter, opts
|
|||
|
||||
if len(out) == 0 {
|
||||
return single(sdk.CheckState{
|
||||
Status: sdk.StatusInfo,
|
||||
Status: sdk.StatusUnknown,
|
||||
Message: "No autoconfig probe reached an endpoint; TLS not assessed.",
|
||||
Code: "autoconfig_tls_skip",
|
||||
})
|
||||
|
|
@ -218,7 +218,7 @@ func (r *encryptionRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter
|
|||
}
|
||||
if d.ClientConfig == nil {
|
||||
return single(sdk.CheckState{
|
||||
Status: sdk.StatusInfo,
|
||||
Status: sdk.StatusUnknown,
|
||||
Message: "No clientConfig parsed; encryption check skipped.",
|
||||
Code: "autoconfig_encryption_skip",
|
||||
})
|
||||
|
|
@ -257,7 +257,7 @@ func (r *encryptionRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter
|
|||
}
|
||||
if len(out) == 0 {
|
||||
return single(sdk.CheckState{
|
||||
Status: sdk.StatusInfo,
|
||||
Status: sdk.StatusUnknown,
|
||||
Message: "clientConfig declares no server to evaluate.",
|
||||
Code: "autoconfig_encryption_skip",
|
||||
})
|
||||
|
|
@ -283,7 +283,7 @@ func (r *consistencyRule) Evaluate(ctx context.Context, obs sdk.ObservationGette
|
|||
}
|
||||
if d.ClientConfig == nil {
|
||||
return single(sdk.CheckState{
|
||||
Status: sdk.StatusInfo,
|
||||
Status: sdk.StatusUnknown,
|
||||
Message: "No clientConfig to compare.",
|
||||
Code: "autoconfig_consistency_skip",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ var Version = "custom-build"
|
|||
|
||||
func NewCheckerPlugin() (*sdk.CheckerDefinition, sdk.ObservationProvider, error) {
|
||||
autoconfig.Version = Version
|
||||
return autoconfig.Definition(), autoconfig.Provider(), nil
|
||||
prvd := autoconfig.Provider()
|
||||
return prvd.(sdk.CheckerDefinitionProvider).Definition(), prvd, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue