Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
RhysLees committed Sep 12, 2024
1 parent ab6d99d commit 2246872
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Connectors/DocuWareConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ protected function defaultAuth(): TokenAuthenticator

/**
* @throws InvalidArgumentException
* @throws \Exception
*/
protected function getOrCreateNewOAuthToken()
protected function getOrCreateNewOAuthToken(): string
{
$cache = Cache::store($this->configuration->cacheDriver);

Expand Down
4 changes: 2 additions & 2 deletions src/DTO/Config/ConfigWithCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CodebarAg\DocuWare\DTO\Config;

use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Hash;

final class ConfigWithCredentials
Expand Down Expand Up @@ -36,7 +37,6 @@ public function __construct(
?int $requestTimeoutInSeconds = null,
?string $clientId = null,
?string $scope = null,
?string $identifier = null,
) {
$this->username = $username;
$this->password = $password;
Expand All @@ -55,6 +55,6 @@ public function __construct(

$this->scope = filled($scope) ? $scope : config('laravel-docuware.configurations.scope');

$this->identifier = filled($identifier) ? $identifier : Hash::make($this->url.'.'.$this->username.'.'.$this->clientId);
$this->identifier = Hash::make($this->url.'.'.$this->username.'.'.Crypt::encrypt($this->password));
}
}
4 changes: 2 additions & 2 deletions src/DTO/Config/ConfigWithCredentialsTrustedUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CodebarAg\DocuWare\DTO\Config;

use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Hash;

final class ConfigWithCredentialsTrustedUser
Expand Down Expand Up @@ -39,7 +40,6 @@ public function __construct(
?int $requestTimeoutInSeconds = null,
?string $clientId = null,
?string $scope = null,
?string $identifier = null,
) {
$this->username = $username;
$this->password = $password;
Expand All @@ -59,6 +59,6 @@ public function __construct(

$this->scope = filled($scope) ? $scope : config('laravel-docuware.configurations.scope');

$this->identifier = filled($identifier) ? $identifier : Hash::make($this->url.'.'.$this->username.'.'.$this->clientId);
$this->identifier = Hash::make($this->url.'.'.$this->username.'.'.Crypt::encrypt($this->password));
}
}

0 comments on commit 2246872

Please sign in to comment.