Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with geotiff access from protected s3 bucket #864

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Changes in 1.1.2 (in development)

### Fixes

* Fixed issue where geotiff access from a protected s3 bucket was denied (#863)

## Changes in 1.1.1

* Bundled new build of [xcube-viewer 1.1.0.1](https://github.com/dcs4cop/xcube-viewer/releases/tag/v1.1.0)
Expand Down
18 changes: 11 additions & 7 deletions xcube/core/store/fs/impl/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import s3fs
import xarray as xr
import zarr
from rasterio.session import AWSSession

from xcube.core.zarrstore import LoggingZarrStore
# Note, we need the following reference to register the
Expand Down Expand Up @@ -376,13 +377,16 @@ def open_data(self,
@classmethod
def create_env_session(cls, fs):
if isinstance(fs, s3fs.S3FileSystem):
return rasterio.env.Env(aws_secret_access_key=fs.token,
aws_access_key_id=fs.key,
aws_session_token=fs.token,
region_name=fs.client_kwargs.get(
'region_name',
'eu-central-1'
),
aws_session = AWSSession(
aws_secret_access_key=fs.secret,
aws_access_key_id=fs.key,
aws_session_token=fs.token,
region_name=fs.client_kwargs.get(
'region_name',
'eu-central-1'
),
)
return rasterio.env.Env(session=aws_session,
aws_no_sign_request=bool(fs.anon)
)
else:
Expand Down
2 changes: 1 addition & 1 deletion xcube/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

version = '1.1.1'
version = '1.1.2.dev0'
Loading