You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the user opts into the allowlist feature via changing their wrangler variable to ENABLE_ALLOWLIST = 1, deploys, and then tries to access any of the REST API endpoints - those calls fail. This is mainly due to the REST API now being blocked by the allowlist when it tries to make SQL calls to get the tables primary key values such as:
PRAGMA table_info(${tableName});
We need to find a way to allow the REST API to continue to work even when the Allowlist feature is toggled on. How can we easily add (or bypass optionally via a configuration toggle) to allow whatever query the LiteREST.ts file produces to be executed?
For example one way to "band-aid" this (but bad, not acceptable solution) is by adding the following code to line 40 of ./allowlist/index.ts
Which works for the SQLite internal source only but could be a loophole for other users to request PRAGMA information on tables when they shouldn't be able to. This requires a more suitable resolution that doesn't open up access to the databases.
To Reproduce
Steps to reproduce the behavior:
Change your wrangler.toml variable to ENABLE_ALLOWLIST = 1
Deploy your instance
Try to make a REST API call such as the below cURL
See error message response instead of expected rows from my_table
Expected behavior
Expected to see the results that the REST endpoint should return. For example, if we make a GET call to a table named todos then I would expect a result containing an array of todo item rows from my database table to be represented.
The text was updated successfully, but these errors were encountered:
Describe the bug
When the user opts into the allowlist feature via changing their wrangler variable to
ENABLE_ALLOWLIST = 1
, deploys, and then tries to access any of the REST API endpoints - those calls fail. This is mainly due to the REST API now being blocked by the allowlist when it tries to make SQL calls to get the tables primary key values such as:We need to find a way to allow the REST API to continue to work even when the Allowlist feature is toggled on. How can we easily add (or bypass optionally via a configuration toggle) to allow whatever query the
LiteREST.ts
file produces to be executed?For example one way to "band-aid" this (but bad, not acceptable solution) is by adding the following code to line 40 of
./allowlist/index.ts
Which works for the SQLite internal source only but could be a loophole for other users to request PRAGMA information on tables when they shouldn't be able to. This requires a more suitable resolution that doesn't open up access to the databases.
To Reproduce
Steps to reproduce the behavior:
ENABLE_ALLOWLIST = 1
my_table
Expected behavior
Expected to see the results that the REST endpoint should return. For example, if we make a GET call to a table named
todos
then I would expect a result containing an array of todo item rows from my database table to be represented.The text was updated successfully, but these errors were encountered: