clear-skies 1.22.0__py3-none-any.whl → 1.22.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of clear-skies might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clear-skies
3
- Version: 1.22.0
3
+ Version: 1.22.1
4
4
  Summary: A framework for building backends in the cloud
5
5
  Home-page: https://github.com/cmancone/clearskies
6
6
  License: MIT
@@ -1,9 +1,10 @@
1
1
  clearskies/__init__.py,sha256=Iz_VxSgiqM6VtGXoUsB_yVKFy_uWvcf071w803wJ8EE,832
2
2
  clearskies/application.py,sha256=_gYGIUGdVE5fAS9dwxRZ1gDpDjqGo7-twVt_VxI6XVE,966
3
- clearskies/authentication/__init__.py,sha256=pHKJOfujgvNAbgzQpKVzEhWORwjAZTE4jKhJ50M7zts,900
3
+ clearskies/authentication/__init__.py,sha256=e8hJ_gKdKn7dIzHe4Hg3jdUYIzGGSr5aJKnQa3zh-MU,997
4
4
  clearskies/authentication/auth0_jwks.py,sha256=bzqNaEoG_iPndwttRXuaKpgkDtgOCLAooyifl0I0ACI,4447
5
5
  clearskies/authentication/auth_exception.py,sha256=8Tay3Sim2K8vAZ6ldisSJyRyN0cwX7iyGHwfglSKW_A,41
6
6
  clearskies/authentication/authorization.py,sha256=eLzBrXMNr1gYoIBZTd8I6uH3R0CfMMjhvimkJt4Amrs,601
7
+ clearskies/authentication/authorization_pass_through.py,sha256=wrRSY0RyRFifeyRgNn9D-3ptCXjPSbytHB8xAyyFSWE,737
7
8
  clearskies/authentication/jwks.py,sha256=AOrCkL7pVznTM6mbrQ3RVHCccws0b_yEtqEOe6NRw5k,3368
8
9
  clearskies/authentication/jwks_jwcrypto.py,sha256=PqyQNJZY7P98qgdxNltwCWoPxsaWLDqPuMknB4u2mDc,1732
9
10
  clearskies/authentication/public.py,sha256=zNpglAILTU7koz22YaGpMOAtTn_dG8dAP4Q9REdbaOk,630
@@ -205,7 +206,7 @@ clearskies/tests/simple_api/models/__init__.py,sha256=nUA0W6fgXw_Bxa9CudkaDkC80t
205
206
  clearskies/tests/simple_api/models/status.py,sha256=PEhPbaQh5qdUNHp8O0gz91LOLENAEBtqSaHxUPXchaM,699
206
207
  clearskies/tests/simple_api/models/user.py,sha256=5_P4Tp1tTdX7PkMJ__epPM5MA7JAeVYGas69vcWloLc,819
207
208
  clearskies/tests/simple_api/users_api.py,sha256=KYXCgEofDxHeRdQK67txN5oYUPvxxmB8JTku7L-apk4,2344
208
- clear_skies-1.22.0.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
209
- clear_skies-1.22.0.dist-info/METADATA,sha256=a0Q4D5KWAlqhWVBabYpHGsj6ZNUClL8Ce1eBaXFE03g,1817
210
- clear_skies-1.22.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
211
- clear_skies-1.22.0.dist-info/RECORD,,
209
+ clear_skies-1.22.1.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
210
+ clear_skies-1.22.1.dist-info/METADATA,sha256=ZETHX5y_yVlBABtBlc3EwHmM-xoE-KikkR_Jca2sFMk,1817
211
+ clear_skies-1.22.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
212
+ clear_skies-1.22.1.dist-info/RECORD,,
@@ -5,6 +5,7 @@ from .auth0_jwks import Auth0JWKS
5
5
  from .authorization import Authorization
6
6
  from .jwks import JWKS
7
7
  from .jwks_jwcrypto import JWKSJwCrypto
8
+ from .authorization_pass_through import AuthorizationPassThrough
8
9
 
9
10
 
10
11
  def public():
@@ -29,6 +30,7 @@ def jwks_jwcrypto(jwks_url, **kwargs):
29
30
 
30
31
  __all__ = [
31
32
  "Authorization",
33
+ "AuthorizationPassThrough",
32
34
  "BindingConfig",
33
35
  "public",
34
36
  "Public",
@@ -0,0 +1,18 @@
1
+ from clearskies.authentication import JWKSJwCrypto
2
+
3
+
4
+ class AuthorizationPassThrough(JWKSJwCrypto):
5
+ """
6
+ This authentication class takes the authentication header from the incoming request and reflects
7
+ it on outgoing requests.
8
+ """
9
+
10
+ def __init__(self, environment, requests, di):
11
+ super().__init__(environment, requests)
12
+ # we need the dependency injection container so we can grab the input output and,
13
+ # with that, the request headers (which contain the JWT we'll pass through).
14
+ self.di = di
15
+
16
+ def headers(self, retry_auth=False):
17
+ input_output = self.di.build("input_output", cache=True)
18
+ return {"Authorization": input_output.get_request_header("authorization", True)}