Skip to content

Conversation

Louis-Tarvin
Copy link

This PR builds off of the work done in #442 and #457, adding the missing support for SASL extensions. This allows extensions to be returned from ClientContext::generate_oauth_token as key-value pairs, which then get passed to rd_kafka_oauthbearer_set_token after being converted into the correct format.

Example:

struct RefreshContext;

impl ClientContext for RefreshContext {
    const ENABLE_REFRESH_OAUTH_TOKEN: bool = true;

    fn generate_oauth_token(
        &self,
        oauthbearer_config: Option<&str>,
    ) -> Result<OAuthToken, Box<dyn std::error::Error>> {
        ...
        return Ok(OAuthToken {
            ...
            extensions: vec![
                ("logicalCluster".to_string(), "abc123".to_string()),
            ]

    }
}

I've tested this using the logicalCluster and identityPoolId extensions with Confluent Cloud.

This commit builds off of the work done in fede1024#442, adding the missing
support for SASL extensions. This allows extensions to be returned from
generate_oauth_token as key-value pairs, which then get passed to
rd_kafka_oauthbearer_set_token after being converted into the correct
format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant