See Release Notes
Long Term Support Release
Differences Between: [Versions 401 and 402] [Versions 401 and 403]
1 <?php 2 3 namespace Packback\Lti1p3\MessageValidators; 4 5 use Packback\Lti1p3\Interfaces\IMessageValidator; 6 use Packback\Lti1p3\LtiConstants; 7 use Packback\Lti1p3\LtiException; 8 9 class SubmissionReviewMessageValidator implements IMessageValidator 10 { 11 public function canValidate(array $jwtBody) 12 { 13 return $jwtBody[LtiConstants::MESSAGE_TYPE] === 'LtiSubmissionReviewRequest'; 14 } 15 16 public function validate(array $jwtBody) 17 { 18 if (empty($jwtBody['sub'])) { 19 throw new LtiException('Must have a user (sub)'); 20 } 21 if ($jwtBody[LtiConstants::VERSION] !== LtiConstants::V1_3) { 22 throw new LtiException('Incorrect version, expected 1.3.0'); 23 } 24 if (!isset($jwtBody[LtiConstants::ROLES])) { 25 throw new LtiException('Missing Roles Claim'); 26 } 27 if (empty($jwtBody[LtiConstants::RESOURCE_LINK]['id'])) { 28 throw new LtiException('Missing Resource Link Id'); 29 } 30 if (empty($jwtBody[LtiConstants::FOR_USER])) { 31 throw new LtiException('Missing For User'); 32 } 33 34 return true; 35 } 36 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body