Skip to content

Commit 3e02203

Browse files
committed
fixing bandit issues
1 parent 3a778d7 commit 3e02203

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

src/amazon-translate-mcp-server/awslabs/amazon_translate_mcp_server/batch_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ def list_translation_jobs(
346346
}
347347

348348
logger.debug(
349-
'Listed %d translation jobs, next_token: %s',
349+
'Listed %d translation jobs, has_more_pages: %s',
350350
len(job_summaries),
351-
'present' if result['next_token'] else 'none',
351+
'yes' if result['next_token'] else 'no',
352352
)
353353

354354
return result

src/amazon-translate-mcp-server/awslabs/amazon_translate_mcp_server/terminology_manager.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,10 @@
2020
"""
2121

2222
import csv
23+
import defusedxml.ElementTree as ET
2324
import io
2425
import logging
2526
import re
26-
from pathlib import Path
27-
from typing import Any, Dict, List, Optional, Union
28-
29-
30-
try:
31-
import defusedxml.ElementTree as ET
32-
except ImportError:
33-
# Fallback to standard library with security warning
34-
import warnings
35-
import xml.etree.ElementTree as ET
36-
37-
warnings.warn(
38-
'defusedxml not available. Using xml.etree.ElementTree which may be vulnerable to XML attacks. '
39-
'Install defusedxml for secure XML parsing.',
40-
UserWarning,
41-
)
42-
4327
from .aws_client import AWSClientManager
4428
from .models import (
4529
AuthenticationError,
@@ -53,6 +37,8 @@
5337
ValidationError,
5438
)
5539
from botocore.exceptions import BotoCoreError, ClientError
40+
from pathlib import Path
41+
from typing import Any, Dict, List, Optional, Union
5642

5743

5844
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)