cloud-auth, grpc: Add OAuth2 support for gRPC destinations#910
Open
MrAnno wants to merge 3 commits intoaxoflow:mainfrom
Open
cloud-auth, grpc: Add OAuth2 support for gRPC destinations#910MrAnno wants to merge 3 commits intoaxoflow:mainfrom
MrAnno wants to merge 3 commits intoaxoflow:mainfrom
Conversation
Contributor
This Pull Request introduces config grammar changesaxoflow/54416fbf21d92dce04676ed16c028f8eb4b7377e -> MrAnno/generic-oauth2 Details--- a/destination
+++ b/destination
http(
cloud-auth(
+ oauth2(
+ <empty>
+ auth-method(
+ basic
+ post-body
+ )
+ authorization-details(<string>)
+ client-id(<string>)
+ client-secret(<string>)
+ refresh-offset(<number>)
+ resource(<string>)
+ scope(<string>)
+ token-url(<string>)
+ )
)
)
|
3b4d9c7 to
85c5073
Compare
This change introduces a generic OAuth2 authentication module that implements the client credentials flow with configurable authentication methods (HTTP Basic Auth or POST body credentials). The module provides a reusable foundation for cloud service authenticators that use OAuth2. Key features: - Token fetching, caching, and automatic refresh based on expiry - Configurable authentication method via `auth-method()` parameter - Support for optional `scope`, `resource`, and `authorization_details` parameters - Extensible via virtual methods for service-specific customization The existing `azure-auth` module has been refactored to inherit from the generic OAuth2 authenticator, eliminating code duplication while maintaining full backward compatibility with the existing user interface and configuration syntax. Signed-off-by: David Tosovic <david.tosovic@databricks.com>
This change extends the cloud-auth module to support gRPC-based destinations by introducing a signal/slot mechanism for metadata injection, mirroring the existing HTTP header injection pattern. Changes include: - New grpc-signals.h header defining GrpcMetadataRequestSignalData for plugin communication - Signal emission in grpc-dest-worker.cpp to collect metadata from plugins - gRPC signal handlers in cloud-auth module for token injection - Refactored oauth2-auth.cpp using template method pattern to eliminate code duplication between HTTP and gRPC implementations This enables OAuth2 authentication for any gRPC destination (opentelemetry, loki, bigquery, pubsub, clickhouse, etc.) using the same cloud-auth() syntax as HTTP destinations. Signed-off-by: David Tosovic <david.tosovic@databricks.com>
…ense Signed-off-by: László Várady <laszlo.varady@anno.io>
a0c7f11 to
ff5db52
Compare
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.
Cherry-picked from syslog-ng/syslog-ng#5570 and syslog-ng/syslog-ng#5584.
This is amazing work from @davidtosovic-db.