Skip to content

Commit

Permalink
debug pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
cnizzardini committed Dec 7, 2023
1 parent 4120d58 commit b483813
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .docker/php/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/cakephp' ]; then
openssl genrsa -out plugins/AuthenticationApi/config/keys/1/private.pem 2048
openssl rsa -in plugins/AuthenticationApi/config/keys/1/private.pem -outform PEM -pubout -out plugins/AuthenticationApi/config/keys/1/public.pem
echo "Generating HMAc secret..."
openssl rand -base64 32 > plugins/AuthenticationApi/config/keys/hmac_secret.txt
openssl rand -base64 24 > plugins/AuthenticationApi/config/keys/hmac_secret.txt
fi

echo "setting ownership..."
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
cd app
composer validate
composer install --prefer-dist --no-interaction --no-progress
mkdir -p plugins/AuthenticationApi/config/keys/1
openssl genrsa -out plugins/AuthenticationApi/config/keys/1/private.pem 2048
openssl rsa -in plugins/AuthenticationApi/config/keys/1/private.pem -outform PEM -pubout -out plugins/AuthenticationApi/config/keys/1/public.pem
openssl rand -base64 24 > plugins/AuthenticationApi/config/keys/hmac_secret.txt
cp config/.env.example config/.env
cp config/app_local.example.php config/app_local.php
vendor/bin/phpunit
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Generate keys for authentication examples:
mkdir -p plugins/AuthenticationApi/config/keys/1
openssl genrsa -out plugins/AuthenticationApi/config/keys/1/private.pem 2048
openssl rsa -in plugins/AuthenticationApi/config/keys/1/private.pem -outform PEM -pubout -out plugins/AuthenticationApi/config/keys/1/public.pem
openssl rand -base64 32 > plugins/AuthenticationApi/config/keys/hmac_secret.txt
openssl rand -base64 24 > plugins/AuthenticationApi/config/keys/hmac_secret.txt
```

Bring on local server:
Expand Down
6 changes: 3 additions & 3 deletions app/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
/*
* MixerApi/JwtAuth config
*/
Configure::write('MixerApi.JwtAuth', [
/*Configure::write('MixerApi.JwtAuth', [
'alg' => 'HS256',
'secret' => 'IMPiqE0iTvnbRgGfuq8ok1t0Q1JDwPrLbWsXA95nn5A=',
'secret' => file_get_contents(TESTS . 'hmac_secret.txt'),
'keys' => [
[
'kid' => '1',
'public' => file_get_contents(TESTS . 'public.pem'),
'private' => file_get_contents(TESTS . 'private.pem'),
]
]
]);
]);*/

0 comments on commit b483813

Please sign in to comment.