Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
geggleto committed Mar 21, 2016
1 parent 687f175 commit fcdfa22
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,19 @@ $app->add(function (Request $request, Response $res, $next) {
}
});
```


## White listing
You may add a URI path for white listing. The whitelisting is based upon `strpos()` so you may use a URI fragment to whitelist a whole class of URIs.
With this it is possible to whitelist URIs by accident.

Example:
```php

$acl = new Acl();
$acl->addWhitelistItem('/api');
```

In this example any URI with `/api` will be whitelisted.
- `/api/*`
- `/myexample/api/*`
10 changes: 10 additions & 0 deletions tests/AclRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,15 @@ public function testAclRepoUser2_yes() {
$this->assertEquals(200, $output->getStatusCode());
}

public function testAclRepoGuest_Whitelist() {
$reqRoot = $this->mockRequest('/yes');
$res = $this->mockResponse(401);

$acl = $this->user2;
$acl->addWhiteListUri('/yes');
$output = $acl($reqRoot, $res, $this->getClosure());

$this->assertEquals(200, $output->getStatusCode());
}

}

0 comments on commit fcdfa22

Please sign in to comment.