{"html_url": "https://github.com/simonw/datasette/issues/699#issuecomment-611879821", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/699", "id": 611879821, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMTg3OTgyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-10T05:06:56Z", "updated_at": "2020-04-10T05:06:56Z", "author_association": "OWNER", "body": "Another problem this would solve: if you want multiple authentication mechanisms - GitHub auth for users, `Authorization: bearer xxx` auth for API keys - the order in which they run might end up mattering.\r\n\r\nI dealt with this a bit in https://github.com/simonw/datasette-auth-github/issues/59\r\n\r\nBut having an authentication plugin hook - where playing get to decide if a user should be authenticated based on the incoming ASGI scopes - would be neater.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 582526961, "label": "Authentication (and permissions) as a core concept"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/699#issuecomment-611880250", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/699", "id": 611880250, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMTg4MDI1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-10T05:08:54Z", "updated_at": "2020-04-10T05:08:54Z", "author_association": "OWNER", "body": "So maybe this is all handled by plugin hooks?\r\n\r\n`auth_from_scope(datasette, scope)` would be the main one - for deciding if a user should be authenticated based on data from the scope.\r\n\r\nHow would a permissions hook work though?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 582526961, "label": "Authentication (and permissions) as a core concept"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/724#issuecomment-612154749", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/724", "id": 612154749, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMjE1NDc0OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-10T18:19:31Z", "updated_at": "2020-04-10T18:19:31Z", "author_association": "OWNER", "body": "Actually that code isn't the problem, since `extra_metadata` has not yet been read from `metadata.json` at that point.\r\n\r\nThe bug is here: https://github.com/simonw/datasette/blob/d55fe8cdfc2ce7bc6960bf2507766c1fcd1d31a7/datasette/utils/__init__.py#L362-L368\r\n\r\nI need to merge dictionaries in a smarter way.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 598013965, "label": "--plugin-secret over-rides existing metadata.json plugin config"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/724#issuecomment-612155297", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/724", "id": 612155297, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMjE1NTI5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-10T18:20:53Z", "updated_at": "2020-04-10T18:20:53Z", "author_association": "OWNER", "body": "Lot's of recipes for deep dictionary merge on https://stackoverflow.com/q/7204805/6083", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 598013965, "label": "--plugin-secret over-rides existing metadata.json plugin config"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/724#issuecomment-612156367", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/724", "id": 612156367, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMjE1NjM2Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-10T18:23:39Z", "updated_at": "2020-04-10T18:23:39Z", "author_association": "OWNER", "body": "I think I'll use https://github.com/clarketm/mergedeep (MIT license)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 598013965, "label": "--plugin-secret over-rides existing metadata.json plugin config"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/98#issuecomment-612173156", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/98", "id": 612173156, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMjE3MzE1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-10T19:03:32Z", "updated_at": "2020-04-10T23:08:28Z", "author_association": "OWNER", "body": "Investigate this traceback:\r\n```\r\nTraceback (most recent call last):\r\n File \"fetch_projects.py\", line 60, in \r\n fetch_projects(db, token)\r\n File \"fetch_projects.py\", line 41, in fetch_projects\r\n db[\"projects\"].upsert(project, pk=\"id\")\r\n File \"/Users/simonw/.local/share/virtualenvs/big-local-datasette-2jT6nJCT/lib/python3.7/site-packages/sqlite_utils/db.py\", line 1139, in upsert\r\n conversions=conversions,\r\n File \"/Users/simonw/.local/share/virtualenvs/big-local-datasette-2jT6nJCT/lib/python3.7/site-packages/sqlite_utils/db.py\", line 1168, in upsert_all\r\n upsert=True,\r\n File \"/Users/simonw/.local/share/virtualenvs/big-local-datasette-2jT6nJCT/lib/python3.7/site-packages/sqlite_utils/db.py\", line 1107, in insert_all\r\n row = list(self.rows_where(\"rowid = ?\", [self.last_rowid]))[0]\r\nIndexError: list index out of range\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 597671518, "label": "Only set .last_rowid and .last_pk for single update/inserts, not for .insert_all()/.upsert_all() with multiple records"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/236#issuecomment-612216820", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/236", "id": 612216820, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMjIxNjgyMA==", "user": {"value": 193185, "label": "cldellow"}, "created_at": "2020-04-10T21:03:38Z", "updated_at": "2020-04-10T21:03:38Z", "author_association": "CONTRIBUTOR", "body": "I made a repo at https://github.com/code402/datasette-lambda to demonstrate the idea, and scratch my personal itch for this.\r\n\r\nThe demo relies on some central authority having already published a public, reusable Lambda layer with Datasette & its dependencies. I think that differs from the other publish plugins which seem to mainly publish Dockerfiles that the host will interpret to install deps from a requirements.txt file.\r\n\r\nI chose that approach because `uvloop` appears to be a dependency with native code that needs to be compiled for the target runtime environment. In this case, that's Amazon Linux 2. I'm not 100% clear on whether that's still required, because:\r\n\r\n- maybe `uvloop` is only needed for `uvicorn`, which the demo doesn't actually use since HTTP routing is handled by API Gateway\r\n- it seems like `uvloop` may be an optional, drop-in optimization for `asyncio` in any case (but I may be misreading this; I'm very much a Python noob)\r\n\r\nIf it's the case that `uvloop` is truly optional, then I think the publish plugin could do the packaging on the user's machine, regardless of what flavour of operating system they're on. That'd be a bit slower for the user, but would provide the most long-term flexibility in terms of supporting plugins.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 317001500, "label": "datasette publish lambda plugin"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/98#issuecomment-612258687", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/98", "id": 612258687, "node_id": "MDEyOklzc3VlQ29tbWVudDYxMjI1ODY4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-10T23:08:48Z", "updated_at": "2020-04-10T23:08:48Z", "author_association": "OWNER", "body": "I need a test that reproduces this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 597671518, "label": "Only set .last_rowid and .last_pk for single update/inserts, not for .insert_all()/.upsert_all() with multiple records"}, "performed_via_github_app": null}