-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added PerRPCCredentials for gRPC settings #1250
Added PerRPCCredentials for gRPC settings #1250
Conversation
For a bit more context: I'm building a PoC for a multi-tenant solution, where the agent reads the token from the file system and adds it as part of the RPC payload to the remote collector. The collector then extracts the tenant information based on the JWT and enhances the spans with a tenant resource value. The feature in this PR is quite generic and would be useful to quite a good number of use cases, not only in the scenario I described above. The processor I mentioned before still needs some work, but will be contributed to the |
Codecov Report
@@ Coverage Diff @@
## master #1250 +/- ##
=======================================
Coverage 89.73% 89.74%
=======================================
Files 215 216 +1
Lines 15136 15150 +14
=======================================
+ Hits 13583 13597 +14
Misses 1134 1134
Partials 419 419
Continue to review full report at Codecov.
|
c0809ff
to
08440a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpkrohling could you please add code (and test) to handle the case when the auth type is unknown other than that LGTM.
PR updated. The only point to clarify seems to be regarding the ability to read tokens from local files. (PS: for some reason, I can't seem to be able to re-request a review from @odeke-em) |
08440a8
to
f6d7a16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, fix the error msg in case of an unknown auth type.
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
a68c9a1
to
449c5d2
Compare
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
449c5d2
to
6c780d1
Compare
Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de
Description:
This PR adds support for including a per-RPC authentication to gRPC settings. Initially, only "bearer" token has been added, but can be easily extended in the future based on real-world needs. The token can be read directly from the configuration file or from an external token file, such as the ones injected by Kubernetes into pods.
Link to tracking Issue: n/a
Testing: this was successfully tested with a custom processor, reading the bearer token from the context via
metadata.FromIncomingContext(ctx)
. Additionally, unit tests were added to this PR.Documentation: the
config.yaml
reference file has been updated to include this new option.