-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSC 1Password Debug #137
Comments
We have the same issue. How would one automatically resolve environment variables with op references when running a given program? Creating a resolved environment once and keeping it in the file-system seems possible but cumbersome and might easily lead to leaked secrets. |
We are highly interested in having a option to use 1Password in VSCode, however the debug is butter and bread. Without a debug integration, it is not possible to use it without still saving clear text passwords. |
@MichaelMHoff @NielsKorschinsky Which debugger are you using? Most tools allow you to configure the executable that's being run by VS Code, so you could create an
And in VS Code, point to the location of this shim. |
We are using the classic launch.json (Python) of VSC. Do you might have an example there? Example launch: {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Program_Name",
"type": "python",
"request": "launch",
"program": "${cwd}/main.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"first-arg"
"--second_arg"
"arg_value"
]
},
] |
I was able to replace the #!/bin/sh
op run -- python3.9_org $@ However the debugger is getting a timeout to connect - It is missing some kind of response. |
For everyone else, who might want to spend more time on this - I found probably a solution but I currently don't have the time to try it out. https://stackoverflow.com/a/57278669
|
Hey guys, many thanks for the inputs and the research. I think I could make it work, combining everything from above:
It appears that the quotes around Use this script (made executable, I am using a Mac, so I figure [edit: after it worked initially, the launch now simply quits without further information. Still needs debugging...] |
Hi all, thanks for this awesome discussion! There's a lot of good information here, and I'm compiling all of it to put on our team's radar. Adding a debugger component to the VS Code extension is not currently on our roadmap but this is all super helpful in informing what we work on next in the extension. Thank you! |
@MichaelMHoff thanks a lot for this testing! I will test that too again, however my initial test proven difficult in combination with pylance and such tools, so I really hope for a solution of the 1 password team. @jodyheavener Thanks for getting this on your list. I really think such an native integration would be very important and helpful as this enables teams to go end-to-end from developing, testing, to deploying without having passwords in clear text. |
I'm not sure if 1Password has come around on putting this in their roadmap but in the meantime as a workaround, I've found it effective to launch VS Code using # Inside the project directory
op run --env-file .env -- code . Since this largely removes the need for the |
@sultanofcardio this is indeed a workaround, hence not ideal. @jodyheavener is this workaround the best we can get to make 1Password secrets usable inside the VSCode debugger or do you know of any other ways combining VSCode (or any IDE?) and 1Password secrets? |
My workaround for debugging tests: in launch.json
Create a file called
Set all your env variables in a file called
|
Summary
I've been looking to integrate the secret provision from
op run --
into vscode, so I can start using it for my local development.I am using 1Password plugin for vscode that is documented here.However, there doesn't seem to be a way to integrate a tool like this (that I can think of) into vscode at the moment - specificallyvscode-python
.And unable to inject variables into runtime without prefixop run --
and it seems there is no option available for this.Use cases
op://<vault-name>/<item-name>[/<section-name>]/<field-name>
op run
(using debugger), not able to inject the variables using debugger and it seems there is no option available for the debugger.Prior Work
I have investigated a lot If a similar feature was implemented for another language, but nothing found on this issue.
References
The text was updated successfully, but these errors were encountered: