# TestAPI 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: 1. `php artisan mkdemodata` - Add demodata 2. `php artisan rmdemodata` - Reset and remove all demo data 3. `php artisan mkuser` - Add a user login (that can use the CRUD functions in the web app) 4. `php artisan rmuser` - Remove user 5. `php artisan mkapiadmin` - Designate an existing user that has the ability to add or remove live API keys to SmartDok 6. `php artisan rmapiadmin` - Remove API admin roles from an existing user