publiclab / image-sequencer-app

An Image Processing server based on image-sequencer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anonymous caller permissions error

jywarren opened this issue · comments

I've been testing this at the demo on Leaflet.DistortableImage, and have been getting some errors when on Chrome Android. One I had trouble capturing, another opened but the jpg link opened this:

https://www.googleapis.com/download/storage/v1/b/mapknitter-is/o/exportd88c76028c890dec20aa845636742c97-60076.html?generation=1578772553148875&alt=media

Anonymous caller does not have storage.objects.get access to mapknitter-is/exportd88c76028c890dec20aa845636742c97-60076.html.

Not sure what's up here?

So exciting to be testing this in a real mapping interface!

Doing the testing from this demo: http://publiclab.github.io/Leaflet.DistortableImage/examples/export (shift drag or long press to select images to export and beware they're overridden with a static test dataset so they won't look the same as shown here.)

Ok the other bug I'm trying to capture here too, will split out once I'm able to:

https://storage.googleapis.com/mapknitter-is/d88c76028c890dec20aa845636742c97-60076.json?GoogleAccessId=image-sequencer-app%40public-lab.iam.gserviceaccount.com&Expires=1578780687&Signature=EXDGhkjyf6vtZhzoSkM9XubyTE0FqZs0emY3DK91hfze%2FXhzVBFjyJZhfC%2BW5N%2Bdm71QE32nS4dtpW9CCuKho%2BvgRzyjVcoFpoJSPGQrplBh%2FlLtl%2Bnot%2B4ppw2cm80wRxMuYao2LRqCOHERJ0V%2Bvcvl9If1L%2BCBtPSHJk24lYVIHBg9utPeTGMJDnMf%2FbUoM7pZkiD5JL%2F%2Bk3q43f%2F5vO3IQdkl2%2FUtjnN2n935vpmrQlDXmr4D2ltStyZFekTWeqSAI7rCktO6gwG133x49NZa5Htc38t5FA1mevfN2hgLVzvDoVRUQWcSlw0ye8VgCp3eDv8L8xx8pMpCuJDnBg%3D%3D

Starts with

{"statusUrl":"http://34.74.118.242/api/v2/status/?pid=d88c76028c890dec20aa845636742c97-60076","status":"starting","tms":"","geotiff":"","zip":"","jpg":"","export_id":"d88c76028c890dec20aa845636742c97-60076","user_id":"","size":"","width":"","height":"","start_time":"Sat Jan 11 2020 21:11:26 GMT+0000 (Coordinated Universal Time)","run_time":"","cm_per_pixel":"200"}

Ends with

{"statusUrl":"http://34.74.118.242/api/v2/status/?pid=d88c76028c890dec20aa845636742c97-60076","status":"uploaded","tms":"","geotiff":"","zip":"","jpg":"https://www.googleapis.com/download/storage/v1/b/mapknitter-is/o/exportd88c76028c890dec20aa845636742c97-60076.html?generation=1578777089819900&alt=media","export_id":"d88c76028c890dec20aa845636742c97-60076","user_id":"","size":"","width":"","height":"","start_time":"Sat Jan 11 2020 21:11:26 GMT+0000 (Coordinated Universal Time)","run_time":"","cm_per_pixel":"200"}

That last status jpg link just says "download failed" on chrome Android!

By contrast, the Ruby exporter returns urls like this from Google storage:

https://mapknitter-exports-warps.storage.googleapis.com/1560464327/status.json

This link, for easy pressing. It's not a standard sharable cloud storage link, actually:

https://www.googleapis.com/download/storage/v1/b/mapknitter-is/o/exportd88c76028c890dec20aa845636742c97-60076.html?generation=1578777089819900&alt=media

Ah, I see! The thing is that it worked in the browser. I'll see if I can get the other link!

By contrast, the Ruby exporter returns urls like this from Google storage:

https://mapknitter-exports-warps.storage.googleapis.com/1560464327/status.json

Hey @jywarren So this is the link to the status.json file, right? The link that you mentioned above is for the final export.
This is the metadata that we get from the api, I used the mediaLink from this. Do you see any other attribute that we can use?

[ { kind: 'storage#object',
    id: 'mapknitter-is/exporta198e536fea6313069306a256453e441-76796.html/1581743672732214',
    selfLink: 'https://www.googleapis.com/storage/v1/b/mapknitter-is/o/exporta198e536fea6313069306a256453e441-76796.html',
    mediaLink: 'https://www.googleapis.com/download/storage/v1/b/mapknitter-is/o/exporta198e536fea6313069306a256453e441-76796.html?generation=1581743672732214&alt=media',
    name: 'exporta198e536fea6313069306a256453e441-76796.html',
    bucket: 'mapknitter-is',
    generation: '1581743672732214',
    metageneration: '2',
    contentType: 'text/html; charset=utf-8',
    storageClass: 'MULTI_REGIONAL',
    size: '166314',
    md5Hash: 'GCwwCo7pyeCuFKlQWgXStw==',
    contentEncoding: 'gzip',
    crc32c: '0//7XQ==',
    etag: 'CLbU9K3m0ucCEAI=',
    timeCreated: '2020-02-15T05:14:32.732Z',
    updated: '2020-02-15T05:14:33.121Z',
    timeStorageClassUpdated: '2020-02-15T05:14:32.732Z' },
  PassThrough {
    _readableState:
     ReadableState {
       objectMode: false,
       highWaterMark: 16384,
       buffer: [BufferList],
       length: 0,
       pipes: null,
       pipesCount: 0,
       flowing: true,
       ended: true,
       endEmitted: true,
       reading: false,
       sync: false,
       needReadable: false,
       emittedReadable: false,
       readableListening: false,
       resumeScheduled: false,
       destroyed: false,
       defaultEncoding: 'utf8',
       awaitDrain: 0,
       readingMore: false,
       decoder: null,
       encoding: null },
    readable: false,
    domain: null,
    _events:
     { end: [Function],
       prefinish: [Function: prefinish],
       error: [Array],
       data: [Function] },
    _eventsCount: 4,
    _maxListeners: undefined,
    _writableState:
     WritableState {
       objectMode: false,
       highWaterMark: 16384,
       finalCalled: false,
       needDrain: false,
       ending: true,
       ended: true,
       finished: true,
       destroyed: false,
       decodeStrings: true,
       defaultEncoding: 'utf8',
       length: 0,
       writing: false,
       corked: 0,
       sync: false,
       bufferProcessing: false,
       onwrite: [Function: bound onwrite],
       writecb: null,
       writelen: 0,
       bufferedRequest: null,
       lastBufferedRequest: null,
       pendingcb: 0,
       prefinished: true,
       errorEmitted: false,
       bufferedRequestCount: 0,
       corkedRequestsFree: [Object] },
    writable: false,
    allowHalfOpen: true,
    _transformState:
     { afterTransform: [Function: bound afterTransform],
       needTransform: false,
       transforming: false,
       writecb: null,
       writechunk: null,
       writeencoding: 'buffer' },
    statusCode: 200,
    statusMessage: 'OK',
    request:
     { headers: [Object],
       href: 'https://www.googleapis.com/storage/v1/b/mapknitter-is/o/exporta198e536fea6313069306a256453e441-76796.html?' },
    body:
     { kind: 'storage#object',
       id: 'mapknitter-is/exporta198e536fea6313069306a256453e441-76796.html/1581743672732214',
       selfLink: 'https://www.googleapis.com/storage/v1/b/mapknitter-is/o/exporta198e536fea6313069306a256453e441-76796.html',
       mediaLink: 'https://www.googleapis.com/download/storage/v1/b/mapknitter-is/o/exporta198e536fea6313069306a256453e441-76796.html?generation=1581743672732214&alt=media',
       name: 'exporta198e536fea6313069306a256453e441-76796.html',
       bucket: 'mapknitter-is',
       generation: '1581743672732214',
       metageneration: '2',
       contentType: 'text/html; charset=utf-8',
       storageClass: 'MULTI_REGIONAL',
       size: '166314',
       md5Hash: 'GCwwCo7pyeCuFKlQWgXStw==',
       contentEncoding: 'gzip',
       crc32c: '0//7XQ==',
       etag: 'CLbU9K3m0ucCEAI=',
       timeCreated: '2020-02-15T05:14:32.732Z',
       updated: '2020-02-15T05:14:33.121Z',
       timeStorageClassUpdated: '2020-02-15T05:14:32.732Z' },
    headers:
     { 'alt-svc': 'quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000',
       'cache-control': 'private, max-age=0, must-revalidate, no-transform',
       connection: 'close',
       'content-length': '938',
       'content-type': 'application/json; charset=UTF-8',
       date: 'Sat, 15 Feb 2020 05:14:33 GMT',
       etag: 'CLbU9K3m0ucCEAI=',
       expires: 'Sat, 15 Feb 2020 05:14:33 GMT',
       server: 'UploadServer',
       vary: 'Origin, X-Origin',
       'x-guploader-uploadid': 'AEnB2UoStToi_V2-K3N3LaAHOxqJh16yN3ESVOcGXEgItQdXa7swRU3e4wUWfY2uV7DbU9zdu1WVCiLhFMDI0FDQxFm4eOi9Mw' },
    toJSON: [Function: toJSON] } ]

Maybe this would be solved by #42 ???

Sure, I'll take a look at this pull request!