Skip to content

Commit

Permalink
Exposes token abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
José San Martin committed Apr 23, 2024
1 parent 2a04b22 commit c60665f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/SlashIdSdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\HandlerStack;
use SlashId\Php\Abstraction\MigrationAbstraction;
use SlashId\Php\Abstraction\TokenAbstraction;
use SlashId\Php\Abstraction\WebhookAbstraction;
use SlashId\Php\Exception\AccessDeniedException;
use SlashId\Php\Exception\BadRequestException;
Expand Down Expand Up @@ -47,6 +48,7 @@ class SlashIdSdk
*/
protected string $apiUrl;
protected MigrationAbstraction $migration;
protected TokenAbstraction $token;
protected WebhookAbstraction $webhook;

public function __construct(
Expand Down Expand Up @@ -108,6 +110,18 @@ public function migration(): MigrationAbstraction
return $this->migration;
}

/**
* Instantiates a token abstraction, to handle authentication tokens.
*/
public function token(): TokenAbstraction
{
if (!isset($this->token)) {
$this->token = new TokenAbstraction($this);
}

return $this->token;
}

/**
* Instantiates a webhook abstraction, to handle webhook requests to the API.
*/
Expand Down

0 comments on commit c60665f

Please sign in to comment.