Commit Graph

1773 Commits

Author SHA1 Message Date
Aiden Foxx
05c045e9ff Handle "form_post" OAuth and OpenID responses (#16231)
* Allow both POST and GET responses in OAuth flow

* Be more explicit about which method we fetch OAuth data from

* Removed unnecessary error handling in OAuth router

* Fixed method check in OAuth router

* Simplified method check

* Added POST support to OpenID flow

* Prefer redirect on OpenID POST to retain LAX cookie policy

* Prefer redirect on OAuth2 POST to retain LAX cookie policy

* Update api/src/auth/drivers/oauth2.ts

* Update api/src/auth/drivers/openid.ts
2022-11-01 16:44:17 -04:00
Azri Kahar
5780bb174f Fix custom hook mocked path in api cli test (#15271)
* fix custom hook mocked path in api cli test

* update @types/jest

* update to latest

* update and pin dependencies

* correct pnpm lock

* remove unrelated changes
2022-11-01 12:12:31 -04:00
Azri Kahar
17c0ef9182 Remove Content-Type header check in Files POST requests (#16176)
* remove request header check in files POST

* basic test

* it's filename_download instead of file_download

* unused vars begone

* make type required when creating file via JSON

* fix blackbox test

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-01 12:06:09 -04:00
Aiden Foxx
2adbb3bfd2 Convert some trace logs to warnings in OAuth flows (#16213)
* Less trace, more warn in OpenID provider

* Less trace, more warn in OAuth provider
2022-10-29 15:59:50 -04:00
Brainslug
9106fc78d6 strip function from fieldnames for validation (#16179) 2022-10-27 15:17:09 +08:00
ian
c996accb00 Fix recursive fields on existing columns (#15621)
* Prevent changing to or from alias type

* Prevent infinite delete loop

* Display error when saving

* More validation for M2M and M2A

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-10-26 11:51:01 -04:00
ian
e7a57827f5 Add GraphQLBigInt type (#16157) 2022-10-25 17:04:45 -04:00
Azri Kahar
10082ccbaf Fix field/collection translated name not resetting after being removed (#16131)
* reset existing field translations

* remove unused and malformed settings translations

* reset existing collection translations

* safer handling in case translations isn't an array

* inverse locales to reset logic for correctness

* add tests

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-25 15:08:09 -04:00
Rijk van Zanten
2d104e933b Patch Tuesday 🐸 (#16052)
* Update API non-majors

* Update major changes

* Temp fix for type warning in sdk

* Resolve missing new keyword in GraphQLNonNull use

* Lock versions in api

* Update and lock versions in shared

* Update lockfile

* Fix build type errors in api

* Update app patches/minors

* Upgrade major versions

* Lock versions

* Upgrade root deps

* Update packages

* Switch from pino-colada to pino-pretty

* Update snapshots

* Fix globby sync usage

* Remove globals from jest config

* No ranges

* Revert "Remove globals from jest config"

This reverts commit e249e2c8fe.

* Revert "Upgrade root deps"

This reverts commit 62add28a85.

* Update non-jest stuff

* We'll keep trying

* Update globby to latest minor only

* Test on all vendors

* Revert test on all vendors

* Fix linting

* Preserve request log format

* Preserve existing timestamp format and allow configuration

* Use lodash merge to allow for nested objects

Co-authored-by: ian <licitdev@gmail.com>
2022-10-20 09:31:17 -04:00
ian
193844c106 Update MAX_PAYLOAD_SIZE env stub to 1mb (#16057) 2022-10-19 13:14:01 -04:00
ian
0f6ed82953 Optimise data model sorting (#16039)
* Add collections batch update endpoint

* Use collections batch update when sorting in data model

* Add autoPurgeSystemCache option

* Change type to false for consistency

* Refactor to InvalidPayloadException

* Add collection batch update test

* Bump default max payload size to 1mb

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-18 19:19:36 +00:00
ian
def580dad5 Skip parsing of date strings that only contain zeros (#16015)
* Skip parsing of date strings that only contain zeros

* Allow dot in case of sub seconds and set min length as 10

* Add unit test to confirm parsing as null

* Fix timezone differences when running unit tests
2022-10-15 16:30:02 -04:00
Ling
24f76abe41 Remove property="og:url" from email base template (#16016) 2022-10-15 16:29:02 -04:00
Gerard Lamusse
e4df9b09ba Throw nicer error if field does not exist on collection (#15803)
* Throw nicer error if field does not exist on collection

* Simplify type signature and shift to be consistent with validateFilterOperator

Co-authored-by: ian <licitdev@gmail.com>
2022-10-15 17:25:30 +08:00
José Varela
da2998a7e7 Allow custom label for auth provider (#15673)
* Allow to pass custom label for auth provider

* Add tests

* Update api/src/cli/utils/create-env/env-stub.liquid

* Fix tests

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-10-14 23:14:00 -04:00
ian
ef895fb784 Cast special in system fields as array (#15644) 2022-10-14 23:10:28 -04:00
Azri Kahar
d0ff4e7922 Fix non-admin role creation via cli for SQLite (#15723)
* fix non-admin role creation via cli

* use the more objectively correct solution

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-10-14 22:55:17 -04:00
ian
9edf9f9ce0 Process page only when merging with parent items (#16010) 2022-10-14 14:18:27 -04:00
ian
6cdd0eead4 Fix CodeQL threadflow steps (#15873)
* Upload SARIF artifact

* Test removal of empty object

* Fix polynomial-redos

* Revert fail-fast change

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-12 16:01:13 -04:00
Brainslug
5fcb3c84c7 Update ioredis to fix connection uri options (#15876)
* updated ioredis to 5.2.3

* type fixes

* removed obsolete @types/ioredis package
2022-10-12 15:56:22 -04:00
Rémi Peron
33d5f86937 Add support for s3 ServerSideEncryption (#15952) 2022-10-12 13:05:04 -04:00
Nitwel
d5a161fb72 add alias to always have the same name (#15960) 2022-10-12 11:47:29 -04:00
Brainslug
3c2125f646 public_url_file in .env causes server start error (#15898)
* allow *_FILE environment vars to overwrite default values

* added test

* added mock for fs

* removed test
2022-10-11 16:47:33 -04:00
Roger Stringer
3761abf1f0 adds missing graphQL operators (#15760)
* missing icontains for strings, missing eq, neq for geo, missing in, nin for dates

* fix unit test

* fix unit test part 2

* Update packages/shared/src/utils/get-filter-operators-for-type.ts

Co-authored-by: ian <licitdev@gmail.com>

* fix tests?

* fix tests?

Co-authored-by: ian <licitdev@gmail.com>
2022-09-27 10:16:37 -07:00
José Varela
fae5ed1c08 Graphql: Fix required PK on create / update (#15693)
* Do not require primary key on data on create / update

* Do not put fields non nullable if they have default value

* Handle manually entered primary keys (don't have default value)

* Allow uuid PK to be nullable

Co-authored-by: ian <licitdev@gmail.com>
2022-09-22 22:57:40 +08:00
Maxim
efdeded18a Implemented an option to filter m2a fields using graphql. (#15162)
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-09-22 13:00:52 +02:00
mtgerb
d6fce8d92a Add support for <collection>.items.query filter hook (#15611)
* fix items.query filtering for a collection

* fix linter error

Co-authored-by: Matthias Gerbershagen <m_gerbersh09@informatik.uni-kl.de>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-09-20 14:40:55 +02:00
José Varela
54cd2d47da Cache: Fix check if endpoint is /graphql or not (#15599) 2022-09-16 09:12:00 -04:00
Azri Kahar
f940b6a1fc correct the documented default type for argon2 (#15594) 2022-09-15 22:15:52 +08:00
Rafly Maulana
e13c8e36b0 Allow user to send a WYSIWYG email body (#15514)
* Allow user to send a WYSIWYG email body

* Revert "Allow user to send a WYSIWYG email body"

This reverts commit b65aeb4efc.

* Use a dropdown to select between WYSIWYG and Markdown Editor

* Change input-rich-text-* to wysiwyg or markdown

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-09-15 13:53:19 +08:00
Nicola Krumschmidt
d68a8768fa Add a pathToRelativeUrl util function (#15578) 2022-09-14 15:01:31 -04:00
Nicola Krumschmidt
6bcd514161 Fix starting Directus using a custom start file (#15574)
This should resolve #15091 without breaking #14728.
2022-09-14 12:47:02 -04:00
Kepi
5a7974aa19 GraphQLID is always Non-Nullable (#15465) 2022-09-12 21:02:28 -04:00
Azri Kahar
487112e679 Ensure case insensitive email for password resets (#15420) 2022-09-12 19:59:33 -04:00
Roger Stringer
b1106e183d revisions for CRUD operations with $full (#15467)
* revisions for CRUD operations with $full

* Update api/src/operations/item-update/index.ts

Co-authored-by: ian <licitdev@gmail.com>

* add system role to getAccountabilityForRole and add it to create, delete and update items operations

* Whitespace consistency

Co-authored-by: ian <licitdev@gmail.com>
2022-09-13 02:25:05 +08:00
Nitwel
b0c9107d3e Fix rotating called twice (#15494)
* fix double rotating

* Fix linting

Co-authored-by: ian <licitdev@gmail.com>
2022-09-12 09:36:55 +00:00
ian
1ef17c2ed2 Disable foreign check outside the trx in SQLite (#15403)
* Disable foreign check outside the trx in SQLite

* Update test

* Test if working for all vendors

* Fix sequential tests flow

* Revert triggering for all vendors
2022-09-05 11:31:36 -04:00
Mehdi Nassim KHODJA
31a6fd208f Adding SendGrid email transport (#15384)
* Adding SendGrid email transport

* Formatting

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-09-05 10:14:41 -04:00
Brainslug
0d56357475 Sort is set to NULL for new items (#15241)
* Fix sort field assignment in relationships

* fixed a merge error

* add sort logic to API

* using isNil for a more concise condition expression

* Removed the custom getSortMax function in favor of Math.max

* increment sort value accordingly for bulk creates

* make reordering sort start with 1 instead of 0

* account for bulk create in API side

* removed the redundant frontend sorting code

* reverted change from pr #14987

* updated selectedOnPage to support both item duplication and sorting

* Revert "account for bulk create in API side"

This reverts commit b37ed207f3.

* re-add bulk create increment sort logic

* prevent sending "+" as primary key for newly created relational items (#15353)

* re-add the removed new line as it felt odd

* ensure sql query fires once only

* fix return value

* use `.max()`

Co-authored-by: André Gaul <andre@gaul.io>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-09-02 15:58:30 -04:00
Rijk van Zanten
0de05b40a7 Don't reset body on singleton non-SEARCH reqs (#15369)
Fixes #15364
2022-09-02 11:11:52 -04:00
ian
d29c2dfc3f Fix lint warnings (#15358) 2022-09-02 00:08:23 -04:00
Nicola Krumschmidt
38fb314950 Do not parse json in transform operation if it is already an object (#15354)
Fixes #14814
2022-09-01 15:42:32 -04:00
Sébastien JEAN
99f38285fd Implement query hook (#10551)
* Implement query hook

* Only run hook if events aren't explicitly skipped

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-08-31 18:08:06 +00:00
Rijk van Zanten
f17b96cf3b Reduce overengineering on async-handler (#15340) 2022-08-31 12:17:53 -04:00
Rijk van Zanten
1f66049c42 Fix SEARCH query not functioning on singleton collections (#15339)
* Don't short-circuit on batch read singletons in search methods

* Add tests

100% babyyyyyyy

* Cleanup middleware
2022-08-31 11:59:03 -04:00
ian
f3b6e5ee9d Remove functions from non-read actions in GraphQL types (#15251) 2022-08-30 17:22:23 -04:00
Rijk van Zanten
1619c03767 Allow setting SMTP name (#15327)
Fixes #15294
2022-08-30 15:14:13 -04:00
ian
2c22940574 Throw rejected error for filter event in Flows (#15283)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-08-30 15:05:07 -04:00
nazarevrn
9c55ed6728 Make threshold checks configurable (#15284)
* Make threshold checks configurable

* Fix linter

Co-authored-by: Roman Nazarev <roman.nazarev@skyeng.ru>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-08-30 14:41:26 -04:00
ian
a971455216 Add origin to accountability (#15273)
* Add origin to accountability

* Remove origin column from seeds
2022-08-30 14:15:44 -04:00