-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Fixed a problem not to decrypt user scope data store value in Jinja expression #4634
Conversation
actual = self.env.from_string(template).render(context) | ||
self.assertEqual(actual, self.secret) | ||
|
||
def test_filter_decrypt_kv_with_user_scope_value(self): |
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.
It would also be a good idea to add "end to end" test which verifies that it works for the following scenarios:
- API user is provided (if action is scheduled via API, API user should be used)
- User is not provided - it should default to stanley (if execution is scheduled outside of the API context, no user context is available so stanley is used by default)
After some more digging in - it looks like this an "addition" to this change - #4463 and we already have some tests for value of the user in the context there. I will go ahead and merge this as is, but going forward it also wouldn't hurt to add some additional end to end tests for this functionality. |
workflows (previously they didn't work).
values using "decrypt_kv" Jinja filter.
user-friendly error is user tries to use this function on datastore item which doesn't exist.
While testing and reviewing this, I noticed there are more issues with this functionality.
I've fixed that in 42fe11b. I also updated an action which verifies this functionality - 8e57029.
Previously Now in such scenario we throw I'm still working on test cases. |
I've pushed a small refactor and tests for additional fixes I made - ba3c6a5. |
Thank you very much for your great help! And sorry for late to reply. It took time to seek the place where is appropriate to extend for doing 'end to end' tests. At last, I reached the test of Could you please give me a couple of days to write it? |
Thank you for the original contribution. And yes, that's the right place for that test. I will probably go ahead and merge this and you feel free to open a new PR for that tests so take your time - no rush. |
Summary
This fixes #4633.
Changing Point
This changes the implementation of custom Jinja filter
decrypt_kv
to be able to handle user scope value.