intake-stac icon indicating copy to clipboard operation
intake-stac copied to clipboard

rasterio driver - authentication

Open fabricebrito opened this issue 4 years ago • 1 comments

I really like intake-stac and together with xpublish it becomes a very powerful solution :-)

  1. Open Assets

The example shown in the notebook using Landsat data @AWS is great. The assets are freely available and thus rasterio simply accesses those resources using the href

  1. Assets requiring authentication

I've got a use-case where the assets require a simple authentication mechanism. With such cases, I usually update the href for rasterio with:

def get_vsi_url(enclosure, username, api_key):
    
   
    parsed_url = urlparse(enclosure)

    url = '/vsicurl/%s://%s:%s@%s/api%s' % (list(parsed_url)[0],
                                            username, 
                                            api_key, 
                                            list(parsed_url)[1],
                                            list(parsed_url)[2])
    
    return url 

Would such an approach be possible with intake-stac ?

fabricebrito avatar May 14 '20 09:05 fabricebrito

We should definitely be able to make this happen. How would you access one of these assets using rasterio directly. The call stack in intake-stac goes like this: intake-stac -> intake-xarray -> xarray -> rasterio. We'll just need to make sure we can pass the required authentication parameters all the way through that stack.

jhamman avatar May 14 '20 15:05 jhamman