yardnsm / tmux-1password

:key: Access your 1Password login items within tmux!
MIT License
256 stars 24 forks source link

Empty password field #10

Closed sherrman closed 5 years ago

sherrman commented 5 years ago

I have a 1password entry that breaks main.sh's get_op_item_password(). The JQ_FILTER is setup to check if the item's details.password field exists otherwise find a field with the password designation.

I'm not sure how I this entry got into this state, but it has a details.password field (empty string). The actual password is in one of the fields objects.

op get item "<item uuid>" | jq .details --raw-output:

{
  "fields": [
    {
      "designation": "username",
      "id": ";opid=__0",
      "name": "username",
      "type": "T",
      "value": "email@address.com"
    },
    {
      "designation": "password",
      "id": ";opid=__1",
      "name": "password",
      "type": "P",
      "value": "secretpassword"
    },
    [...]
  ],
  "password": "",
  "passwordHistory": [
    {
      "time": 999999,
      "value": "oldsecretpassword"
    }
  ],
  [...]
}

How should this behave?

(And is this related to the passwordHistory field? I spot checked a few random other entries that work and the others don't have a passwordHistory.)