Skip to content

Commit

Permalink
Merge pull request #127 from oat-sa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ekkinox authored Aug 25, 2021
2 parents f1efc5a + 43d2688 commit 23a89a6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/Message/Payload/LtiMessagePayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
use OAT\Library\Lti1p3Core\Message\Payload\Claim\ProctoringVerifiedUserClaim;
use OAT\Library\Lti1p3Core\Message\Payload\Claim\ResourceLinkClaim;
use OAT\Library\Lti1p3Core\Role\Collection\RoleCollection;
use OAT\Library\Lti1p3Core\Role\Collection\RoleCollectionInterface;
use OAT\Library\Lti1p3Core\Role\Factory\RoleFactory;
use OAT\Library\Lti1p3Core\User\UserIdentity;
use OAT\Library\Lti1p3Core\User\UserIdentityInterface;
Expand Down Expand Up @@ -227,6 +226,16 @@ public function getProctoringEndAssessmentReturn(): bool
return false;
}

public function getProctoringErrorMessage(): ?string
{
return $this->getClaim(static::CLAIM_LTI_PROCTORING_ERROR_MESSAGE);
}

public function getProctoringErrorLog(): ?string
{
return $this->getClaim(static::CLAIM_LTI_PROCTORING_ERROR_LOG);
}

public function getAcs(): ?AcsClaim
{
return $this->getClaim(AcsClaim::class);
Expand Down
6 changes: 6 additions & 0 deletions src/Message/Payload/LtiMessagePayloadInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ interface LtiMessagePayloadInterface extends MessagePayloadInterface
public const CLAIM_LTI_PROCTORING_ATTEMPT_NUMBER = 'https://purl.imsglobal.org/spec/lti-ap/claim/attempt_number';
public const CLAIM_LTI_PROCTORING_VERIFIED_USER = 'https://purl.imsglobal.org/spec/lti-ap/claim/verified_user';
public const CLAIM_LTI_PROCTORING_END_ASSESSMENT_RETURN = 'https://purl.imsglobal.org/spec/lti-ap/claim/end_assessment_return';
public const CLAIM_LTI_PROCTORING_ERROR_MESSAGE = ' https://purl.imsglobal.org/spec/lti-ap/claim/errormsg';
public const CLAIM_LTI_PROCTORING_ERROR_LOG = ' https://purl.imsglobal.org/spec/lti-ap/claim/errorlog ';

// ACS claim
public const CLAIM_LTI_ACS = 'https://purl.imsglobal.org/spec/lti-ap/claim/acs';
Expand Down Expand Up @@ -140,6 +142,10 @@ public function getProctoringVerifiedUser(): ?ProctoringVerifiedUserClaim;

public function getProctoringEndAssessmentReturn(): bool;

public function getProctoringErrorMessage(): ?string;

public function getProctoringErrorLog(): ?string;

public function getAcs(): ?AcsClaim;

public function getAgs(): ?AgsClaim;
Expand Down
1 change: 0 additions & 1 deletion src/Security/OAuth2/Repository/ClientRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use League\OAuth2\Server\Entities\ClientEntityInterface;
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
use OAT\Library\Lti1p3Core\Message\Payload\LtiMessagePayloadInterface;
use OAT\Library\Lti1p3Core\Message\Payload\MessagePayloadInterface;
use OAT\Library\Lti1p3Core\Registration\RegistrationRepositoryInterface;
use OAT\Library\Lti1p3Core\Security\Jwks\Fetcher\JwksFetcher;
use OAT\Library\Lti1p3Core\Security\Jwks\Fetcher\JwksFetcherInterface;
Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/Message/Payload/LtiMessagePayloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ protected function setUp(): void
->withClaim(LtiMessagePayloadInterface::CLAIM_LTI_PROCTORING_ATTEMPT_NUMBER, '1')
->withClaim(LtiMessagePayloadInterface::CLAIM_LTI_PROCTORING_VERIFIED_USER, ['picture' => 'picture'])
->withClaim(LtiMessagePayloadInterface::CLAIM_LTI_PROCTORING_END_ASSESSMENT_RETURN, true)
->withClaim(LtiMessagePayloadInterface::CLAIM_LTI_PROCTORING_ERROR_MESSAGE, 'proctoringErrorMessage')
->withClaim(LtiMessagePayloadInterface::CLAIM_LTI_PROCTORING_ERROR_LOG, 'proctoringErrorLog')
->withClaim(new AcsClaim(['action'], 'assessmentControlUrl'))
->withClaim(new AgsClaim(['scope'], 'lineItemContainerUrl'))
->withClaim(new NrpsClaim('membershipUrl'))
Expand Down Expand Up @@ -121,6 +123,8 @@ public function testClaims(): void
$this->assertEquals('proctoringSettings', $this->subject->getProctoringSettings()->getData());
$this->assertEquals('proctoringSessionData', $this->subject->getProctoringSessionData());
$this->assertTrue($this->subject->getProctoringEndAssessmentReturn());
$this->assertEquals('proctoringErrorMessage', $this->subject->getProctoringErrorMessage());
$this->assertEquals('proctoringErrorLog', $this->subject->getProctoringErrorLog());
$this->assertEquals('1', $this->subject->getProctoringAttemptNumber());
$this->assertEquals(['picture' => 'picture'], $this->subject->getProctoringVerifiedUser()->getUserData());
$this->assertEquals(['action'], $this->subject->getAcs()->getActions());
Expand Down

0 comments on commit 23a89a6

Please sign in to comment.