-
Notifications
You must be signed in to change notification settings - Fork 581
Add Conformance tests for BackendTLSPolicy validating SANs with Type dsnName #3983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,33 @@ spec: | |
- path: | ||
type: Exact | ||
value: /backendTLSCertMismatch | ||
- backendRefs: | ||
- group: "" | ||
kind: Service | ||
name: backendtlspolicy-san-mismatch-test | ||
port: 443 | ||
matches: | ||
- path: | ||
type: Exact | ||
value: /backendTLSSanMismatch | ||
- backendRefs: | ||
- group: "" | ||
kind: Service | ||
name: backendtlspolicy-san-test | ||
port: 443 | ||
matches: | ||
- path: | ||
type: Exact | ||
value: /backendTLSSan | ||
- backendRefs: | ||
- group: "" | ||
kind: Service | ||
name: backendtlspolicy-multiple-sans-test | ||
port: 443 | ||
matches: | ||
- path: | ||
type: Exact | ||
value: /backendTLSMultiSans | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
|
@@ -115,6 +142,51 @@ spec: | |
port: 443 | ||
targetPort: 8443 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: backendtlspolicy-san-mismatch-test | ||
namespace: gateway-conformance-infra | ||
spec: | ||
selector: | ||
app: backendtlspolicy-test | ||
ports: | ||
- name: "btls" | ||
protocol: TCP | ||
appProtocol: HTTPS | ||
port: 443 | ||
targetPort: 8443 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: backendtlspolicy-san-test | ||
namespace: gateway-conformance-infra | ||
spec: | ||
selector: | ||
app: backendtlspolicy-test | ||
ports: | ||
- name: "btls" | ||
protocol: TCP | ||
appProtocol: HTTPS | ||
port: 443 | ||
targetPort: 8443 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: backendtlspolicy-multiple-sans-test | ||
namespace: gateway-conformance-infra | ||
spec: | ||
selector: | ||
app: backendtlspolicy-test | ||
ports: | ||
- name: "btls" | ||
protocol: TCP | ||
appProtocol: HTTPS | ||
port: 443 | ||
targetPort: 8443 | ||
--- | ||
# Deployment must not be applied until after the secret is generated. | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
|
@@ -237,3 +309,73 @@ spec: | |
# This secret is generated dynamically by the test suite. | ||
name: "backend-tls-mismatch-certificate" | ||
hostname: "abc.example.com" | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1alpha3 | ||
kind: BackendTLSPolicy | ||
metadata: | ||
name: backendtlspolicy-san | ||
namespace: gateway-conformance-infra | ||
spec: | ||
targetRefs: | ||
- group: "" | ||
kind: Service | ||
name: "backendtlspolicy-san-test" | ||
sectionName: "btls" | ||
validation: | ||
caCertificateRefs: | ||
- group: "" | ||
kind: ConfigMap | ||
# This secret is generated dynamically by the test suite. | ||
name: "backend-tls-checks-certificate" | ||
hostname: "abc.example.com" | ||
subjectAltNames: | ||
- type: Hostname | ||
hostname: abc.example.com | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1alpha3 | ||
kind: BackendTLSPolicy | ||
metadata: | ||
name: backendtlspolicy-multiple-sans | ||
namespace: gateway-conformance-infra | ||
spec: | ||
targetRefs: | ||
- group: "" | ||
kind: Service | ||
name: "backendtlspolicy-multiple-sans-test" | ||
sectionName: "btls" | ||
validation: | ||
caCertificateRefs: | ||
- group: "" | ||
kind: ConfigMap | ||
# This secret is generated dynamically by the test suite. | ||
name: "backend-tls-checks-certificate" | ||
hostname: "abc.example.com" | ||
subjectAltNames: | ||
- type: Hostname | ||
hostname: abc.example.com | ||
- type: Hostname | ||
hostname: efg.example.com | ||
- type: Hostname | ||
hostname: yjh.example.com | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you also plan to add some test with SAN type URI? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes but I wanted to do this in next PR, because there will be more changes related to certificate creation. |
||
--- | ||
apiVersion: gateway.networking.k8s.io/v1alpha3 | ||
kind: BackendTLSPolicy | ||
metadata: | ||
name: backendtlspolicy-san-mismatch | ||
namespace: gateway-conformance-infra | ||
spec: | ||
targetRefs: | ||
- group: "" | ||
kind: Service | ||
name: "backendtlspolicy-san-mismatch-test" | ||
sectionName: "btls" | ||
validation: | ||
caCertificateRefs: | ||
- group: "" | ||
kind: ConfigMap | ||
# This secret is generated dynamically by the test suite. | ||
name: "backend-tls-checks-certificate" | ||
hostname: "abc.example.com" | ||
subjectAltNames: | ||
- type: Hostname | ||
hostname: cde.example.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this will pass if any non-200 error code is returned. Can we be more specific here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the spec is a bit vague here, error codes are not constrained but it is up to implementation how to signal the error