-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Feature request] Is it possible to add URI string format support for both import and export #296
Comments
Yeah it could be implemented easily. I will do that when i can. Thank you! |
@PM2p5 I forgot that import from OTP Uri should be already possible, by running |
Hello, replydev! I've tested the 'add -u' switch with input as following,
Yeah, it works well! The point is not on adding one OTP URI, but on the lacking of import/export a batch of OTP URIs. |
Ok, I misunderstood the requirement, to import and export as batch could be good. |
Hi @PM2p5, I found some time to implement an import / export draft from OTP Uris. Let me know your impressions. This is the PR, you can take a debug artifact from Github Actions: https://github.com/replydev/cotp/actions/runs/6201005097?pr=317 |
Hi, replydev! I've tested both export and import features on Windows, Tested the export with following switches:
They all working! The default output path is The exported file is of json? or ron? format with contents like this:
Although this isn't the newline separated OTP URIs format I was after, the current export feature is working nicely! The import feature is something different! first, try to import what it has exported:(the json? ron? file!)
This means the import not working with the export feature! 2nd, try to import an hand-made utf-8 BOM, newline separated OTP URIs formatted file:
the file content of utf8bom_OTPURIs_newline_separeted.txt:
3rd, try to import an hand-made utf-8 without BOM, newline separated OTP URIs formatted file,
The import feature is not working at all! Here is a small detail, the export switch is a bit of different from the import switch: |
Thanks a lot for your contribution. |
Hi, replydev! I'm sorry that I've forgotten to put a valid test case to my bug report. The whole process I've done is as following:
Import this file with:
The issue is that the export feature exported a file with items without the issuer, which should be fine, but the import feature doesn't allow that! And here is another issue on the import feature, the current version of Google Authenticator App's internal has changed a lot, you can't import it's codes with it's DB now, the decryption key is in the Android key store! So the import feature for Google is broken! The only and valid way to import the codes from it is to support the format of newline-separated OTP URIs, which is already mentioned. For a working way to do this, please refer to: One more thing, it's my honor for the participation on the best TUI OTP App ever! |
Hi again @PM2p5. Sorry for delay but these times i do not have so much time. I pushed a fix for the import problem you reported. If you can please confirm that it's working for you now. |
Good day, @replydev! Don't say sorry, we all had the experience of busying on something! Who ever dare to say you are lazy? lol! I've running following tests on the debug artifacts of pull https://github.com/replydev/cotp/actions/runs/6343919848?pr=317, Test 1, create a blank db, then export it with
the file I got is:
Nice! Test 2, let's add some codes with the
So the Test 3, checking the
what I've got is:
It seems that the Test 4, import this file.
then check the codes, the screen shot will look like this: Test 5, export the db with
The Test 6, import an hand crafted file
The import feature still not supporting import OTP URIs with no issuer! The features around OTP URI scheme might need more overhaul to achieve a usable status. |
Hi @PM2p5, thank you for your clear instruction. The fact was that, reading the specification, i didn't knew that the issuer is optional. So the latest changes:
Feel free to download the latest binary from CI: https://github.com/replydev/cotp/actions/runs/6459034054 |
Hi, @replydev
I'm not sure if the behavior of generate a default It mentioned the format is something like:
Let's ignore the the TYPE might be totp/hotp for now,
The So, both issuers are optional, if an URI is missing both issuer parts in LABEL and PARAMETERS, it's fine. Short facts from the yubico's article:
Yeah, it passed all the previous tests, what I got is:
The good thing is, I think the current status of the App is quite charming and promising! Thanks for the hard work(again!) :-) Have a great day and on! |
You are right. Yesterday i've read the exact same doc, but I misunderstood the "Account", part. The fact is that, currently, the issuer is a required field, but the label should be instead. I will handle this last case and the finally merge :). |
Hello community,
The otpauth:// URI scheme was originally formalized by Google. It's very common to see sites all around world use this format for the 2FA setup process. Is it possible to add a feature to import an utf-8 encoded file which contains a list of otpauth:// URI?
The file content is like this:
the command switch could be something like:
cotp import --otpauth_uri --path "./utf8encoded.txt"
Thanks in advance!
The text was updated successfully, but these errors were encountered: