wandera / 1password-client

Python wrapper for OnePassword CLI developed at Wandera.
MIT License
47 stars 25 forks source link

Windows support #10

Open EhsanKia opened 3 years ago

EhsanKia commented 3 years ago

I wonder if anyone has gotten this working on a windows system. It seems to rely on an .rcfile to work, which is not available on windows based systems.

First it complained about missing environ['HOME'], but I set that and then it complains about not finding a shell rc file. It seems like it's used to managed the OP_SESSION key, it may be nice to have a way for the user to just provide the session value manually maybe?

dtpryce commented 3 years ago

That would be great! If you want to submit a PR but make sure it's backwards compatible (there is some platform detection in there) ... We are unable to develop and test this on Windows currently but would welcome any contribution for it

dtpryce commented 3 years ago

Ok I was able to try some stuff out on my partners Win10 laptop and think we can make something work, but won't be very soon. @EhsanKia would you like to help / test it when we do? Will probably be a simple:

Keep your eyes peeled for now or if you make any progress yourself respond here!

EhsanKia commented 3 years ago

I'd be happy to help test, I can also contribute if you can give a few pointers.

dtpryce commented 3 years ago

Ok we have a ticket in our JIRA board but unlikely to get there in next few weeks but will be in contact when we do. If you do develop something yourself we can help too.

dtpryce commented 3 years ago

Just as an update here ... we have estimated this as quite complex since we don't have a Windows development environment, so we won't be able to get to this quickly. But we will in time - we have an environment on the way ;).

dtpryce commented 3 years ago

Further update ... we had issues with a more recent version of op which are now fixed in MacOS and Linux. Windows environment is still on the way, but hoping to get to it soon or just borrow a Windows machine from someone.

EhsanKia commented 3 years ago

Thank you for the regular updates :)

dtpryce commented 3 years ago

Another one for you :) so we went down the VM route and got one working and fell down the hole of environment variables on Windows 🤦🏼 however we have decided to go with using chocolatey to help us install the op cli and then we only have to update the client to handle Windows potentially.

@EhsanKia The question that raises, to install the package manager needs to be done using administrative shell, is this ok from a UX perspective? I imagine it would mean pip install would also need to be run in this mode.

More details here: https://chocolatey.org/install

EhsanKia commented 3 years ago

I think that's fair if install is required. though would the package still work if op is already installed and properly setup to work in shell, with check_install_required(): returning true?

dtpryce commented 3 years ago

Right now I'm not sure it would since with other platforms it uses the bash profile. Will have to leverage the powershell PS1 profile I think to get the client working / find another library for Windows specific profiles - we shall see.

dtpryce commented 3 years ago

Sorry we haven't got round to this ... some other bugs with existing platforms and our release pipeline have to take priority I am afraid. I am hoping to get round to Windows sometime in this quarter though!

dtpryce commented 2 years ago

Well I definitely miss estimated this by a long shot, our previous company was acquired and a lot has got ahead of this lib. Sorry @EhsanKia ... if you want to go ahead and try it yourself go ahead, we had some great initial ideas!

dtpryce commented 1 year ago

Hey @EhsanKia as you might have seen we have just released 1.0.1 which supports v2 and within the new cli there is much more windows support. We have started a windows branch to add this support proper within our client - it's coming. We have fully tested the installation which should work if you can run pip as as admin and have setup Windows Hello. We still want to double check that the client works fully and then will add the windows updates.