yiisoft / yiisoft/docs

Create "Middleware" article in "Internals"

Open
#318 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
252
Forks
98
Avg merge
7h 12m
Merged PRs (30d)
4

Description

Convention about failure handler in middleware should be written.

Because each failure handler is specific for each middleware, so it shouldn't implement RequestHandlerInterface. So separate failure handler interface should be created for each middleware.

Example:

interface AuthenticationFailureHandlerInterface
{
    public function handle(ServerRequestInterface $request): ResponseInterface;
}

When failure handler requires some context, it should be a second parameter in handle() metod. For example:

interface ThrowableHandlerInterface
{
    public function create(ServerRequestInterface $request, Throwable $throwable): ResponseInterface;
}

Related PRs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the requested Internals article topic and the related yiisoft/auth pull request #101. Locate the existing Internals documentation structure, then document the middleware failure-handler convention and the AuthenticationFailureHandlerInterface and ThrowableHandlerInterface examples shown in the issue. Done means the convention is clearly recorded in the new article.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.