New concept "simple auth" - authentication that happens immediately (in one http request) without redirecting to any third party.
uppyAuthToken initially used to simply contain an encrypted & json encoded OAuth2 access_token for a specific provider. Then we added refresh tokens as well inside uppyAuthToken #4448. Now we also allow storing other state or parameters needed for that specific provider, like username, password, host name, webdav URL etc... This is needed for providers like webdav, ftp etc, where the user needs to give some more input data while authenticating
Companion:
- `providerTokens` has been renamed to `providerUserSession` because it now includes not only tokens, but a user's session with a provider.
Companion `Provider` class:
- New `hasSimpleAuth` static boolean property - whether this provider uses simple auth
- uppyAuthToken expiry default 24hr again for providers that don't support refresh tokens
- make uppyAuthToken expiry configurable per provider - new `authStateExpiry` static property (defaults to 24hr)
- new static property `grantDynamicToUserSession`, allows providers to specify which state from Grant `dynamic` to include into the provider's `providerUserSession`.
* Dashboard: auto discover plugins no matter when they were installed
* Remove target from RemoteSoruces, making it compatible with @uppy/react
* Update packages/@uppy/dashboard/src/Dashboard.jsx
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Removed comments, added comments
* better comment
* Change type — otherwise gets listed on Dashboard sources
* Add RemoteSources to React test
* Add RemoteSources to React example
* Add tests
* Refactor for less iteration for each plugin, rename functions
* Prevent error when opts are undefined
* remove console.logs
* prettier
---------
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
JS files are ignored for now because we want to migrate them to TS
anyway.
MD files are also ignored to minimize the diff.
ESLint is run twice twice on TS files in case it conflicts with Prettier.
When pausing the upload, we don't want to remove the cached `uploadId`,
otherwise Uppy needs to re-upload the file from the begininng, even if
it has already uploaded some chunks.
* @uppy/companion: fix 500 when file name contains non-ASCII chars
* Update packages/@uppy/companion/src/server/controllers/s3.js
* fixup! @uppy/companion: fix 500 when file name contains non-ASCII chars
* we need a lint rule for this
* Use filename from content-disposition instead of relying on url, with fallback
* Update packages/@uppy/companion/src/server/helpers/request.js
* Update packages/@uppy/companion/src/server/helpers/request.js
* Add random string to file name coming from basename in case ?param is a differentiator
* Add e2e test for Companion /url/meta file name + mock server with Content-Disposition
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update e2e/cypress/integration/dashboard-xhr.spec.ts
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Update e2e/mock-server.mjs
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update package.json
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update e2e/mock-server.mjs
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update e2e/cypress/integration/dashboard-xhr.spec.ts
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Add comment about why randomUUID is added to file name
* yarn
* res vs response
---------
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Reset `tus` key in the file on error, so retried files are re-uploaded
* add a test
* Use one file, try to set headers
* Pass Upload-Length and Upload-Offset, so tus knows when upload is complete
* test clean up
---------
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* show how many files are added when loading
remake of https://github.com/transloadit/uppy/pull/4388
* add french (cherry pick)
* implement concurrent file listing
* refactor / fix lint
* refactor/reduce duplication
* pull out totals validation
don't do it for every file added, as it's very slow
instead do the check at the end when all files are added.
this allows us to easily work with 10k+ files
fixes#4389
* Update packages/@uppy/core/src/Uppy.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* make restricter.validate validate everything
instead make more specific methods for sub-validation
also rename validateTotals to validateAggregateRestrictions
* improve errors and user feedback
- handle errors centrally so that we can limit the amount of toasts (informers) sent to the users (prevent flooding hundreds/thousands of them)
- introduce FileRestrictionError which is a restriction error for a specific file
- introduce isUserFacing field for RestrictionError
* fix performance issue reintroduced
* improvements
- show "%{count} additional restrictions were not fulfilled" for any restriction errors more than 4
- refactor/rename methods
- improve ghost logic/comments
* improve performance when uploading
- introduce new event "upload-start" that can contain multiple files
- make a new patchFilesState method to allow updating more files
- unify "upload-start" logic in all plugins (send it before files start uploading)
- defer slicing buffer until we need the data
- refactor to reuse code
* fix e2e build issue
* try to upgrade cypress
maybe it fixes the error
* Revert "fix e2e build issue"
This reverts commit ff3e580c0f.
* upgrade parcel
* move mutation logic to end
* remove FileRestrictionError
merge it with RestrictionError
* fix silly bug
looks like the e2e tests are doing its job 👏
---------
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* add (failing) e2e test for remote xhr (multipart)
regression caused by #3834
* Revert "do not use a default upload protocol"
This reverts commit c7e61ddfea.
* add note on todo
* dry code a bit
* explicitly add protocol: 'multipart' in the client
* fix review comment
`webkitGetAsEntry` is a non-standard/deprecated API, replacing it with
`getAsFileSystemHandle` when available.
This also work around a Chromium bug with symlinks.
Fixes: https://github.com/transloadit/uppy/issues/3505.
When starting an upload and removing it right away, it creates a race
condition when the assembly is created with no files and is never
closed. This commit ensures that the assembly is closed if all files
have been removed, or updated with the new expected number of
files otherwise.
Co-authored-by: Aaron Heimlich <aaron.heimlich@gmail.com>
* Fix outdated file ids and incorrect usage of files
* add e2e test
* Update packages/@uppy/transloadit/src/index.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>