Skip to content

Commit 8f55dcc

Browse files
committed
fix: ruff formatting in cedar-policy index.py, suppress false positive logger findings in auth.py
1 parent 180dc3c commit 8f55dcc

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

infra-cdk/lambdas/cedar-policy/index.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,5 @@ def _wait_for_gateway_ready(gateway_id: str) -> None:
414414
time.sleep(GATEWAY_POLL_INTERVAL_SECONDS)
415415

416416
raise RuntimeError(
417-
f"Gateway {gateway_id} did not become READY "
418-
f"within {GATEWAY_TIMEOUT_SECONDS}s"
417+
f"Gateway {gateway_id} did not become READY within {GATEWAY_TIMEOUT_SECONDS}s"
419418
)

patterns/utils/auth.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def get_gateway_access_token(user_id: str) -> str:
158158
"AWS_REGION", os.environ.get("AWS_DEFAULT_REGION", "us-east-1")
159159
)
160160

161-
logger.info("Getting access token for stack: %s, region: %s", stack_name, region)
161+
logger.info("Getting access token for stack: %s, region: %s", stack_name, region) # nosemgrep: python.lang.security.audit.logging.logger-credential-leak.python-logger-credential-disclosure
162162

163163
# Get Cognito configuration from SSM and Secrets Manager
164164
cognito_domain = get_ssm_parameter(f"/{stack_name}/cognito_provider")
@@ -191,14 +191,14 @@ def get_gateway_access_token(user_id: str) -> str:
191191
"aws_client_metadata": client_metadata,
192192
}
193193

194-
logger.info("Requesting token from: %s", token_url)
194+
logger.info("Requesting token from: %s", token_url) # nosemgrep: python.lang.security.audit.logging.logger-credential-leak.python-logger-credential-disclosure
195195
logger.info("Scopes: %s", data["scope"])
196196

197197
# Request access token from Cognito
198198
response = requests.post(url=token_url, headers=headers, data=data, timeout=30)
199199

200200
if response.status_code != 200:
201-
logger.error("Token request failed: %s", response.status_code)
201+
logger.error("Token request failed: %s", response.status_code) # nosemgrep: python.lang.security.audit.logging.logger-credential-leak.python-logger-credential-disclosure
202202
logger.error("Response: %s", response.text)
203203
raise Exception(
204204
f"Failed to get access token: {response.status_code} - {response.text}"
@@ -208,8 +208,8 @@ def get_gateway_access_token(user_id: str) -> str:
208208
access_token = token_data.get("access_token")
209209

210210
if not access_token:
211-
logger.error("No access_token in response: %s", token_data)
211+
logger.error("No access_token in response")
212212
raise Exception("No access_token in Cognito response")
213213

214-
logger.info("Successfully got access token: %s...", access_token[:20])
214+
logger.info("Successfully got access token")
215215
return access_token

0 commit comments

Comments
 (0)