示例#1
0
 public function testMissingKey()
 {
     try {
         \Galmi\Xacml\Config::get('test2');
     } catch (\Exception $e) {
         $this->assertEquals("Key test2 not exists.", $e->getMessage());
     }
 }
示例#2
0
 /**
  * Retrieve attributeId value using AttributeFinder
  *
  * @inheritdoc
  */
 public function evaluate(Request $request)
 {
     try {
         $attributeFinder = Config::get(Config::ATTRIBUTE_FINDER);
         $value = $attributeFinder->getValue($request, $this->attributeId);
     } catch (\Exception $e) {
         return Match::INDETERMINATE;
     }
     if ($value == null && $this->mustBePresent) {
         return Match::INDETERMINATE;
     }
     return $value;
 }
示例#3
0
文件: Apply.php 项目: galmi/xacml
 /**
  * Get function from functionId
  *
  * @return \Galmi\Xacml\Func\FuncInterface
  * @throws \Galmi\Xacml\Exception\FunctionNotFoundException
  */
 public function getFunc()
 {
     $funcFactory = Config::get(Config::FUNC_REGISTRY);
     return $funcFactory->get($this->functionId);
 }
示例#4
0
 public function __construct()
 {
     $this->funcFactory = Config::get(Config::FUNC_REGISTRY);
 }