Skip to content

Commit 4ea8e5f

Browse files
committed
Code review fixes
1 parent bbbc824 commit 4ea8e5f

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

examples/ConnectedAccounts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ server_client = ServerClient(
2222
secret="YOUR_SECRET",
2323
use_mrrt=True,
2424
authorization_params={
25-
"redirect_uri"=:"YOUR_CALLBACK_URL",
25+
"redirect_uri":"YOUR_CALLBACK_URL",
2626
}
2727
)
2828
```

src/auth0_server_python/auth_server/my_account_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self, domain: str):
1919
self._domain = domain
2020

2121
@property
22-
def audienceIdentifier(self):
22+
def audience_identifier(self):
2323
return f"https://{self._domain}/me/"
2424

2525
async def connect_account(
@@ -30,7 +30,7 @@ async def connect_account(
3030
try:
3131
async with httpx.AsyncClient() as client:
3232
response = await client.post(
33-
url=f"{self.audienceIdentifier}v1/connected-accounts/connect",
33+
url=f"{self.audience_identifier}v1/connected-accounts/connect",
3434
json=request.model_dump(exclude_none=True),
3535
auth=BearerAuth(access_token)
3636
)
@@ -73,7 +73,7 @@ async def complete_connect_account(
7373
try:
7474
async with httpx.AsyncClient() as client:
7575
response = await client.post(
76-
url=f"{self.audienceIdentifier}v1/connected-accounts/complete",
76+
url=f"{self.audience_identifier}v1/connected-accounts/complete",
7777
json=request.model_dump(exclude_none=True),
7878
auth=BearerAuth(access_token)
7979
)

src/auth0_server_python/auth_server/server_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ async def get_session(self, store_options: Optional[dict[str, Any]] = None) -> O
576576

577577
async def get_access_token(
578578
self,
579-
audience = None,
580-
scope = None,
579+
audience: Optional[str] = None,
580+
scope: Optional[str] = None,
581581
store_options: Optional[dict[str, Any]] = None
582582
) -> str:
583583
"""
@@ -618,7 +618,7 @@ async def get_access_token(
618618
if ts.get("audience") == audience and (not scope or ts.get("scope") == scope):
619619
token_set = ts
620620
break
621-
621+
622622
# After loop: if no matching token found and MRRT disabled, check if we need to error
623623
if not token_set and not self._use_mrrt and state_data_dict.get("token_sets"):
624624
# We have tokens but none match, and we can't use RT to get a new one
@@ -1347,10 +1347,10 @@ async def start_connect_account(
13471347
code_challenge=code_challenge,
13481348
code_challenge_method="S256",
13491349
state=state,
1350-
authorization_params=options.authorization_params
1350+
authorization_params=auth_params or None
13511351
)
13521352
access_token = await self.get_access_token(
1353-
audience=self._my_account_client.audienceIdentifier,
1353+
audience=self._my_account_client.audience_identifier,
13541354
scope="create:me:connected_accounts",
13551355
store_options=store_options
13561356
)
@@ -1385,7 +1385,7 @@ async def complete_connect_account(
13851385
Handles the redirect callback to complete the connect account flow for linking a third-party
13861386
account to the user's profile.
13871387
1388-
This works similiar to the redirect from the login flow except it verifies the `connect_code`
1388+
This works similar to the redirect from the login flow except it verifies the `connect_code`
13891389
with the My Account API rather than the `code` with the Authorization Server.
13901390
13911391
Args:
@@ -1420,7 +1420,7 @@ async def complete_connect_account(
14201420
raise MissingTransactionError()
14211421

14221422
access_token = await self.get_access_token(
1423-
audience=self._my_account_client.audienceIdentifier,
1423+
audience=self._my_account_client.audience_identifier,
14241424
scope="create:me:connected_accounts",
14251425
store_options=store_options
14261426
)
@@ -1440,7 +1440,7 @@ async def complete_connect_account(
14401440
if transaction_data.app_state is not None:
14411441
response.app_state = transaction_data.app_state
14421442

1443-
# Clean up transaction data after successful login
1443+
# Clean up transaction data after successful account connection
14441444
await self._transaction_store.delete(transaction_identifier, options=store_options)
14451445

14461446
return response

src/auth0_server_python/auth_types/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,5 +248,5 @@ class CompleteConnectAccountResponse(BaseModel):
248248
access_type: str
249249
scopes: list[str]
250250
created_at: str
251-
expires_at: Optional[str] = None
251+
expires_at: Optional[str] = None
252252
app_state: Optional[Any] = None

0 commit comments

Comments
 (0)