Skip to content

Generic exception message to catch-all exception#97

Open
pinclau wants to merge 2 commits intomezzio:3.0.xfrom
pinclau:issue-92
Open

Generic exception message to catch-all exception#97
pinclau wants to merge 2 commits intomezzio:3.0.xfrom
pinclau:issue-92

Conversation

@pinclau
Copy link

@pinclau pinclau commented Mar 16, 2026

Q A
Documentation no
Bugfix yes
BC Break no
New Feature yes
RFC no
QA no

Description

This PR addresses #92 issued by @marcguyer and implements his "suggested fix". I added a test for the new LoggerInterface

Signed-off-by: pinclau <claudiu@dotkernel.com>
@arhimede
Copy link
Member

@mezzio/tsc-reviewers
With this PR , we can release the version 3 of this library

@arhimede arhimede added this to the 3.0.0 milestone Mar 16, 2026
* @param (callable():ResponseInterface)|ResponseFactoryInterface $responseFactory
*/
public function __construct(AuthorizationServer $server, $responseFactory)
public function __construct(AuthorizationServer $server, $responseFactory, ?LoggerInterface $logger = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have here a typical problem: nobody knows about it.
There is a simple rule: what is not documented does not exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The related factory should also be extended:

return new AuthorizationMiddleware(
$container->get(AuthorizationServer::class),
$this->detectResponseFactory($container)
);
}

The Psr\Container\ContainerInterface defines a has method which can be used here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@froschdesign i made changes to the related factory
What should we do about the documentation?

Signed-off-by: pinclau <claudiu@dotkernel.com>
@pinclau pinclau requested a review from froschdesign March 20, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AuthorizationMiddleware catch-all leaks internal exception messages in HTTP response

3 participants