Tsugi

PlatformDynamicRegistration
in package

IMS Dynamic Registration with Tsugi as the platform.

The openid configuration is one document for the install. Its URLs do not contain a tool id. A course mints a one-time token, the browser opens the tool, and the tool POSTs here. The registration row is created only after that POST validates.

Table of Contents

Constants

BODY_LIMIT  : mixed = 300000
PLATFORM_CONFIGURATION  : mixed = 'https://purl.imsglobal.org/spec/lti-platform-c...
TOKEN_SECONDS  : mixed = 3600

Methods

accept()  : array{status: int, document: array}
Accept a tool's registration POST.
courseToken()  : array{tool_url: string, registration_id: int|null, fresh: bool, used: bool}|null
Token minted for this course, or null when it is not.
forwardUrl()  : string
Tool registration URL with the openid configuration and one-time token.
openIdConfiguration()  : array<string, mixed>
Stable platform openid configuration. No client_id and no deployment_id.
openIdConfigurationUrl()  : string
platformUrls()  : array<int, array{label: string, value: string}>
Platform URLs a tool copies when it is configured by hand.
startForCourse()  : string
Mint a one-time token for a course. No registration row is created.
bearer()  : string|null
consume()  : void
creatorOnKey()  : int|null
db()  : PDOX
error()  : array{status: int, document: array}
findContext()  : array{context_id: int, key_id: int}|null
findToken()  : array<string, mixed>|null
httpField()  : string
httpUrlOrNull()  : string|null
launchUrl()  : string|null
lockToken()  : array<string, mixed>|null
prefix()  : string
prefixFresh()  : bool
Sakai stamps the token as unix-time, a colon, then the secret.
registrationFields()  : array{login: string, jwks: string, redirect: string, launch: string|null, title: string}
requireHttpUrl()  : string
root()  : string
stamp()  : array<string, mixed>
title()  : string
tokenRow()  : array<string, mixed>|null
toolConfiguration()  : array<string, mixed>|null
usable()  : bool
uuid()  : string

Constants

PLATFORM_CONFIGURATION

public mixed PLATFORM_CONFIGURATION = 'https://purl.imsglobal.org/spec/lti-platform-configuration'

Methods

accept()

Accept a tool's registration POST.

public static accept(string $authorization, string $payloadText[, string|null $contentType = null ]) : array{status: int, document: array}

The raw body is logged once the token names a real pending registration, and before JSON parsing. An unknown token is rejected without a log row.

The answer keeps every placement the tool sent, including lessons next to ContentArea. The stored registration keeps one name for each pair.

Parameters
$authorization : string
$payloadText : string
$contentType : string|null = null
Return values
array{status: int, document: array}

courseToken()

Token minted for this course, or null when it is not.

public static courseToken(string $token, int $contextId) : array{tool_url: string, registration_id: int|null, fresh: bool, used: bool}|null
Parameters
$token : string
$contextId : int
Return values
array{tool_url: string, registration_id: int|null, fresh: bool, used: bool}|null

forwardUrl()

Tool registration URL with the openid configuration and one-time token.

public static forwardUrl(string $toolUrl, string $token) : string
Parameters
$toolUrl : string
$token : string
Return values
string

openIdConfiguration()

Stable platform openid configuration. No client_id and no deployment_id.

public static openIdConfiguration() : array<string, mixed>
Return values
array<string, mixed>

platformUrls()

Platform URLs a tool copies when it is configured by hand.

public static platformUrls() : array<int, array{label: string, value: string}>

Dynamic registration publishes these same values.

Return values
array<int, array{label: string, value: string}>

startForCourse()

Mint a one-time token for a course. No registration row is created.

public static startForCourse(int $contextId, int|null $userId, string $toolUrl) : string
Parameters
$contextId : int
$userId : int|null
$toolUrl : string
Return values
string —

raw token

bearer()

private static bearer(mixed $authorization) : string|null
Parameters
$authorization : mixed
Return values
string|null

consume()

private static consume(int $tokenId, int $registrationId) : void
Parameters
$tokenId : int
$registrationId : int

creatorOnKey()

private static creatorOnKey(mixed $userId, int $keyId) : int|null
Parameters
$userId : mixed
$keyId : int
Return values
int|null

error()

private static error(int $status, string $message) : array{status: int, document: array}
Parameters
$status : int
$message : string
Return values
array{status: int, document: array}

findContext()

private static findContext(int $contextId) : array{context_id: int, key_id: int}|null
Parameters
$contextId : int
Return values
array{context_id: int, key_id: int}|null

findToken()

private static findToken(string $token) : array<string, mixed>|null
Parameters
$token : string
Return values
array<string, mixed>|null

httpField()

private static httpField(array<string, mixed> $document, string $key, string $label) : string
Parameters
$document : array<string, mixed>
$key : string
$label : string
Return values
string

httpUrlOrNull()

private static httpUrlOrNull(mixed $url) : string|null
Parameters
$url : mixed
Return values
string|null

launchUrl()

private static launchUrl(array<string, mixed> $document) : string|null
Parameters
$document : array<string, mixed>
Return values
string|null

lockToken()

private static lockToken(int $tokenId) : array<string, mixed>|null
Parameters
$tokenId : int
Return values
array<string, mixed>|null

prefixFresh()

Sakai stamps the token as unix-time, a colon, then the secret.

private static prefixFresh(string $token) : bool
Parameters
$token : string
Return values
bool

registrationFields()

private static registrationFields(array<string, mixed> $document) : array{login: string, jwks: string, redirect: string, launch: string|null, title: string}
Parameters
$document : array<string, mixed>
Return values
array{login: string, jwks: string, redirect: string, launch: string|null, title: string}

requireHttpUrl()

private static requireHttpUrl(string $url, string $label) : string
Parameters
$url : string
$label : string
Return values
string

stamp()

private static stamp(array<string, mixed> $document, string $clientId, string $deploymentId) : array<string, mixed>
Parameters
$document : array<string, mixed>
$clientId : string
$deploymentId : string
Return values
array<string, mixed>

title()

private static title(array<string, mixed> $document, string $login) : string
Parameters
$document : array<string, mixed>
$login : string
Return values
string

tokenRow()

private static tokenRow(mixed $row) : array<string, mixed>|null
Parameters
$row : mixed
Return values
array<string, mixed>|null

toolConfiguration()

private static toolConfiguration(array<string, mixed> $document) : array<string, mixed>|null
Parameters
$document : array<string, mixed>
Return values
array<string, mixed>|null

usable()

private static usable(array<string, mixed> $row, string $token) : bool
Parameters
$row : array<string, mixed>
$token : string
Return values
bool

        
On this page

Search results