Trusted.php 1.8 KB

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