-
Notifications
You must be signed in to change notification settings - Fork 54
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
pass the unmodified login path to the native component instead of assuming .gpg #312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to only do this for versions of the native host that have the ability to accept such paths. Changes to the extension must be backwards-compatible with older host versions.
@erayd the filenames here come from the native host. it won’t return any path that didn’t originate in the native host to begin with. today the host uses a can you clarify your concern with backward compatibility, and then maybe i can try to fix whatever it is? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uninsane My mistake then sorry - clearly I reviewed this too fast! I just looked at it, saw filename changes without compatibility checks, and called it a day. If it's just passing the same thing back, then I have no issue with that 🙂.
Other than the replacement method, I'm happy with this.
I'm also happy with this and don't have any additional comments, thanks @uninsane! |
e36da97
to
f7cb5af
Compare
…uming .gpg this is in support of <browserpass/browserpass-native#127>. this has immediate benefit for anyone using the patches shared in that PR today. without this, browserpass doesn't recognize `github.aaakk.us.kg.age` as a default key for `https://github.com`, because it fails the substring match. by stripping the extension -- whatever it is -- both `github.aaakk.us.kg.gpg` and `github.aaakk.us.kg.age` are recognized as keys for their intended domain.
f7cb5af
to
e3bf558
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks @uninsane 😁
You guys are awesome 👍 |
also, no one even mentioned how close the large edit refactor was to being merged ... |
@patgmiller Read but not run, as was reviewing this on my phone at the time. Can you clarify what is too aggressive about the regex? It's end-anchored, so it should not be removing anything but the file extension. Didn't explicitly mention the edit PR, because it didn't seem particularly relevant to do so - this one addresses something entirely different. |
@patgmiller I just tested this commit now, and it seems to be working fine with paths containing a period. I tested the following:
All tested scenarios worked as expected. Can you clarify what specifically this commit is breaking for you? |
the Dec 25 16:57:20 friday browserpass[26345]: time="2022-12-25T16:57:20-07:00" level=error msg="Unable to decrypt the password file 'browserpass/google.gpg' in the password store '{ID:x468bpnd2 Name:pass.go Path:/home/patrick/playground/github.com/w3digitalfoundry/.password-store Settings:{GpgPath:}}': open /home/patrick/playground/github.com/w3digitalfoundry/.password-store/browserpass/google.gpg: no such file or directory" the actual path for that file is /home/patrick/playground/github.com/w3digitalfoundry/.password-store/browserpass/google.com/example-extra-lines.gpg
You didn't think there would be conflicts especially considering the amount of refactoring that was done!? I couldn't de-crypt anything after these changes. So I'll just have to figure out what the problem is. I'm just really tried of more changes and things getting pushed further back |
Not all file extensions are only three chars; longer ones are common. Unless we are needing to handle files with no extension at all, then the length is irrelevant here; what matters is correctly identifying the final dot. Which this regex does.
I can guarantee it's not broken because of the regex (see screenshot below). I'll see if I can locate the issue for you. It doesn't break on master, which is what this PR is against. Stand by.
With this specific issue, no - because it shouldn't even be touching your bit; it's a six-line change to switch from
This commit should not have required changes from you, unless you also changed these lines (and if the latter is the case, then merging this in should be trivial). I'm not going to deny merge for six trivial lines for the sake of an enormous PR that is entirely unrelated. Picking up this kind of thing is what rebasing is for. |
@patgmiller So, the root cause appears to be a bug in your PR, which calls the helper function To reproduce it on your I will produce a diff for you against |
This should sort it. The bugfix is in I'll take a more retailed look though later and see if I can spot any other filename-related issues (e.g. hardcoded gpg suffixes).
|
this is in support of
browserpass/browserpass-native#127.
this has immediate benefit for anyone using the patches shared in that PR today. without this, browserpass doesn't recognize
github.aaakk.us.kg.age
as a default key forhttps://github.com
, because it fails the substring match. by stripping the extension -- whatever it is -- bothgithub.aaakk.us.kg.gpg
andgithub.aaakk.us.kg.age
are recognized as keys for their intended domain.