1*d10b5556SXylle<?php 2*d10b5556SXylle 3*d10b5556SXylle/** 4*d10b5556SXylle * Licensed to Jasig under one or more contributor license 5*d10b5556SXylle * agreements. See the NOTICE file distributed with this work for 6*d10b5556SXylle * additional information regarding copyright ownership. 7*d10b5556SXylle * 8*d10b5556SXylle * Jasig licenses this file to you under the Apache License, 9*d10b5556SXylle * Version 2.0 (the "License"); you may not use this file except in 10*d10b5556SXylle * compliance with the License. You may obtain a copy of the License at: 11*d10b5556SXylle * 12*d10b5556SXylle * http://www.apache.org/licenses/LICENSE-2.0 13*d10b5556SXylle * 14*d10b5556SXylle * Unless required by applicable law or agreed to in writing, software 15*d10b5556SXylle * distributed under the License is distributed on an "AS IS" BASIS, 16*d10b5556SXylle * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17*d10b5556SXylle * See the License for the specific language governing permissions and 18*d10b5556SXylle * limitations under the License. 19*d10b5556SXylle * 20*d10b5556SXylle * PHP Version 7 21*d10b5556SXylle * 22*d10b5556SXylle * @file CAS/ProxyChain/Trusted.php 23*d10b5556SXylle * @category Authentication 24*d10b5556SXylle * @package PhpCAS 25*d10b5556SXylle * @author Adam Franco <afranco@middlebury.edu> 26*d10b5556SXylle * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 27*d10b5556SXylle * @link https://wiki.jasig.org/display/CASC/phpCAS 28*d10b5556SXylle */ 29*d10b5556SXylle 30*d10b5556SXylle/** 31*d10b5556SXylle * A proxy-chain definition that defines a chain up to a trusted proxy and 32*d10b5556SXylle * delegates the resposibility of validating the rest of the chain to that 33*d10b5556SXylle * trusted proxy. 34*d10b5556SXylle * 35*d10b5556SXylle * @class CAS_ProxyChain_Trusted 36*d10b5556SXylle * @category Authentication 37*d10b5556SXylle * @package PhpCAS 38*d10b5556SXylle * @author Adam Franco <afranco@middlebury.edu> 39*d10b5556SXylle * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 40*d10b5556SXylle * @link https://wiki.jasig.org/display/CASC/phpCAS 41*d10b5556SXylle */ 42*d10b5556SXylleclass CAS_ProxyChain_Trusted 43*d10b5556SXylleextends CAS_ProxyChain 44*d10b5556SXylleimplements CAS_ProxyChain_Interface 45*d10b5556SXylle{ 46*d10b5556SXylle 47*d10b5556SXylle /** 48*d10b5556SXylle * Validate the size of the the list as compared to our chain. 49*d10b5556SXylle * 50*d10b5556SXylle * @param array $list list of proxies 51*d10b5556SXylle * 52*d10b5556SXylle * @return bool 53*d10b5556SXylle */ 54*d10b5556SXylle protected function isSizeValid (array $list) 55*d10b5556SXylle { 56*d10b5556SXylle return (sizeof($this->chain) <= sizeof($list)); 57*d10b5556SXylle } 58*d10b5556SXylle 59*d10b5556SXylle} 60