nginxinc / kubernetes-ingress

NGINX and NGINX Plus Ingress Controllers for Kubernetes
https://docs.nginx.com/nginx-ingress-controller
Apache License 2.0
4.68k stars 1.97k forks source link

Add nil check to apikey suppliedIn #6735

Closed nginx-bot closed 3 weeks ago

nginx-bot commented 3 weeks ago

Proposed changes

Add nil check in apiKey auth policy's suppliedIn field.

Instead of a stack trace, the policy will now be invalid

I20241030 11:30:59.581640   1 controller.go:2430] Skipping invalid Policy default/api-key-policy: spec.apiKey.suppliedIn: Required value: suppliedIn cannot be nil

A VS that uses an invalid policy will then return 500s for each request.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (release-3.7@83386f6). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release-3.7 #6735 +/- ## ============================================== Coverage ? 52.99% ============================================== Files ? 85 Lines ? 19764 Branches ? 0 ============================================== Hits ? 10473 Misses ? 8885 Partials ? 406 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.