Skip to content

Commit 15b9b61

Browse files
Merge pull request #674 from eywalker/master
Add support for secure S3 connection. Fix #663
2 parents 524e578 + 007e045 commit 15b9b61

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

datajoint/s3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Folder:
1313
"""
1414
A Folder instance manipulates a flat folder of objects within an S3-compatible object store
1515
"""
16-
def __init__(self, endpoint, bucket, access_key, secret_key, **_):
17-
self.client = minio.Minio(endpoint, access_key=access_key, secret_key=secret_key, secure=False)
16+
def __init__(self, endpoint, bucket, access_key, secret_key, *, secure=False, **_):
17+
self.client = minio.Minio(endpoint, access_key=access_key, secret_key=secret_key, secure=secure)
1818
self.bucket = bucket
1919
if not self.client.bucket_exists(bucket):
2020
warnings.warn('Creating bucket "%s"' % self.bucket)

datajoint/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_store_spec(self, store):
137137
spec['subfolding'] = spec.get('subfolding', DEFAULT_SUBFOLDING)
138138
spec_keys = { # REQUIRED in uppercase and allowed in lowercase
139139
'file': ('PROTOCOL', 'LOCATION', 'subfolding', 'stage'),
140-
's3': ('PROTOCOL', 'ENDPOINT', 'BUCKET', 'ACCESS_KEY', 'SECRET_KEY', 'LOCATION', 'subfolding', 'stage')}
140+
's3': ('PROTOCOL', 'ENDPOINT', 'BUCKET', 'ACCESS_KEY', 'SECRET_KEY', 'LOCATION', 'secure', 'subfolding', 'stage')}
141141

142142
try:
143143
spec_keys = spec_keys[spec.get('protocol', '').lower()]
@@ -147,7 +147,7 @@ def get_store_spec(self, store):
147147

148148
# check that all required keys are present in spec
149149
try:
150-
raise DataJointError('dj.config["stores"]["{store}" is missing "{k}"'.format(
150+
raise DataJointError('dj.config["stores"]["{store}"] is missing "{k}"'.format(
151151
store=store, k=next(k.lower() for k in spec_keys if k.isupper() and k.lower() not in spec)))
152152
except StopIteration:
153153
pass

0 commit comments

Comments
 (0)