Skip to content

Commit

Permalink
merges with latest
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Aug 16, 2024
2 parents 57ce38b + 41da84d commit ac55aa8
Show file tree
Hide file tree
Showing 23 changed files with 40 additions and 36 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Session recipe's error handlers take an extra param of recipe_user_id as well
- Session recipe, removes `validate_claims_in_jwt_payload` that is exposed to the user.

## [0.24.1] - 2024-08-16

- Sets time out for httpx client to 30s everywhere. - https://github.com/supertokens/supertokens-python/issues/516

## [0.24.0] - 2024-07-31

### Changes
Expand Down
2 changes: 1 addition & 1 deletion html/supertokens_python/constants.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
from __future__ import annotations

SUPPORTED_CDI_VERSIONS = [&#34;3.0&#34;]
VERSION = &#34;0.24.0&#34;
VERSION = &#34;0.24.1&#34;
TELEMETRY = &#34;/telemetry&#34;
USER_COUNT = &#34;/users/count&#34;
USER_DELETE = &#34;/user/remove&#34;
Expand Down
6 changes: 3 additions & 3 deletions html/supertokens_python/querier.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h1 class="title">Module <code>supertokens_python.querier</code></h1>
raise Exception(&#34;Retry request failed&#34;)

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
if method == &#34;GET&#34;:
return await client.get(url, *args, **kwargs) # type: ignore
if method == &#34;POST&#34;:
Expand Down Expand Up @@ -658,7 +658,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
raise Exception(&#34;Retry request failed&#34;)

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
if method == &#34;GET&#34;:
return await client.get(url, *args, **kwargs) # type: ignore
if method == &#34;POST&#34;:
Expand Down Expand Up @@ -1234,7 +1234,7 @@ <h3>Methods</h3>
raise Exception(&#34;Retry request failed&#34;)

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
if method == &#34;GET&#34;:
return await client.get(url, *args, **kwargs) # type: ignore
if method == &#34;POST&#34;:
Expand Down
4 changes: 2 additions & 2 deletions html/supertokens_python/recipe/dashboard/api/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.api.analytics
data[&#34;telemetryId&#34;] = telemetry_id

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
url=TELEMETRY_SUPERTOKENS_API_URL,
json=data,
Expand Down Expand Up @@ -209,7 +209,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
data[&#34;telemetryId&#34;] = telemetry_id

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
url=TELEMETRY_SUPERTOKENS_API_URL,
json=data,
Expand Down
2 changes: 1 addition & 1 deletion html/supertokens_python/recipe/dashboard/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
data[&#34;telemetryId&#34;] = telemetry_id

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
url=TELEMETRY_SUPERTOKENS_API_URL,
json=data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailpassword.emaildeli
&#34;passwordResetURL&#34;: password_reset_url_with_token,
}
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post(&#34;https://api.supertokens.io/0/st/auth/password/reset&#34;, json=data, headers={&#34;api-version&#34;: &#34;0&#34;}) # type: ignore
resp.raise_for_status()
log_debug_message(&#34;Password reset email sent to %s&#34;, user.email)
Expand Down Expand Up @@ -140,7 +140,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
&#34;passwordResetURL&#34;: password_reset_url_with_token,
}
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post(&#34;https://api.supertokens.io/0/st/auth/password/reset&#34;, json=data, headers={&#34;api-version&#34;: &#34;0&#34;}) # type: ignore
resp.raise_for_status()
log_debug_message(&#34;Password reset email sent to %s&#34;, user.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.emailverification.email
&#34;emailVerifyURL&#34;: email_verification_url,
}
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post(&#34;https://api.supertokens.io/0/st/auth/email/verify&#34;, json=data, headers={&#34;api-version&#34;: &#34;0&#34;}) # type: ignore
resp.raise_for_status()
log_debug_message(&#34;Email verification email sent to %s&#34;, user.email)
Expand Down Expand Up @@ -126,7 +126,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
&#34;emailVerifyURL&#34;: email_verification_url,
}
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post(&#34;https://api.supertokens.io/0/st/auth/email/verify&#34;, json=data, headers={&#34;api-version&#34;: &#34;0&#34;}) # type: ignore
resp.raise_for_status()
log_debug_message(&#34;Email verification email sent to %s&#34;, user.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.passwordless.emaildeliv
data[&#34;userInputCode&#34;] = input_.user_input_code

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post(&#34;https://api.supertokens.io/0/st/auth/passwordless/login&#34;, json=data, headers={&#34;api-version&#34;: &#34;0&#34;}) # type: ignore
resp.raise_for_status()
log_debug_message(&#34;Passwordless login email sent to %s&#34;, input_.email)
Expand Down Expand Up @@ -145,7 +145,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
data[&#34;userInputCode&#34;] = input_.user_input_code

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post(&#34;https://api.supertokens.io/0/st/auth/passwordless/login&#34;, json=data, headers={&#34;api-version&#34;: &#34;0&#34;}) # type: ignore
resp.raise_for_status()
log_debug_message(&#34;Passwordless login email sent to %s&#34;, input_.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.passwordless.smsdeliver
sms_input_json[&#34;urlWithLinkCode&#34;] = input_.url_with_link_code

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.post( # type: ignore
SUPERTOKENS_SMS_SERVICE_URL,
json={
Expand Down Expand Up @@ -165,7 +165,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
sms_input_json[&#34;urlWithLinkCode&#34;] = input_.url_with_link_code

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.post( # type: ignore
SUPERTOKENS_SMS_SERVICE_URL,
json={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.passwordless.smsdeliver
if template_vars.user_input_code:
sms_input[&#34;userInputCode&#34;] = template_vars.user_input_code
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
SUPERTOKENS_SMS_SERVICE_URL,
json={
Expand Down Expand Up @@ -136,7 +136,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
if template_vars.user_input_code:
sms_input[&#34;userInputCode&#34;] = template_vars.user_input_code
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
SUPERTOKENS_SMS_SERVICE_URL,
json={
Expand Down Expand Up @@ -186,7 +186,7 @@ <h3>Methods</h3>
if template_vars.user_input_code:
sms_input[&#34;userInputCode&#34;] = template_vars.user_input_code
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
SUPERTOKENS_SMS_SERVICE_URL,
json={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.providers.cu
id_token: str, jwks_uri: str, audience: str
):
public_keys: List[RSAAlgorithm] = []
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
response = await client.get(jwks_uri) # type:ignore
key_payload = response.json()
for key in key_payload[&#34;keys&#34;]:
Expand Down Expand Up @@ -695,7 +695,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
id_token: str, jwks_uri: str, audience: str
):
public_keys: List[RSAAlgorithm] = []
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
response = await client.get(jwks_uri) # type:ignore
key_payload = response.json()
for key in key_payload[&#34;keys&#34;]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.providers.ut
if headers is None:
headers = {}

async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.get(url, params=query_params, headers=headers) # type:ignore

log_debug_message(
Expand All @@ -87,7 +87,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.thirdparty.providers.ut
headers[&#34;content-type&#34;] = &#34;application/x-www-form-urlencoded&#34;
headers[&#34;accept&#34;] = &#34;application/json&#34;

async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.post(url, data=body_params, headers=headers) # type:ignore
log_debug_message(
&#34;Received response with status %s and body %s&#34;, res.status_code, res.text
Expand Down Expand Up @@ -143,7 +143,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
if headers is None:
headers = {}

async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.get(url, params=query_params, headers=headers) # type:ignore

log_debug_message(
Expand Down Expand Up @@ -175,7 +175,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
headers[&#34;content-type&#34;] = &#34;application/x-www-form-urlencoded&#34;
headers[&#34;accept&#34;] = &#34;application/json&#34;

async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.post(url, data=body_params, headers=headers) # type:ignore
log_debug_message(
&#34;Received response with status %s and body %s&#34;, res.status_code, res.text
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

setup(
name="supertokens_python",
version="0.24.0",
version="0.24.1",
author="SuperTokens",
license="Apache 2.0",
author_email="[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import annotations

SUPPORTED_CDI_VERSIONS = ["3.0"]
VERSION = "0.24.0"
VERSION = "0.24.1"
TELEMETRY = "/telemetry"
USER_COUNT = "/users/count"
USER_DELETE = "/user/remove"
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/querier.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def api_request(
raise Exception("Retry request failed")

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
if method == "GET":
return await client.get(url, *args, **kwargs) # type: ignore
if method == "POST":
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/dashboard/api/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def handle_analytics_post(
data["telemetryId"] = telemetry_id

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
url=TELEMETRY_SUPERTOKENS_API_URL,
json=data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def create_and_send_email_using_supertokens_service(
"passwordResetURL": password_reset_url_with_token,
}
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post("https://api.supertokens.io/0/st/auth/password/reset", json=data, headers={"api-version": "0"}) # type: ignore
resp.raise_for_status()
log_debug_message("Password reset email sent to %s", user.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def create_and_send_email_using_supertokens_service(
"emailVerifyURL": email_verification_url,
}
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post("https://api.supertokens.io/0/st/auth/email/verify", json=data, headers={"api-version": "0"}) # type: ignore
resp.raise_for_status()
log_debug_message("Email verification email sent to %s", user.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def create_and_send_email_with_supertokens_service(
data["userInputCode"] = input_.user_input_code

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
resp = await client.post("https://api.supertokens.io/0/st/auth/passwordless/login", json=data, headers={"api-version": "0"}) # type: ignore
resp.raise_for_status()
log_debug_message("Passwordless login email sent to %s", input_.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def create_and_send_sms_using_supertokens_service(
sms_input_json["urlWithLinkCode"] = input_.url_with_link_code

try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.post( # type: ignore
SUPERTOKENS_SMS_SERVICE_URL,
json={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def send_sms(
if template_vars.user_input_code:
sms_input["userInputCode"] = template_vars.user_input_code
try:
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
await client.post( # type: ignore
SUPERTOKENS_SMS_SERVICE_URL,
json={
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/recipe/thirdparty/providers/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async def verify_id_token_from_jwks_endpoint_and_get_payload(
id_token: str, jwks_uri: str, audience: str
):
public_keys: List[RSAAlgorithm] = []
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
response = await client.get(jwks_uri) # type:ignore
key_payload = response.json()
for key in key_payload["keys"]:
Expand Down
4 changes: 2 additions & 2 deletions supertokens_python/recipe/thirdparty/providers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def do_get_request(
if headers is None:
headers = {}

async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.get(url, params=query_params, headers=headers) # type:ignore

log_debug_message(
Expand All @@ -59,7 +59,7 @@ async def do_post_request(
headers["content-type"] = "application/x-www-form-urlencoded"
headers["accept"] = "application/json"

async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
res = await client.post(url, data=body_params, headers=headers) # type:ignore
log_debug_message(
"Received response with status %s and body %s", res.status_code, res.text
Expand Down

0 comments on commit ac55aa8

Please sign in to comment.