Commit graph

849 commits

Author SHA1 Message Date
Simon Willison
f84acae98e Return 400 errors for ?_sort errors, closes #1950 2022-12-13 14:23:17 -08:00
Simon Willison
45979eb723 Rename permission created by demo plugin
It was showing up as 'new-permission' on https://latest.datasette.io/-/permissions
which I thought was confusing
2022-12-12 21:21:01 -08:00
Simon Willison
a1a372f179 /-/actor no longer requires view-instance, refs #1945 2022-12-12 21:06:30 -08:00
Simon Willison
260fbb598e Fix some failing tests, refs #1855 2022-12-12 21:00:40 -08:00
Simon Willison
809fad2392 Tests for datasette create-token restrictions, refs #1855 2022-12-12 20:44:19 -08:00
Simon Willison
c13dada2f8 datasette --get --token option, closes #1946, refs #1855 2022-12-12 20:36:42 -08:00
Simon Willison
c6a811237c /-/actor.json no longer requires view-instance, closes #1945 2022-12-12 20:11:51 -08:00
Simon Willison
3e6a208ba3 Rename 't' to 'r' in '_r' actor format, refs #1855 2022-12-12 19:27:34 -08:00
Simon Willison
c5d30b58a1 Implemented metadata permissions: property, closes #1636 2022-12-12 18:40:45 -08:00
Simon Willison
8bf06a76b5
register_permissions() plugin hook (#1940)
* Docs for permissions: in metadata, refs #1636
* Refactor default_permissions.py to help with implementation of #1636
* register_permissions() plugin hook, closes #1939 - also refs #1938
* Tests for register_permissions() hook, refs #1939
* Documentation for datasette.permissions, refs #1939
* permission_allowed() falls back on Permission.default, refs #1939
* Raise StartupError on duplicate permissions
* Allow dupe permisisons if exact matches
2022-12-12 18:05:54 -08:00
Simon Willison
34cffff02a Refactor _headers() for write API tests 2022-12-07 17:39:07 -08:00
Simon Willison
dee18ed8ce test_create_table_error_rows_twice_with_duplicates, refs #1927 2022-12-07 17:29:24 -08:00
Simon Willison
9342b60f14 test_create_table_error_if_pk_changed, refs #1927 2022-12-07 17:27:01 -08:00
Simon Willison
6b27537988 ignore/replace to create requires pk, refs #1927 2022-12-07 17:18:40 -08:00
Simon Willison
272982e8a6
/db/table/-/upsert API
Close #1878

Also made a few tweaks to how _r works in tokens and actors,
refs #1855 - I needed that mechanism for the tests.
2022-12-07 17:12:15 -08:00
Simon Willison
93ababe6f7 Initial attempt at insert/replace for /-/create, refs #1927 2022-12-02 23:00:18 -08:00
Simon Willison
d7e5e3c9f9 Fix for todomvc permission check
Refs https://github.com/simonw/todomvc-datasette/issues/2
2022-12-01 17:38:23 -08:00
Simon Willison
27efa8c381 todomvc permissions and fixed DATASETTE_SECRET for new demo
Refs https://github.com/simonw/todomvc-datasette/issues/2
2022-12-01 17:29:44 -08:00
Simon Willison
f3c8da7acd MAke the sign in as root button bigger on latest.datasette.io 2022-12-01 13:29:31 -08:00
Simon Willison
7fde34cfcb Documentation and test for UNIQUE constraint failed, refs #1924 2022-11-30 18:05:29 -08:00
Simon Willison
31d6a0bc5e Applied Black, refs #1922 2022-11-30 15:17:39 -08:00
Simon Willison
f0fadc28dd Access-Control-Allow-Headers: Authorization, Content-Type - refs #1922 2022-11-30 15:11:18 -08:00
Simon Willison
2cd7ecaa0a Apply Black, refs #1922 2022-11-30 13:54:47 -08:00
Simon Willison
6bfd71f5c6 Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS - refs #1922 2022-11-30 12:25:12 -08:00
Simon Willison
4c18730e71 Update tests to export 200 for OPTIONS calls, refs #1922 2022-11-30 10:29:48 -08:00
Simon Willison
48725bb4ea CORS headers for write APIs, refs #1922 2022-11-30 09:27:10 -08:00
Simon Willison
8404b21556 405 method not allowed for GET to POST endpoints, closes #1916 2022-11-29 21:15:13 -08:00
Simon Willison
6b47734c04 _memory database should not be mutable, closes #1917 2022-11-29 21:06:52 -08:00
Simon Willison
b8fc8e2cd7
Merge branch 'main' into 1.0-dev 2022-11-29 11:34:39 -08:00
Simon Willison
6bda225786 Tests for rowid and compound pk row deletion, closes #1864 2022-11-29 10:53:55 -08:00
Simon Willison
1154048f79 Compound primary key support for /db/-/create - closes #1911
Needed for tests in #1864
2022-11-29 10:47:48 -08:00
Simon Willison
484bef0d3b /db/table/pk/-/update endpoint, closes #1863 2022-11-29 10:06:19 -08:00
Simon Willison
733447d7c7 Upgrade to Python 3.11 on Heroku, refs #1905 2022-11-18 16:44:46 -08:00
Simon Willison
72ac9bf82f --generate-dir option to publish heroku, refs #1905 2022-11-18 16:34:33 -08:00
Simon Willison
c588a89f26 db.view_exists() method, needed by #1896 2022-11-18 14:16:38 -08:00
Simon Willison
b29ccb59c7 Add test for db.view_names() 2022-11-18 14:13:48 -08:00
Simon Willison
83a6872d1b Include views in SQL autocomplete, refs #1897 2022-11-17 18:53:48 -08:00
Simon Willison
98611b3da0 Include SQL schema for CodeMirror on query pages, closes #1897
Refs #1893
2022-11-17 17:24:44 -08:00
Simon Willison
b35522c6dd Updated test, refs #1890 2022-11-17 17:23:35 -08:00
Simon Willison
3e61a41b9b Include SQL schema for CodeMirror on query pages, closes #1897
Refs #1893
2022-11-17 17:19:37 -08:00
Simon Willison
6f610e1d94 Updated test, refs #1890 2022-11-15 19:04:24 -08:00
Simon Willison
187d91d686 /db/-/create API endpoint, closes #1882 2022-11-14 21:57:28 -08:00
Simon Willison
264d0ab471 Renamed return_rows to return in insert API
Refs https://github.com/simonw/datasette/issues/1866#issuecomment-1313128913
2022-11-13 21:49:23 -08:00
Simon Willison
65521f03db Error for drop against immutable database, closes #1874 2022-11-13 21:40:10 -08:00
Simon Willison
612da8eae6 confirm: true mechanism for drop table API, closes #1887 2022-11-13 21:17:18 -08:00
Simon Willison
fa9cc9efaf Fix for redirects ignoring base_url, refs #1883 2022-11-12 12:29:59 -08:00
Simon Willison
26262d08f3 Test form actions use prefix, refs #1883 2022-11-12 12:29:59 -08:00
Simon Willison
8d9a957c63 Fix for redirects ignoring base_url, refs #1883 2022-11-10 22:49:54 -08:00
Simon Willison
bbaab3b38e Test form actions use prefix, refs #1883 2022-11-10 22:20:40 -08:00
Simon Willison
bcc781f4c5 Implementation and tests for _r field on actor, refs #1855
New mechanism for restricting permissions further for a given actor.

This still needs documentation. It will eventually be used by the mechanism to issue
signed API tokens that are only able to perform a subset of actions.

This also adds tests that exercise the POST /-/permissions tool, refs #1881
2022-11-03 17:12:23 -07:00