|
| 1 | +## 5.x to 6.0 |
| 2 | + |
| 3 | +### HIGH LIKELIHOOD OF IMPACT: Changes to `LtiMessageLaunch` |
| 4 | + |
| 5 | +When handling a new launch, the new `initialize()` method should be used instead of the previous `validate()` method. The validate method no longer accepts arguments, and requires that the request be set on the message launch object first (which happens in `initialize()`). This fixes some separation-of-concern issues with the `validate()` method, and allows for seamless integration of LTI 1.1 to 1.3 migrations if enabled. |
| 6 | + |
| 7 | +```php |
| 8 | +// instead of doing this: |
| 9 | +$message->validate($request); |
| 10 | + |
| 11 | +// you should do this: |
| 12 | +$message->inilialize($request); |
| 13 | +``` |
| 14 | + |
| 15 | +### HIGH LIKELIHOOD OF IMPACT: Changed how the OIDC Login URL is retrieved, deprecated the `Redirect` object |
| 16 | + |
| 17 | +When redirecting to the OIDC Login URL, the `Packback\Lti1p3\LtiOidcLogin::getOidcLoginUrl()` method should be used to retrieve the URL. Your application should use this to build the redirect response in whatever way is appropriate for your framework. This replaces `Packback\Lti1p3\LtiOidcLogin::doOidcLoginRedirect()`, which returned a `Redirect` object. See: https://github.com/packbackbooks/lti-1-3-php-library/pull/116 |
| 18 | + |
| 19 | +```php |
| 20 | +// instead of doing this: |
| 21 | +$redirect = $oidLogin->doOidcLoginRedirect($launchUrl, $request); |
| 22 | +return redirect($redirect->getRedirectUrl()); |
| 23 | + |
| 24 | +// you should do this: |
| 25 | +return redirect($oidLogin->getRedirectUrl($launchUrl, $request)); |
| 26 | +``` |
| 27 | + |
| 28 | +### HIGH LIKELIHOOD OF IMPACT - Strict typing added |
| 29 | + |
| 30 | +All arguments and returns are now strictly typed. This includes interfaces that require custom implementations. Notable changes: |
| 31 | + |
| 32 | +```php |
| 33 | +Packback\Lti1p3\Interfaces\ICookie |
| 34 | + setCookie(string $name, string $value, int $exp = 3600, array $options = []): void; |
| 35 | + |
| 36 | +Packback\Lti1p3\Interfaces\IDatabase |
| 37 | + findRegistrationByIssuer(string $iss, ?string $clientId = null): ?ILtiRegistration; |
| 38 | + findDeployment(string $iss, string $deploymentId, ?string $clientId = null): ?ILtiDeployment; |
| 39 | + |
| 40 | +Packback\Lti1p3\Interfaces\IMigrationDatabase |
| 41 | + migrateFromLti1p1(LtiMessageLaunch $launch): ?ILtiDeployment; |
| 42 | +``` |
| 43 | + |
| 44 | +### Dropped support for PHP 7 and PHP-JWT 5 |
| 45 | + |
| 46 | +This library now requires PHP 8 and firebase/php-jwt 6. |
| 47 | + |
| 48 | +### `Packback\Lti1p3\DeepLinkResource*` objects moved to their own namespace |
| 49 | + |
| 50 | +Objects named `DeepLinkResource*` have been moved to their own namespace: `Packback\Lti1p3\DeepLinkResources`. The following classes have been moved: |
| 51 | + |
| 52 | +- `Packback\Lti1p3\DeepLinkResourceDateTimeInterval` is now `Packback\Lti1p3\DeepLinkResources\DateTimeInterval` |
| 53 | +- `Packback\Lti1p3\DeepLinkResourceIcon` is now `Packback\Lti1p3\DeepLinkResources\Icon` |
| 54 | +- `Packback\Lti1p3\DeepLinkResourceIframe` is now `Packback\Lti1p3\DeepLinkResources\Iframe` |
| 55 | +- `Packback\Lti1p3\DeepLinkResource` is now `Packback\Lti1p3\DeepLinkResources\Resource` |
| 56 | +- `Packback\Lti1p3\DeepLinkResourceWindow` is now `Packback\Lti1p3\DeepLinkResources\Window` |
| 57 | + |
| 58 | +### `Packback\Lti1p3\DeepLinkResources\Iframe` constructor arguments changed order |
| 59 | + |
| 60 | +To make the interface consistent with other deep link resources, `src` is now the first argument in the constructor: |
| 61 | + |
| 62 | +```php |
| 63 | +class Iframe |
| 64 | +{ |
| 65 | + public function __construct( |
| 66 | + private ?string $src = null, |
| 67 | + private ?int $width = null, |
| 68 | + private ?int $height = null |
| 69 | + ) { |
| 70 | + } |
| 71 | +} |
| 72 | +``` |
| 73 | + |
| 74 | +### Removed `ImsStorage` classes |
| 75 | + |
| 76 | +Everything in the `Packback\Lti1p3\ImsStorage` namespace has been removed, specifically the `Packback\Lti1p3\ImsStorage\ImsCache` and `Packback\Lti1p3\ImsStorage\ImsCookie`. If you were using these classes, you will need to implement your own custom storage services. See the [Laravel Implementation Guide](https://github.com/packbackbooks/lti-1-3-php-library/wiki/Laravel-Implementation-Guide#sample-data-store-implementations) for an example. |
| 77 | + |
| 78 | +### Removed deprecated methods and classes |
| 79 | + |
| 80 | +The following classes have been removed: |
| 81 | + |
| 82 | +* `Packback\Lti1p3\ImsStorage\ImsCache` |
| 83 | +* `Packback\Lti1p3\ImsStorage\ImsCookie` |
| 84 | +* `Packback\Lti1p3\Redirect` |
| 85 | + |
| 86 | +The following methods have been removed: |
| 87 | + |
| 88 | +* `Packback\Lti1p3\JwksEndpoint::outputJwks()` - use `getPublicJwks()` to build your own output |
| 89 | +* `Packback\Lti1p3\LtiDeepLink::outputResponseForm()` - use `getResponseJwt()` to build your own output |
| 90 | +* `Packback\Lti1p3\LtiDeepLinkResources\Resource::getTarget()` - consider using `getIframe()` or `getWindow()` instead |
| 91 | +* `Packback\Lti1p3\LtiDeepLinkResources\Resource::setTarget()` - consider using `setIframe()` or `setWindow()` instead |
| 92 | +* `Packback\Lti1p3\Redirect::doHybridRedirect()` |
| 93 | +* `Packback\Lti1p3\Redirect::getRedirectUrl()` |
| 94 | + |
| 95 | +### Changes to method signatures |
| 96 | + |
| 97 | +* When instantiating `LtiMessageLaunch`, `LtiOidcLogin`, and `LtiServiceConnector` objects, all arguments are required now (instead of some being optional). |
| 98 | +* `Lti1p1Key` methods `setKey()` and `setSecret()` accept strings instead of arrays. |
| 99 | +* `LtiServiceConnector::setDebuggingMode()` now returns self instead of void. |
| 100 | + |
1 | 101 | ## 5.6 to 5.7
|
2 | 102 |
|
3 | 103 | No breaking changes were introduced. However, going forward when processing a `LtiOidcLogin`, it is recommended to use the new `getRedirectUrl()` method:
|
|
0 commit comments