Giter Site home page Giter Site logo

Comments (8)

jeffwidman avatar jeffwidman commented on June 3, 2024

We don't pass the passwords in as a command line option for security reasons. So the two places the password can go is either your system keychain or if it's not found, the script will ask you for the password. ~/.htrc is definitely not the correct place, and actually won't do anything at all.

I haven't used the keyring lib myself... @jaraco does this error indicate he's got the python lib keyring installed, but it's not finding any GH/BB creds in the keyring? If so, should we be catching this error and dropping back to manually prompting or is there a better way?

In the meantime @abadger1406 as a workaround, I suggest uninstalling the keyring lib: pip uninstall keyring and then re-running the script... it will realize keyring isn't installed and prompt you for the passwords then.

from bitbucket-issue-migration.

igorsantos07 avatar igorsantos07 commented on June 3, 2024

Same here, except my error says "no recommended backend was available".

I'm running Ubuntu 14.04 here, and had to install pip3 in my machine - only had Python 3. Additionally, I don't think I even use the system keychain - maybe it's not setup at all, and thus it issued that message? If that's indeed the case, I guess the script should silently fail and prompt for password.

Finally, from pure interpretation I guess what you said is right: the @abadger1406 error means the keyring do not have the GH/BB passwords.

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 3, 2024

This sounds like a separate issue--likely as you say the system keychain simply isn't setup--but I'm not too familiar with the keyring library. Hopefully @jaraco can explain a little more of what's happening here?

from bitbucket-issue-migration.

jaraco avatar jaraco commented on June 3, 2024

Ugh.

So keyring 8.0 removes a bunch of non-preferred backends, which means it may be possible that there is no valid backend available, leading to the error message (which itself erroneously referenced 'preferred password' instead of 'preferred backend' until 8.0.1).

See jaraco/keyring#117 for a history leading to the 8.0 release.

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 3, 2024

EDIT: Looks like you're already ahead of me in the linked issue. Whenever this is resolved, we should just require the latest version of keyring and call it a day. Thanks!


My original comment:

  1. For the first issue above--where he seems to have an available backend, any idea why Keyring throws an exception rather than returning None when GH/BB creds weren't available?
  2. When a preferred backend isn't available, sounds like we just need to catch the exception. I also have no problem with requiring keyring >= 8.0.1.

I'm a little surprised keyring throws an exception rather than just returning None when no backend is available... I guess it makes sense in other contexts to know why it's explicitly failing, but in this context, all we need is just try to grab the creds, and if they aren't available, then revert to manually asking the user--doesn't matter to us if they aren't available due to no backend or no creds.

from bitbucket-issue-migration.

jaraco avatar jaraco commented on June 3, 2024

The quick workaround is to also install keyrings.alt which will bring in the non-preferred backends and one of them will return None for the call to get_password, allowing the script to prompt for the password and continue.

from bitbucket-issue-migration.

jaraco avatar jaraco commented on June 3, 2024

If you would just pull that commit, I expect it fixes the issue with minimal fuss. Assuming it works well, I'll make it a formal recommendation for other projects moving forward.

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 3, 2024

Thanks @jaraco really appreciate you willing to help maintain the keyring implementation here.

I didn't test it myself, but it makes sense in theory and since this should error in an obvious way, I'm fine with assuming it works and then dealing with any issues that crop up.

from bitbucket-issue-migration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.