Commit Graph

2993 Commits

Author SHA1 Message Date
Zehir
7d2a1392f4 Fix #22572 Invalid query for random string (#22573)
* 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>
2024-05-26 09:13:17 -04:00
dependabot[bot]
333f0173b7 Bump graphql-compose from 9.0.10 to 9.0.11 (#22547)
Bumps [graphql-compose](https://github.com/graphql-compose/graphql-compose) from 9.0.10 to 9.0.11.
- [Release notes](https://github.com/graphql-compose/graphql-compose/releases)
- [Changelog](https://github.com/graphql-compose/graphql-compose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/graphql-compose/graphql-compose/compare/v9.0.10...v9.0.11)

---
updated-dependencies:
- dependency-name: graphql-compose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 10:14:55 +02:00
Brainslug
7b212f8f1e v10.11.1 (#22537) 2024-05-21 16:51:19 +00:00
Brainslug
9335664aa8 Session token "safety window" when refreshing (#22503)
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-21 11:50:00 +00:00
Brainslug
8609b4a2db Fix database session duration (#22501) 2024-05-16 17:07:28 +02:00
Brainslug
9a6e23639b Prevent "invalid token" from being blocking (#22459)
* Throw a consistent invalid credentials error and remove invalid session cookies on the response

* updated tests

* prettier

* Added tests for cookie clearing

* prettier

* Update api/src/middleware/authenticate.test.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Update api/src/middleware/authenticate.test.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Update api/src/middleware/authenticate.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-14 14:01:40 +02:00
Hannes Küttner
c2ba3e1349 Fix regression in count database helper when counting filtered related fields (#22448)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-13 12:28:03 +02:00
dependabot[bot]
cc9b095f2d Bump zod from 3.23.6 to 3.23.8 (#22454)
* Bump zod from 3.23.6 to 3.23.8

Bumps [zod](https://github.com/colinhacks/zod) from 3.23.6 to 3.23.8.
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Changelog](https://github.com/colinhacks/zod/blob/master/CHANGELOG.md)
- [Commits](https://github.com/colinhacks/zod/compare/v3.23.6...v3.23.8)

---
updated-dependencies:
- dependency-name: zod
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changeset

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-11 09:50:06 +00:00
dependabot[bot]
fee7e9dfc8 Bump tar from 7.0.1 to 7.1.0 (#22455)
* Bump tar from 7.0.1 to 7.1.0

Bumps [tar](https://github.com/isaacs/node-tar) from 7.0.1 to 7.1.0.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v7.0.1...v7.1.0)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changeset

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-10 21:28:29 +00:00
dependabot[bot]
66cf968a5d Bump @types/node from 18.19.31 to 18.19.33 (#22453)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.31 to 18.19.33.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-10 06:46:48 +02:00
Hannes Küttner
1a7bdb1b95 Fix filter compare value casting for filter operators that take 2 or more values (#22410) 2024-05-08 15:13:51 +02:00
Rijk van Zanten
0d6c6b90b0 v10.11.0 2024-05-07 18:01:38 -04:00
Daniel Biegler
c893b9fa65 Add public registration (#22125)
* 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>
2024-05-07 23:20:24 +02:00
Hannes Küttner
1d7e0b7160 Fix bundle (re-)loading (#22013)
* Fix bundle (re-)loading (fixes #21942 and #21946)

* Add changeset

* Use .some instead of .find for checking existance

* Fix names

* Cleanup

* Add comments

* Update changeset

* moved out type check

* Clearer params, fix bundle check

* Use enabled state from parent

* Clarify changeset

---------

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Brainslug <tim@brainslug.nl>
2024-05-07 14:42:23 +00:00
Pascal Jufer
b7135fdf64 Fix handling of invalid and empty filter queries (#22048)
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
2024-05-07 15:47:58 +02:00
dependabot[bot]
78546678d0 Bump tsx from 4.9.0 to 4.9.3 (#22407)
Bumps [tsx](https://github.com/privatenumber/tsx) from 4.9.0 to 4.9.3.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.9.0...v4.9.3)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 13:20:05 +02:00
Pascal Jufer
537d7f1e36 Revert "Consolidate content versioning (#22227)" (#22412)
This reverts commit 5a258dd406.
2024-05-07 17:25:19 +08:00
ian
5a258dd406 Consolidate content versioning (#22227)
* 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
2024-05-06 21:02:23 +02:00
Rijk van Zanten
ec2604f913 Don't require KEY or SECRET to be set on startup (#22320)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-06 13:00:10 +00:00
Pascal Jufer
cf83f33939 Patch Tuesday 🐸 (Light Edition) (#22376) 2024-05-03 11:19:23 +02:00
dependabot[bot]
a50460c005 Bump @types/nodemailer from 6.4.14 to 6.4.15 (#22368)
Bumps [@types/nodemailer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/nodemailer) from 6.4.14 to 6.4.15.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/nodemailer)

---
updated-dependencies:
- dependency-name: "@types/nodemailer"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-03 02:31:50 +02:00
Brainslug
e70a90c267 Improved values redacting (#22332)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-02 14:54:16 +02:00
Brainslug
a6172f8a6a Improved session token validation (#22353)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-02 14:53:41 +02:00
Hannes Küttner
d10385d303 Fix large and real numbers in search query (#22345)
* 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>
2024-04-30 17:22:53 +02:00
ian
df254cc093 Add falsy fallback condition to search query (#22342)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
2024-04-30 11:02:57 +02:00
Pascal Jufer
160b982928 Patch Tuesday 🐸 (#22063)
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
2024-04-30 10:49:20 +02:00
Pascal Jufer
a3051b3de4 Downgrade samlify to fix issue with allowCreate attribute (#22340) 2024-04-30 09:39:17 +02:00
Pascal Jufer
4b75c375df Client-side restart of failed transactions on CockroachDB (#22240) 2024-04-25 14:19:17 +02:00
Pascal Jufer
4fe4c6e988 Fix filter validation for field functions (#22060)
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
2024-04-24 16:10:04 +00:00
Hannes Küttner
bc3f698851 Fix count helper function for self-referencing relations (#22297)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-04-24 14:07:18 +02:00
Hannes Küttner
7c08452305 Fix ambiguous column SQL error for M2A relations (#22262) 2024-04-19 23:05:48 +02:00
Hannes Küttner
c5fe153c62 Fix caching for marketplace account / type extension listing (#22254)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-04-19 12:20:46 +00:00
Rijk van Zanten
98589cca6d v10.10.7 2024-04-17 17:09:17 -04:00
José Varela
476a2482ad Api: Clear system cache only if specified on /utils/cache/clear (#22234)
* Clear system cache only if specified

* Add changeset

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2024-04-17 17:07:10 -04:00
Rijk van Zanten
be895926ef Revert "Don't influence Cache-Control through CACHE_AUTO_PURGE" (#22235)
* Revert "Don't influence Cache-Control through `CACHE_AUTO_PURGE` (#22203)"

This reverts commit 12fb7719fe.

* Add changeset
2024-04-17 17:01:09 -04:00
José Varela
4bb03df6da Api: Bubble up the error to prevent unhandledRejection (#22231)
* 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>
2024-04-17 16:00:20 -04:00
José Varela
bf47a19428 API: Prevent endless loop on get-schema (#22230)
* Prevent endless loop on `get-schema`

* Make magic value configurable

* Fix linter warning

* Add changeset

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2024-04-17 15:50:27 -04:00
Brainslug
9aa4e703b2 v10.10.6 2024-04-17 17:37:11 +02:00
dependabot[bot]
549bfb641e Bump openapi3-ts from 4.2.2 to 4.3.1 (#22217)
Bumps [openapi3-ts](https://github.com/metadevpro/openapi3-ts) from 4.2.2 to 4.3.1.
- [Release notes](https://github.com/metadevpro/openapi3-ts/releases)
- [Changelog](https://github.com/metadevpro/openapi3-ts/blob/master/Changelog.md)
- [Commits](https://github.com/metadevpro/openapi3-ts/commits)

---
updated-dependencies:
- dependency-name: openapi3-ts
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 08:10:44 +02:00
Hannes Küttner
12fb7719fe Don't influence Cache-Control through CACHE_AUTO_PURGE (#22203)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-04-16 09:55:41 +00:00
Rijk van Zanten
577f08e5f5 Remove nested transactions (#22023)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2024-04-16 10:13:33 +02:00
Pascal Jufer
6c35f43460 Fix nested queries with unlimited default limit (#22049)
* Fix nested queries with unlimited default limit

* Add changeset
2024-04-15 11:52:41 +02:00
José Varela
dfe6cca40b Api / Assets: Prevent backpressure on sending big files (#22175)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-04-15 08:29:57 +00:00
José Varela
75c03bdd99 Api / Graphql : Allow version as singleton argument on singleton (#22184)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-04-12 10:50:32 +00:00
Rijk van Zanten
58c1e308fc Tweak default email in init cli command email_from config (#22162)
* Change default email from in init .env to example.com

Directus's domain has a strict dmarc quarantine, so this will never work. Changing it to example should make it super obvious it's just an example.

* Add changeset
2024-04-10 11:45:17 -04:00
dependabot[bot]
91a029e893 Bump @aws-sdk/client-ses from 3.533.0 to 3.552.0 (#22150)
Bumps [@aws-sdk/client-ses](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ses) from 3.533.0 to 3.552.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ses/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.552.0/clients/client-ses)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-ses"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 01:13:26 +00:00
dependabot[bot]
2581718f7b Bump nanoid from 5.0.6 to 5.0.7 (#22147)
Bumps [nanoid](https://github.com/ai/nanoid) from 5.0.6 to 5.0.7.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/5.0.6...5.0.7)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 03:07:23 +02:00
dependabot[bot]
107ae55a4d Bump axios from 1.6.7 to 1.6.8 (#22128)
Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.6.8.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.6.7...v1.6.8)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 08:54:03 +02:00
Pascal Jufer
c9105eaead Use Item/PrimaryKey from and move Alterations to @directus/types (#22027)
Co-authored-by: ian <licitdev@gmail.com>
2024-04-08 10:12:26 +02:00
Rijk van Zanten
bd4b8b5949 v10.10.5 2024-04-03 15:47:12 -04:00