-
Notifications
You must be signed in to change notification settings - Fork 103
fix: don't strip valid characters from secret data #1276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: don't strip valid characters from secret data #1276
Conversation
c86a5af to
6bbba9c
Compare
6bbba9c to
154c7c2
Compare
|
|
||
| data = create_secret_data(["key1=value1", f"key2#file={file_path}"]) | ||
|
|
||
| self.assertDictEqual( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just changing to assert data ==, which results in dedenting the assertion data.
| from juju.secrets import create_secret_data, read_secret_data | ||
|
|
||
|
|
||
| class TestCreateSecretData(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop mostly unused unittest.TestCase base class so that pytest.mark.parametrize can work.
dimaqq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
let’s get clarity on failing integration tests vs main
|
Manual run on |
|
Summary: it's the same on main. The non-quarantined integration test failures in this branch are all with Juju 3.3. #1267 noted multiple test failures in Quarantined integration tests are failing Additionally, several more quarantined integration tests fail on 3.3 specifically (3.4, 3.5, and 3.6 only fail |
|
/merge |
Description
create_secret_dataunnecessarily attempts to strip trailing=symbols from secret data, and inadvertently strips all trailingP,Qand=characters instead. This PR drops the unnecessary removal of trailing characters, and adds unit tests covering cases that would previously have been handled badly (as well as some test cases validating existing behaviour that wasn't covered).Fixes: #1275
QA Steps
Unit test should pass. Locally I have
tests/unit/test_jujudata.py::TestJujuData::test_verify_controller_uninitializedfailing both onmainand on this branch.