From a4637debe9ecdff1c2b9ed9daabeec4486c682c3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 22 Feb 2025 08:07:52 +0100 Subject: [PATCH] Update changelog, fix log reference. --- .../Authentication/RemoteUserGuard.php | 35 ++++++++++--------- changelog.md | 2 ++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index a6c787a8d8..93c418ce69 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -31,6 +31,7 @@ use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Auth\UserProvider; use Illuminate\Contracts\Foundation\Application; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; /** * Class RemoteUserGuard @@ -48,7 +49,7 @@ class RemoteUserGuard implements Guard { /** @var null|Request $request */ $request = $app->get('request'); - app('log')->debug(sprintf('Created RemoteUserGuard for %s "%s"', $request?->getMethod(), $request?->getRequestUri())); + Log::debug(sprintf('Created RemoteUserGuard for %s "%s"', $request?->getMethod(), $request?->getRequestUri())); $this->application = $app; $this->provider = $provider; $this->user = null; @@ -56,9 +57,9 @@ class RemoteUserGuard implements Guard public function authenticate(): void { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); if (null !== $this->user) { - app('log')->debug(sprintf('%s is found: #%d, "%s".', get_class($this->user), $this->user->id, $this->user->email)); + Log::debug(sprintf('%s is found: #%d, "%s".', get_class($this->user), $this->user->id, $this->user->email)); return; } @@ -67,17 +68,17 @@ class RemoteUserGuard implements Guard $userID = request()->server($header) ?? null; if (function_exists('apache_request_headers')) { - app('log')->debug('Use apache_request_headers to find user ID.'); + Log::debug('Use apache_request_headers to find user ID.'); $userID = request()->server($header) ?? apache_request_headers()[$header] ?? null; } if (null === $userID || '' === $userID) { - app('log')->error(sprintf('No user in header "%s".', $header)); + Log::error(sprintf('No user in header "%s".', $header)); throw new FireflyException('The guard header was unexpectedly empty. See the logs.'); } - app('log')->debug(sprintf('User ID found in header is "%s"', $userID)); + Log::debug(sprintf('User ID found in header is "%s"', $userID)); /** @var User $retrievedUser */ $retrievedUser = $this->provider->retrieveById($userID); @@ -98,30 +99,30 @@ class RemoteUserGuard implements Guard } } - app('log')->debug(sprintf('Result of getting user from provider: %s', $retrievedUser->email)); + Log::debug(sprintf('Result of getting user from provider: %s', $retrievedUser->email)); $this->user = $retrievedUser; } public function guest(): bool { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); return !$this->check(); } public function check(): bool { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); return null !== $this->user(); } public function user(): ?User { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); $user = $this->user; if (null === $user) { - app('log')->debug('User is NULL'); + Log::debug('User is NULL'); return null; } @@ -131,7 +132,7 @@ class RemoteUserGuard implements Guard public function hasUser(): bool { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); throw new FireflyException('Did not implement RemoteUserGuard::hasUser()'); } @@ -141,20 +142,20 @@ class RemoteUserGuard implements Guard */ public function id(): null|int|string { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); return $this->user?->id; } public function setUser(null|Authenticatable|User $user): void // @phpstan-ignore-line { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); if ($user instanceof User) { $this->user = $user; return; } - app('log')->error(sprintf('Did not set user at %s', __METHOD__)); + Log::error(sprintf('Did not set user at %s', __METHOD__)); } /** @@ -164,14 +165,14 @@ class RemoteUserGuard implements Guard */ public function validate(array $credentials = []): bool { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); throw new FireflyException('Did not implement RemoteUserGuard::validate()'); } public function viaRemember(): bool { - app('log')->debug(sprintf('Now at %s', __METHOD__)); + Log::debug(sprintf('Now at %s', __METHOD__)); return false; } diff --git a/changelog.md b/changelog.md index 19d525e969..9db3bd1361 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - [Issue 9868](https://github.com/firefly-iii/firefly-iii/issues/9868) (API: `TransactionSplit` -> `transaction_journal_id` returns int, not String) reported by @dreautall - [Issue 9871](https://github.com/firefly-iii/firefly-iii/issues/9871) (include net worth is ignored in the API - from PICO developer) reported by @fate8383 - [Issue 9882](https://github.com/firefly-iii/firefly-iii/issues/9882) (Reconciliation bug on Docker instance) reported by @benjaminteyssier +- #9884 +- #9887 ## 6.2.7 - 2025-02-19