Giter VIP home page Giter VIP logo

Comments (10)

dominikschulz avatar dominikschulz commented on May 31, 2024

This should work. I regularly use that feature. Let me try to reproduce.

from gopass.

AnomalRoil avatar AnomalRoil commented on May 31, 2024

I can't reproduce on my side on neither v1.15.5 nor on master:

$ gopass show test
Secret: test

this is a test
on two line

test
otpauth: otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example

$ gopass show --password test
this is a test

How did you install gopass?
Which version do you have?

gopass -v

from gopass.

r3k2 avatar r3k2 commented on May 31, 2024

Thanks @AnomalRoil and @dominikschulz for the prompt reply.

gopass 1.15.5 go1.20.3 linux amd64
using Arch GNU/Linux
I installed using pacman/paru

This is the format I have the results when I do a gopass show "name"

Secret: name_of_secret


Name: name.of.entry
Username: here_username
Password: here_password
URL: https://here.url

I am starting to suspect the issue is that gopass gets the first line and not the line with Password on it? And such is why I got the Name key: as a password?
I have around 300 records, if this is the case, is there a way to fix this on all?
I imported all those from Bitwarden, 3–4 months a go, and until now, I was just doing show without the --password option but I do need it now to run another tool.

[edit] I think I used this one to import the data https://github.com/shassard/bitwarden2pass/blob/master/bitwarden2pass.py and it did a good job until now that I notice with your example that my entries are a bit different

from gopass.

AnomalRoil avatar AnomalRoil commented on May 31, 2024

Ah, does gopass show name_of_secret password using our KV feature work?

I think to recall we might have had once upon a time a special case for --password pulling from key-values maybe. I'll need to check.

But yeah, worth asking what that flag is supposed to do when you have parsing enabled I guess.

from gopass.

r3k2 avatar r3k2 commented on May 31, 2024

hmm interesting with the argument at the end does work, unfortunately most apps ask to be pass compatible and I though gopass was 100% compatible with pass? If I do like in pass a gopass -c name it also gets Name key instead of Password same with the original command I wrote in my first comment. So I think is trying to get the first entries "Name:" as the password so I may need to change the format, is there a way to mass edit or a command to move this around I can write a loop and do it with a bash script

from gopass.

r3k2 avatar r3k2 commented on May 31, 2024

ok, so I confirmed I got a ramdon entry and edited with gopass edit name_of_key I copy the Password: key entry and have paste it on top of all the rest of keys as is, and now when I do gopass -c name_of_key it gets the password.
now this entry is like:

Secret: name_of_secret

here_plain_password_with_no_key

Name: name.of.entry
Username: here_username
Password: here_password
URL: https://here.url

from gopass.

dominikschulz avatar dominikschulz commented on May 31, 2024

pass did always put the password on the first line of the secret. That's what gopass does at well.
And the import script you linked seems to handle that correctly as well.

Not sure what went wrong. We might want to fall back checking for a password key if the first line is empty. But if it's not empty there is no way for us to tell if the first line is supposed to be the password or not.

from gopass.

AnomalRoil avatar AnomalRoil commented on May 31, 2024

You could use the following, I guess:

for entry in $(gopass ls --flat); do
    data=$(gopass show -n -f $entry)
    password=$(echo $data | grep Password | sed -r 's/Password: //g')
    if [ -z "$password" ]
    then
        continue
    fi
    echo -n "$password\n---\n$(echo $data | sed -r 's/Password: .*?//g' | awk NF)" | gopass insert -f $entry
done

It would go through all entries and if there is a match for the Password: pwd line it would insert it on the first line and add a yaml --- separator to it.

e.g. entries would look like

here_password
---
Name: name.of.entry
Username: here_username
URL: https://here.url

afterwards

from gopass.

r3k2 avatar r3k2 commented on May 31, 2024

@AnomalRoil Thanks for the reply! sorry I was out traveling for work. will review your response thanks for the solution.

from gopass.

AnomalRoil avatar AnomalRoil commented on May 31, 2024

Closing this, feel free to re-open / comment in case you need more help solving the issue. But it looks like the cause is bitwarden2pass not conforming with the expected pass output for secrets (e.g. secret on the first line).

from gopass.

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.