ILIAS  release_7 Revision v7.30-3-g800a261c036
CAS_ProxyChain_AllowedList Class Reference

ProxyChain is a container for storing chains of valid proxies that can be used to validate proxied requests to a service. More...

+ Collaboration diagram for CAS_ProxyChain_AllowedList:

Public Member Functions

 isProxyingAllowed ()
 Check whether proxies are allowed by configuration. More...
 
 allowProxyChain (CAS_ProxyChain_Interface $chain)
 Add a chain of proxies to the list of possible chains. More...
 
 isProxyListAllowed (array $proxies)
 Check if the proxies found in the response match the allowed proxies. More...
 
 contains (array $list)
 Validate the proxies from the proxy ticket validation against the chains that were definded. More...
 

Private Attributes

 $_chains = array()
 

Detailed Description

ProxyChain is a container for storing chains of valid proxies that can be used to validate proxied requests to a service.

Definition at line 43 of file AllowedList.php.

Member Function Documentation

◆ allowProxyChain()

CAS_ProxyChain_AllowedList::allowProxyChain ( CAS_ProxyChain_Interface  $chain)

Add a chain of proxies to the list of possible chains.

Parameters
CAS_ProxyChain_Interface$chainA chain of proxies
Returns
void

Definition at line 64 of file AllowedList.php.

65 {
66 $this->_chains[] = $chain;
67 }

◆ contains()

CAS_ProxyChain_AllowedList::contains ( array  $list)

Validate the proxies from the proxy ticket validation against the chains that were definded.

Parameters
array$listList of proxies from the proxy ticket validation.
Returns
if any chain fully matches the supplied list

Definition at line 102 of file AllowedList.php.

103 {
105 $count = 0;
106 foreach ($this->_chains as $chain) {
107 phpCAS::trace("Checking chain " . $count++);
108 if ($chain->matches($list)) {
109 phpCAS::traceEnd(true);
110 return true;
111 }
112 }
113 phpCAS::trace("No proxy chain matches.");
114 phpCAS::traceEnd(false);
115 return false;
116 }
static trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:599
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode.
Definition: CAS.php:611

References phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by isProxyListAllowed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isProxyingAllowed()

CAS_ProxyChain_AllowedList::isProxyingAllowed ( )

Check whether proxies are allowed by configuration.

Returns
bool

Definition at line 52 of file AllowedList.php.

53 {
54 return (count($this->_chains) > 0);
55 }

Referenced by isProxyListAllowed().

+ Here is the caller graph for this function:

◆ isProxyListAllowed()

CAS_ProxyChain_AllowedList::isProxyListAllowed ( array  $proxies)

Check if the proxies found in the response match the allowed proxies.

Parameters
array$proxieslist of proxies to check
Returns
bool whether the proxies match the allowed proxies

Definition at line 76 of file AllowedList.php.

77 {
79 if (empty($proxies)) {
80 phpCAS::trace("No proxies were found in the response");
81 phpCAS::traceEnd(true);
82 return true;
83 } elseif (!$this->isProxyingAllowed()) {
84 phpCAS::trace("Proxies are not allowed");
85 phpCAS::traceEnd(false);
86 return false;
87 } else {
88 $res = $this->contains($proxies);
90 return $res;
91 }
92 }
contains(array $list)
Validate the proxies from the proxy ticket validation against the chains that were definded.
isProxyingAllowed()
Check whether proxies are allowed by configuration.
Definition: AllowedList.php:52
foreach($_POST as $key=> $value) $res

References $res, contains(), isProxyingAllowed(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

+ Here is the call graph for this function:

Field Documentation

◆ $_chains

CAS_ProxyChain_AllowedList::$_chains = array()
private

Definition at line 45 of file AllowedList.php.


The documentation for this class was generated from the following file: