ci4

Форк
0
/
SecurityInterface.php 
73 строки · 1.8 Кб
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace CodeIgniter\Security;
15

16
use CodeIgniter\HTTP\RequestInterface;
17
use CodeIgniter\Security\Exceptions\SecurityException;
18

19
/**
20
 * Expected behavior of a Security.
21
 */
22
interface SecurityInterface
23
{
24
    /**
25
     * CSRF Verify
26
     *
27
     * @return $this|false
28
     *
29
     * @throws SecurityException
30
     */
31
    public function verify(RequestInterface $request);
32

33
    /**
34
     * Returns the CSRF Hash.
35
     */
36
    public function getHash(): ?string;
37

38
    /**
39
     * Returns the CSRF Token Name.
40
     */
41
    public function getTokenName(): string;
42

43
    /**
44
     * Returns the CSRF Header Name.
45
     */
46
    public function getHeaderName(): string;
47

48
    /**
49
     * Returns the CSRF Cookie Name.
50
     */
51
    public function getCookieName(): string;
52

53
    /**
54
     * Check if request should be redirect on failure.
55
     */
56
    public function shouldRedirect(): bool;
57

58
    /**
59
     * Sanitize Filename
60
     *
61
     * Tries to sanitize filenames in order to prevent directory traversal attempts
62
     * and other security threats, which is particularly useful for files that
63
     * were supplied via user input.
64
     *
65
     * If it is acceptable for the user input to include relative paths,
66
     * e.g. file/in/some/approved/folder.txt, you can set the second optional
67
     * parameter, $relative_path to TRUE.
68
     *
69
     * @param string $str          Input file name
70
     * @param bool   $relativePath Whether to preserve paths
71
     */
72
    public function sanitizeFilename(string $str, bool $relativePath = false): string;
73
}
74

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.