Skip to content

Commit

Permalink
🔨 #270 lista ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Aug 5, 2022
1 parent 6248637 commit 353489d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion appexemplo_v2.0/api/api_controllers/Authentication.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand All @@ -30,6 +33,10 @@ public function addPath($path){
$this->listPath[] = $this->getUrlbase().$path;
}

public function getArrayPathIgnore(){
return $this->listPathIgnore;
}

/**
* Cria um autenticação basica
*
Expand All @@ -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"
]
Expand Down

0 comments on commit 353489d

Please sign in to comment.