gristlabs_grist-core/app/gen-server/lib
Paul Fitzpatrick dd8d2e18f5 (core) add an access token mechanism to help with attachments in custom widgets
Summary:
With this, a custom widget can render an attachment by doing:
```
const tokenInfo = await grist.docApi.getAccessToken({readOnly: true});
const img = document.getElementById('the_image');
const id = record.C[0];  // get an id of an attachment
const src = `${tokenInfo.baseUrl}/attachments/${id}/download?auth=${tokenInfo.token}`;
img.setAttribute('src', src)
```

The access token expires after a few mins, so if a user right-clicks on an image
to save it, they may get access denied unless they refresh the page. A little awkward,
but s3 pre-authorized links behave similarly and it generally isn't a deal-breaker.

Test Plan: added tests

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D3488
2022-07-19 11:55:18 -04:00
..
Activations.ts (core) add minimal support for activation keys 2022-05-16 22:46:23 -04:00
DocApiForwarder.ts (core) add an access token mechanism to help with attachments in custom widgets 2022-07-19 11:55:18 -04:00
DocWorkerMap.ts (core) add an access token mechanism to help with attachments in custom widgets 2022-07-19 11:55:18 -04:00
Doom.ts (core) add a tool for deleting a user 2021-09-29 12:08:23 -04:00
HomeDBManager.ts (core) Faster builds all around. 2022-07-04 10:42:40 -04:00
Housekeeper.ts (core) Faster builds all around. 2022-07-04 10:42:40 -04:00
Permissions.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
scrubUserFromOrg.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
TypeORMPatches.ts (core) Faster builds all around. 2022-07-04 10:42:40 -04:00
Usage.ts (core) Faster builds all around. 2022-07-04 10:42:40 -04:00
values.ts (core) move home server into core 2020-07-21 20:39:10 -04:00