Skip to content

Configuration helper to get password needs to prompt for my keyring's password #1545

@armellarcier

Description

@armellarcier

Description of the problem, including code/CLI snippet

This is my config file :

[global]
default = gitlab
ssl_verify = true
timeout = 5

[gitlab]
url = https://gitlab.com
private_token = helper: ~/showGitlabToken.sh

The ~/showGitlabToken.sh runs a keepassxc-cli command to show the gitlab token.

This keepassxc-cli needs to prompt me for my password.

Expected Behavior

When I run gitlab ls I get a prompt for my keyring password, then a result

Actual Behavior

I get an error

Traceback (most recent call last):
  File "/home/MYUSERNAME/.local/bin/gitlab", line 8, in <module>
    sys.exit(main())
  File "/home/MYUSERNAME/.local/lib/python3.9/site-packages/gitlab/cli.py", line 204, in main
    config = gitlab.config.GitlabConfigParser(options.gitlab, options.config_file)
  File "/home/MYUSERNAME/.local/lib/python3.9/site-packages/gitlab/config.py", line 164, in __init__
    self._get_values_from_helper()
  File "/home/MYUSERNAME/.local/lib/python3.9/site-packages/gitlab/config.py", line 224, in _get_values_from_helper
    subprocess.check_output(commmand, stderr=subprocess.PIPE)
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/MYUSERNAME/showGitlabToken.sh'

Specifications

  • python-gitlab version: 2.9.0
  • API version you are using (v3/v4):
  • Gitlab server version (or gitlab.com):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions