Skip to content

Commit

Permalink
Merge pull request #30 from mickadoo/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
glena committed May 26, 2016
2 parents 85d9082 + 0a21c0c commit a33e4ec
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},

"require-dev": {
"phpunit/phpunit": "^5.1"
},

"suggest": {
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php" colors="true">
<phpunit bootstrap="Tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="JWTAuthBundle Test Suite">
<directory>tests/</directory>
<directory>Tests/</directory>
</testsuite>
</testsuites>

Expand Down
3 changes: 1 addition & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('client_id')->isRequired()->cannotBeEmpty()->end()
->scalarNode('client_secret')->isRequired()->cannotBeEmpty()->end()
->scalarNode('domain')->defaultValue('')->end()
->booleanNode('secret_base64_encoded')->defaultTrue()->end();
->scalarNode('domain')->defaultValue('')->end();

return $treeBuilder;
}
Expand Down
2 changes: 0 additions & 2 deletions src/DependencyInjection/JWTAuthExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('jwt_auth.client_id', $config['client_id']);
$container->setParameter('jwt_auth.client_secret', $config['client_secret']);
$container->setParameter('jwt_auth.domain', $config['domain']);
$container->setParameter('jwt_auth.secret_base64_encoded', $config['secret_base64_encoded']);
}

}
2 changes: 1 addition & 1 deletion src/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
jwt_auth.auth0_service:
class: "Auth0\\JWTAuthBundle\\Security\\Auth0Service"
arguments: [%jwt_auth.client_id%, %jwt_auth.client_secret%, %jwt_auth.domain%, %jwt_auth.secret_base64_encoded%]
arguments: [%jwt_auth.client_id%, %jwt_auth.client_secret%, %jwt_auth.domain%]

jwt_auth.jwt_authenticator:
class: "Auth0\\JWTAuthBundle\\Security\\JWTAuthenticator"
Expand Down
11 changes: 7 additions & 4 deletions src/Security/Auth0Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ class Auth0Service {
private $client_id;
private $client_secret;
private $domain;
private $oauth_client;

public function __construct($client_id, $client_secret, $domain, $secret_base64_encoded)
/**
* @param string $client_id
* @param string $client_secret
* @param string $domain
*/
public function __construct($client_id, $client_secret, $domain)
{
$this->client_id = $client_id;
$this->client_secret = $client_secret;
$this->domain = $domain;
$this->secret_base64_encoded = $secret_base64_encoded;
}

/**
Expand All @@ -40,7 +43,7 @@ public function getUserProfileByA0UID($jwt, $a0UID)
/**
* Decodes the JWT and validate it
*
* @return stdClass
* @return \stdClass
*/
public function decodeJWT($encToken)
{
Expand Down

0 comments on commit a33e4ec

Please sign in to comment.