🐋Implement k8s authorization#618
Merged
amorey merged 1 commit intokubetail-org:cluster-agent-rewritefrom Aug 24, 2025
Merged
Conversation
gikaragia
commented
Aug 23, 2025
| } | ||
|
|
||
| /// Checks that the the k8s doing the request has proper rights to access the log files. | ||
| #[cfg(not(test))] |
Collaborator
Author
There was a problem hiding this comment.
There are a couple of issues with this implementation.
- First, the ideal way to implement such functionality is with an interceptor (middleware). The problem is that tonic does not support async interceptors out of the box, and I would need to use a custom crate for this functionality. I chose not to use an interceptor.
- Secondly, the ideal way to stub the authorizer in the tests would be to use dependency injection. However, this made the types very complicated, so I think that using #[cfg] directives is preferable
Member
There was a problem hiding this comment.
Makes sense. When we switch over to treating the Cluster API as a "Kubernetes API extension" then authentication will work with impersonation headers rather than tokens so I think doing things quick-and-simple like this for now sounds good. When we have a better idea of how auth will work long-term we can revisit it.
Signed-off-by: Giannis K <ikaragi23@yahoo.gr>
9ef90eb to
ad44135
Compare
gikaragia
added a commit
to gikaragia/kubetail
that referenced
this pull request
Aug 31, 2025
…ail-org#618) Signed-off-by: Giannis K <ikaragi23@yahoo.gr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #616
Summary
Similarly with the old cluster agent, we now check that the pods making a request have the proper rights.
Changes
Testing instructions
Submitter checklist
Footnotes
See suggested commit format ↩