From 8984ed109fab1faf39f97afbf765a0e91578bbf2 Mon Sep 17 00:00:00 2001 From: Emelie Graven Date: Wed, 31 Jan 2024 10:37:15 +0100 Subject: [PATCH 1/2] fix: Ignore system proxy configuration --- synapse_token_authenticator/token_authenticator.py | 2 +- synapse_token_authenticator/utils.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/synapse_token_authenticator/token_authenticator.py b/synapse_token_authenticator/token_authenticator.py index 7ccb439..164e3d2 100644 --- a/synapse_token_authenticator/token_authenticator.py +++ b/synapse_token_authenticator/token_authenticator.py @@ -208,7 +208,7 @@ async def check_oidc_auth( data = {"token": token, "token_type_hint": "access_token", "scope": "openid"} auth = HTTPBasicAuth(oidc.client_id, oidc.client_secret) response = requests.post( - oidc_metadata.introspection_endpoint, data=data, auth=auth + oidc_metadata.introspection_endpoint, data=data, auth=auth, proxies={} ) if response.status_code == 401: logger.info("User's access token is invalid") diff --git a/synapse_token_authenticator/utils.py b/synapse_token_authenticator/utils.py index 7b0051e..f61d477 100644 --- a/synapse_token_authenticator/utils.py +++ b/synapse_token_authenticator/utils.py @@ -9,7 +9,9 @@ class OpenIDProviderMetadata: """ def __init__(self, issuer: str): - response = requests.get(urljoin(issuer, "/.well-known/openid-configuration")) + response = requests.get( + urljoin(issuer, "/.well-known/openid-configuration"), proxies={} + ) response.raise_for_status() configuration = response.json() @@ -25,7 +27,7 @@ def jwks(self) -> JWKSet: """ Signing keys used to validate signatures from the OpenID Provider """ - response = requests.get(self.jwks_uri) + response = requests.get(self.jwks_uri, proxies={}) response.raise_for_status() return JWKSet.from_json(response.text) From c35a4d8f6ae129cb78dd327a3d2a354859bb1d63 Mon Sep 17 00:00:00 2001 From: Emelie Graven Date: Wed, 31 Jan 2024 11:08:44 +0100 Subject: [PATCH 2/2] release: v0.4.1 --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b003429..7ee7dc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.4.1] - 2024-01-31 + +### Bug Fixes + +- Ignore system proxy as workaround + ## [0.4.0] - 2024-01-10 ### Features diff --git a/pyproject.toml b/pyproject.toml index 370ed62..6c5ea5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = ["jwcrypto", "twisted"] -version = "0.4.0" +version = "0.4.1" [project.urls] Documentation = "https://github.com/famedly/synapse-token-authenticator"