mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-03 10:41:51 +05:30
Learnt how to spell delimiter
This commit is contained in:
parent
35369038db
commit
f83e5a8731
@ -25,7 +25,7 @@ class AuthorizationServer extends AbstractServer
|
|||||||
* The OAuth 2 specification states it should be a space but most use a comma
|
* The OAuth 2 specification states it should be a space but most use a comma
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $scopeDelimeter = ' ';
|
protected $scopeDelimiter = ' ';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The TTL (time to live) of an access token in seconds (default: 3600)
|
* The TTL (time to live) of an access token in seconds (default: 3600)
|
||||||
@ -184,22 +184,22 @@ class AuthorizationServer extends AbstractServer
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the scope delimeter
|
* Get the scope delimiter
|
||||||
* @return string The scope delimiter (default: ",")
|
* @return string The scope delimiter (default: ",")
|
||||||
*/
|
*/
|
||||||
public function getScopeDelimeter()
|
public function getScopeDelimiter()
|
||||||
{
|
{
|
||||||
return $this->scopeDelimeter;
|
return $this->scopeDelimiter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the scope delimiter
|
* Set the scope delimiter
|
||||||
* @param string $scopeDelimeter
|
* @param string $scopeDelimiter
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setScopeDelimeter($scopeDelimeter = ' ')
|
public function setScopeDelimiter($scopeDelimiter = ' ')
|
||||||
{
|
{
|
||||||
$this->scopeDelimeter = $scopeDelimeter;
|
$this->scopeDelimiter = $scopeDelimiter;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ abstract class AbstractGrant implements GrantTypeInterface
|
|||||||
*/
|
*/
|
||||||
public function validateScopes($scopeParam = '', ClientEntity $client, $redirectUri = null)
|
public function validateScopes($scopeParam = '', ClientEntity $client, $redirectUri = null)
|
||||||
{
|
{
|
||||||
$scopesList = explode($this->server->getScopeDelimeter(), $scopeParam);
|
$scopesList = explode($this->server->getScopeDelimiter(), $scopeParam);
|
||||||
|
|
||||||
for ($i = 0; $i < count($scopesList); $i++) {
|
for ($i = 0; $i < count($scopesList); $i++) {
|
||||||
$scopesList[$i] = trim($scopesList[$i]);
|
$scopesList[$i] = trim($scopesList[$i]);
|
||||||
|
@ -15,7 +15,7 @@ class AuthorizationServerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$server->requireScopeParam(true);
|
$server->requireScopeParam(true);
|
||||||
$server->requireStateParam(true);
|
$server->requireStateParam(true);
|
||||||
$server->setDefaultScope('foobar');
|
$server->setDefaultScope('foobar');
|
||||||
$server->setScopeDelimeter(',');
|
$server->setScopeDelimiter(',');
|
||||||
$server->setAccessTokenTTL(1);
|
$server->setAccessTokenTTL(1);
|
||||||
|
|
||||||
$grant = M::mock('League\OAuth2\Server\Grant\GrantTypeInterface');
|
$grant = M::mock('League\OAuth2\Server\Grant\GrantTypeInterface');
|
||||||
@ -36,7 +36,7 @@ class AuthorizationServerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertTrue($server->stateParamRequired());
|
$this->assertTrue($server->stateParamRequired());
|
||||||
$this->assertTrue($server->getScopeStorage() instanceof ScopeInterface);
|
$this->assertTrue($server->getScopeStorage() instanceof ScopeInterface);
|
||||||
$this->assertEquals('foobar', $server->getDefaultScope());
|
$this->assertEquals('foobar', $server->getDefaultScope());
|
||||||
$this->assertEquals(',', $server->getScopeDelimeter());
|
$this->assertEquals(',', $server->getScopeDelimiter());
|
||||||
$this->assertEquals(1, $server->getAccessTokenTTL());
|
$this->assertEquals(1, $server->getAccessTokenTTL());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user