diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..accdc0bc1 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +### Pull Request Checklist (Feature Branch to `next`): + +- [ ] Ich habe die neuesten Änderungen aus dem `next` Branch in meinen Feature-Branch gemergt. +- [ ] Das Code-Review wurde abgeschlossen. +- [ ] Fachliche Tests wurden durchgeführt und sind abgeschlossen. diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 22ce2b1ba..4fb48fe6b 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -1,21 +1,16 @@ -# Workflow for deploying zmsapi PHP and Node.js static content to Pages -name: Deploy zmsapi static content to Pages +# Workflow for deploying API documentation to Pages +name: Deploy API Documentation to Pages on: - # Runs on pushes targeting the default branch (main) push: branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. concurrency: group: "pages" cancel-in-progress: false @@ -28,64 +23,61 @@ jobs: runs-on: ubuntu-latest steps: - # Step 1: Checkout the repository - name: Checkout uses: actions/checkout@v4 - # Step 2: Set up PHP environment - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' # Specify PHP version as per your requirement + php-version: '8.0' extensions: mbstring, json tools: composer - # Step 3: Install PHP dependencies for zmsapi - name: Install PHP dependencies run: | composer install --working-dir=zmsapi + composer install --working-dir=zmscitizenapi - # Step 4: Run PHP post-install scripts for zmsapi - name: Run PHP post-install scripts run: | cd zmsapi && bin/configure && composer run-script post-install-cmd && cd .. + cd zmscitizenapi && bin/configure && composer run-script post-install-cmd && cd .. - # Step 5: Set up Node.js environment - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '16' # Specify Node.js version as needed + node-version: '16' - # Step 6: Install Node.js dependencies for zmsapi - - name: Install Node.js dependencies for zmsapi + - name: Install Node.js dependencies run: | - cd zmsapi - npm install + cd zmsapi && npm install && cd .. + cd zmscitizenapi && npm install && cd .. - # Step 7: Build the project for zmsapi - - name: Build zmsapi + - name: Build projects run: | - cd zmsapi - npm run build + cd zmsapi && npm run build && cd .. + cd zmscitizenapi && npm run build && cd .. - # Step 8: Generate Swagger documentation for zmsapi - name: Generate Swagger documentation run: | cd zmsapi npm run doc npx swagger-cli bundle -o public/doc/swagger.json public/doc/swagger.yaml + cd .. + + cd zmscitizenapi + npm run doc + npx swagger-cli bundle -o public/doc/swagger.json public/doc/swagger.yaml + cd .. - # Step 9: Set up GitHub Pages for deployment - name: Setup Pages uses: actions/configure-pages@v5 - # Step 10: Upload the static content to GitHub Pages - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: '.' # Upload the entire repository, including the generated docs + path: '.' - # Step 11: Deploy to GitHub Pages - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/zmsadmin/src/Zmsadmin/Oidc.php b/zmsadmin/src/Zmsadmin/Oidc.php index b11e65462..8ee8fb657 100644 --- a/zmsadmin/src/Zmsadmin/Oidc.php +++ b/zmsadmin/src/Zmsadmin/Oidc.php @@ -23,34 +23,32 @@ public function readResponse( $state = $request->getParam("state"); $authKey = \BO\Zmsclient\Auth::getKey(); - // Log state validation attempt - error_log(json_encode([ + \App::$log->info('OIDC state validation', [ 'event' => 'oauth_state_validation', 'timestamp' => date('c'), 'provider' => \BO\Zmsclient\Auth::getOidcProvider(), 'application' => 'zmsadmin', 'state_match' => ($state == $authKey) - ])); + ]); if ($state == $authKey) { try { $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity(); $username = $workstation->getUseraccount()->id . '@' . \BO\Zmsclient\Auth::getOidcProvider(); - // Log workstation access with username - error_log(json_encode([ + \App::$log->info('OIDC workstation access', [ 'event' => 'oauth_workstation_access', 'timestamp' => date('c'), 'provider' => \BO\Zmsclient\Auth::getOidcProvider(), 'application' => 'zmsadmin', 'username' => $username, 'workstation_id' => $workstation->id ?? 'unknown' - ])); + ]); $departmentCount = $workstation->getUseraccount()->getDepartmentList()->count(); // Log department check with username - error_log(json_encode([ + \App::$log->info('OIDC department check', [ 'event' => 'oauth_department_check', 'timestamp' => date('c'), 'provider' => \BO\Zmsclient\Auth::getOidcProvider(), @@ -58,7 +56,7 @@ public function readResponse( 'username' => $username, 'department_count' => $departmentCount, 'has_departments' => ($departmentCount > 0) - ])); + ]); if (0 == $departmentCount) { return \BO\Slim\Render::redirect( @@ -76,38 +74,37 @@ public function readResponse( ); } catch (\Exception $e) { // Log workstation access error - error_log(json_encode([ + \App::$log->error('OIDC workstation error', [ 'event' => 'oauth_workstation_error', 'timestamp' => date('c'), 'provider' => \BO\Zmsclient\Auth::getOidcProvider(), 'application' => 'zmsadmin', 'error' => $e->getMessage(), 'code' => $e->getCode() - ])); + ]); throw $e; } } // Log invalid state - error_log(json_encode([ + \App::$log->error('OIDC invalid state', [ 'event' => 'oauth_invalid_state', 'timestamp' => date('c'), 'provider' => \BO\Zmsclient\Auth::getOidcProvider(), 'application' => 'zmsadmin' - ])); + ]); throw new \BO\Slim\Exception\OAuthInvalid(); } catch (\Exception $e) { - // Log any uncaught exceptions - error_log(json_encode([ + \App::$log->error('OIDC error', [ 'event' => 'oauth_error', 'timestamp' => date('c'), 'provider' => \BO\Zmsclient\Auth::getOidcProvider(), 'application' => 'zmsadmin', 'error' => $e->getMessage(), 'code' => $e->getCode() - ])); + ]); throw $e; } } diff --git a/zmsadmin/templates/block/emergency/emergency.twig b/zmsadmin/templates/block/emergency/emergency.twig index 59fc3d3eb..ac2ba3f62 100644 --- a/zmsadmin/templates/block/emergency/emergency.twig +++ b/zmsadmin/templates/block/emergency/emergency.twig @@ -7,10 +7,11 @@ data-state="clear" data-source="">

Notruf

+ {% if workstation.name %} - + {% endif %}