Skip to content
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

htgettoken crashes if --nobearertoken is given and credkey is not found or specified #73

Closed
duncanmmacleod opened this issue May 22, 2023 · 4 comments

Comments

@duncanmmacleod
Copy link
Contributor

If htgettoken is executed with the --nobearertoken option and a --credkey is not given or found in ~/.config then it crashes:

$ htgettoken --nobearertoken
Traceback (most recent call last):
  File "/home/duncan/opt/mambaforge/envs/py311/bin/htgettoken", line 1488, in <module>
    main()
  File "/home/duncan/opt/mambaforge/envs/py311/bin/htgettoken", line 936, in main
    fullsecretpath = secretpath.replace("%credkey", credkey)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: replace() argument 2 must be str, not None

It looks like this was introduced by 48fa256.

@DrDaveD
Copy link
Collaborator

DrDaveD commented May 22, 2023

Ok, I can reproduce this if I give a -a and -i option. I'm guessing you have those set in $HTGETTOKENOPTS.

@duncanmmacleod
Copy link
Contributor Author

@DrDaveD
Copy link
Collaborator

DrDaveD commented May 23, 2023

Oh that just confuses me. I can clearly see the bug and how to fix it, but what I don't see is how it could be triggered by the example in that issue, because that one has a credkey.

@DrDaveD
Copy link
Collaborator

DrDaveD commented May 31, 2023

It was because there issuer wasn't passed to it, so it didn't find a credkey under the "default" issuer. Fixed in #76 and htgettoken-1.18.

@DrDaveD DrDaveD closed this as completed May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants