Skip to content

Commit 12335c8

Browse files
committed
Added NOSONAR tags and an explanation of why
1 parent 76c7cd1 commit 12335c8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

podpac/core/data/file_source.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,20 @@ def dataset(self):
104104
return self._open(self._file, cache=False)
105105

106106
# otherwise, open the file (and cache it if desired)
107+
# A note on these NOSONAR lines: SonarQube considers it a security hotspot when
108+
# non-encrypted protocols are used. However, it's not a security risk to permit
109+
# this package to draw data from sources via unencrypted links. Some external geospatial data
110+
# sources are public by design, and they can choose deliver data via FTP or HTTP if they please.
111+
# Users concerned about these data sources being somehow poisoned can just not configure podpac
112+
# to use unencrypted sources.
107113
if self.source.startswith("s3://"):
108114
_logger.info("Loading AWS resource: %s" % self.source)
109115
self._file = self.s3.open(self.source, "rb")
110-
elif self.source.startswith("http://") or self.source.startswith("https://"):
116+
elif self.source.startswith("http://") or self.source.startswith("https://"): # NOSONAR(S5332)
111117
_logger.info("Downloading: %s" % self.source)
112118
response = requests.get(self.source)
113119
self._file = BytesIO(response.content)
114-
elif self.source.startswith("ftp://"):
120+
elif self.source.startswith("ftp://"): # NOSONAR(S5332)
115121
_logger.info("Downloading: %s" % self.source)
116122
addinfourl = urlopen(self.source)
117123
self._file = BytesIO(addinfourl.read())

0 commit comments

Comments
 (0)