-
Notifications
You must be signed in to change notification settings - Fork 718
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1521dd
commit 404b81b
Showing
6 changed files
with
41 additions
and
24 deletions.
There are no files selected for viewing
Empty file.
This file contains 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 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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
class NoAuthHTTPClient: | ||
|
||
def get_headers(self): | ||
headers = {} | ||
return headers |
This file contains 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 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 |
---|---|---|
@@ -1,18 +1,7 @@ | ||
from twilio.base.version import Version | ||
from twilio.http.orgs_token_manager import OrgTokenManager | ||
class TokenManager: | ||
org_token_manager = None | ||
|
||
@classmethod | ||
def init(cls, grant_type: str, client_id: str, client_secret: str, code: str = None, redirect_uri: str = None, audience: str = None, refreshToken: str = None, scope: str = None, tokenManager: OrgTokenManager = None): | ||
if tokenManager is None: | ||
cls.org_token_manager = OrgTokenManager(grant_type, client_id, client_secret, code, redirect_uri, audience, refreshToken, scope) | ||
else: | ||
cls.org_token_manager = tokenManager | ||
|
||
@classmethod | ||
def get_token_manager(cls, version: Version): | ||
if cls.org_token_manager is None: | ||
raise Exception("Token Manager not initialized") | ||
cls.org_token_manager.version = version | ||
return cls.org_token_manager | ||
class TokenManager: | ||
|
||
def fetch_access_token(self, version: Version): | ||
pass |
This file contains 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from twilio.http.token_manager import TokenManager | ||
|
||
|
||
class TokenManagerInitializer: | ||
|
||
org_token_manager = None | ||
|
||
@classmethod | ||
def set_token_manager(cls, token_manager: TokenManager): | ||
cls.org_token_manager = token_manager | ||
|
||
@classmethod | ||
def get_token_manager(cls): | ||
if cls.org_token_manager is None: | ||
raise Exception('Token Manager not initialized') | ||
return cls.org_token_manager |