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

fix: use different error messages for namespace scoped token errors #3358

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

rajyan
Copy link
Contributor

@rajyan rajyan commented Aug 7, 2024

Had some difficulty debugging the namespace scoped token error, so improved the error message reason.

@rajyan rajyan requested a review from a team as a code owner August 7, 2024 13:24
return ctx, errUnauthenticated
}
}
default:
// if the the token has a namespace but the request does not then we should reject the request
logger.Error("unauthenticated",
zap.String("reason", "namespace is not allowed"))
zap.String("reason", "namespace is requried when using namespace scoped token"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo:

Suggested change
zap.String("reason", "namespace is requried when using namespace scoped token"))
zap.String("reason", "namespace is required when using namespace scoped token"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!
Fixed and rebased with signed-off commits.

Signed-off-by: Yohta Kimura <38206553+rajyan@users.noreply.github.com>
Signed-off-by: Yohta Kimura <38206553+rajyan@users.noreply.github.com>
Copy link
Contributor

@GeorgeMac GeorgeMac left a comment

Choose a reason for hiding this comment

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

Thank for this @rajyan 🙏 Nice improvement.

@markphelps markphelps added the automerge Used by Kodiak bot to automerge PRs label Aug 7, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.44%. Comparing base (87ca6e8) to head (834fcd4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3358      +/-   ##
==========================================
+ Coverage   64.41%   64.44%   +0.02%     
==========================================
  Files         172      172              
  Lines       13820    13820              
==========================================
+ Hits         8902     8906       +4     
+ Misses       4234     4232       -2     
+ Partials      684      682       -2     
Flag Coverage Δ
unittests 64.44% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@markphelps
Copy link
Collaborator

@all-contributors please add @rajyan for code

Copy link
Contributor

@markphelps

I've put up a pull request to add @rajyan! 🎉

@kodiakhq kodiakhq bot merged commit 5a18261 into flipt-io:main Aug 7, 2024
33 checks passed
@rajyan rajyan deleted the patch-1 branch August 7, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Used by Kodiak bot to automerge PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants