fix misdetection of every file being changed every time
This commit is contained in:
parent
17b0665893
commit
3262ff3791
2 changed files with 16 additions and 2 deletions
|
|
@ -716,8 +716,9 @@ class Bouncer
|
|||
}
|
||||
|
||||
if ($target->hasAuth()) {
|
||||
$authFileHash = $this->configFilesystem->fileExists($target->getAuthFileName()) ? sha1($this->configFilesystem->read($target->getAuthFileName())) : null;
|
||||
if (sha1($target->getAuthFileData()) != $authFileHash) {
|
||||
$authFileHash = $this->configFilesystem->fileExists($target->getAuthFileName()) ? $this->configFilesystem->read($target->getAuthFileName()) : null;
|
||||
if ($target->getAuthHash() != $authFileHash) {
|
||||
$this->configFilesystem->write($target->getAuthFileName() . '.hash', $target->getAuthHash());
|
||||
$this->configFilesystem->write($target->getAuthFileName(), $target->getAuthFileData());
|
||||
$changed = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,19 @@ class Target
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getAuth(): array
|
||||
{
|
||||
return [
|
||||
'username' => $this->getUsername(),
|
||||
'password' => $this->getPassword(),
|
||||
];
|
||||
}
|
||||
|
||||
public function getAuthHash(): string
|
||||
{
|
||||
return sha1(implode(':', $this->getAuth()));
|
||||
}
|
||||
|
||||
public function setAuth(string $username, string $password): self
|
||||
{
|
||||
return $this->setUsername($username)->setPassword($password);
|
||||
|
|
|
|||
Loading…
Reference in a new issue