Skip to content

Commit

Permalink
reformatted auth file
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Sep 29, 2023
1 parent e41c473 commit 7f87a51
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ably/rest/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from ably.decorator.sync import optional_sync
from ably.types.options import Options

if TYPE_CHECKING:
from ably.rest.rest import AblyRest
from ably.realtime.realtime import AblyRealtime
Expand All @@ -26,7 +27,6 @@


class Auth:

class Method:
BASIC = "BASIC"
TOKEN = "TOKEN"
Expand Down Expand Up @@ -106,7 +106,8 @@ async def __authorize_when_necessary(self, token_params=None, auth_options=None,

if self.ably._is_realtime:
realtime_loop = self.ably.connection.connection_manager.options.loop
future = asyncio.run_coroutine_threadsafe(self.ably.connection.connection_manager.on_auth_updated(token_details), realtime_loop)
future = asyncio.run_coroutine_threadsafe(
self.ably.connection.connection_manager.on_auth_updated(token_details), realtime_loop)
await asyncio.wrap_future(future)

return token_details
Expand Down Expand Up @@ -430,6 +431,6 @@ async def token_request_from_auth_url(self, method: str, url: str, token_params,
token_request = response.text
else:
msg = 'auth_url responded with unacceptable content-type ' + content_type + \
', should be either text/plain, application/jwt or application/json',
', should be either text/plain, application/jwt or application/json',
raise AblyAuthException(msg, 401, 40170)
return token_request

0 comments on commit 7f87a51

Please sign in to comment.