Skip to content

Commit fe29274

Browse files
fix: Only set 'secure' default for S3 protocol
The 'secure' parameter is only valid for S3 stores, not for file/GCS/Azure protocols. Move the default setting to protocol-specific section to avoid validation errors when using file stores.
1 parent 7df2f97 commit fe29274

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/datajoint/settings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,10 @@ def get_store_spec(self, store: str | None = None) -> dict[str, Any]:
368368

369369
spec = dict(self.stores[store])
370370

371-
# Set defaults for optional fields
371+
# Set defaults for optional fields (common to all protocols)
372372
spec.setdefault("subfolding", None) # No subfolding by default
373373
spec.setdefault("partition_pattern", None) # No partitioning by default
374374
spec.setdefault("token_length", 8) # Default token length
375-
spec.setdefault("secure", True) # HTTPS by default for cloud
376375

377376
# Validate protocol
378377
protocol = spec.get("protocol", "").lower()
@@ -383,6 +382,10 @@ def get_store_spec(self, store: str | None = None) -> dict[str, Any]:
383382
f"Supported protocols: {', '.join(supported_protocols)}"
384383
)
385384

385+
# Set protocol-specific defaults
386+
if protocol == "s3":
387+
spec.setdefault("secure", True) # HTTPS by default for S3
388+
386389
# Define required and allowed keys by protocol
387390
required_keys: dict[str, tuple[str, ...]] = {
388391
"file": ("protocol", "location"),

0 commit comments

Comments
 (0)