adobe / aio-lib-files

An abstraction on top of cloud blob storage exposing a file system like API
https://www.adobe.io
Apache License 2.0
10 stars 14 forks source link

document what `public` means for files #139

Open shazron opened 8 months ago

shazron commented 8 months ago

public here does not mean accessible to the whole public internet in general.

public means you don’t need any credentials to access the file:

  1. you can access a file across runtime actions only (internalUrl or url property below)
  2. you can access the file publicly on the Internet if you use the CDN link (url property below)
> await files.write('public/test', 'i am public')
11
> await files.getProperties('public/test')
{
  name: 'public/test',
  creationTime: 2023-11-10T09:29:02.000Z,
  lastModified: 2023-11-10T09:29:02.000Z,
  etag: '"0x9GBE1CF7A26B67A"',
  contentLength: 11,
  contentType: 'application/octet-stream',
  isDirectory: false,
  isPublic: true,
  url: 'https://my-cdn-domain.net/example-not-working-container-id-public/public/test',
  internalUrl: 'https://my-blob-storage.net/example-not-working-container-id-public/public/test'
}

Note url vs internalUrl (valid only when isPublic is true in this case). Direct access to the blob storage is restricted.

aiojbot commented 8 months ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-2628