Repository navigation
Move mutual auth helpers to shared utils - #4918
Conversation
|
Hi @bobert-2. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Protocol-specific validation needs non-HTTPS coverage, and the dependency and documentation inconsistencies should be corrected.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Centralizes mutual-authentication parsing, validation, and trust-store resolution in shared utilities.
Changes:
- Adds shared mutual-authentication helpers and tests.
- Updates ingress listener construction to use shared helpers.
- Removes obsolete context parameters and duplicated validation code.
| File | Description |
|---|---|
pkg/shared_utils/mutual_auth_utils.go |
Adds shared mTLS utilities. |
pkg/shared_utils/mutual_auth_utils_test.go |
Adds validation tests. |
pkg/ingress/model_build_listener.go |
Adopts shared utilities and removes duplication. |
pkg/ingress/model_build_listener_test.go |
Updates tests for revised signatures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| }{ | ||
| { | ||
| name: "happy path no validation error off mode", | ||
| protocol: elbv2model.ProtocolHTTPS, |
| func (t *defaultModelBuildTask) computeIngressListenPortConfigByPort(ctx context.Context, ing *ClassifiedIngress, cert *acmModel.Certificate) (map[int32]listenPortConfig, error) { | ||
| explicitTLSCertARNs := t.computeIngressExplicitTLSCertARNs(ctx, ing) | ||
| // explicitly set ARNs on the IngressClass or Ingress take predecende over newly created certificates, avoid creating unneeded certs then | ||
| // ARNs set on the IngressClass or Ingress take precedent over newly created certificates, avoid creating unneeded certs |
| AdvertiseTrustStoreCaNames *string `json:"advertiseTrustStoreCaNames,omitempty"` | ||
| } | ||
|
|
||
| // ParseMtlsConfigEntries returns an array mapping listener port to MutualAuthenticationAttributes |
|
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bobert-2, shraddhabang, wweiwei-li The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4918 +/- ##
==========================================
+ Coverage 57.44% 57.66% +0.22%
==========================================
Files 396 400 +4
Lines 31619 31922 +303
==========================================
+ Hits 18164 18409 +245
- Misses 12398 12444 +46
- Partials 1057 1069 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
67c67f8 to
3b94210
Compare
0857124 to
4ac66ac
Compare
4ac66ac to
107c8f1
Compare
|
/lgtm |


Description
Code refactoring. Moving mutual authentication helpers to
shared_utils. Tests are updated.Checklist
README.md, or thedocsdirectory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯