Skip to content

Commit

Permalink
feat: support passing pacs selector in token
Browse files Browse the repository at this point in the history
  • Loading branch information
joostfaassen committed Jul 9, 2019
1 parent 5388677 commit 0618c14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Client.php
Expand Up @@ -8,12 +8,14 @@ class Client
{
protected $key;
protected $url;
protected $pacs;

public function __construct($url, $key, $algorithm)
public function __construct($url, $key, $algorithm, $pacs = null)
{
$this->url = $url;
$this->key = $key;
$this->algorithm = $algorithm;
$this->pacs = $pacs;
}

public function getJwt($studyUid, $seriesUid, $objectUid, $contentType)
Expand All @@ -27,6 +29,9 @@ public function getJwt($studyUid, $seriesUid, $objectUid, $contentType)
'objectUid' => $objectUid,
'contentType' => $contentType
];
if ($this->pacs) {
$token['pacs'] = $this->pacs;
}
$jwt = JWT::encode($token, $this->key, $this->algorithm);
return $jwt;
}
Expand Down

0 comments on commit 0618c14

Please sign in to comment.