Skip to content

Conversation

@constanca-m
Copy link
Contributor

Description

Add support for azure auth when feature gate receiver.azureeventhubreceiver.UseAzeventhubs is enabled.

Link to tracking issue

Fixes #40711.

Testing

Unit tests added.

Documentation

README updated.

@constanca-m constanca-m requested a review from cparkins December 16, 2025 10:40
@constanca-m
Copy link
Contributor Author

@dyl10s As a codeowner, can you take a look at this? For some reason, I can't request your review

Copy link
Contributor

@dyl10s dyl10s left a comment

Choose a reason for hiding this comment

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

Just a quick code skim through. Have not had time to test this out yet.

Comment on lines +39 to +40
azureeventhub/auth_missing_feature_gate:
auth: azureauth
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this a valid configuration, since the issue with it is supposed to be that we have the feature gate disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I don't understand. Why would this be valid? auth is only available when the feature gate is enabled

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
azureeventhub/auth_missing_feature_gate:
auth: azureauth
azureeventhub/auth_missing_feature_gate:
auth: azureauth
event_hub:
namespace: ns
name: hub

Apologies for the confusion. I was trying to say that because this test is specifically testing what happens when the feature gate is missing, there shouldn't be other issues with it. It is currently missing the namespace and the name parameters that would be required with the azureauth.

If the code were to get refactored down the line and the validation order changed, this test would fail. This update is just to make the test slightly more resilient.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am fine with this refactor, but the old tests tested the flag enabled and disabled state for most of the cases. Can you make sure the new test suite can run on both versions if the old version did that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests are doing that already:

Copy link
Contributor

Choose a reason for hiding this comment

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

Took a closer look this morning, the feature gate scenarios that are missing were not providing any additional coverage. So I am all good with this 👍

Comment on lines +48 to +55
// EventHubConfig defines the configuration for an Azure Event Hub when
// using authentication.
type EventHubConfig struct {
// Name is the name of the Event Hub.
Name string `mapstructure:"name"`
// Namespace is the fully qualified namespace of the Event Hub.
Namespace string `mapstructure:"namespace"`
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have an opinion about parsing this from a connection string so that it doesn't require two different configuration settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes,we want to get rid of the connection string because this is a security issue. You can read it in this page, Important section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for azureauth

3 participants