diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 578d5fcb5e..13ec231513 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,22 +6,16 @@ in development Fixed ~~~~~ -* Fix Snyk Security Finding Cross-site Scripting (XSS) in contrib/examples/sensors/echo_flask_app.py - Contributed by (@philipphomberger Schwarz IT KG) - -* Additional fixes for st2 client auth when proxy auth mode enabled #6049 +* Fix proxy auth mode in HA environments #5766 #6049 Contributed by @floatingstatic * Fix issue with linux pack actions failed to run remotely due to incorrect python shebang. #5983 #6042 Contributed by Ronnie Hoffmann (@ZoeLeah Schwarz IT KG) -* Fix proxy auth mode in HA environments #5766 - Contributed by @floatingstatic - * Fix CI usses #6015 Contributed by Amanda McGuinness (@amanda11 intive) -* Bumped `paramiko` to `2.10.5` to fix an issue with SSH Certs - https://github.com/paramiko/paramiko/issues/2017 +* Bumped `paramiko` to `2.10.5` to fix an issue with SSH Certs - paramiko/paramiko#2017 (security) Contributed by @jk464 * Avoid logging sensitive information in debug (fix #5977) @@ -30,6 +24,12 @@ Fixed * Fix #4676, edge case where --inherit-env is skipped if the action has no parameters +* Fix ST2 Client for Windows Clients. PWD is a Unix only Libary. #6071 + Contributed by (@philipphomberger Schwarz IT KG) + +* Fix Snyk Security Finding Cross-site Scripting (XSS) in contrib/examples/sensors/echo_flask_app.py #6070 + Contributed by (@philipphomberger Schwarz IT KG) + * Update cryptography 3.4.7 -> 39.0.1, pyOpenSSL 21.0.0 -> 23.1.0, paramiko 2.10.5 -> 2.11.0 (security). #6055 * Bumped `eventlet` to `0.33.3` and `gunicorn` to `21.2.0` to fix `RecursionError` bug in setting `SSLContext` `minimum_version` property. (security) #6061 @@ -72,7 +72,6 @@ Added Contributed by Amanda McGuinness (@amanda11 intive) * Run the st2 self-check in Github Actions and support the environment variable `TESTS_TO_SKIP` to skip tests when running st2-self-check. #5609 - Contributed by @winem Changed diff --git a/st2client/st2client/base.py b/st2client/st2client/base.py index 4dfd0e95ae..6c2fa94b55 100644 --- a/st2client/st2client/base.py +++ b/st2client/st2client/base.py @@ -16,12 +16,12 @@ from __future__ import absolute_import import os -import pwd import json import logging import time import calendar import traceback +import platform import six import requests @@ -40,8 +40,13 @@ __all__ = ["BaseCLIApp"] -# Fix for "os.getlogin()) OSError: [Errno 2] No such file or directory" -os.getlogin = lambda: pwd.getpwuid(os.getuid())[0] +# Add Plattform Check to fix the Issue that PWD not exist on Windows and so the ST2 CLI not working. +# https://docs.python.org/3.8/library/pwd.html +if platform.system() != "Windows": + import pwd + + # Fix for "os.getlogin()) OSError: [Errno 2] No such file or directory" + os.getlogin = lambda: pwd.getpwuid(os.getuid())[0] # How many seconds before the token actual expiration date we should consider the token as # expired. This is used to prevent the operation from failing durig the API request because the