Skip to content

Commit

Permalink
[Event Hubs] Add security token to management request message applica…
Browse files Browse the repository at this point in the history
…tion properties (#9931)

* Increment version

* Update Development Status

* Add security_token to management request message's application_properties

* Fix an async call issue

* use auth.token instead of get_token()
  • Loading branch information
YijunXieMS authored Feb 24, 2020
1 parent af4ffee commit 690151b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def _management_request(self, mgmt_msg, op_type):
self._address.hostname, mgmt_auth
) # pylint:disable=assignment-from-none
mgmt_client.open(connection=conn)
mgmt_msg.application_properties["security_token"] = mgmt_auth.token
response = mgmt_client.mgmt_request(
mgmt_msg,
constants.READ_OPERATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ async def _management_request_async(self, mgmt_msg: Message, op_type: bytes) ->
conn = await self._conn_manager_async.get_connection(
self._address.hostname, mgmt_auth
)
mgmt_msg.application_properties["security_token"] = mgmt_auth.token
await mgmt_client.open_async(connection=conn)
response = await mgmt_client.mgmt_request_async(
mgmt_msg,
Expand Down

0 comments on commit 690151b

Please sign in to comment.