Skip to content

Commit b38c6cd

Browse files
authored
Release 1.3.1 Security Bug Fixes (#194)
* fix(sec-vul): Updated the example file of oauth-client to skip the token details, http file log will capture the redacted url instead of logging full URLs * updated pyproject to exclude md files on reformat * updated pytfe version
1 parent 7b4680f commit b38c6cd

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,6 @@ protos.bin
138138
# Local RSA keys
139139
.local/*
140140

141+
# Bob files
142+
.bob/
143+
_context/

‎examples/oauth_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def main():
241241
print(" OAuth Token details:")
242242
for i, token in enumerate(read_oauth_client.oauth_tokens[:2], 1):
243243
if isinstance(token, dict):
244-
print(f"{i}. Token ID: {token.get('id', 'N/A')}")
244+
print(f"{i}. Token details: [REDACTED]")
245245

246246
except Exception as e:
247247
print(f"Error reading OAuth client with options: {e}")

‎pyproject.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "pytfe"
7-
version = "1.3.0"
7+
version = "1.3.1"
88
description = "Official Python SDK for HashiCorp Terraform Cloud / Terraform Enterprise (TFE) API v2"
99
readme = "README.md"
1010
license = { text = "MPL-2.0" }
@@ -48,6 +48,7 @@ packages = ["src/pytfe"]
4848
target-version = "py310"
4949
line-length = 88
5050
exclude = [
51+
".bob",
5152
".bzr",
5253
".direnv",
5354
".eggs",
@@ -90,6 +91,7 @@ quote-style = "double"
9091
indent-style = "space"
9192
skip-magic-trailing-comma = false
9293
line-ending = "auto"
94+
exclude = ["*.md"]
9395

9496
[tool.ruff.lint.isort]
9597
known-first-party = ["pytfe"]

‎src/pytfe/_http.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def request(
104104
transport_logger.debug(
105105
"transport exception on %s %s (attempt %d): %s",
106106
method,
107-
url,
107+
"<redacted-url>",
108108
attempt,
109109
e,
110110
)
@@ -125,7 +125,7 @@ def request(
125125
transport_logger.info(
126126
"retrying %s %s after %s (status=%d, attempt=%d)",
127127
method,
128-
url,
128+
"<redacted-url>",
129129
f"{retry_after:.2f}s" if retry_after else "backoff",
130130
resp.status_code,
131131
attempt,

0 commit comments

Comments
 (0)