Skip to content

Commit

Permalink
Improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
seallard committed Mar 11, 2024
1 parent 085315e commit 5e29664
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/integration/services/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def google_oauth_client(google_oauth_response: dict, mock_request: Mocker) -> Go
client_id="client_id",
client_secret="client_secret",
redirect_uri="redirect_uri",
token_uri=token_uri,
oauth_base_url=token_uri,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

class GoogleOAuthClient:

def __init__(self, client_id: str, client_secret: str, redirect_uri: str, token_uri: str):
def __init__(self, client_id: str, client_secret: str, redirect_uri: str, oauth_base_url: str):
self.client_id = client_id
self.client_secret = client_secret
self.token_uri = token_uri
self.oauth_base_url = oauth_base_url
self.redirect_uri = redirect_uri

def get_tokens(self, authorization_code: str) -> TokensResponse:
Expand All @@ -26,7 +26,7 @@ def get_tokens(self, authorization_code: str) -> TokensResponse:
)
data: dict = request.model_dump()

response = requests.post(self.token_uri, data=data)
response = requests.post(self.oauth_base_url, data=data)

if not response.ok:
raise GoogleOAuthClientError(response.text)
Expand All @@ -42,7 +42,7 @@ def get_access_token(self, refresh_token: str) -> str:
)
data: str = request.model_dump_json()

response = requests.post(self.token_uri, data=data)
response = requests.post(self.oauth_base_url, data=data)

if not response.ok:
raise GoogleOAuthClientError(response.text)
Expand Down
4 changes: 2 additions & 2 deletions trailblazer/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Container(containers.DeclarativeContainer):
oauth_client_id: str = os.environ.get("GOOGLE_CLIENT_ID")
oauth_client_secret: str = os.environ.get("GOOGLE_CLIENT_SECRET")
oauth_redirect_uri: str = os.environ.get("GOOGLE_REDIRECT_URI")
oauth_token_uri: str = os.environ.get("TOKEN_URI")
google_oauth_base_url: str = os.environ.get("GOOGLE_OAUTH_BASE_URL")
encryption_key: str = os.environ.get("SECRET_KEY")
google_api_base_url: str = os.environ.get("GOOGLE_API_BASE_URL")

Expand All @@ -28,7 +28,7 @@ class Container(containers.DeclarativeContainer):
client_id=oauth_client_id,
client_secret=oauth_client_secret,
redirect_uri=oauth_redirect_uri,
token_uri=oauth_token_uri,
oauth_base_url=google_oauth_base_url,
)

store = providers.Singleton(Store)
Expand Down

0 comments on commit 5e29664

Please sign in to comment.