iaptoolkit 0.3.5__tar.gz → 0.3.7__tar.gz

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.
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: iaptoolkit
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: Library of common utils for interacting with Identity-Aware Proxies
5
5
  Author: Rob Voigt
6
6
  Author-email: code@ravoigt.com
7
- Requires-Python: >=3.11
7
+ Requires-Python: >=3.11,<4.0
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Programming Language :: Python :: 3.12
11
11
  Classifier: Programming Language :: Python :: 3.13
12
12
  Requires-Dist: google-auth (>=2.29.0,<3.0.0)
13
- Requires-Dist: kvcommon[k8s] (>=0.2.8,<0.3.0)
13
+ Requires-Dist: kvcommon[k8s] (>=0.3.6,<0.4.0)
14
14
  Requires-Dist: requests (>=2.31.0,<3.0.0)
15
15
  Requires-Dist: toml (>=0.10.2,<0.11.0)
16
16
  Project-URL: Homepage, https://github.com/RAVoigt/iaptoolkit
@@ -1,24 +1,16 @@
1
- [project]
1
+ [tool.poetry]
2
2
  name = "iaptoolkit"
3
- version = "0.3.5"
3
+ version = "0.3.7"
4
4
  description = "Library of common utils for interacting with Identity-Aware Proxies"
5
- authors = [
6
- {name = "Rob Voigt", email = "code@ravoigt.com"}
7
- ]
5
+ authors = ["Rob Voigt <code@ravoigt.com>"]
8
6
  readme = "README.md"
9
- requires-python = ">=3.11"
10
-
11
- # [tool.poetry]
12
- # packages = [{include = "iaptoolkit"}]
7
+ homepage = "https://github.com/RAVoigt/iaptoolkit"
8
+ repository = "https://github.com/RAVoigt/iaptoolkit"
13
9
 
14
10
  [build-system]
15
- requires = ["poetry-core>=2.0"]
11
+ requires = ["poetry-core>=1.0.0"] # Poetry 1.x style; not PEP 621
16
12
  build-backend = "poetry.core.masonry.api"
17
13
 
18
- [project.urls]
19
- Homepage = "https://github.com/RAVoigt/iaptoolkit"
20
- Repository = "https://github.com/RAVoigt/iaptoolkit"
21
-
22
14
  # ================================
23
15
  # Tools etc.
24
16
  [tool.black]
@@ -33,7 +25,7 @@ python = "^3.11"
33
25
  google-auth = "^2.29.0"
34
26
  requests = "^2.31.0"
35
27
  toml = "^0.10.2"
36
- kvcommon = {extras = ["k8s"], version = "^0.2.8"}
28
+ kvcommon = {extras = ["k8s"], version = "^0.3.6"}
37
29
 
38
30
  [tool.poetry.group.dev.dependencies]
39
31
  black = "*"
@@ -64,7 +64,7 @@ class GoogleIAPKeys:
64
64
  google_public_keys: GoogleIAPKeys | None = None
65
65
 
66
66
 
67
- def verify_iap_jwt(iap_jwt: str, expected_audience: str) -> str:
67
+ def verify_iap_jwt(iap_jwt: str, expected_audience: str|None) -> str:
68
68
  global google_public_keys # Use as singleton
69
69
  if not google_public_keys:
70
70
  google_public_keys = GoogleIAPKeys()
@@ -75,8 +75,7 @@ def verify_iap_jwt(iap_jwt: str, expected_audience: str) -> str:
75
75
  email = decoded_jwt.get("email")
76
76
  audience = decoded_jwt.get("aud")
77
77
 
78
- if audience != expected_audience:
79
- print("Invalid audience:", audience)
78
+ if expected_audience and audience != expected_audience:
80
79
  raise JWTVerificationFailure("Audience mismatch when verifying IAP JWT")
81
80
 
82
81
  return email
File without changes
File without changes