-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use PHP array form encoding when sending multiple authorized_key
#113
Conversation
PHP required arrays to contains `[]` in the parameters key. Without the brackets, only a single value will be parsed. See as example: $ php -r "echo http_build_query(array('authorized_key' => array('key1', 'key2', 'key3')));" authorized_key%5B0%5D=key1&authorized_key%5B1%5D=key2&authorized_key%5B2%5D=key3%
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #113 +/- ##
=======================================
Coverage 98.22% 98.22%
=======================================
Files 34 34
Lines 2427 2427
Branches 274 274
=======================================
Hits 2384 2384
Misses 20 20
Partials 23 23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
changelogs/fragments/fix-authorized_key-php-array-form-encoding.yml
Outdated
Show resolved
Hide resolved
@@ -404,7 +404,7 @@ def main(): | |||
if should is None: | |||
continue | |||
# unfold the return object for the idempotence check to work correctly | |||
has = existing.get(data_key) | |||
has = existing.get(result_key) |
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.
While reviewing I noticed that it should be using result_key
here, not data_key
- this so far didn't make a difference since the values were equal, but now they're not :)
@jooola thanks for fixing this! |
) * Use PHP array form encoding when sending multiple `authorized_key` PHP required arrays to contains `[]` in the parameters key. Without the brackets, only a single value will be parsed. See as example: $ php -r "echo http_build_query(array('authorized_key' => array('key1', 'key2', 'key3')));" authorized_key%5B0%5D=key1&authorized_key%5B1%5D=key2&authorized_key%5B2%5D=key3% * fix changelog * test: fix unit tests * Update changelog fragment. * Use the correct key for idempotency. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 2c3977d)
Awesome, I appreciate the quick response and release 🫶 |
SUMMARY
PHP required arrays to contains
[]
in the parameters key. Without the brackets, only a single value will be parsed. See as example:More about this array syntax: https://www.php.net/manual/en/function.parse-str.php#76792
Closes #112
ISSUE TYPE
COMPONENT NAME
community.hrobot.boot