Skip to content

Commit 9dbb6a7

Browse files
authored
chore: fix 'publicly accessible' wording (#242)
## Issue Resolves #240 ## Description Reword misleading usages of the term 'publicly accessible'. Signed-off-by: Tyler Gillson <[email protected]>
1 parent 574776b commit 9dbb6a7

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Network validator plugin reconciles `NetworkValidator` custom resources to p
1717
3. Validate TCP connections to arbitrary host + port(s), optionally through an HTTP proxy
1818
4. Check each IP in a given range (starting IP + next N IPs) to ensure that they're all unallocated
1919
5. Check that the default NIC has an MTU of at least X, where X is the provided MTU
20-
6. Check that each file in a list of URLs is available and publicly accessible by any HTTP client, unless the client were behind a firewall that would prevent it from connecting to the host in the URL.
20+
6. Check that each file in a list of URLs is available via an HTTP HEAD request, optionally with HTTP basic authentication.
2121

2222
Each `NetworkValidator` CR is (re)-processed every two minutes to continuously ensure that your network matches the expected state.
2323

api/v1alpha1/networkvalidator_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type NetworkValidatorSpec struct {
4444
// +kubebuilder:validation:MaxItems=5
4545
// +kubebuilder:validation:XValidation:message="TCPConnRules must have unique names",rule="self.all(e, size(self.filter(x, x.name == e.name)) == 1)"
4646
TCPConnRules []TCPConnRule `json:"tcpConnRules,omitempty" yaml:"tcpConnRules,omitempty"`
47-
// HTTPFileRules validate that files are publicly available via HTTP
47+
// HTTPFileRules validate that files are available via HTTP HEAD requests
4848
// +kubebuilder:validation:MaxItems=5
4949
// +kubebuilder:validation:XValidation:message="HTTPFileRules must have unique names",rule="self.all(e, size(self.filter(x, x.name == e.name)) == 1)"
5050
HTTPFileRules []HTTPFileRule `json:"httpFileRules,omitempty" yaml:"httpFileRules,omitempty"`

chart/validator-plugin-network/crds/validation.spectrocloud.labs_networkvalidators.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ spec:
9797
- message: DNSRules must have unique names
9898
rule: self.all(e, size(self.filter(x, x.name == e.name)) == 1)
9999
httpFileRules:
100-
description: HTTPFileRules validate that files are publicly available
101-
via HTTP
100+
description: HTTPFileRules validate that files are available via HTTP
101+
HEAD requests
102102
items:
103103
description: HTTPFileRule defines an HTTP file rule. A unique rule
104104
must be created for each host requiring HTTP basic authentication.

config/crd/bases/validation.spectrocloud.labs_networkvalidators.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ spec:
9797
- message: DNSRules must have unique names
9898
rule: self.all(e, size(self.filter(x, x.name == e.name)) == 1)
9999
httpFileRules:
100-
description: HTTPFileRules validate that files are publicly available
101-
via HTTP
100+
description: HTTPFileRules validate that files are available via HTTP
101+
HEAD requests
102102
items:
103103
description: HTTPFileRule defines an HTTP file rule. A unique rule
104104
must be created for each host requiring HTTP basic authentication.

pkg/network/network.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,23 +218,23 @@ func (n *RuleService) ReconcileHTTPFileRule(rule v1alpha1.HTTPFileRule) *types.V
218218

219219
// Build the default ValidationResult for this HTTP file rule
220220
vr := BuildValidationResult(rule, constants.ValidationTypeHTTPFile)
221-
vr.Condition.Message = "All files are publicly accessible."
221+
vr.Condition.Message = "All files are accessible."
222222
vr.Condition.Details = append(vr.Condition.Details, fmt.Sprintf(
223-
"Ensuring that files %v are publicly accessible.",
223+
"Ensuring that files %v are accessible.",
224224
rule.Paths,
225225
))
226226

227227
for _, path := range rule.Paths {
228228
checkFileErrMsg, err := n.checkFile(path)
229229
if err != nil {
230-
vr.Condition.Failures = append(vr.Condition.Failures, fmt.Sprintf("failed to check file '%s': %s", path, err))
230+
vr.Condition.Failures = append(vr.Condition.Failures, fmt.Sprintf("failed to check file %s: %s", path, err))
231231
continue
232232
}
233233
if checkFileErrMsg != "" {
234-
vr.Condition.Failures = append(vr.Condition.Failures, fmt.Sprintf("file '%s' is not publicly accessible; %s", path, checkFileErrMsg))
234+
vr.Condition.Failures = append(vr.Condition.Failures, fmt.Sprintf("file %s is not accessible; %s", path, checkFileErrMsg))
235235
continue
236236
}
237-
vr.Condition.Details = append(vr.Condition.Details, fmt.Sprintf("File '%s' is publicly accessible.", path))
237+
vr.Condition.Details = append(vr.Condition.Details, fmt.Sprintf("File %s is accessible.", path))
238238
}
239239

240240
if len(vr.Condition.Failures) > 0 {

pkg/network/network_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ func TestReconcileHTTPFileRule(t *testing.T) {
3737
Condition: &vapi.ValidationCondition{
3838
ValidationType: "http-file",
3939
ValidationRule: "rule-1",
40-
Message: "All files are publicly accessible.",
40+
Message: "All files are accessible.",
4141
Details: []string{
42-
"Ensuring that files [{{serverUrl}}/file1] are publicly accessible.",
43-
"File '{{serverUrl}}/file1' is publicly accessible.",
42+
"Ensuring that files [{{serverUrl}}/file1] are accessible.",
43+
"File {{serverUrl}}/file1 is accessible.",
4444
},
4545
Failures: []string{},
4646
Status: corev1.ConditionTrue,
@@ -61,11 +61,11 @@ func TestReconcileHTTPFileRule(t *testing.T) {
6161
Condition: &vapi.ValidationCondition{
6262
ValidationType: "http-file",
6363
ValidationRule: "rule-1",
64-
Message: "All files are publicly accessible.",
64+
Message: "All files are accessible.",
6565
Details: []string{
66-
"Ensuring that files [{{serverUrl}}/file1 {{serverUrl}}/file2] are publicly accessible.",
67-
"File '{{serverUrl}}/file1' is publicly accessible.",
68-
"File '{{serverUrl}}/file2' is publicly accessible.",
66+
"Ensuring that files [{{serverUrl}}/file1 {{serverUrl}}/file2] are accessible.",
67+
"File {{serverUrl}}/file1 is accessible.",
68+
"File {{serverUrl}}/file2 is accessible.",
6969
},
7070
Failures: []string{},
7171
Status: corev1.ConditionTrue,
@@ -99,10 +99,10 @@ func TestReconcileHTTPFileRule(t *testing.T) {
9999
ValidationRule: "rule-1",
100100
Message: "HTTPFile check(s) failed. See failures for details.",
101101
Details: []string{
102-
"Ensuring that files [{{serverUrl}}/file1] are publicly accessible.",
102+
"Ensuring that files [{{serverUrl}}/file1] are accessible.",
103103
},
104104
Failures: []string{
105-
`failed to check file '{{serverUrl}}/file1': failed to send HTTP request: Head "{{serverUrl}}/file1": EOF`,
105+
`failed to check file {{serverUrl}}/file1: failed to send HTTP request: Head "{{serverUrl}}/file1": EOF`,
106106
},
107107
Status: corev1.ConditionFalse,
108108
},
@@ -124,10 +124,10 @@ func TestReconcileHTTPFileRule(t *testing.T) {
124124
ValidationRule: "rule-1",
125125
Message: "HTTPFile check(s) failed. See failures for details.",
126126
Details: []string{
127-
"Ensuring that files [{{serverUrl}}/file1] are publicly accessible.",
127+
"Ensuring that files [{{serverUrl}}/file1] are accessible.",
128128
},
129129
Failures: []string{
130-
"file '{{serverUrl}}/file1' is not publicly accessible; '404' status code in response to HEAD request",
130+
"file {{serverUrl}}/file1 is not accessible; '404' status code in response to HEAD request",
131131
},
132132
Status: corev1.ConditionFalse,
133133
},

pkg/secrets/secrets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func ReadKeys(name, namespace string, keys []string, reader client.Reader) ([][]
2323
for i, k := range keys {
2424
data, ok := secret.Data[k]
2525
if !ok {
26-
return nil, fmt.Errorf("secret %s/%s does not contain key '%s'", name, namespace, k)
26+
return nil, fmt.Errorf("secret %s/%s does not contain key %s", name, namespace, k)
2727
}
2828
values[i] = data
2929
}

0 commit comments

Comments
 (0)