op secret provisioning in vscode

jamesstidard
jamesstidard
Community Member

Hi all,

I've been looking to integrate the secret provision from op run -- into vscode, so I can start using it for my local development. 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 - specifically vscode-python.

I've created a feature request on the vscode-python GitHub repo, it needs to get :thumbsup: reactions for it to be considered. Thought, 'd cross-post here to maybe catch the eye of anyone else who's potentially interested and could throw a thumb behind it.

Here's the feature request: https://github.com/microsoft/vscode-python/issues/19132


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

Comments

  • Hey @jamesstidard,

    Thank you for opening up the ticket! This is a super nice idea. I know this is possible with vscode-go, but no idea about other languages. I do agree that it would be super cool to have this feature over the best known extensions of VSC, I've been using the Go feature a lot.

    Left a :thumbs-up: :) Please keep us posted with any development on this, and, if this needs a hand from 1Password in any way, make sure to let us know!

    Best,
    Horia

  • jamesstidard
    jamesstidard
    Community Member

    Oh, I appreciate the thumb. I didn’t know vscode-go had support for this. I’ll add this to the ticket, as probably makes sense to copy whoever they’ve done it so it’s consistent.

    Thanks :)

  • jamesstidard
    jamesstidard
    Community Member
    edited May 2022

    @Horia.Culea_1P I've not used the vscode-go extension at all. I was hoping I would be able to find it fairly easy in the launch.json or settings.json documentation, but wasn't able to. How do you currently get op playing nice with vscode-go? Be nice to see how they've supported it.

  • Horia.Culea_1P
    edited May 2022

    In vscode-go, it would go something like this:
    1. create a custom runner, save it somewhere (e.g. ~/.op/runners/go):

    #!/bin/bash
    if [ $# -ge 1 ] && ([ $1 = 'run' ] || [ $1 = 'test' ]); then
        op run -- go $@
    else
        go $@
    fi
    
    1. in your project, in settings.json, update go.alternateTools to point to the new runner:
    "go.alternateTools":
        {
             "go":"~/.op/runners/go"
        }
    

    Let me know if this helps.

    Best,
    Horia

  • jamesstidard
    jamesstidard
    Community Member

    @Horia.Culea_1P that's perfect. Thanks for the help. Did actually try something similar with python by making a fake python runner as you did here, but vscode-python was too smart for it, and rejected using it.

    Anyway, thanks for the help.

  • No worries. Let us know how it goes on the vs-python side.
    Once again, if you need help with anything else, don't hesitate to reach out!

    Best,
    Horia

This discussion has been closed.