This repository was archived by the owner on May 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathAccessReferenceMap.php
More file actions
executable file
·120 lines (111 loc) · 4.12 KB
/
AccessReferenceMap.php
File metadata and controls
executable file
·120 lines (111 loc) · 4.12 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/**
* OWASP Enterprise Security API (ESAPI)
*
* This file is part of the Open Web Application Security Project (OWASP)
* Enterprise Security API (ESAPI) project.
*
* PHP version 5.2
*
* LICENSE: This source file is subject to the New BSD license. You should read
* and accept the LICENSE before you use, modify, and/or redistribute this
* software.
*
* @category OWASP
* @package ESAPI
* @author Andrew van der Stock <vanderaj@owasp.org>
* @author Mike Boberski <boberski_michael@bah.com>
* @copyright 2009-2010 The OWASP Foundation
* @license http://www.opensource.org/licenses/bsd-license.php New BSD license
* @version SVN: $Id$
* @link http://www.owasp.org/index.php/ESAPI
*/
require_once dirname(__FILE__) . '/errors/AccessControlException.php';
/**
* Use this ESAPI security control to create access reference maps.
*
* The idea behind this interface is to map a set of internal direct
* object references to a set of indirect references that are safe to
* disclose publicly. This can be used to help protect database keys,
* filenames, and other types of direct object references. As a rule,
* developers should not expose their direct object references as it
* enables attackers to attempt to manipulate them.
*
* @category OWASP
* @package ESAPI
* @author Andrew van der Stock <vanderaj@owasp.org>
* @author Mike Boberski <boberski_michael@bah.com>
* @copyright 2009-2010 The OWASP Foundation
* @license http://www.opensource.org/licenses/bsd-license.php New BSD license
* @version Release: @package_version@
* @link http://www.owasp.org/index.php/ESAPI
*/
interface AccessReferenceMap
{
/**
* Get an iterator through the direct object references. No guarantee is made as
* to the order of items returned.
*
* @return iterator the iterator
*/
function iterator();
/**
* Get a safe indirect reference to use in place of a potentially sensitive
* direct object reference. Developers should use this call when building
* URL's, form fields, hidden fields, etc... to help protect their private
* implementation information.
*
* @param string $directReference the direct reference
*
* @return string the indirect reference
*/
function getIndirectReference($directReference);
/**
* Get the original direct object reference from an indirect reference.
* Developers should use this when they get an indirect reference from a
* request to translate it back into the real direct reference. If an
* invalid indirect reference is requested, then an AccessControlException is
* thrown.
*
* @param string $indirectReference the indirect reference
*
* @return string the direct reference
*
* @throws AccessControlException if no direct reference exists for the
* specified indirect reference
*/
function getDirectReference($indirectReference);
/**
* Adds a direct reference to the AccessReferenceMap, then generates and returns
* an associated indirect reference.
*
* @param string $direct the direct reference
*
* @return string the corresponding indirect reference
*/
function addDirectReference($direct);
/**
* Removes a direct reference and its associated indirect reference from
* the AccessReferenceMap.
*
* @param string $direct the direct reference to remove
*
* @return does not return a avalue
*
* @throws AccessControlException
*/
function removeDirectReference($direct);
/**
* Updates the access reference map with a new set of direct references,
* maintaining any existing indirect references associated with items that
* are in the new list. New indirect references could be generated every time,
* but that might mess up anything that previously used an indirect reference,
* such as a URL parameter.
*
* @param string $directReferences a Set of direct references to add
*
* @return does not return a avalue
*/
function update($directReferences);
}
?>