Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
"pydevd_authorize" request #1829
We currently exchange the authorization tokens in the "initialize" request and response.
However, our most recent design for subprocess debugging implies that, while the TCP connection between the subprocess server and the adapter is established immediately as soon as subprocess starts, "initialize" is not sent by the adapter immediately. Instead, the adapter sends "pydevd_systemInfo" request to the debuggee as soon as connection is established, to determine PID and parent PID, and waits for IDE to request attach to the process. When IDE connects to adapter and requests attach, it sends an "initialize" request to the adapter, and that request is then relayed to the server.
Thus, we need to move the token exchange out of "initialize". We can do this via debugger properties, as mentioned in #1782, but this would require adding "getDebuggerProperty". However, this seems to be better suited for a dedicated request, since when authorization is in place, no other messages can be handled until the tokens are validated. Rather than special-casing one property like that, let's refactor this into a distinct request, in which the server token (if present) is sent as part of the request, and the IDE token (if present) is sent as part of the response.
On pydevd side, this should be very similar to the existing implementation, but instead of special-casing "initialize" in
On a second thought, we might also want to rename "ideAccessToken". In our most recent design, the token exchange actually occurs between the adapter and the server, not the IDE and the server, so it's confusing. Let's revert it to "clientAccessToken" - this covers both ptvsd (where adapter is involved), and direct connections from an IDE to pydevd, if somebody wants to do that.