Skip to content
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

Encoding and user_id bug fixes LRN-43802 LRN-44754 LRN-44748 #83

Closed
wants to merge 4 commits into from

Conversation

david-scarratt-lrn
Copy link
Contributor

@david-scarratt-lrn david-scarratt-lrn commented Aug 29, 2024

Checklist

  • Feature

  • Bug

  • ChangeLog.md updated

  • Tests added

  • All testsuite passes

  • make dist completed successfully

@david-scarratt-lrn david-scarratt-lrn linked an issue Aug 29, 2024 that may be closed by this pull request
@david-scarratt-lrn david-scarratt-lrn changed the title Use Json::encode() throughout LRN-43802 Use Json::encode() throughout LRN-43802 LRN-44754 Aug 29, 2024
@david-scarratt-lrn david-scarratt-lrn force-pushed the LRN-43802/bug/signature-mismatch branch 2 times, most recently from 6d0d2d1 to 0a6afed Compare August 30, 2024 05:01
Copy link
Contributor

@shtrom shtrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. I added a few suggestions, and I think it should be funced by Groot, to confirm the various issues found in site-labs are all gone.

Thanks for jumping on this!

Comment on lines -356 to +359
return '20739eed410d54a135e8cb3745628834886ab315bfc01693ce9acc0d14dc98bf';
return 'fd236f3bc3e14bb291a222637fe86d71c3d4393ed7c51353a2f9a14b356fd605';
case '02':
return '$02$5c3160dbb9ab4d01774b5c2fc3b01a35ce4f9709c84571c27dfe333d1ca9d349';
return '$02$e319a1c9c3e0118d1e81188a650b054a765e072a2d90e4b422ecca2ae9589449';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be worth propagating those changes to the test-suite of the other SDKs. They should be using the same payload/signature pairs.

Comment on lines +455 to 456
$eventsApiExpected = '{"security":{"consumer_key":"yis0TYCu7U9V4o7M","domain":"localhost","timestamp":"20140626-0528","user_id":"events-proctor","signature":"'
. $eventsApiSig . '"},"config":{"users":{"$ANONYMIZED_USER_ID_1":"64ccf06154cf4133624372459ebcccb8b2f8bd7458a73df681acef4e742e175c","$ANONYMIZED_USER_ID_2":"7fa4d6ef8926add8b6411123fce916367250a6a99f50ab8ec39c99d768377adb","$ANONYMIZED_USER_ID_3":"3d5b26843da9192319036b67f8c5cc26e1e1763811270ba164665d0027296952","$ANONYMIZED_USER_ID_4":"3b6ac78f60f3e3eb7a85cec8b48bdca0f590f959e0a87a9c4222898678bd50c8"}}}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised that the signature doesn't change with despite a change of payload. Is it not covered by it?

$params = ParamsFixture::getWorkingDataApiParams(true);
$params['security']['user_id'] = 'a-user-id';
$params['v1Compat'] = false;
$params['expected'] = 'yis0TYCu7U9V4o7M_localhost_20140626-0528_a-user-id_{"limit":100}_get';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding signature checks, too.

@david-scarratt-lrn david-scarratt-lrn changed the title Use Json::encode() throughout LRN-43802 LRN-44754 Encoding and user_id bug fixes LRN-43802 LRN-44754 LRN-44748 Aug 30, 2024
@sreenivasa-murty-lrn
Copy link
Contributor

User Story :- https://learnosity.atlassian.net/browse/LRN-44748
CheeryPicked the commit hashes into https://github.com/Learnosity/learnosity-sdk-php/pull/85. Hence closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discrepancy between request packet data and its signature
3 participants