Skip to content

Commit

Permalink
initial commit of transition to api v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
spell00 committed Sep 1, 2020
1 parent 8a6893c commit 801d93b
Show file tree
Hide file tree
Showing 39 changed files with 1,168 additions and 26 deletions.
1,104 changes: 1,104 additions & 0 deletions modules/api/docs/LorisRESTAPI_v0.0.4.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions modules/api/php/endpoints/candidate/candidate.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Candidate extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ class Dicom extends Endpoint implements \LORIS\Middleware\ETagCalculator
*/
protected function supportedVersions() : array
{
return ['v0.0.3'];
return [
'v0.0.3'
];
}

/**
Expand Down
5 changes: 4 additions & 1 deletion modules/api/php/endpoints/candidate/visit/dicoms.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ class Dicoms extends Endpoint implements \LORIS\Middleware\ETagCalculator
*/
protected function supportedVersions() : array
{
return ['v0.0.3'];
return [
'v0.0.3',
'v0.0.4',
];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class BidsFile extends Endpoint
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Archive extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Channels extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Electrodes extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Events extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Channels extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down Expand Up @@ -142,4 +143,4 @@ class Channels extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return md5(json_encode($this->_handleGET($request)->getBody()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Electrodes extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Events extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Metadata extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down Expand Up @@ -155,4 +156,4 @@ class Metadata extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return md5(json_encode($this->_handleGET($request)->getBody()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Recording extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down Expand Up @@ -217,4 +218,4 @@ class Recording extends Endpoint implements \LORIS\Middleware\ETagCalculator

return md5(json_encode($signature));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Format extends Endpoint
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Brainbrowser extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Raw extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Thumbnail extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Headers extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Image extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Qc extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
1 change: 1 addition & 0 deletions modules/api/php/endpoints/candidate/visit/images.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Images extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Flags extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Instrument extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Instruments extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
1 change: 1 addition & 0 deletions modules/api/php/endpoints/candidate/visit/qc.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Qc extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class Recordings extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return [
'v0.0.3',
'v0.0.4',
];
}

Expand Down
6 changes: 5 additions & 1 deletion modules/api/php/endpoints/candidate/visit/visit.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ class Visit extends Endpoint implements \LORIS\Middleware\ETagCalculator
protected function supportedVersions() : array
{
// Removed 0.0.2 since session requires a project.
return ['v0.0.3'];
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

/**
Expand Down
20 changes: 4 additions & 16 deletions modules/api/php/endpoints/candidates.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,10 @@ class Candidates extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
"v0.0.2",
"v0.0.3",
"v0.0.4",
];
}

/**
* Tells the base class that this page's provisioner can support
* the UserProjectMatch filter.
*
* @return bool always true
*/
public function useProjectFilter() : bool
{
return true;
}

/**
* Handles a request starts with /candidates
*
Expand Down Expand Up @@ -165,11 +155,9 @@ class Candidates extends Endpoint implements \LORIS\Middleware\ETagCalculator
$provisioner = (new \LORIS\api\Provisioners\CandidatesProvisioner())
->filter($filter);

if ($this->useProjectFilter()) {
$provisioner = $provisioner->filter(
new \LORIS\Data\Filters\UserProjectMatch()
);
}
$provisioner = $provisioner->filter(
new \LORIS\Data\Filters\UserProjectMatch()
);

$candidates = (new \LORIS\Data\Table())
->withDataFrom($provisioner)
Expand Down
1 change: 1 addition & 0 deletions modules/api/php/endpoints/login.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Login extends Endpoint
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
1 change: 1 addition & 0 deletions modules/api/php/endpoints/project/candidates.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Candidates extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
5 changes: 4 additions & 1 deletion modules/api/php/endpoints/project/images.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ class Images extends Endpoint implements \LORIS\Middleware\ETagCalculator
*/
protected function supportedVersions() : array
{
return ["v0.0.3"];
return [
"v0.0.3",
"v0.0.4",
];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Instrument extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
1 change: 1 addition & 0 deletions modules/api/php/endpoints/project/instruments.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Instruments extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
1 change: 1 addition & 0 deletions modules/api/php/endpoints/project/project.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Project extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
7 changes: 5 additions & 2 deletions modules/api/php/endpoints/project/recordings.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ class Recordings extends Endpoint implements \LORIS\Middleware\ETagCalculator
*/
protected function supportedVersions() : array
{
return ["v0.0.3"];
return [
"v0.0.3",
"v0.0.4"
];
}

/**
Expand Down Expand Up @@ -178,4 +181,4 @@ class Recordings extends Endpoint implements \LORIS\Middleware\ETagCalculator
{
return md5(json_encode($this->_handleGET($request)->getBody()));
}
}
}
1 change: 1 addition & 0 deletions modules/api/php/endpoints/project/visits.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Visits extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
1 change: 1 addition & 0 deletions modules/api/php/endpoints/projects.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Projects extends Endpoint implements \LORIS\Middleware\ETagCalculator
return [
'v0.0.2',
'v0.0.3',
'v0.0.4',
];
}

Expand Down
6 changes: 5 additions & 1 deletion raisinbread/test/api/LorisApiAuthenticatedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class LorisApiAuthenticatedTest extends LorisIntegrationTest
{

protected $client;
protected $version;
protected $headers;
protected $base_uri;
protected $originalJwtKey;
Expand All @@ -36,6 +37,9 @@ class LorisApiAuthenticatedTest extends LorisIntegrationTest
public function setUp()
{
parent::setUp();

$this->_version = 'v0.0.4';

// store the original JWT key for restoring it later
$jwtConfig = $this->DB->pselect(
'
Expand Down Expand Up @@ -83,7 +87,7 @@ public function setUp()
*/
public function apiLogin($username, $password)
{
$this->base_uri = "$this->url/api/v0.0.3/";
$this->base_uri = "$this->url/api/$this->_version/";
$this->client = new Client(['base_uri' => $this->base_uri]);
$response = $this->client->request(
'POST',
Expand Down

0 comments on commit 801d93b

Please sign in to comment.