Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4943c99
refactor: update libs, references, uses (WIP)
romanetar Apr 26, 2024
10b5076
chore: add local docker support
smarcet Apr 29, 2024
fb7a487
chore: remove unused rabbitmq configuration
romanetar Apr 30, 2024
a8bc1c0
fix: rollback swift svc provider settings
romanetar Apr 30, 2024
a7aef36
feat(dependencies): Remove unused dependency fruitcake/laravel-cors
romanetar Apr 30, 2024
750679f
chore: fix composer.lock
smarcet May 11, 2024
712a914
chore: refactor swift League\Flysystem adapter to v3.x
smarcet May 12, 2024
9b50089
chore: updated dockerfile
smarcet May 15, 2024
ef9fea4
refactor: change collective HTML:: and Form:: helpers to custom
romanetar May 16, 2024
39496c3
fix: update instantiation of swift adapter on custom provider
smarcet May 24, 2024
57a55a5
chore: update sendgrid adapter lib
smarcet Jun 10, 2024
7ec1333
fix: Zend -> Laminas NS renaming
romanetar Jun 11, 2024
317d778
chore: fix base test migrations
smarcet Jun 11, 2024
032159b
chore: fix on unit tests
smarcet Jun 11, 2024
36b64a6
chore: fix OIDC protocol test suite
smarcet Jun 12, 2024
88338bb
chore: update push github action
smarcet Jun 12, 2024
4866ce3
chore: fix on OpenID tests
smarcet Jun 12, 2024
cb0ffcb
chore: replace hardocded values on github actions by env variables
smarcet Jun 12, 2024
a5f80f2
chore: updated remaining github workflows
smarcet Jun 12, 2024
9d85302
chore: store test output on artifact
smarcet Jun 12, 2024
a8dcf68
chore: upgrade LV9.x to LV10.X
smarcet Jun 12, 2024
2acebe7
chore: migrate deps to LV 11.x
smarcet Jun 13, 2024
bd2a321
chore: update github actions
smarcet Jun 13, 2024
e0d15b2
chore: fixed phpunit 11 tests
smarcet Jun 14, 2024
38f4bcb
fix: tx management
smarcet Jun 19, 2024
c311cbe
fix: doctrine transaction manager reconnection on server one away
smarcet Jun 21, 2024
da26552
chore: fixed unit tests
smarcet Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 52 additions & 5 deletions .github/workflows/nightly_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,59 @@ jobs:
unit-tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: smarcet/openstackid_test:v1.0
# Steps represent a sequence of tasks that will be executed as part of the job
env:
APP_ENV: testing
APP_DEBUG: true
APP_KEY: base64:4vh0op/S1dAsXKQ2bbdCfWRyCI9r8NNIdPXyZWt9PX4=
DEV_EMAIL_TO: smarcet@gmail.com
APP_URL: http://localhost
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: idp_test
DB_USERNAME: root
DB_PASSWORD: 1qaz2wsx
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
REDIS_DB: 0
REDIS_PASSWORD: 1qaz2wsx
REDIS_DATABASES: 16
SSL_ENABLED: false
SESSION_DRIVER: redis
PHP_VERSION: 8.3
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{env.DB_PASSWORD}}
MYSQL_DATABASE: ${{env.DB_DATABASE}}
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: 'Run Unit Tests'
run: cd / && ./tests.sh 2>&1 | tee /output.log
- name: Create Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-port: ${{env.REDIS_PORT}}
redis-password: ${{env.REDIS_PASSWORD}}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Install PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{env.PHP_VERSION}}
extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, sockets, gettext
- name: Install dependencies
uses: "ramsey/composer-install@v3"
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.PAT }}"} }'
- name: 'Run Tests'
run: |
./update_doctrine.sh
php artisan doctrine:migrations:migrate --no-interaction
php artisan db:seed --force
vendor/bin/phpunit --log-junit results.xml
- name: 'Upload Unit Test Output'
uses: actions/upload-artifact@v4
with:
Expand Down
69 changes: 58 additions & 11 deletions .github/workflows/pull_request_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,62 @@ jobs:
unit-tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: smarcet/openstackid_test:v1.0
# Steps represent a sequence of tasks that will be executed as part of the job
env:
APP_ENV: testing
APP_DEBUG: true
APP_KEY: base64:4vh0op/S1dAsXKQ2bbdCfWRyCI9r8NNIdPXyZWt9PX4=
DEV_EMAIL_TO: smarcet@gmail.com
APP_URL: http://localhost
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: idp_test
DB_USERNAME: root
DB_PASSWORD: 1qaz2wsx
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
REDIS_DB: 0
REDIS_PASSWORD: 1qaz2wsx
REDIS_DATABASES: 16
SSL_ENABLED: false
SESSION_DRIVER: redis
PHP_VERSION: 8.3
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{env.DB_PASSWORD}}
MYSQL_DATABASE: ${{env.DB_DATABASE}}
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: 'Run Unit Tests'
run: cd / && ./tests.sh ${{ github.event.pull_request.head.sha }} 2>&1 | tee /output.log
- name: 'Upload Unit Test Output'
uses: actions/upload-artifact@v4
with:
name: output
path: /output.log
retention-days: 5
- name: Create Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-port: ${{env.REDIS_PORT}}
redis-password: ${{env.REDIS_PASSWORD}}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Install PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{env.PHP_VERSION}}
extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, sockets, gettext
- name: Install dependencies
uses: "ramsey/composer-install@v3"
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.PAT }}"} }'
- name: 'Run Tests'
run: |
./update_doctrine.sh
php artisan doctrine:migrations:migrate --no-interaction
php artisan db:seed --force
vendor/bin/phpunit --log-junit results.xml
- name: 'Upload Unit Test Output'
uses: actions/upload-artifact@v4
with:
name: output
path: /output.log
retention-days: 5
67 changes: 54 additions & 13 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,70 @@
name: Unit Tests On Push

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
on: push

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "unit-tests"
unit-tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: smarcet/openstackid_test:v1.0
# Steps represent a sequence of tasks that will be executed as part of the job
env:
APP_ENV: testing
APP_DEBUG: true
APP_KEY: base64:4vh0op/S1dAsXKQ2bbdCfWRyCI9r8NNIdPXyZWt9PX4=
DEV_EMAIL_TO: smarcet@gmail.com
APP_URL: http://localhost
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: idp_test
DB_USERNAME: root
DB_PASSWORD: 1qaz2wsx
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
REDIS_DB: 0
REDIS_PASSWORD: 1qaz2wsx
REDIS_DATABASES: 16
SSL_ENABLED: false
SESSION_DRIVER: redis
PHP_VERSION: 8.3
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{env.DB_PASSWORD}}
MYSQL_DATABASE: ${{env.DB_DATABASE}}
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: 'Run Unit Tests'
run: cd / && ./tests.sh 2>&1 | tee /output.log
- name: Create Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-port: ${{env.REDIS_PORT}}
redis-password: ${{env.REDIS_PASSWORD}}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Install PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{env.PHP_VERSION}}
extensions: pdo_mysql, mbstring, exif, pcntl, bcmath, sockets, gettext
- name: Install dependencies
uses: "ramsey/composer-install@v3"
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.PAT }}"} }'
- name: 'Run Tests'
run: |
./update_doctrine.sh
php artisan doctrine:migrations:migrate --no-interaction
php artisan db:seed --force
vendor/bin/phpunit --log-junit results.xml
- name: 'Upload Unit Test Output'
uses: actions/upload-artifact@v4
with:
name: output
path: /output.log
path: results.xml
retention-days: 5
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ doc/build
Homestead.yaml
Homestead.json
.env
.env.testing
.env.*
storage/proxies
/public/assets/jquery-cookie/
/public/assets/crypto-js/
Expand Down Expand Up @@ -50,4 +50,4 @@ model.sql
/public/assets/*.txt
/.env.local
/.phpunit.cache/
docker-compose/mysql/model/*.sql
docker-compose/mysql/model/*.sql
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM php:7.4-fpm
FROM php:8.3-fpm

ARG DEBIAN_FRONTEND=noninteractive
ARG NVM_VERSION="v0.39.7"
ARG GITHUB_OAUTH_TOKEN
ARG XDEBUG_VERSION="xdebug-3.1.6"
ARG XDEBUG_VERSION="xdebug-3.3.2"

ENV NVM_VERSION=$NVM_VERSION
ENV NODE_VERSION="18.20.4"
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/ClientPublicKeyApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function _delete($owner_id, $public_key_id)
protected function getCreatePayloadValidationRules(): array
{
return [
'client_id' => 'required|integer',
'owner_id' => 'required|integer',
'kid' => 'required|text|max:255',
'active' => 'required|boolean',
'valid_from' => 'required|date_format:m/d/Y',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Kernel extends HttpKernel
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\SingleAccessPoint::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\ParseMultipartFormDataInputForNonPostRequests::class,
];

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Utils/Log/LaravelMailerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ protected function send($content, array $records):void
$message
->to($to)
->subject($subject)
->setBody($content, 'text/html')
->setFrom($this->from);
->html($content)
->from($this->from);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/OAuth2/OAuth2OTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use OAuth2\Requests\OAuth2AccessTokenRequestPasswordless;
use Utils\IPHelper;
use Utils\Model\Identifier;
use Zend\Math\Rand;
use Laminas\Math\Rand;

/**
* @ORM\Entity(repositoryClass="App\Repositories\DoctrineOAuth2OTPRepository")
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
if(!App::isLocal())
if (!App::isLocal())
URL::forceScheme('https');

$logger = Log::getLogger();
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function boot()
Event::listen(\Illuminate\Mail\Events\MessageSending::class, function($event){
$devEmail = env('DEV_EMAIL_TO', null);
if(in_array(App::environment(), ['local','dev','testing']) && !empty($devEmail)){
$event->message->setTo(explode(",", $devEmail));
$event->message->to(explode(",", $devEmail));
}
return true;
});
Expand Down
2 changes: 1 addition & 1 deletion app/Services/OAuth2/ClientCredentialGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use OAuth2\Models\IClient;
use OAuth2\OAuth2Protocol;
use OAuth2\Services\IClientCredentialGenerator;
use Zend\Math\Rand;
use Laminas\Math\Rand;
use DateTime;
use DateInterval;
/**
Expand Down
2 changes: 1 addition & 1 deletion app/Services/OAuth2/TokenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
use Utils\Services\IdentifierGenerator;
use Utils\Services\ILockManagerService;
use Utils\Services\IServerConfigurationService;
use Zend\Crypt\Hash;
use Laminas\Crypt\Hash;
use Exception;

/**
Expand Down
1 change: 1 addition & 0 deletions app/Services/UserActionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function addUserAction($user_id, $ip, $user_action, $realm = null, $user_
{
return $this->tx_service->transaction(function () use ($user_id, $ip, $user_action, $realm, $user_email) {

Log::debug(sprintf("UserActionService::addUserAction user %s action %s ip %s", $user_id, $user_action, $ip));
$action = new UserAction();
$action->setFromIp($ip);
$action->setUserAction($user_action);
Expand Down
Loading
Loading