Skip to content

Commit

Permalink
fix: look for the passwords in the particular realm, not all the pass…
Browse files Browse the repository at this point in the history
…words (#162)

Similar to splunk/addonfactory-solutions-library-python#189.

This change should fix the situation when you try to get a specific password for you add-on
and some other password in other add-on is corrupted, then the configuration page is
not loading for all the add-ons.
  • Loading branch information
artemrys authored Sep 1, 2022
1 parent 5ddf197 commit 326ffa1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
39 changes: 10 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ license = "APACHE-2.0"

[tool.poetry.dependencies]
python = "^3.7"
solnlib = "^4.0.0"
splunktalib = "^3.0.0"
requests = "^2.26.0"
PySocks = "^1.7.1"
splunk-sdk = ">=1.6.18"
solnlib = "^4.7.0"

[tool.poetry.dev-dependencies]
pytest = "^7.1"
Expand Down
4 changes: 1 addition & 3 deletions splunktaucclib/rest_handler/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ def decrypt_all(self, data):
host=self._splunkd_info.hostname,
port=self._splunkd_info.port,
)

all_passwords = credential_manager._get_all_passwords()
# filter by realm
all_passwords = credential_manager.get_clear_passwords_in_realm()
realm_passwords = [x for x in all_passwords if x["realm"] == self._realm]
return self._merge_passwords(data, realm_passwords)

Expand Down

0 comments on commit 326ffa1

Please sign in to comment.