Skip to content

Commit

Permalink
Prepare debug endpoint firewall for resource_type=debug_endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
hswong3i committed Jul 12, 2014
1 parent 4aa014f commit 203fa62
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/config/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
// @link http://tools.ietf.org/html/rfc6749#section-7
'oauth2_debug' => array(
'pattern' => '^/oauth2/debug$',
'oauth2_resource' => true,
'oauth2_resource' => array(
'resource_type' => 'model',
'scope' => array('debug'),
),
),
'resource_debug' => array(
'pattern' => '^/resource/debug$',
Expand All @@ -84,4 +87,16 @@
'scope' => array('demoscope1'),
),
),
'resource_debug_debug_endpoint' => array(
'pattern' => '^/resource/debug/debug_endpoint$',
'oauth2_resource' => array(
'resource_type' => 'debug_endpoint',
'scope' => array('demoscope1'),
'options' => array(
'request_uri' => '/oauth2/debug',
'client_id' => 'http://democlient1.com/',
'client_secret' => 'demosecret1',
),
),
),
);
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function load(ObjectManager $manager)
->setUsername('demousername1')
->setExpires(new \DateTime('+1 hours'))
->setScope(array(
'debug',
'demoscope1',
));
$manager->persist($model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function load(ObjectManager $manager)
$model->setClientId('51b2d34c3a661b5e111a694dfcb4b248')
->setUsername('demousername1')
->setScope(array(
'debug',
'demoscope1',
'demoscope2',
'demoscope3',
Expand All @@ -33,6 +34,7 @@ public function load(ObjectManager $manager)
$model->setClientId('authorization_code_grant')
->setUsername('demousername1')
->setScope(array(
'debug',
'demoscope1',
));
$manager->persist($model);
Expand All @@ -41,6 +43,7 @@ public function load(ObjectManager $manager)
$model->setClientId('implicit_grant')
->setUsername('demousername1')
->setScope(array(
'debug',
'demoscope1',
));
$manager->persist($model);
Expand All @@ -49,6 +52,7 @@ public function load(ObjectManager $manager)
$model->setClientId('resource_owner_password_credentials_grant')
->setUsername('demousername1')
->setScope(array(
'debug',
'demoscope1',
));
$manager->persist($model);
Expand All @@ -57,6 +61,7 @@ public function load(ObjectManager $manager)
$model->setClientId('client_credentials_grant')
->setUsername('')
->setScope(array(
'debug',
'demoscope1',
));
$manager->persist($model);
Expand All @@ -65,6 +70,7 @@ public function load(ObjectManager $manager)
$model->setClientId('http://democlient1.com/')
->setUsername('demousername1')
->setScope(array(
'debug',
'demoscope1',
));
$manager->persist($model);
Expand All @@ -73,6 +79,7 @@ public function load(ObjectManager $manager)
$model->setClientId('http://democlient2.com/')
->setUsername('demousername2')
->setScope(array(
'debug',
'demoscope1',
'demoscope2',
));
Expand All @@ -82,6 +89,7 @@ public function load(ObjectManager $manager)
$model->setClientId('http://democlient3.com/')
->setUsername('demousername3')
->setScope(array(
'debug',
'demoscope1',
'demoscope2',
'demoscope3',
Expand All @@ -92,6 +100,7 @@ public function load(ObjectManager $manager)
$model->setClientId('http://democlient1.com/')
->setUsername('')
->setScope(array(
'debug',
'demoscope1',
'demoscope2',
'demoscope3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class ScopeFixture implements FixtureInterface
{
public function load(ObjectManager $manager)
{
$model = new Scope();
$model->setScope('debug');
$manager->persist($model);

$model = new Scope();
$model->setScope('demoscope1');
$manager->persist($model);
Expand Down

0 comments on commit 203fa62

Please sign in to comment.