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`.
Closes#3232
### Summary
- Create `locale.js` for every plugin instead of `this.defaultLocale` in the class
- Complete refactor of locale scripts
- No dynamic plugin class imports with hacks to mimic the environment in order to get the `defaultLocale`.
- Separate tests and build in separate files
- Add two modes for test file, `unused` (fails hard) and `warnings`
- Generate docs
- Use remark to cleanly mutate the file
- Rename some doc files to match the plugin name (such as `statusbar` --> `status-bar`)
- Comments in `locale.js` are kept and are present in the docs as well.
- Generate types
* What is happening "*"
* Instead of re-creating i18nInit, we could just make it part of the BasePlugin
* set plugin title and allow changing it from locale
* remove i18nInit method, since we now include it in BasePlugin
* All provider titles should come from locale
* Update en_US.js
* make translator private
//cc @aduh95
* init locale after calling setOptions
* Update en_US.js
* Update packages/@uppy/core/src/BasePlugin.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Update packages/@uppy/core/src/index.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Bind `i18n` functions
* Remove duplicate i18nInit — it’s in BasePlugin already
* fix formatting
* fix name
* Update en_US.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* remove deprecated serverHeaders in favour of companionHeaders
* remove TL_UPPY_SERVER and exports.UPPY_SERVER
@kvz @goto-bus-stop ok to do this already, right?
* Update index.js
This PR added companion cookies rule to every provider except Box.
https://github.com/transloadit/uppy/pull/2618
(Not sure if there's a reason Box was left out)
* Update docs for the change
* Introduce opts.disabled for the Dashboard
* Reduce opacity, disable user-select, set cursor
* Add classes to providers' background circles
So they can be grayscaled via css
* add disableAllFocusableElements and run it in afterUpdate hook, if needed
* increase opacity for readability
* Store previous tabindex value and use it when restoring (setting disable: false)
//cc @goto-bus-stop
* Add disabled docs
* add disabled option to website example
Co-authored-by: Alexander Zaytsev <nqst@users.noreply.github.com>