ValvePython / steamctl

🤸 Take control of Steam from your terminal
https://pypi.org/project/steamctl/
MIT License
306 stars 16 forks source link

[BUG] Password environment variables do not work within depot download command due to subparser #80

Open MattMills opened 6 months ago

MattMills commented 6 months ago

Description While using the STEAMCTL_USER and STEAMCTL_PASSWORD environment variables they fail to function within the depot download subfunctionality.

Steps to Reproduce the behavior Set STEAMCTL_USER and STEAMCTL_PASSWORD in environment IE:

export STEAMCTL_USER='bob'
export STEAMCTL_PASSWORD='supersecretpassword'

Execute: steamctl -l debug depot download --app 281990 --depot 281992 --manifest 4118290319047653281 -o ./test (or any valid appid/depot/manifest)

Witness parsed output in debug output:

[DEBUG] steamctl: Parsed args: {'versions_report': None, 'log_level': 'debug', 'anonymous': False, 'user': '[removed]', 'password': None, 'command': 'depot', '_cmd_func': 'steamctl.commands.depot.gcmds:cmd_depot_download', 'subcommand': 'download', 'cell_id': None, 'os': 'any', 'output': './test', 'no_directories': False, 'no_progress': False, 'file': None, 'app': 281990, 'depot': 281992, 'manifest': 4118290319047653281, 'branch': 'public', 'skip_depot': None, 'skip_login': False, 'skip_licenses': False, 'vpk': False, 'skip_verify': False, 'name': None, 'regex': None}

Note password: None and prompt for password.

Expected behavior The correct password should be used from the environment variable

What actually happend The password argument is overwritten by the sub-parser argument in steamctl/commands/depot/__init__.py for "Branch Password" that uses the same --password argument.

By replacing all the --password arguments in this file with --bpassword (or anything other than --password) the functionality works as expected.

Logs (see above)

Versions Report

steamctl --versions-report (Run steamctl --versions-report and paste the output below) ```yaml steamctl: 0.9.5 Dependencies: steam: 1.4.4 appdirs: 1.4.4 argcomplete: 2.0.0 tqdm: 4.64.1 arrow: 1.2.3 pyqrcode: 1.2.1 beautifulsoup4: 4.10.0 vpk: 1.4.0 vdf: 3.4 gevent-eventemitter: 2.1 gevent: 21.8.0 greenlet: 1.1.2 pyyaml: 5.4.1 pycryptodomex: 3.15.0 protobuf: 3.20.3 Python runtime: executable: /usr/bin/python3 version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] platform: linux System info: system: Linux machine: x86_64 release: 5.15.0-53-generic version: #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 ```
MattMills commented 6 months ago

@rossengeorgiev Do you own this repo // is it still managed?