-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add AAD support for EG #19421
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
Merged
Merged
Add AAD support for EG #19421
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3722b52
Add AAD support
rakshith91 31e4478
lint
rakshith91 ca3f361
tests fix
rakshith91 b73b0f7
comments
rakshith91 af4a5e7
unskip tests
rakshith91 7f03c04
aad tests
rakshith91 cb12665
Update sdk/eventgrid/azure-eventgrid/README.md
e7f9405
emdpoint
rakshith91 562faeb
Update sdk/eventgrid/azure-eventgrid/README.md
55bd8aa
black formatting
rakshith91 f21370d
oauth
rakshith91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ | |
| from azure.eventgrid._helpers import _cloud_event_to_generated | ||
|
|
||
| from eventgrid_preparer import ( | ||
| CachedEventGridTopicPreparer | ||
| CachedEventGridTopicPreparer, | ||
| ) | ||
|
|
||
| class EventGridPublisherClientTests(AzureMgmtTestCase): | ||
|
|
@@ -343,5 +343,19 @@ def test_send_custom_schema_event_as_list(self, resource_group, eventgrid_topic, | |
|
|
||
| def test_send_throws_with_bad_credential(self): | ||
| bad_credential = "I am a bad credential" | ||
| with pytest.raises(ValueError, match="The provided credential should be an instance of AzureSasCredential or AzureKeyCredential"): | ||
| with pytest.raises(ValueError, match="The provided credential should be an instance of a TokenCredential, AzureSasCredential or AzureKeyCredential"): | ||
| client = EventGridPublisherClient("eventgrid_endpoint", bad_credential) | ||
|
|
||
| @pytest.mark.live_test_only | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why live only?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. little tricky to generate recording given we use resource group preparers and envvars for secrets |
||
| @CachedResourceGroupPreparer(name_prefix='eventgridtest') | ||
| @CachedEventGridTopicPreparer(name_prefix='eventgridtest') | ||
| def test_send_token_credential(self, resource_group, eventgrid_topic, eventgrid_topic_primary_key, eventgrid_topic_endpoint): | ||
| credential = self.get_credential(EventGridPublisherClient) | ||
| client = EventGridPublisherClient(eventgrid_topic_endpoint, credential) | ||
| eg_event = EventGridEvent( | ||
| subject="sample", | ||
| data={"sample": "eventgridevent"}, | ||
| event_type="Sample.EventGrid.Event", | ||
| data_version="2.0" | ||
| ) | ||
| client.send(eg_event) | ||
Oops, something went wrong.
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.
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.
Nice, this reminds me I need to add this for .NET 😄