Skip to content

Commit

Permalink
Merge 7590e60 into 1e9cc03
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Dec 18, 2015
2 parents 1e9cc03 + 7590e60 commit 405c087
Show file tree
Hide file tree
Showing 12 changed files with 218 additions and 118 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: php
php:
- 5.6
- 7.0

addons:
postgresql: "9.3"
Expand Down Expand Up @@ -64,7 +64,7 @@ before_script:

script:
- gulp test:app
- php ./api/vendor/bin/phpunit --colors --configuration ./api/phpunit.xml --coverage-clover=./reports/coverage/api/clover.xml
- ./api/vendor/bin/phpunit --colors --configuration ./api/phpunit.xml --coverage-clover=./reports/coverage/api/clover.xml
- ./node_modules/.bin/cucumber.js --tags ~@ignore #skip @ignored features

after_script:
Expand Down
14 changes: 10 additions & 4 deletions api/app/Console/Commands/GenerateKeysCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,21 @@ public function __construct(Filesystem $file)
*/
public function handle()
{
$rsa = new \Crypt_RSA();
$keys = $rsa->createKey();
$res = openssl_pkey_new();

// Get private key
openssl_pkey_export($res, $privateKey);

// Get public key
$publicKey = openssl_pkey_get_details($res);
$publicKey = $publicKey['key'];

if (! $this->file->exists(storage_path('app/keys'))) {
$this->file->makeDirectory(storage_path('app/keys'));
}

$this->file->put(storage_path('app/keys/private.pem'), $keys['privatekey']);
$this->file->put(storage_path('app/keys/public.pem'), $keys['publickey']);
$this->file->put(storage_path('app/keys/private.pem'), $privateKey);
$this->file->put(storage_path('app/keys/public.pem'), $publicKey);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"namshi/jose": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpunit/phpunit": "~5.1",
"mockery/mockery": "^0.9.4",
"fzaninotto/faker": "^1.4",
"barryvdh/laravel-ide-helper": "dev-master"
Expand Down
154 changes: 120 additions & 34 deletions api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions api/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./app</directory>
</whitelist>
<blacklist>
<directory>./vendor</directory>
<directory>./storage</directory>
Expand Down
Loading

0 comments on commit 405c087

Please sign in to comment.