Comments (5)
Thanks for reporting the problem. Unfortunately, it's not a simple one to fix.
I just replaced
-w
by the-g
option inworkflow.py
This makes the error disappear.
However, the workflow isn't still working (although it works the first time, it crashes later on), as other authentication errors show up. It is close to work though.
It makes that error disappear, but it causes the other authentication errors. I'm afraid it's not actually close to working :(
Replacing -w
with -g
doesn't work because they do different things. -w
, where available, outputs only the password, whereas -g
outputs the entire entry for the Keychain item in some odd format:
$ security add-generic-password -s net.deanishe.alfred-pinboard -a pinboard_api_key3 -w 'This is a test'
$ security find-generic-password -s net.deanishe.alfred-pinboard -a pinboard_api_key3 -w
This is a test
$ security find-generic-password -s net.deanishe.alfred-pinboard -a pinboard_api_key3 -g
keychain: "/Volumes/Users/daj/Library/Keychains/login.keychain"
class: "genp"
attributes:
0x00000007 <blob>="net.deanishe.alfred-pinboard"
0x00000008 <blob>=<NULL>
"acct"<blob>="pinboard_api_key3"
"cdat"<timedate>=0x32303134303832343130353033345A00 "20140824105034Z\000"
"crtr"<uint32>=<NULL>
"cusi"<sint32>=<NULL>
"desc"<blob>=<NULL>
"gena"<blob>=<NULL>
"icmt"<blob>=<NULL>
"invi"<sint32>=<NULL>
"mdat"<timedate>=0x32303134303832343130353033345A00 "20140824105034Z\000"
"nega"<sint32>=<NULL>
"prot"<blob>=<NULL>
"scrp"<sint32>=<NULL>
"svce"<blob>="net.deanishe.alfred-pinboard"
"type"<uint32>=<NULL>
password: "This is a test"
So the output from -g
requires parsing. Things also get a lot more complicated if there is a backslash or non-ASCII character in your password:
$ security add-generic-password -s net.deanishe.alfred-pinboard -a pinboard_api_key2 -w 'This " is a \test"'
$ security find-generic-password -s net.deanishe.alfred-pinboard -a pinboard_api_key2 -w
This " is a \test"
$ security find-generic-password -s net.deanishe.alfred-pinboard -a pinboard_api_key2 -g
keychain: "/Volumes/Users/daj/Library/Keychains/login.keychain"
class: "genp"
…
…
password: 0x5468697320222069732061205C7465737422 "This " is a \134test""
$ security add-generic-password -s net.deanishe.alfred-pinboard -a pinboard_api_key2 -w 'This is a tüst'
keychain: "/Volumes/Users/daj/Library/Keychains/login.keychain"
class: "genp"
…
…
password: 0x5468697320697320612074C3BC7374 "This is a t\303\274st"
Notice that using -g
in this case returns a different format with \xxx
escapes in the output.
So it would be a lot more complicated to use the -g
option instead of -w
. There is another way to access Keychain using the Python–Objective-C bridge, but that doesn't help with the second problem:
I don't have a Lion machine to test it on: there might be other problems, too.
I'd be happy to accept a pull request implementing the change, but it's not one I can realistically do myself because I don't have anything older than Mavericks to test it on, and I don't want to spend hours re-implementing a feature for it to turn out to be still broken, just in a different way.
from alfred-workflow.
Thanks a lot for the detailed and clear explanations. Now I understands precisely why it didn't work and it seems daunting :). If I get the time, I will try to solve the problem on my local fork.
from alfred-workflow.
I'm closing this issue for now, but please feel free to reopen it if you come up with an idea of how to fix the problem: it's something I would like to work.
from alfred-workflow.
Should work in 0551765
from alfred-workflow.
Awesome job @deanishe, thanks a lot. It fixed the whole issue. I was able to test it on Lion with the above-mentioned alfred-workflow and now it makes it at least compatible with 10.7 and, I guess, 10.6 as well. Will likely make many others workflows work on 10.6 and above. Sweet !
from alfred-workflow.
Related Issues (20)
- Run with error HOT 2
- Cache Image HOT 5
- Basic auth HOT 3
- Pass parameter to subprocess HOT 5
- Tutorial options for keywords need to be updated for Alfred 4 HOT 11
- set_config raises error when the bundle id is null HOT 4
- Setting only arg on Variables adds line break HOT 1
- will it support python3? HOT 1
- python3 has no cpickle HOT 1
- cant get output HOT 11
- chr() arg not in range(256) error when trying to use Beautiful Soup 4 HOT 1
- workflow:magic not working?
- API functionality question
- AlertCautionIcon.icns does not exist on Big Sur
- ERROR: [Script Filter] JSON error
- Google SDK
- Can't get Script Filter to find the pinboard.py file from the tutorial HOT 1
- [Feature request] Possible to open bookmarks from root?
- Not working on the latest MacOS 12.3 HOT 11
- How to fetch chrome cookie?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alfred-workflow.