From a8706454695c0088cb412e7ab4d7b2b0b1bfb251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge-Mikael=20Nordg=C3=A5rd?= Date: Fri, 20 Jun 2025 13:57:02 +0200 Subject: [PATCH] Updated readme --- README.md | 23 +++++++++++++++++++++-- app/Console/Commands/mkdemodata.php | 4 +--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 15f4734..eba13a6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ -# testapi +# TestAPI -This app, made with the Laravel 12 framework, is a simple CRUD and middleware application for testing and implementing solutions that need to connect with Visma SmartDok. Not production grade \ No newline at end of file +This app made with the Laravel 12 framework. It's main purpose is: + +1. Provide a CRUD interface to create, read, update, and delete test data in an environment that is a replica of Visma SmartDok +2. Serve that test data via an API in the exact same manner (excluding the data structure not needed for our purposes) that SmartDok does +3. Show how a middleware API pipeline can be used to filter traffic from Visma SmartDok's REST endpoint (see the smartdok live controller in `App\Http\Controllers\Api\SmartdokLiveController.php`). The thought here is to add code that filters the data based on the user's role definitions when they have authenticated and recieved a bearer token, so they do not get accesss to information they are not privy to retrieve (right now it just routes the json response from SmartDok through to the user). And also, make routines that check if there are sensitive information embedded that should not be there (for instance, a routine that checks if a real persons name is in the json reply from smartdok), and then notify designated auditors. This way the data can always be made sure to be GDPR compliant. + +This is **not** production grade software, the main focus of this package has been to facilitate a testing environment for fetching bogus and fictional data into other applications to test and implement integration to the main API. + +You can see a live version of this package running on https://testapi.outlands.no/ + +## Server backend commands + +All backend administration is done through console commands and artisan: + +`php artisan mkdemodata` - Add demodata +`php artisan rmdemodata` - Reset and remove all demo data +`php artisan mkuser` - Add a user login (that can use the CRUD functions in the web app) +`php artisan rmuser` - Remove user +`php artisan mkapiadmin` - Designate an existing user that has the ability to add or remove live API keys to SmartDok +`php artisan rmapiadmin` - Remove API admin roles from an existing user \ No newline at end of file diff --git a/app/Console/Commands/mkdemodata.php b/app/Console/Commands/mkdemodata.php index 946fc29..3a299e6 100644 --- a/app/Console/Commands/mkdemodata.php +++ b/app/Console/Commands/mkdemodata.php @@ -37,9 +37,7 @@ class MkDemoData extends Command * * @return int */ - public function handle() - { - // Define arrays for random selection (fill these later) + public function handle(){ $profileNames = [ 'first_names' => [ "Aksel", "Alma", "Andreas", "Anna", "Arne", "Aurora", "Benedicte", "Benjamin", "Bjørn", "Camilla",