* Limit users
* Add defaults
* Allow specifying of reason for limit exceeded error
* Update config options doc
* Make existing tests pass
* Update extensions limit error
* Update usage of regular expression
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
* Rename typo
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
* Rename files
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
* Use first() and remove redundant +=
* Fix incorrect api access count
* Rework to account for passing of unchanged access values
* Fix increased counts in updateMany
* Consistent error message
* Simplify unnecessary find
* Add tests
* Rename UserCount to AccessTypeCount
* renamed env var
* prettier
* Add changeset
* fix limit checking for batch and status updates
* test and prettier
* removed obsolete check
* updated error
* fixed error usage in extenions service
* Use randomUUID from '@directus/random'
* Fix payload check in updateMany
* implemented RolesService.updateBatch from its parent
* resolved unit test error
* updated type
* fixed existing role query
* Temporary activation of blackbox tests
* Move to separate fn, to make skippable for non-existent role
* Revert "Temporary activation of blackbox tests"
This reverts commit 4c4ac846d6.
* Revert "Move to separate fn, to make skippable for non-existent role"
This reverts commit 1d90a82e39.
* Add user limits - extension (#22642)
* adressing existing users issue
* migrated changes from pascal
* only check the role for active users
* only count active users
* updated incorrect if
* default to count zero
* Undid abstraction to separate function
* fixed updating through user counting error
* prettier
* simplified fallback query
* prettier
* Added try catch to be safee
* updated db mocking for tests
* removed extra check to satisfy implementation tests
---------
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* Filter by active users
* Allow simple where clause
* Update tests
* Add field counts
* Add database size
* Fix test
* Add changeset
* Remove comment
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* Fix user counts for edge cases
* Update test
* Add db size unit and jsdoc
Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
* Return null if database size undetermined
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* Fix extensions bundle count
* Update tests
* Account for partially enabled bundles
* Update tests
* Remove inner await
* Account for bundle enabled with all nested extensions disabled
* Update test
* Prefix with users instead
* Fix invalid activeTotal value
Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
* redo extension counting and fix test
* shorten get field count
* change to test the subtraction instead of implementation
* use new name for key
* Revert users naming convention change
Tricky to map fields from older versions into the updated field names
* Get extensions count from ExtensionManager
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
* Update extension count test
* Mock EMAIL_TEMPLATES_PATH
* Fix formatting
---------
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
* Fix#22572 Invalid query for random string
* Add changeset
* Run prettier
* Fix unit tests warnings
* redo validation with Joi
* make validation on object level
documents itself and is cleaner to expand on
* Update changeset
* Allow integer only
* Require min value of 1
* Report as query error, ignore unknown queries
---------
Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* WIP: add new register dummy-route
* fix notice on register route
* WIP register form
* WIP: registering ui and controller for testing
* fix lint ordering problem
* wip: users service
* add migration, initial style for fields in settings
* redo how emails will be filtered
* WIP add filter in the register handler
* conditionally render register link depending on settings
* WIP: add email validation
* wip add email sending
* make clicking the email link work
* rm console log
* update controller
* dont send emails for existing emails
* add translation
* only show register link when unauthenticated
* add different redirects
* only allow selecting non-admin roles
* redirect to users page
* update translation
* move logic from controller to usersservice
* rm remnant of logic from controller
* add stall time to registration
* update translation
* rm comments
* rm unused var
* add changeset
* update translation for success
* remove sso related stuff from registration
* also allow setting first and last name
* update error check
* add @directus/errors to app
* replace error strings with enum
* rename to public_registration
* rename to public_registration_verify_email
* add notes to fields
* add types package to changeset
* dont stall if no work is being done
* allow null-role and resending of reg. email
* add public registration env vars, rm RATE_LIMITER_GLOBAL_STORE
RATE_LIMITER_GLOBAL_STORE wasnt being used. Lets just stick to RATE_LIMITER_STORE for all rate limiters. TODO: also remove from docs!
* use ratelimiter for registration, use stall time env var
* add registration limiter docs, rm global store variable from docs
* update changeset
* add ignore-notice
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
* use and document new `EMAIL_VERIFICATION_TOKEN_TTL`, also doc `REGISTER_STALL_TIME`
* change variable name
Co-authored-by: ian <licitdev@gmail.com>
* apply variable rename to usage
* change backticks to single quote
Co-authored-by: ian <licitdev@gmail.com>
* inline variables
* add fields to server info, update types
- The other ratelimiters also expose points and duration, done
- Add `public_registration_verify_email` so that we can render different success messages
* tiny wording tweak of registration mail
* add new user status 'unverified' and check for it
* add unverified status translation
* decouple email verification and validation
* enable register rate limiter by default and up its config
* add autocomplete=new-password on the registration form
* added sdk functions
* add gql query for new fields
* added register api reference
* updated verify sdk function name
* added reference block for email verify endpoint
* updated reference examples
* WIP: add gql resolvers
* add ratelimiter to mutation
* remove ratelimiter registration point+duration info
* rm points and duration from gql
* Update docs/reference/system/users.md
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
---------
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* Add migration
* Use the new delta field
* Add cast-json flag
* Fix typing
* Fetch existing deltas if version created during migration
* Add changeset
* Add version delta field into sdk schema
* Add db search helper
* Use raw query for redshift
* Fix SQL injection possibility
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
* WIP fix for MS SQL
* Improved big int support and value limit checking
* prettier
* updated for failing test
* Added missing lower bound
* Add missing lower bound at another place
* Rewrite helpers for postgres
* updated constants
* extracted utils
* updated types
* prettier
* renamed searchhelper to numberhelper and extracted parseNumericString util
* moved constants up the tree
* moved constants and types to packages
* prettier
* Add type guard for numeric field
* Fix import - so much for auto imports...
* Use isIn helper
* Drop implementation specific test
* Remove temporary vite file
* Move parseNumericString to its own file
* Rename orWhere
* Fix wrong type
* Fix test after merge
* Change constants import location
* updated postgres valid condition
* Added same stringify logic for oracle
* Add helper for sqlite and catch big int parsing error
* Add curly brackets and redundant catch argument
---------
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
* Bubble up the error to prevent `unhandledRejection`
* Add changeset
* Remove unused async context
* Catch callback errors
Just in the off chance the bus.publish will throw an error
---------
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>