From 353489d8afab2baf641fc0c6a2c81a9eba926b40 Mon Sep 17 00:00:00 2001 From: Bjverde Date: Fri, 5 Aug 2022 16:46:03 -0300 Subject: [PATCH] :hammer: #270 lista ignore --- .../api/api_controllers/Authentication.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/appexemplo_v2.0/api/api_controllers/Authentication.class.php b/appexemplo_v2.0/api/api_controllers/Authentication.class.php index 01288dad..6e81de31 100644 --- a/appexemplo_v2.0/api/api_controllers/Authentication.class.php +++ b/appexemplo_v2.0/api/api_controllers/Authentication.class.php @@ -8,10 +8,13 @@ class Authentication { private $urlChamada = null; private $listPath = array(); + private $listPathIgnore= array(); public function __construct($urlChamada) { $this->urlChamada = $urlChamada; + $this->listPathIgnore[] = $urlChamada.'api'; + $this->listPathIgnore[] = $urlChamada.'sysinfo'; } public function getUrlbase(){ @@ -30,6 +33,10 @@ public function addPath($path){ $this->listPath[] = $this->getUrlbase().$path; } + public function getArrayPathIgnore(){ + return $this->listPathIgnore; + } + /** * Cria um autenticaĆ§Ć£o basica * @@ -42,7 +49,7 @@ public function basicAuth(): HttpBasicAuthentication { return new HttpBasicAuthentication([ 'path' => $this->getArrayPath() - ,'ignore'=> [$this->getUrlbase().'/api', $this->getUrlbase().'/sysinfo'] + ,'ignore'=> $this->getArrayPathIgnore() ,"users" => [ "root" => "teste123" ]