Giter Site home page Giter Site logo

wofi-pass's People

Contributors

artemsmaznov avatar mdosch avatar schmidtandreas avatar tinfoilsubmarine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mdosch

wofi-pass's Issues

Failing tests

Dear Andreas,

I tried to run the tests with bash_unit but some fail for me:

bash_unit tests/*
Running tests in tests/test_args
	Running test_args_autotype ... SUCCESS ✓ 
	Running test_args_copy ... SUCCESS ✓ 
	Running test_args_fileisuser ... SUCCESS ✓ 
	Running test_args_help ... SUCCESS ✓ 
	Running test_args_squash ... SUCCESS ✓ 
	Running test_args_type ... SUCCESS ✓ 
	Running test_args_unknown ... FAILURE ✗ 
args: parsed not defined parameter
 expected regex [.*unrecognized option.*] to match [wofi-pass: Unbekannte Option »--not-exist«]
test_args:70:test_args_unknown()

So it seems to fail if the locale is not english. But also with an english locale some tests fail:

LC_ALL=C bash_unit tests/*
Running tests in tests/test_args
	Running test_args_autotype ... SUCCESS \u2713 
	Running test_args_copy ... SUCCESS \u2713 
	Running test_args_fileisuser ... SUCCESS \u2713 
	Running test_args_help ... SUCCESS \u2713 
	Running test_args_squash ... SUCCESS \u2713 
	Running test_args_type ... SUCCESS \u2713 
	Running test_args_unknown ... SUCCESS \u2713 
Running tests in tests/test.conf
Running tests in tests/test_config
	Running test_config_get_custom_config_file ... SUCCESS \u2713 
	Running test_config_get_global_config_file ... FAILURE \u2717 
config get file: get global config file failed
 expected [/etc/wofi-pass.conf] but was [/home/martin/.config/wofi-pass/config]
test_config:67:test_config_get_global_config_file()
	Running test_config_get_user_config_file ... FAILURE \u2717 
config: test environment contains /home/martin/.config/wofi-pass/config
test_config:36:test_config_get_user_config_file()
	Running test_config_load_empty ... test_config: line 19: COPROC: command not found
FAILURE \u2717 
config load: mock get_config_file not executed
 expected regex [.*FAKE_PARAMS.*] to match []
test_config:21:test_config_load_empty()
	Running test_config_load_test_conf ... SUCCESS \u2713 
Running tests in tests/test_get_field
	Running test_get_field_mulitfields ... SUCCESS \u2713 
	Running test_get_field_password_only ... SUCCESS \u2713 
Running tests in tests/test_get_output_cmd
	Running test_get_output_cmd ... SUCCESS \u2713 
Running tests in tests/test_get_passname
	Running test_passname_change_pass_store_dir ... SUCCESS \u2713 
	Running test_passname_empty_input ... SUCCESS \u2713 
	Running test_passname_selection ... SUCCESS \u2713 
Running tests in tests/test_help
	Running test_exit_help_flag_not_set ... SUCCESS \u2713 
	Running test_exit_help_flag_set ... SUCCESS \u2713 
Running tests in tests/test_output_autotype
	Running test_output_autotype_customize_username ... SUCCESS \u2713 
	Running test_output_autotype_default ... SUCCESS \u2713 
	Running test_output_autotype_single_keyword ... SUCCESS \u2713 
Running tests in tests/test_output_field
	Running test_output_field_autotype ... SUCCESS \u2713 
	Running test_output_field_single_selection ... SUCCESS \u2713 
Running tests in tests/test_parse_fields
	Running test_parse_fields_autotype ... SUCCESS \u2713 
	Running test_parse_fields_empty_password ... SUCCESS \u2713 
	Running test_parse_fields_ignore ... SUCCESS \u2713 
	Running test_parse_fields_only_password ... SUCCESS \u2713 
	Running test_parse_fields_otp ... SUCCESS \u2713 
	Running test_parse_fields_username_password ... SUCCESS \u2713 
Running tests in tests/test_pass_field
	Running test_pass_field ... SUCCESS \u2713 
Running tests in tests/test_pass_get
	Running test_pass_get_fileisuser ... SUCCESS \u2713 
	Running test_pass_get_other_fields ... SUCCESS \u2713 
	Running test_pass_get_otp ... SUCCESS \u2713 
	Running test_pass_get_password ... SUCCESS \u2713 
Running tests in tests/test_verify_flags
	Running test_flags_no_type_copy ... SUCCESS \u2713 
	Running test_flags_no_type_nor_copy ... SUCCESS \u2713 
	Running test_flags_type_and_copy ... SUCCESS \u2713 
	Running test_flags_type_no_copy ... SUCCESS \u2713 
Overall result: FAILURE \u2717 

I'm not sure what is causing this failures, but it seems to fail if it doesn't find the config files where it expects them.
I think those might be false-positives as wofi-pass is working well here with my config.

autotype skips username with custom PASS_FIELD_USERNAME

v23.1.3

Description

Hi again,

I have finally updated wofi-pass to get the PASS_FIELD_USERNAME changes we worked on and I noticed that auto-typing broke (i was using the script from my last PR up until this point)

Repro steps

  1. pass edit test
mypass
login: itisme
  1. PASS_FIELD_USERNAME="login" in .config/wofi-pass/config
  2. wofi-pass -at
  3. select test

Expected result

itisme mypass

Actual result

mypass

PASSWORD_STORE_DIR not set for pass command

Using an alternate PASSWORD_STORE_DIR defined in the wofi-pass config, the tree is loaded correctly, but it's not passed on to the call to pass.

Here's some scrubbed output to demonstrate what I'm seeing

~ $ [[ -z $PASSWORD_STORE_DIR ]]; echo $?
0

~ $ grep PASSWORD_STORE_DIR ~/var/pass/wofi-pers.conf
PASSWORD_STORE_DIR="${HOME}/var/pass/pers"

~ $ stat ~/.password-store
stat: cannot statx '/home/david/.password-store': No such file or directory

~ $ ls ~/var/pass/pers/github
pass.gpg  user.gpg

~ $ WOFI_PASS_CONFIG="$HOME/var/pass/wofi-pers.conf" ~/src/wofi-pass/wofi-pass -sc
Error: github/user is not in the password store.
Error: github/user is not in the password store.

~ $ WOFI_PASS_CONFIG="$HOME/var/pass/wofi-pers.conf" bash -x ~/src/wofi-pass/wofi-pass -sc
+ VERSION=23.1.5
+ set -eu
+ FLAG_AUTOTYPE=0
+ FLAG_COPY=0
+ FLAG_FILEISUSER=0
+ FLAG_ONLYPASSWORD=0
+ FLAG_SQUASH=0
+ FLAG_TYPE=0
+ FLAG_HELP=0
+ CMD_COPY=wl-copy
+ CMD_TYPE='wtype -'
+ PASS_FIELD_USERNAME=username
+ WOFI_PASS_AUTOTYPE=':username :tab :password'
+ WOFI_PASS_DELAY=2
+ WOFI_PASS_AUTO_ENTER=false
+ [[ -z '' ]]
+ main -sc
+ local passname
+ local field
+ load_config_file
++ get_config_file
++ local config_base_dir=/home/david/.config
++ readonly config_base_dir
++ config_files=("${WOFI_PASS_CONFIG:-""}" "${config_base_dir}/wofi-pass/config" "/etc/wofi-pass.conf")
++ for config in "${config_files[@]}"
++ [[ -n /home/david/var/pass/wofi-pers.conf ]]
++ [[ -f /home/david/var/pass/wofi-pers.conf ]]
++ printf %s /home/david/var/pass/wofi-pers.conf
++ return
+ config_file=/home/david/var/pass/wofi-pers.conf
+ [[ -n /home/david/var/pass/wofi-pers.conf ]]
+ source /home/david/var/pass/wofi-pers.conf
++ PASSWORD_STORE_DIR=/home/david/var/pass/pers
+ parse_arguments -sc
++ getopt --options ac::fhst:: --longoptions autotype,copy::,fileisuser,help,squash,type:: -n wofi-pass -- -sc
+ OPTS=' -s -c '\'''\'' --'
+ eval set -- ' -s -c '\'''\'' --'
++ set -- -s -c '' --
+ true
+ case "${1}" in
+ FLAG_SQUASH=1
+ shift
+ true
+ case "${1}" in
+ FLAG_COPY=1
+ '[' -n '' ']'
+ shift 2
+ true
+ case "${1}" in
+ shift
+ break
+ exit_if_help_flag_set
+ '[' 0 -eq 1 ']'
+ verify_flags
+ '[' 0 -eq 1 ']'
+ '[' 0 -eq 0 ']'
+ '[' 1 -eq 0 ']'
++ get_passname_from_menu
++ local -r pass_dir=/home/david/var/pass/pers
++ local password_files
+++ find /home/david/var/pass/pers -name '*.gpg'
+++ sed 's|^/home/david/var/pass/pers\/\(.*\)\.gpg$|\1|'
+++ sort
++ password_files='github/pass
github/user'
++ printf %s github/user
+ passname=github/user
+ '[' -n github/user ']'
++ get_field_from_menu github/user
++ local field
++ local field_count
++ local -r passname=github/user
++ mapfile -t field_list
+++ parse_fields github/user
+++ local field_list
+++ local has_username=0
+++ local -r passname=github/user
+++ mapfile -t entries
++++ _pass show github/user
++++ pass show github/user
++++ tail -n +2
Error: github/user is not in the password store.
+++ local line=
+++ fields=()
+++ local fields
+++ field_list+=("password")
+++ '[' 0 -eq 1 ']'
+++ '[' 0 -eq 1 ']'
+++ printf '%s\n' password
++ field_count=1
++ readonly field_list
++ readonly field_count
++ '[' 1 -eq 1 ']'
++ '[' 1 -le 1 ']'
++ printf password
++ FLAG_ONLYPASSWORD=1
+ field=password
+ output_field github/user password
+ local cmd_output
+ local -r passname=github/user
+ local -r field=password
++ get_output_cmd
++ '[' 0 -eq 1 ']'
++ printf %s wl-copy
+ cmd_output=wl-copy
+ '[' 0 -eq 1 ']'
+ '[' password = autotype ']'
+ pass_get github/user password
+ local -r passname=github/user
+ local -r field=password
+ wl-copy
+ '[' password = password ']'
+ _pass show github/user
+ pass show github/user
+ IFS=
+ read -r pass
Error: github/user is not in the password store.

Add option to pass flags to wofi

I would love to be able to pass flags to wofi, specifically --conf flag, because I have normal-window=true in my wofi config which doesn't work well with wofi-pass. Also changing small things like prompt is also would be nice.

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.