CFE-882: Route external certificate validation#1549
CFE-882: Route external certificate validation#1549thejasn wants to merge 3 commits intoopenshift:masterfrom
Conversation
|
@thejasn: This pull request references CFE-882 which is a valid jira issue. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Skipping CI for Draft Pull Request. |
bc7829a to
679f3fc
Compare
679f3fc to
e6f2ca7
Compare
e6f2ca7 to
31a4e26
Compare
f340708 to
2245efc
Compare
b9b6aac to
9e93e53
Compare
|
@thejasn: This pull request references CFE-882 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
9e93e53 to
90c9115
Compare
|
/cc @p0lyn0mial |
90c9115 to
2805597
Compare
|
/cc @alebedev87 |
Introduce new external certificate validation function to check if user has the required rbac when updating routes and using the ExternalCertificate field on the route.
Update all route validation functions to parse TP featuregate and validate ExternalCertificate field on the route.
2805597 to
971698e
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: thejasn The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
alebedev87
left a comment
There was a problem hiding this comment.
First run: code oriented, not logic oriented.
| AllowExternalCertificates bool | ||
| } | ||
|
|
||
| func CheckRouteCustomHostSAR(ctx context.Context, fldPath *field.Path, sarc SubjectAccessReviewCreator) field.ErrorList { |
There was a problem hiding this comment.
Can you please provide a comment which verbs and sub resources are supposed to be checked?
| validType bool | ||
| secretData map[string]string | ||
| validNS bool |
There was a problem hiding this comment.
Same as in validation package. What do you think about providing corev1.Secret as a test case input?
f276dc4 to
186073d
Compare
|
@thejasn: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/close |
|
@chiragkyal: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Description
Updates route validations based on openshift/enhancements#1307 which introduces a new field in the route API externalCertificate behind the TP feature gate.
Changes
ValidateRoute()has been updated to pass additional args (secrets lister and subjectaccessreviewer) to validateexternalCertificateand the rbac required. Now it also does additional subject access review authorization checks to verify if the router SA has the correct permissions to parseexternalCertificate. It also adds a hard requirement that the secret referenced inexternalCertificatebe present prior to creating the route.ValidateHostUpdate()has also been updated since updating route host/subdomain is also affected by updatingcertificates on the route. Now
certificateChangeRequiresAuth()will always returntrueif the route has aexternalCertificateset (check EP for additional info).custom-hostsub-resource. Additional details can be found on the EP.