aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/JsonApi/Middlewares/Auth/Strategy.php
blob: 6b26cedceb6cfc6e1f9a27576d5756a6e1cf4355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

namespace JsonApi\Middlewares\Auth;

use Psr\Http\Message\ResponseInterface as Response;

interface Strategy
{
    /**
     * Determine if the current user is authenticated.
     *
     * @return bool
     */
    public function check();

    /**
     * Get the currently authenticated user.
     *
     * @return ?\User
     */
    public function user();

    /**
     * Validate a user's credentials.
     *
     * @param Response $response the current response
     *
     * @return Response the new response containing the challenge
     */
    public function addChallenge(Response $response);
}