github
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/datasette/issues/1020#issuecomment-712482504 | https://api.github.com/repos/simonw/datasette/issues/1020 | 712482504 | MDEyOklzc3VlQ29tbWVudDcxMjQ4MjUwNA== | 9599 | 2020-10-19T22:45:01Z | 2020-10-19T22:45:01Z | OWNER | I'm having trouble coming up with the syntax for this. Here's one option: ```python response = await datasette.client.get(path, request=request) ``` But this feels confusing to me. We're not using the `request=` argument as a request - we're using it as a source of some default request values (the cookies and incoming headers, but not the path). We're essentially combining that request with the other arguments passed to `.get()`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
721068929 | |
https://github.com/simonw/datasette/issues/1020#issuecomment-712482015 | https://api.github.com/repos/simonw/datasette/issues/1020 | 712482015 | MDEyOklzc3VlQ29tbWVudDcxMjQ4MjAxNQ== | 9599 | 2020-10-19T22:43:24Z | 2020-10-19T22:43:24Z | OWNER | ... unless I want to support authentication mechanisms that work based on incoming IP address instead, in which case there's an argument for copying more over from the incoming request. Tailscale is a good example of a system where authentication based on IP address can actually work well, so this is worth doing. Also, there might be authentication mechanisms which work by setting a custom header on the incoming request (not to mention the `Authorization` header). | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
721068929 | |
https://github.com/simonw/datasette/issues/1020#issuecomment-712481568 | https://api.github.com/repos/simonw/datasette/issues/1020 | 712481568 | MDEyOklzc3VlQ29tbWVudDcxMjQ4MTU2OA== | 9599 | 2020-10-19T22:41:59Z | 2020-10-19T22:41:59Z | OWNER | It turns out this works just fine: ```python response = await datasette.client.get(path, cookies=request.cookies) ``` So I don't need a mechanism for this. I'm going to add this to the documentation instead. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
721068929 |