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 #6733

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

j1m-ryan
Copy link

@j1m-ryan j1m-ryan commented Oct 30, 2024

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

@j1m-ryan j1m-ryan requested a review from a team as a code owner October 30, 2024 13:13
@github-actions github-actions bot added bug An issue reporting a potential bug go Pull requests that update Go code labels Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.46%. Comparing base (83d09fa) to head (6b7b252).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6733      +/-   ##
==========================================
+ Coverage   53.44%   53.46%   +0.02%     
==========================================
  Files          87       87              
  Lines       20111    20120       +9     
==========================================
+ Hits        10748    10757       +9     
  Misses       8928     8928              
  Partials      435      435              

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

Copy link
Contributor

@jjngx jjngx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@j1m-ryan j1m-ryan added the needs cherry pick Cherry pick this PR into a release branch label Oct 30, 2024
@j1m-ryan j1m-ryan merged commit e9561e9 into main Oct 30, 2024
81 checks passed
@j1m-ryan j1m-ryan deleted the fix/apikey-suppliedin-nil-check branch October 30, 2024 14:41
nginx-bot pushed a commit that referenced this pull request Oct 30, 2024
@pdabelf5 pdabelf5 changed the title add nil check to apikey suppliedIn Add nil check to apikey suppliedIn Dec 13, 2024
@pdabelf5 pdabelf5 removed go Pull requests that update Go code needs cherry pick Cherry pick this PR into a release branch labels Dec 13, 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