-
Notifications
You must be signed in to change notification settings - Fork 24
Prepare the library for being hosted on packagist #1
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
Conversation
Add support for the groups service and submission review
use \IMSGlobal\LTI; | ||
use Firebase\JWT\JWT; | ||
|
||
JWT::$leeway = 5; |
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.
As somebody not familiar with Firebase
or the $leeway
field, I have no clue what this bootstrapping is doing.
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.
That makes two of us 😆
README.md
Outdated
- Packback\Lti1p3\Interfaces\Cookie | ||
- Packback\Lti1p3\Interfaces\Database | ||
|
||
Cache and Cookie storage have legacy implementations at Packback\Lti1p3\ImsStorage if you do not wish to implement your own. However you must implement your own database. |
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 general thoughts here - are the legacy Packback\Lti1p3\ImsStorage
used by default? I don't know what these are doing, but generally it's good for a package to start with "batteries included" and then explain more advanced usages like implementing your own storage mechanism.
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.
They're not used by default. Honestly, I'm hesitant to have them used out of the box. They're not the most flexible and make a lot of assumptions about implementation. For example, Laravel's Cache and Cookie stores are completely incompatible with the IMS implementations. If you drop them into a fresh Laravel install and try to use them, it'll 500.
|
||
If a lineitem with the same `tag` exists, that lineitem will be used, otherwise a new lineitem will be created. | ||
|
||
## Laravel Implementation Guide |
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.
Do we have any idea how other folks have used this package? Is it solely with Laravel or are there more general use cases? This README starts off hitting you with a lot of technical details. Which may make sense, but it's still pretty intimidating for someone with minimal LTI 1.3 experience.
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.
No idea. I know there's at least one person using this branch, but have no idea who else might user it or how.
Any recommendations for how to make the readme more accessible to new users?
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.
Mhmm, I don't have any practical suggestions.
It largely depends on target audience and how much effort we want to put into it. What comes to mind is either walking through integrating this with a fresh Laravel app or linking to another open-source repo demoing the already setup library. At least for me, it's hard to see how all of these pieces are tied together at first when all the technical details are laid out without runnable examples. Though, the newly added tests do help out here.
I say Laravel because most PHP folks are familiar with Laravel. It's easy to engineer things once you understand how they work. Starting with all the implementation details being generic is tricky to follow at first.
README.md
Outdated
@@ -1,181 +1,196 @@ | |||
# LTI 1.3 Advantage Library |
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.
This is nit-picking, but I don't see "Advantage" mentioned anywhere else in the project. Seems kind of random for the main page title.
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.
LTI 1.3's full name is "LTI v1.3 and LTI Advantage" ... I'm not exactly sure what the terms mean, tbh. I think the "Advantage" part may refer to things like roster pull and gradebook sync, whereas the "1.3" part maybe refers to the actual launch process?
@@ -1,181 +1,196 @@ | |||
# LTI 1.3 Advantage Library | |||
|
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.
Briefly skimming through the README, I'm not sure I understand what all this library offers to help get an app LTI 1.3 compatible. It's okay if the answer is no, but is there anything that can add to the overview to make the benefits of this package clearer at first glance?
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.
Nice work. Besides the comments below, I noticed some other places where we were still using old constant names - run this package thru a linter and you'll be able to find more of them. (I just used PhpStorm)
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.
Noticed a few more issues and two things not addressed yet. (used PhpStorm for linting)
src/ImsStorage/ImsCache.php
Outdated
} | ||
|
||
public function cacheLaunchData($key, $jwt_body) | ||
public function cacheLaunchData($key, $jwtbody) |
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.
This case doesn't match the case in the interface.
src/LtiMessageLaunch.php
Outdated
throw new LtiException('Missing Nonce'); | ||
} | ||
if (!$this->cache->checkNonce($this->jwt['body']['nonce'])) { | ||
//throw new LtiException("Invalid Nonce"); |
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.
Should this be commented out?
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's commented out in the current branch that we're using. I checked the blame, and it's been commented out for as long as we've been using it. I'm not sure, but can look into it. Probably shouldn't be commented out, but who knows.
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.
Ah, that's fine then - just looked weird.
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.
Well, not sure why it was commented out, but added it back in successfully.
Now that we're actually validating the Nonce, it's causing our LTI 1.3 cert suite to fail. Looking into why exactly. |
Alright, everything passes. I also tested manual launching with LTI 1.3 |
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.
Looks good, I just see one comment that still isn't addressed. https://github.com/packbackbooks/lti-1-3-php-library/pull/1/files#r555240560
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.
Awesome work!
First commit of a pr workflow github action
This PR is admittedly massive, and there's not really any way around it. I'll do my best to categorize the changes I've made:
Packback\Lti1p3
Code coverage is currently at 52%. Not great, but it's a lot better than 0. I also ported over our certification tests from PBQ and (with not a small amount of struggling) managed to get the tests implemented for IMS LTI 1.3 Certification.
There are several areas of the code marked with
@todo
, mostly revolving around testing. If I have time later this sprint, I'll come back to these, but I wanted to get something out there first.I have a local branch on PBQ that references this one to verify at the very least that nothing I did here breaks anything over there. https://github.com/packbackbooks/questions/tree/lti-13