Skip to content
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

Add nil check to apikey suppliedIn #6735

Conversation

nginx-bot
Copy link
Contributor

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.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@nginx-bot nginx-bot requested a review from a team as a code owner October 30, 2024 14:41
@nginx-bot nginx-bot added bug An issue reporting a potential bug go Pull requests that update Go code needs cherry pick Cherry pick this PR into a release branch labels Oct 30, 2024
@github-actions github-actions bot removed the bug An issue reporting a potential bug label Oct 30, 2024
@AlexFenlon AlexFenlon enabled auto-merge (squash) October 30, 2024 14:42
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pdabelf5 pdabelf5 removed the needs cherry pick Cherry pick this PR into a release branch label Oct 31, 2024
@AlexFenlon AlexFenlon merged commit c96d629 into release-3.7 Oct 31, 2024
69 checks passed
@AlexFenlon AlexFenlon deleted the cherry-pick-release-3.7-e9561e990c51eb671321f336f2a639538f0067f4 branch October 31, 2024 10:57
@pdabelf5 pdabelf5 changed the title [cherry-pick] add nil check to apikey suppliedIn Add nil check to apikey suppliedIn Nov 6, 2024
@pdabelf5 pdabelf5 added bug An issue reporting a potential bug and removed go Pull requests that update Go code labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue reporting a potential bug
Projects
Status: Done 🚀
Development

Successfully merging this pull request may close these issues.

4 participants