gristlabs_grist-core/app/client
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
..
aclui (core) Use table title instead of ID in ACL UI 2022-07-19 16:27:17 +02:00
components (core) add an access token mechanism to help with attachments in custom widgets 2022-07-19 11:55:18 -04:00
lib (core) Polish ChoiceListEntry drag and drop 2022-07-19 08:14:04 -07:00
models (core) Use table title instead of ID in ACL UI 2022-07-19 16:27:17 +02:00
ui (core) Prevent raw table names from overflowing 2022-07-19 08:25:31 -07:00
ui2018 (core) Polish ChoiceListEntry drag and drop 2022-07-19 08:14:04 -07:00
widgets (core) Polish ChoiceListEntry drag and drop 2022-07-19 08:14:04 -07:00
accountMain.ts (core) Enable MFA configuration (and add SMS) 2022-01-19 13:55:54 -08:00
app.css (core) Make mobile the default mode. 2021-02-25 11:31:43 -05:00
app.js (core) Disable bfcache for all browsers 2021-11-24 09:47:00 -08:00
browserCheck.ts (core) fix browser check and favicon in grist-core 2022-01-05 18:15:05 -05:00
declarations.d.ts (core) Reference columns weren't added to Raw Data Views 2022-07-07 17:07:13 +02:00
errorMain.ts (core) Enable MFA configuration (and add SMS) 2022-01-19 13:55:54 -08:00
exposeModulesForTests.js (core) Some cleanup: remove old unused modules. 2020-11-20 11:23:20 -05:00
logo.css (core) Cleanup removing some old unused files, fixing logo.css, and removing #grist-app. 2020-10-09 17:04:09 -04:00
tsconfig.json (core) Migrate to SRP and add change password dialog 2022-03-16 21:35:06 -07:00