Skip to content

Commit 07af16e

Browse files
committed
New version that does not require authentication for public accesses.
1 parent 10d3226 commit 07af16e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

python/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Install this library like this:
22
```
3-
pip install https://github.com/allenai/datastore/releases/download/v3.2.0/datastore-3.2.0-py3-none-any.whl
3+
pip install https://github.com/allenai/datastore/releases/download/v3.2.1/datastore-3.2.1-py3-none-any.whl
44
```
55

66
Then, in Python, you can say this:

python/datastore.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def forget_cleanup(p: Union[Path, str]) -> None:
4747
#
4848

4949
_s3 = boto3.resource('s3')
50+
_s3_public = boto3.resource('s3')
51+
from botocore.handlers import disable_signing
52+
_s3_public.meta.client.meta.events.register('choose-signer.s3.*', disable_signing)
5053

5154
class Locator(NamedTuple):
5255
group: str
@@ -107,7 +110,10 @@ def __init__(self, name: str):
107110

108111
_mkpath(self.temp_dir)
109112

110-
self.bucket = _s3.Bucket(f"{name}.store.dev.allenai.org")
113+
s3 = _s3
114+
if name == "public":
115+
s3 = _s3_public
116+
self.bucket = s3.Bucket(f"{name}.store.dev.allenai.org")
111117

112118
self.logger = logging.getLogger(f"org.allenai.datastore.Datastore.{name}")
113119

python/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='datastore',
13-
version='3.2.0',
13+
version='3.2.1',
1414
description='Store for immutable objects in S3',
1515
long_description=long_description,
1616
url='https://github.com/allenai/datastore',

0 commit comments

Comments
 (0)