Skip to content

Commit bc496cf

Browse files
authored
Merge pull request #57 from sentinel-hub/chore/satisfy-qgis-scanner
Chore/satisfy qgis scanner
2 parents f69c17a + 6671d7d commit bc496cf

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ pylint SentinelHub
5555

5656
### Release
5757

58+
- Verify the plugin passes the checks that the [QGIS plugin repository runs on upload](https://plugins.qgis.org/docs/security-scanning). Bandit and detect-secrets findings are blocking; flake8 is informational but worth resolving:
59+
```bash
60+
pip install bandit detect-secrets flake8
61+
bandit -r SentinelHub/ -x SentinelHub/tests
62+
detect-secrets scan SentinelHub/
63+
flake8 SentinelHub/
64+
```
5865
- Package code into a zip file using `pb_tool`
5966
```bash
6067
cd ./SentinelHub

SentinelHub/sentinelhub/configuration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ def get_layer(self, instance_id, layer_id, load_url=False):
108108
if load_url and data_source.service_url is None:
109109
# Copernicus Dataspace uses different API endpoint
110110
if self.settings.base_url == "https://sh.dataspace.copernicus.eu":
111-
url = f"{self.settings.base_url}/api/v2/configuration/datasets/{data_source.type}/sources/{data_source.id}"
111+
base = f"{self.settings.base_url}/api/v2/configuration"
112112
else:
113-
url = f"{self.configuration_url}/datasets/{data_source.type}/sources/{data_source.id}"
113+
base = self.configuration_url
114+
url = f"{base}/datasets/{data_source.type}/sources/{data_source.id}"
114115
result = self.client.download(url, session_settings=self.settings).json()
115116

116117
data_source.name = result["description"]

SentinelHub/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class Settings:
1515

1616
base_url = ""
1717
client_id = ""
18-
client_secret = ""
18+
# Placeholder default, populated from QSettings at runtime
19+
client_secret = "" # nosec B105
1920

2021
instance_id = ""
2122
service_type = ServiceType.WMS

0 commit comments

Comments
 (0)