3 declare(strict_types=1);
77 $this->type =
'RestService';
80 $this->variables = array();
81 $this->formats = array();
82 $this->methods = array();
83 $this->params = array();
123 if (empty($this->params)) {
124 $this->params = array();
125 if (!empty(
$_SERVER[
'PATH_INFO'])) {
126 $path = explode(
'/', $this->service->getResourcePath());
127 $template = preg_replace(
'/\([0-9a-zA-Z_\-,\/]+\)/',
'', $this->
getTemplate());
128 $parts = explode(
'/', $template);
131 if ((str_starts_with(
$parts[
$i],
'{')) && (str_ends_with(
$parts[$i],
'}'))) {
133 if ($i < count(
$path)) {
136 $this->params[substr(
$parts[$i], 1, -1)] = $value;
150 $permittedScopes = $this->
getService()->getPermittedScopes();
151 if (empty(
$scopes) || empty(array_intersect($permittedScopes,
$scopes))) {
array $params
Template variables parsed from the resource template.
string $id
ID for this resource.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
parseTemplate()
Parse the template for variables.
ilLTIConsumerServiceBase $service
Service associated with this resource.
string $template
Template for this resource.
array $methods
HTTP actions supported by this resource.
string $type
Type for this resource.
checkTool(array $scopes=array())
Check to make sure the request is valid.
const HTTP_DELETE
HTTP Delete method.
getTemplate()
Get the resource template.
const HTTP_POST
HTTP Post method.
getMethods()
Get the resource methods.
const HTTP_PUT
HTTP Put method.
array $formats
Media types supported by this resource.
const HTTP_GET
HTTP Get method.
array $variables
Custom parameter substitution variables associated with this resource.
getFormats()
Get the resource media types.
__construct(ilLTIConsumerServiceBase $service)
Class constructor.
getService()
Get the resource's service.