diff --git a/.env b/.env
index 6f87e0eb..308e3a37 100644
--- a/.env
+++ b/.env
@@ -1,6 +1,6 @@
##################################################
-#
-# General settings for your component
+#
+# General settings for your component
#
##################################################
@@ -8,19 +8,45 @@
# Enviroment settings
##################################################
-# Depracticed, now set as CONTAINER_PROJECT_NAME
+# The shortcode for this component, should be a small set of letters reprecentint the application
APP_NAME=vtc
-# Do you want to dsiplay the symfony debug toolbar?
+# The Full title of the application
+APP_TITLE=Verzoek Type Catalogus
+# The current version of the application
+APP_VERSION=V.0.1
+# Do you want to display the symfony debug toolbar?
APP_DEBUG=1
# What is the enviroment type you want to use for local production? (choose between dec,stag,prod, acce or test)
APP_ENV=dev
+# We use a build to tag images, this is swithced to the version on master and to env on other branches
+APP_BUILD=dev
+# The description for this api
+APP_DESCRIPTION='Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.'
+
+# The urls on wich this api is available
+TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
+TRUSTED_HOSTS=^(.+\.)?conduction\.nl$|^(.+\.)?huwelijksplanner\.online$|^(.+\.)?larping\.eu$|^(.+\.)?common-ground\.nl$|^(.+\.)?trouwplanner\.online$|^(.+\.)?zaakonline\.nl$|localhost
+
+##################################################
+# Orgization details
+##################################################
+
+# The following details describe your organisations and are used for both certificate creation and common-ground.dev
+
+ORGANIZATION_NAME=Conduction
+ORGANIZATION_EMAIL_ADDRESS=info@conduction.nl
+ORGANIZATION_COUNTRY_NAME=Netherlands
+ORGANIZATION_STATE=Noord-Holland
+ORGANIZATION_LOCALITY=Amsterdam
+ORGANIZATION_UNIT_NAME=Common-Ground
##################################################
# Documentation settings
##################################################
-APP_DEMO=dev
-APP_REPRO=dev
+APP_DOMAIN=conduction.nl
+APP_DEMO=vtc.zaakonline.nl
+APP_REPRO=https://github.com/ConductionNL/verzoektypecatalogus
##################################################
# Docker settings
@@ -29,36 +55,54 @@ APP_REPRO=dev
CONTAINER_REGISTRY_BASE=docker.io/conduction
CONTAINER_PROJECT_TITLE=Verzoek Type Catalogus
CONTAINER_PROJECT_NAME=vtc
-CONTAINER_PROJECT_VERSION=V.0.1
-APP_NAME=pc
-## Eviroment Setup
+CONTAINER_REPRO=https://hub.docker.com/repository/docker/conduction/vtc-php
##################################################
-# Websub settings
+# Notifcation settings
##################################################
-WEBSUB_PROVIDER=sasd
-WEBSUB_AUTHORIZATION=sasd
+NOTIFICATION_ENABLED=falsedxfddxf
+NOTIFICATION_PROVIDER=sasdasd
+NOTIFICATION_ENABLED_AUTHORIZATION=sasd
##################################################
# Authorization settings
##################################################
+AUTH_ENABLED=false
AUTH_PROVIDER=sasd
AUTH_AUTHORIZATION=sasd
##################################################
-# NLX Setup, read more at https://docs.nlx.io/get-started/#
+# Auditrail settings
+##################################################
+
+AUDITTRAIL_ENABLED=false
+
+##################################################
+# Healthcheck settings
+##################################################
+
+HEALTH_ENABLED=false
+
+##################################################
+# Archive settings
+##################################################
+
+ARCHIVE_ENABLED=false
+
+##################################################
+# NLX Setup, read more at https://docs.nlx.io/get-started/#
##################################################
# Do you want to provide an nlx outway? (option for your component to reach nlx services)
-NLX_OUTWAY=true
+NLX_OUTWAY=true
# Do you want to provice an nlx inway (option for nlx services to reach your api)
-NLX_INWAY=false
+NLX_INWAY=false
# NLX Certification Details
-NLX_COUNTRY_NAME=Netherlands
+NLX_COUNTRY_NAME=Netherlands
NLX_STATE=Noord-Holland
NLX_LOCALITY=Amsterdam
NLX_ORGANIZATION_NAME=Conduction
diff --git a/.github/deploy.yml b/.github/deploy.yml
new file mode 100644
index 00000000..3bd4c3c9
--- /dev/null
+++ b/.github/deploy.yml
@@ -0,0 +1,4 @@
+# View examples and documentation at https://deliverybot.dev/docs/
+production:
+ environment: production
+ production_environment: true
diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml
new file mode 100644
index 00000000..3be28c02
--- /dev/null
+++ b/.github/workflows/dockerimage.yml
@@ -0,0 +1,132 @@
+name: Docker Image CI
+
+on:
+ pull_request:
+ branches:
+ - master
+ - staging
+ - development
+ push:
+ branches:
+ - master
+ - staging
+ - development
+
+jobs:
+
+ build:
+
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - name: Pulling old images, if any
+ run: docker-compose pull --ignore-pull-failures
+ - name: Setting APP_NAME
+ run: |
+ export NAME=$(grep APP_NAME= .env | cut -d '=' -f2)
+ echo ::set-env name=APP_NAME::$NAME
+ - name: Print app name
+ run: echo "APP_NAME = $APP_NAME"
+ - name: Setting APP_ENV to dev
+ run: |
+ echo ::set-env name=APP_ENV::dev
+ echo ::set-env name=APP_BUILD::dev
+ echo "set APP_ENV to $APP_ENV"
+ - name: Setting APP_ENV to prod
+ if: contains( github.ref, 'master' ) || contains( github.base_ref, 'master' )
+ run: |
+ echo ::set-env name=APP_ENV::prod
+ echo "set APP_ENV to $APP_ENV"
+ - name: Set APP_BUILD to APP_VERSION
+ if: contains( github.ref, 'master' )
+ run: |
+ export VERSION=$(grep APP_VERSION= .env | cut -d '=' -f2)
+ echo ::set-env name=APP_BUILD::$VERSION
+ echo "set APP_BUILD to $APP_BUILD"
+ - name: Setting APP_ENV to stag
+ if: contains( github.ref, 'staging' ) || contains( github.base_ref, 'staging' )
+ run: |
+ echo ::set-env name=APP_ENV::stag
+ echo ::set-env name=APP_BUILD::stag
+ echo "set APP_ENV to $APP_ENV"
+ - name: Print definitive APP_ENV
+ run: echo "APP_ENV is now $APP_ENV"
+ - name: Build the Docker image
+ run: docker-compose build --pull --build-arg APP_ENV=$APP_ENV --build-arg APP_BUILD=$APP_BUILD
+ - name: Run the docker image
+ run: docker-compose up -d
+ - name: Taking some sleep
+ run: sleep 100
+ - name: Check if all containers are running
+ run: docker ps
+ - name: Dumping the logs
+ run: docker-compose logs
+ - name: Security Checks
+ run: docker-compose exec -T php composer req sensiolabs/security-checker
+ - name: Database Update
+ run: docker-compose exec -T php bin/console doctrine:schema:update --force
+ - name: Database Check
+ run: docker-compose exec -T php bin/console doctrine:schema:validate
+ - name: Chores
+ run: docker-compose down
+ - name: Login to DockerHub Registry
+ id: dockerhub-login
+ run: |
+ if [ "${{ secrets.DOCKERHUB_PASSWORD }}" != "" ] && [ "${{ secrets.DOCKERHUB_USERNAME }}" != "" ]; then
+ echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
+ echo "##[set-output name=success;]true"
+ else
+ echo "##[set-output name=success;]false"
+ fi
+ - if: steps.dockerhub-login.outputs.success == 'true'
+ name: Push to docker hub
+ run: docker-compose push
+ - name: Create kube config
+ id: kubeconfig
+ if: contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )
+ run: |
+ if [ "${{ secrets.KUBECONFIG }}" != "" ]; then
+ printf "${{ secrets.KUBECONFIG }}" > kubeconfig.yaml
+ echo "##[set-output name=success]true"
+ else
+ echo "##[set-output name=success]false"
+ fi
+ - name: Set correct helm version
+ if: (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true'
+ run: helm init --upgrade --kubeconfig="kubeconfig.yaml"
+ - name: Deploy through helm
+ id: helm-install
+ if: (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true'
+ run: helm upgrade $APP_NAME-$APP_ENV ./api/helm --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV --set settings.env=$APP_ENV,settings.debug=1
+ - name: Install through helm
+ if: failure()
+ run: helm install --name $APP_NAME-$APP_ENV ./api/helm --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV --set settings.env=$APP_ENV,settings.debug=1
+ - name: Rollout new containers
+ if: (contains( github.ref, 'master' ) || contains( github.ref, 'staging' ) || contains( github.ref, 'development' )) && steps.kubeconfig.outputs.success == 'true' && success()
+ run: |
+ kubectl rollout restart deployment/$APP_NAME-php --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV
+ kubectl rollout restart deployment/$APP_NAME-nginx --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV
+ kubectl rollout restart deployment/$APP_NAME-varnish --kubeconfig="kubeconfig.yaml" --namespace=$APP_ENV
+ - name: Export release code
+ if: (success() || failure())
+ id: releasecode
+ run: |
+ export RELEASE=$APP_BUILD-$(git rev-parse --short $GITHUB_SHA)
+ echo "##[set-output name=releasename]$RELEASE"
+ - name: Print release name
+ if: (success() || failure())
+ run: echo $RELEASENAME
+ env:
+ RELEASENAME: ${{ steps.releasecode.outputs.releasename }}
+ - name: Create Release
+ if: contains( github.ref, 'master' ) && steps.kubeconfig.outputs.success == 'true' && ( success() || failure() )
+ id: create_release
+ uses: actions/create-release@v1
+ continue-on-error: true
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
+ with:
+ tag_name: ${{ steps.releasecode.outputs.releasename }}
+ release_name: ${{ steps.releasecode.outputs.releasename }}
+ draft: false
+ prerelease: false
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 00000000..ced0c1eb
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,375 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $PROJECT_DIR$/api/composer.json
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1573726460744
+
+
+ 1573726460744
+
+
+
+
+
+ 1573726496674
+
+
+
+ 1573726496674
+
+
+ 1573733386819
+
+
+
+ 1573733386819
+
+
+ 1573735733551
+
+
+
+ 1573735733551
+
+
+ 1574770855136
+
+
+
+ 1574770855136
+
+
+ 1575279662940
+
+
+
+ 1575279662940
+
+
+ 1575279748074
+
+
+
+ 1575279748074
+
+
+ 1575280067186
+
+
+
+ 1575280067186
+
+
+ 1575280181182
+
+
+
+ 1575280181182
+
+
+ 1575281141670
+
+
+
+ 1575281141670
+
+
+ 1575282235015
+
+
+
+ 1575282235015
+
+
+ 1575282356507
+
+
+
+ 1575282356507
+
+
+ 1575282386363
+
+
+
+ 1575282386363
+
+
+ 1575282997667
+
+
+
+ 1575282997667
+
+
+ 1575283562491
+
+
+
+ 1575283562491
+
+
+ 1575283747919
+
+
+
+ 1575283747919
+
+
+ 1575283918851
+
+
+
+ 1575283918851
+
+
+ 1575379056373
+
+
+
+ 1575379056373
+
+
+ 1575383847583
+
+
+
+ 1575383847583
+
+
+ 1575386337848
+
+
+
+ 1575386337849
+
+
+ 1575388288073
+
+
+
+ 1575388288074
+
+
+ 1575443809720
+
+
+
+ 1575443809721
+
+
+ 1575443827717
+
+
+
+ 1575443827717
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DESIGN.md b/DESIGN.md
index edcb7692..cffb8595 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -1,60 +1,133 @@
-# Design Considerations
+# Design Considerations as Proposal
+
+Welcome, you are currently viewing the design decisions for the proto component. The proto component aims to provide a framework for the quick development of production apis for the commonground project.
+
+*Index*
+- [The European factor](#the-european-factor)
+- [On standards and standardisation](#on-standards-and-standardization)
+- [NL API Strategie](#nl-api-strategie)
+
+*Design Choices*
+- [NLX](#nlx)
+- [English](#english)
+- [Fields](#fields)
+- [Search](#search)
+- [Queries](#queries)
+- [Extending](#extending)
+- [Time travel](#timetravel)
+- [Archivation](#archivation)
+- [Audit trail](#audittrail)
+- [Health checks](#healthchecks)
+- [Notifications](#notifications)
+- [Authentication](#authentication)
+- [Authorization](#authorization)
+- [Ordering](#ordering)
+- [Translations](#translations)
+- [Errors](#errors)
+- [Arrays](#arrays)
+- [Filtering](#filtering)
+
+*Implementation choices*
+- [Api Versioning](#api-versioning)
+- [Environments and name spacing](#environments-and-namespacing)
+- [Domain Build-up and routing](#domain-build-up-and-routing)
+- [Container Setup](#container-setup)
-This component was designed inline with the [NL API Strategie](https://docs.geostandaarden.nl/api/API-Strategie), [NORA](https://www.noraonline.nl/wiki/Standaarden), [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/index), [commonground principles](https://vng.nl/onderwerpenindex/bestuur/samen-organiseren-2019/common-ground) and international standards.
-
-The spefic goal of this component is to provide a common architecture for common ground components as such the common ground principles are leading in design choices, and within those principles technological invoation and international complyancy is deemd most inportant. WE DO NOT WANT TO MAKE CONSESIONS TO CURRENT INFRASTRUCTURE. As such the component might differ on [NL API Strategie](https://docs.geostandaarden.nl/api/API-Strategie), [NORA](https://www.noraonline.nl/wiki/Standaarden), [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/index) and other standards if they are deemed incompatible or out of line with international standards.
The European factor
-------
-The proto-component isn't just a Dutch Component, it is in easance a dutch translation of european components, nowhere is this more obvius than in the core code. Our component is based on [API Platform](https://api-platform.com/) an API specific version of the symfony framework. This framework is build by the lovely people of []() and is build with support of the Euroean Commision trough the [EU-FOSSA Hackathon](https://ec.europa.eu/info/news/first-eu-fossa-hackathon-it-happened-2019-may-03_en) and Digital Ocean trough [Hacktoberfest].(https://hacktoberfest.digitalocean.com/).
-
-But it dosn't just end there the [varnish container](https://hub.docker.com/r/eeacms/varnish/) that we use to speed up the API responce it build and maintained by [EEA]() (The European Environment Agency) and the development team at conduction itself is attached to the [Odyssey program](https://www.odyssey.org/) and originated from the [startupinresidence](https://startupinresidence.com/) program.
+The proto-component isn't just a Dutch Component, it is in essence a Dutch translation of European components, nowhere is this more obvious than in the core code. Our component is based on [API Platform](https://api-platform.com/) an API specific version of the symfony framework. This framework is build by the lovely people of [Les Tilleuls](https://les-tilleuls.coop/en) and is build with support of the European Commission trough the [EU-FOSSA Hackathon](https://ec.europa.eu/info/news/first-eu-fossa-hackathon-it-happened-2019-may-03_en) and Digital Ocean trough [Hacktoberfest](https://hacktoberfest.digitalocean.com/).
-So you could say that both change and a european perspective is in our blood.
+But it doesn't just end there. The [varnish container](https://hub.docker.com/r/eeacms/varnish/) that we use to speed up the API response is build and maintained by [EEA]() (The European Environment Agency) and the development team at conduction itself is attached to the [Odyssey program](https://www.odyssey.org/) and originated from the [startupinresidence](https://startupinresidence.com/) program.
+So you could say that both change and a European perspective is in our blood.
-Domain Build-up and routing
+On standards and standardization
-------
-By convention the component assumes that you follow the common ground domain name build up, meaning {enviroment}.{component}.{rest of domain}. That means that only the first two url parts are used for routing. It is also assumed that when no envirment is supplied the production enviroment should be offerd E.g. a propper domain for the production API of the verzoeken registratie component would be prod.vrc.zaakonline.nl but it should also be reachable under vrc.zaakonline.nl. The proper location for the development enviroment shoud always be dev.vrc.zaakonlin.nl
+The specific goal of the proto component (which this current code base is a version of) is to provide a common architecture for common ground components. As such the common ground principles are leading in design choices, and within those principles international compliancy and technological invocation is deemed most important. **We do not want to make concessions to the current infrastructure.** As such the component might differ on [NL API Strategie](https://docs.geostandaarden.nl/api/API-Strategie), [NORA](https://www.noraonline.nl/wiki/Standaarden), [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/index) and or other standards if they are deemed incompatible or out of line with (inter)national standards and or good practices.
-Enviroments and namespacing
--------
-We assume that for that you want to run several enviroments for development purposes. We identify the following namespaces for support.
-- prod (Production)
-- acce (Acceptation)
-- stag (Staging)
-- test (Testing)
-- dev (Development)
+Unfortunately (inter)national standards can be conflicting. We therefore prioritize standards on several grounds
-Becouse we base the commonground infastructure on kubernetes, and we want to keep a hard sepperation between enviroment we also assume that you are using your enviroment as a namespace
+- International is put before local
+- Standards carried by a standard organization (like ISO, W3C etc) at put before floating standards (like RFC's) wichs are put before industry standards, good practices and so on.
-Symfony libary managment gives us the optoin to define the libbarys on a per envirmoent base, you can find that definition in the [bundle config](api/config/bundles.php)
+So if for instance a **local** standard is out of line with an **international** good practice we follow the international good practice.
+
+### Commonground specific standards
+
+This component was designed in line with the [NL API Strategie](https://docs.geostandaarden.nl/api/API-Strategie), [NORA](https://www.noraonline.nl/wiki/Standaarden), [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/index), [commonground principles](https://vng.nl/onderwerpenindex/bestuur/samen-organiseren-2019/common-ground).
+
+## NL API Strategie
+
+The [NL API Strategie](https://docs.geostandaarden.nl/api/API-Strategie) takes a special place in this component, it is designed as a set of guidelines for API's for the Dutch landscape. As such we follow it as close as possible. It dos however contains inconsistencies with both international standards and good practices. On those items we do not follow the norm but consider it our duty to try to change the norm.
+
+** We implement **
+
+api-01, api-02, api-03, api-05, api-06, api-10, api-11, api-12, api-13,api-14, api-16, api-18, api-19, api-20, api-21, api-22, api-23, api-24, api-25, api-26, api-27, api-28, api-29, api-30, api-33, api-34, api-35, api-42
+
+** We want to implement **
+- [api-14](https://docs.geostandaarden.nl/api/API-Strategie/#api-14) Use OAuth 2.0 for authorization
+
+** We do not implement **
+
+- [api-04](https://docs.geostandaarden.nl/api/API-Strategie/#api-04) Define interfaces in Dutch unless there is an official English glossary (see [english](#english))
+- [api-09](https://docs.geostandaarden.nl/api/API-Strategie/#api-09) Implement custom representation if supported (see [fields](#fields))
+- [api-17](https://docs.geostandaarden.nl/api/API-Strategie/#api-17) Publish documentation in Dutch unless there is existing documentation in English or there is an official English glossary (see [english](#english))
+- [api-31](https://docs.geostandaarden.nl/api/API-Strategie/#api-31) Use the query parameter sorteer to sort (see [ordering](#ordering))
+- [api-32](https://docs.geostandaarden.nl/api/API-Strategie/#api-32) Use the query parameter zoek for full-text search (see [search](#search))
+- [api-36](https://docs.geostandaarden.nl/api/API-Strategie/#api-36) Provide a POST endpoint for GEO queries (see [queries](#queries))
+- [api-37](https://docs.geostandaarden.nl/api/API-Strategie/#api-37) Support mixed queries at POST endpoints available (see [queries](#queries))
+- [api-38](https://docs.geostandaarden.nl/api/API-Strategie/#api-38) Put results of a global spatial query in the relevant geometric context (see [queries](#queries))
-Besides the API envormiments the component also ships with aditional tools/enviroments but those are not meant to be deployed
-- client (An react client frontend)
-- admin ( An read admin interface)
-On the local development docker deploy the client enviroment is used as default in stead of the production version of the api.
+** We doubt or haven’t made a choice yet about**
-Loging Headers (NLX Audit trail)
+- [api-15](https://docs.geostandaarden.nl/api/API-Strategie/#api-15) Use PKI overheid certificates for access-restricted or purpose-limited API authentication
+- [api-39](https://docs.geostandaarden.nl/api/API-Strategie/#api-39) Use ETRS89 as the preferred coordinate reference system (CRS)
+- [api-40](https://docs.geostandaarden.nl/api/API-Strategie/#api-40) Pass the coordinate reference system (CRS) of the request and the response in the headers
+- [api-41](https://docs.geostandaarden.nl/api/API-Strategie/#api-41) Use content negotiation to serve different CRS
+
+NLX
-------
-@todo update, a reaction about this has been given by the NLX team.
+We implement the [NLX system](https://docs.nlx.io/understanding-the-basics/introduction/) as part of the basic commonground infrastructure, as such nlx headers are used in the internal logging.
+The following X-NLX headers have been implemented for that reason `X-NLX-Logrecord-ID`,`X-NLX-Request-Process-Id`,`X-NLX-Request-Data-Elements` and `X-NLX-Request-Data-Subject`, these are tied to the internal audit trail (see audit trail for more information), and `X-Audit-Toelichting` (from the ZGW APIs) is implemented as `X-Audit-Clarification`. We do not use other NLX headers since they (conform to the [NLX schema](https://docs.nlx.io/reference-information/transaction-log-headers/)) wil not reach the provider.
-We inherit a couple of headers from the transaction logging within the [NLX schema](https://docs.nlx.io/further-reading/transaction-logs/), we strongly discurage the use of the `X-NLX-Request-Data-Subject` header as it might allow private data (such as BSN's) to show up in logging.
+We strongly discourage the use of the `X-NLX-Request-Data-Subject` header as it might allow private data (such as BSNs) to show up in logging.
-__solution__
-The follwoing X-NLX headers have been implemented `X-NLX-Logrecord-ID`,`X-NLX-Request-Process-Id`,`X-NLX-Request-Data-Elements` and `X-NLX-Request-Data-Subject`, these are tied to the internal audit trail (see audit trail for more information), and `X-Audit-Toelichting` (from the ZGW API's) is implemented as `X-Audit-Clarification`
+Please note that the use of nlx is optional. The component can be used without NLX. In that case set `X-NLX-Logrecord-ID` to false and provide (the normaly ignored) fields `X-NLX-Requester-User-Id`, `X-NLX-Request-Application-Id`, `X-NLX-Request-Subject-Identifier`, `X-NLX-Requester-Claims` and `X-NLX-Request-User` as if you are making an NLX call. This provides the API with enough credentials to make an complete audit trail. It also provides an easy implementation route to NLX since the only thing that would need to be changed at a later time is making you call to an nlx outway instead of the API directly.
-Api versioning
+English
-------
-As per [landelijke API-strategie.](https://geonovum.github.io/KP-APIs/#versioning) major versions in endpoint minor versions in header, for this the `API-Version` is used (instead of the `api-version` header used in haal centraal)
+The [NL API Standard](https://geonovum.github.io/KP-APIs/#api-04-define-interfaces-in-dutch-unless-there-is-an-official-english-glossary) describes that there is a preference for Dutch in API documentation.
+
+> Define resources and the underlying entities, fields and so on (the information model ad the external interface) in Dutch. English is allowed in case there is an official English glossary.
+
+We view this as a breach with good coding practice and international coding standards, all documentation and code is therefore supplied in English. We do however provide translation (or i18n) support.
Fields
-------
A part of the [haal centraal](https://raw.githubusercontent.com/VNG-Realisatie/Haal-Centraal-BRP-bevragen/master/api-specificatie/Bevraging-Ingeschreven-Persoon/openapi.yaml) the concept of field limitations has been introduced its general purpose being to allow an application to limit the returned fields to prevent the unnecessary transportation of (private) data. In the [NL API Strategie](https://github.com/VNG-Realisatie/Haal-Centraal-BRP-bevragen/blob/master/features/fields.feature) this has been implemented as a parameter consisting of comma separated values. However the normal web standard for optional lists (conform w3c form standards) is an array.
+Search
+-------
+As part of [api-32](https://docs.geostandaarden.nl/api/API-Strategie/#api-32) a `zoeken` query has been introduced that can handle wildcards. This breaks best practice, first of allest practice is a `search` query parameter (see also the nodes on [English](#english)). Secondly wildcards are a sql concept, not a webconcept, they are also a rather old concept severely limiting the search options provided. Instead the [regular expression standard](https://en.wikipedia.org/wiki/Regular_expression) should be used.
+
__solution__
-The fields parameter and functionality has been implemented as an array
+We implement a `search` query parameter on resource collections, that filters with regex.
+
+Queries
+-------
+In several examples of the nl api strategie we see query parameters being attached to post requests. This is unusual in the sence that sending query strings along with a post is considered bad practice (because query parameters end up as part of an url and are therefore logged by servers). But it is technically possible folowing RFC 3986. The real pain is that in the NL api-stratgie the POST requests seems to be used to search, ot in other words GET data. This is where compliance with HTTP (1.1) breaks.
+
+__solution__
+We do not implement a query endpoint on post requests.
+
+Api Versioning
+-------
+As per [landelijke API-strategie.](https://geonovum.github.io/KP-APIs/#versioning) we provide/ask major versions in the endpoint and minor versions in header, for this the `API-Version` is used (instead of the `api-version` header used in haal centraal)
+
+__solution__
+We implement both endpoint and header versioning
Extending
-------
@@ -65,64 +138,92 @@ The extend parameter has been implemented as an array
Archivation
-------
-In line with the extending and fields principle whereby we only want resources that we need it was deemed, nice to make a sub resource of the archivation properties. This also results in a bid cleaner code.
+There is a need (by law) for archivation, meaning that we should only keep resources for a fixed amount of time and delete them thereafter. In line with the extending and fields principle whereby we only want resource properties that we need when we needed, it is deemed good practice make a sub resource of the archivation properties. For the archivation properties the [zgw](https://zaken-api.vng.cloud/api/v1/schema/#operation/zaak_list) is followed and translated to englisch.
+
+
+```json
+{
+ "id": "e2984465-190a-4562-829e-a8cca81aa35d",
+ "nomination": "destroy",
+ "action_date": "2019-11-25T07:26:54Z",
+ "status": "to_be_archived",
+}
+```
+
+This gives us an interesting thought, according to [NL API Strategie](https://docs.geostandaarden.nl/api/API-Strategie/#api-10-implement-operations-that-do-not-fit-the-crud-model-as-sub-resources) sub resources should have their own endpoint. Therefore we could use a archive sub of a different resource for archivation rules e.g. /zaken/{uuid}/archivation for a verzoek. This in itself leads credence to the thought that archivation should have its own central crud api.
Audittrail
-------
-@todo this needs to be implemented
-For notifications we use the base mechanism as provided by [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/audit-trail) but we differ on insight into the data that should be returned and feel that the international standard [RFC 3881](https://tools.ietf.org/html/rfc3881) should have been followed here.
+For audittrail we use the base mechanism as provided by [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/audit-trail), we do however diver on some key point,
+- Personal data should never be part of a log, therefore only the user id with the client should be logged (instead of the name)
+- Besides an endpoint per resource there should be a general enpoint to search all audit trials of a component
+- [Time travel](#timetravel) in combination with objects versioning makes the return of complete objects unnecessary. But an audit rail endpoint should support the [extend](#extending) functionality to provide the option of obtaining complete objects.
+
__solution__
-In compliance with [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/audit-trail) each individual object should support an /audittrail endpoint. You can look into the [tutorial](TUTORIAL.md) for specifications on how to activate an audit trail for a given object. However, instead of the values mention in the vng.cloud design we follow [RFC 3881](https://tools.ietf.org/html/rfc3881) for the return values. And we give NLX values precedence if provided.
+In compliance with [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/audit-trail) each individual object should support an /audittrail endpoint. You can look into the [tutorial](TUTORIAL.md) for specifications on how to activate an audit trail for a given object.
+
+Healthchecks
+-------
+From [issue 154](https://github.com/VNG-Realisatie/huwelijksplanner/issues/154)
+
+For healthchecks we use the health-json principle (or json-health to stay in line with json-ld and json-hal). This means the any endpoint `should` be capable of providing health information concerning that endpoint and services behind it.
+
+__solution__
+The use of a `Content-Type: application/health+json` header returns an health json schema.
+
Notifications
-------
-@todo this needs to be implemented
-For notifications we do not use the current [ZGW standard](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/notificaties) since we deem it insecure to send properties or data objects along with a notification. This is a potential security breach explained [here](https://github.com/VNG-Realisatie/gemma-zaken/issues/1427#issuecomment-549272696). It also doesn’t follow the [web standard](https://www.w3.org/TR/websub/). Instead we are developing our own subscriber service that is tailored for the NLX / VNG environment and based on current web standards [here]().
+For notifications we do not YET use the current [ZGW standard](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/notificaties) since there is an [dicusion](https://github.com/VNG-Realisatie/gemma-zaken/issues/1427#issuecomment-549272696) about the possible insecurity of sending properties or data objects along with a notification. It also doesn’t follow the [web standard](https://www.w3.org/TR/websub/). We wait for the conclusion of that discussion before making an implementation.
+
+__solution__
+In compliance with [w3.org](https://www.w3.org/TR/websub/) each endpoint `should` returns an header containing an subscription url. That can be used in accordance with the application to subscribe to both individual objects as collections whereby collections serve as 'kanalen'. We aim to implement the ZGW notificatie component, but feel that further features on that component would be required to make to be fully supported. We will supply feature requests per issue to support this effort.
+
+Authentication
+-------
__solution__
-In compliance with [w3.org](https://www.w3.org/TR/websub/) each endpoint returns an header containing an subscribtion url. That can be used in acordanse with the application to subscribe to both individual objects as collections. whereby collections serve as 'kanalen'.
-Scopes, Authentication and Authorization
+Authorization
-------
-@todo this needs to be implemented
-We implement user scopes as per [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/autorisatie-scopes) standard. But see problems with how the scopes are defined and named, and consider the general setup to be to focused on ZGW (including Dutch naming, zgw specific fields like maxVertrouwlijkheid and a lack of CRUD thinking). There is a further document concerning [Authentication and Authorization](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/authenticatie-autorisatie) that details how we should authenticate users and give them scopes. We agree with the principles of the document on application based authorization and the use of JWT tokens. But disagree on some key technical aspect. Most important being that the architecture doesn't take into consideration the use of one component by several organizations
+We implement user scopes as per [vng.cloud](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/autorisatie-scopes) standard. But see problems with how the scopes are defined and named, and consider the general setup to be to focused on ZGW (including Dutch naming, zgw specific fields like maxVertrouwlijkheid and a lack of CRUD thinking). There is a further document concerning [Authentication and Authorization](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/authenticatie-autorisatie) that details how we should authenticate users and give them scopes. We agree with the principles of the document on application based authorization and the use of JWT tokens. But disagree on some key technical aspect. Most important being that the architecture doesn't take into consideration the use of one component by several organizations at once. Or scopes per property.
__solution__
-No solution as of yet, so there is no implementation of Authorization or Scopes. We might build a new Authorization Component in the long run.
+No solution as of yet, so there is no implementation of Authorization or Scopes. We aim to implement the ZGW authorisatie component, but feel that further features on that component would be required to make to be fully supported. We will supply feature requests per issue to support this effort.
Timetravel
-------
A part of the [haal centraal](https://raw.githubusercontent.com/VNG-Realisatie/Haal-Centraal-BRP-bevragen/master/api-specificatie/Bevraging-Ingeschreven-Persoon/openapi.yaml) the concept of timetravel has been introduced, as in getting the version of an object as it was on a given date. For this the `geldigop` [see the docs](file:///C:/Users/ruben/Desktop/doc_gba_historie.html#operation/getBewoningen) header is used. In addition the `geldigvan` and `geldigtot` are introduced as collection filters.
-The commonground proto componant natively supports time traveling on all entities that are annotaded with the @Gedmo\Loggable, this is done by adding the ?validOn=[date] query to a request, date can either be a datetime or datedatime string. Any value supported by php's [strtotime()](https://www.php.net/manual/en/function.strtotime.php) is supported. Keep in mind that this returns the entity a as it was valid on that time or better put, the last changed version BEFORE that moment. To get a complete list of all changes on a item the ?showLogs=true quarry can be used.
+The commonground proto componant natively supports time traveling on all resources that are annotaded with the @Gedmo\Loggable, this is done by adding the ?validOn=[date] query to a request, date can either be a datetime or datedatime string. Any value supported by php's [strtotime()](https://www.php.net/manual/en/function.strtotime.php) is supported. Keep in mind that this returns the entity a as it was valid on that time or better put, the last changed version BEFORE that moment. To get a complete list of all changes on an item the [/audittrail](#Audittrail
+) endpoint can be used.
__solution__
-In compliance with [schema.org](https://schema.org/validFrom) `geldigop`,`geldigvan` and `geldigtot` are implemented as `validOn`,`validFrom` and `validUntil`. And can be used a query parameters on colelction operations.
+In compliance with [schema.org](https://schema.org/validFrom) `geldigop`,`geldigvan` and `geldigtot` are implemented as `validOn`,`validFrom` and `validUntil`. And can be used a query parameters on collection operations/
-Additionally `validOn` can be used on a single object get request to get the version of that object on a given date, a 404 is returned if no version of that object can be given for that date
+Additionally `validOn` can be used on a single object get request to get the version of that object on a given date, a 404 is returned if no version of that object can be given for the given date
-Ordering results
+Ordering
-------
In the [zaak-api](https://zaken-api.vng.cloud/api/v1/schema/#operation/zaak_list) ordering is done in a single field parameter, we however prefer to be able to order on multiple fields in combination of ascending and descending orders. We therefore implement an order parameter as array where they key is the property on wish should be ordered and the value the type of ordering e.g. `?order[name]=desc&order[status]=asc`. The order in which the keys are added to the order array determines the order in which they are applied.
-Dutch versus English
--------
-The [NL API Standard](https://geonovum.github.io/KP-APIs/#api-04-define-interfaces-in-dutch-unless-there-is-an-official-english-glossary) describes that there is a preference for Dutch in API documentation.
-
-> Define resources and the underlying entities, fields and so on (the information model ad the external interface) in Dutch. English is allowed in case there is an official English glossary.
-
-We view this as a breach with good coding practice and international coding standards, all documentation is therefore supplied in English
+Translations
+-------
+We support translations trough the `Accept-Language` header (read the [docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language)), the fallback language for all messages is English
+Errors
+-------
+See [jsonapi](https://jsonapi.org/examples/#error-objects) and the [rfc](https://tools.ietf.org/html/rfc7807).
-Comma Notation versus Bracket Notation on arrays's
+Arrays
-------
The NL API standard uses comma notation on array's in http requests. E.g. fields=id,name,description however common browsers(based on chromium e.g. chrome and edge) use bracket notation for query style array's e.g. fields[]=id&fields[]=name,&fields[]=description. The difference of course is obvious since comma notation doesn't allow you to index arrays. [Interestingly enough there isn't actually a rfc spec for this](https://stackoverflow.com/questions/15854017/what-rfc-defines-arrays-transmitted-over-http).
-It is perceivable that in future iterations we would like to use indexed array in situations where the index of the array can't be assumed on basis of url notation, when indexes aren’t numerical, when we don’t want an index to start at 0 or when indexes are purpusly missing (comma notation of id,name,description would always refert to the equivalent of fields: [
+It is perceivable that in future iterations we would like to use indexed array in situations where the index of the array can't be assumed on basis of url notation, when indexes aren�t numerical, when we don�t want an index to start at 0 or when indexes are purpusly missing (comma notation of id,name,description would always refert to the equivalent of fields: [
0 => id,
1 => name,
2 => description
@@ -134,7 +235,7 @@ We support both comma and bracket notation on array's, but only document bracket
Container Setup
-------
- https://medium.com/shiphp/building-a-custom-nginx-docker-image-with-environment-variables-in-the-config-4a0c36c4a617
+https://medium.com/shiphp/building-a-custom-nginx-docker-image-with-environment-variables-in-the-config-4a0c36c4a617
Filtering
@@ -146,7 +247,7 @@ __Regex Exact__
__Regex Contains__
__Like___
-The like filters is used to search for enities with the traditional sql LIKE operator. If pattern does not contain percent signs or underscores, then the pattern only represents the string itself; in that case LIKE acts like the equals operator. An underscore (_) in pattern stands for (matches) any single character; a percent sign (%) matches any sequence of zero or more characters.
+The like filters is used to search for resources with the traditional sql LIKE operator. If pattern does not contain percent signs or underscores, then the pattern only represents the string itself; in that case LIKE acts like the equals operator. An underscore (_) in pattern stands for (matches) any single character; a percent sign (%) matches any sequence of zero or more characters.
Some examples:
@@ -154,6 +255,7 @@ Some examples:
'abc' LIKE 'a%' true
'abc' LIKE '_b_' true
'abc' LIKE 'c' false
+
LIKE pattern matching always covers the entire string. Therefore, if it's desired to match a sequence anywhere within a string, the pattern must start and end with a percent sign.
To match a literal underscore or percent sign without matching other characters, the respective character in pattern must be preceded by a backlash.
@@ -161,10 +263,32 @@ To match a literal underscore or percent sign without matching other characters,
## Kubernetes
### Loadbalancers
-We no longer provide a load balancer per component, since this would require a ip per component. Draining ip's on mult component kubernetes clusters. In stead we make componentes available as an interner service
+We no longer provide a load balancer per component, since this would require a IP address per component (and ipv 4 addresses are in short supply). Instead we make components available as an internal service. A central load balancer could then be used to provide several api’s in one
### server naming
-A component is (speaking in kubernetes terms) a service that is available at
+A component is (speaking in kubernetes terms) a service that is available at a name corresponding to its designation
+
+### Domain Build-up and routing
+By convention the component assumes that you follow the common ground domain name build up, meaning {environment}.{component}.{rest of domain}. That means that only the first two url parts are used for routing. It is also assumed that when no environment is supplied the production environment should be offered E.g. a proper domain for the production API of the verzoeken registratie component would be prod.vrc.zaakonline.nl but it should also be reachable under vrc.zaakonline.nl. The proper location for the development environment should always be dev.vrc.zaakonlin.nl
+
+### Environments and namespacing
+We assume that for that you want to run several environments for development purposes. We identify the following namespaces for support.
+- prod (Production)
+- acce (Acceptation)
+- stag (Staging)
+- test (Testing)
+- dev (Development)
+
+Because we base the common ground infrastructure on kubernetes, and we want to keep a hard separation between environment we also assume that you are using your environment as a namespace
+
+Symfony library management gives us the option to define the libraries on a per environment base, you can find that definition in the [bundle config](api/config/bundles.php)
+
+Besides the API environments the component also ships with additional tools/environments but those are not meant to be deployed
+- client (An react client frontend)
+- admin (An read admin interface)
+
+On the local development docker deploy the client environment is used as default instead of the production version of the api.
+
## Data types
@@ -202,3 +326,5 @@ A component is (speaking in kubernetes terms) a service that is available at
| string | bsn | | | | |
| string | iban | | | | |
| | | | | | |
+
+
diff --git a/INSTALLATION.md b/INSTALLATION.md
index 99c5d04e..d68f1db2 100644
--- a/INSTALLATION.md
+++ b/INSTALLATION.md
@@ -1,56 +1,72 @@
# Installation
-This document dives a litle bit deeper into installing your component on a kubernetes cluster, looking for information on setting up your component on a lookal maschine? Take a look at the [tutorial](TUTORIAL.md) instead.
+This document dives a little bit deeper into installing your component on a kubernetes cluster, looking for information on setting up your component on a local machine? Take a look at the [tutorial](TUTORIAL.md) instead.
## Setting up helm
+
## Setting up tiller
-Create the tiller serviceaccount:
+Create the tiller service account:
```CLI
$ kubectl -n kube-system create serviceaccount tiller --kubeconfig="api/helm/kubeconfig.yaml"
```
-Next, bind the tiller serviceaccount to the cluster-admin role:
+Next, bind the tiller service account to the cluster-admin role:
```CLI
$ kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller --kubeconfig="api/helm/kubeconfig.yaml"
```
Now we can run helm init, which installs Tiller on our cluster, along with some local housekeeping tasks such as downloading the stable repo details:
```CLI
-$ helm init --service-account tiller --kubeconfig="api/helm/kubeconfig.yaml"
+$ helm init --service-account tiller --kubeconfig="kubeconfig.yaml"
```
-To verify that Tiller is running, list the pods in thekube-system namespace:
+To verify that Tiller is running, list the pods in the kube-system namespace:
```CLI
-$ kubectl get pods --namespace kube-system --kubeconfig="api/helm/kubeconfig.yaml"
+$ kubectl get pods --namespace kube-system --kubeconfig="kubeconfig.yaml"
```
The Tiller pod name begins with the prefix tiller-deploy-.
-Now that we�ve installed both Helm components, we�re ready to use helm to install our first application.
+Now that we've installed both Helm components, we're ready to use helm to install our first application.
+
+
+## Setting up ingress
+We need at least one nginx controller per kubernetes kluster, doh optionally we could set on up on a per namebase basis
+
+```CLI
+$ helm install stable/nginx-ingress --name loadbalancer --kubeconfig="kubeconfig.yaml"
+```
+
+We can check that out with
+
+```CLI
+$ kubectl describe ingress pc-dev-ingress -n=kube-system --kubeconfig="kubeconfig.yaml"
+```
## Setting up Kubernetes Dashboard
-Afhter we installed helm and tiller we can easyallty use both to install kubernets dashboard
+After we installed helm and tiller we can easily use both to install kubernetes dashboard
+
```CLI
-$ helm install stable/kubernetes-dashboard --name dashboard --kubeconfig="api/helm/kubeconfig.yaml" --namespace="kube-system"
+$ helm install stable/kubernetes-dashboard --name dashboard --kubeconfig="kubeconfig.yaml" --namespace="kube-system"
```
-But before we can login to tille we need a token, we can get one of those trough the secrets. Get yourself a secret list by running the following command
+But before we can login to tiller we need a token, we can get one of those trough the secrets. Get yourself a secret list by running the following command
```CLI
-$ kubectl -n kube-system get secret --kubeconfig="api/helm/kubeconfig.yaml"
+$ kubectl -n kube-system get secret --kubeconfig="kubeconfig.yaml"
```
-Becouse we just bound tiller to our admin acount and use tiller (trough helm) to manage our code deployment it makes sence to use the tiller token, lets look uo the tilles secret (it should loo something like "tiller-token-XXXXX" and ask for the coresponding token.
+Because we just bound tiller to our admin account and use tiller (trough helm) to manage our code deployment it makes sense to use the tiller token, lets look at the tiller secret (it should look something like "tiller-token-XXXXX" and ask for the corresponding token.
```CLI
-$ kubectl -n kube-system describe secrets tiller-token-5m4tg --kubeconfig="api/helm/kubeconfig.yaml"
+$ kubectl -n kube-system describe secrets tiller-token-xxxxx --kubeconfig="kubeconfig.yaml"
```
This should return the token, copy it to somewhere save (just the token not the other returned information) and start up a dashboard connection
```CLI
-$kubectl proxy --kubeconfig="api/helm/kubeconfig.yaml"
+$ kubectl proxy --kubeconfig="kubeconfig.yaml"
```
This should proxy our dashboard to helm making it available trough our favorite browser and a simple link
@@ -58,11 +74,34 @@ This should proxy our dashboard to helm making it available trough our favorite
http://localhost:8001/api/v1/namespaces/kube-system/services/https:dashboard-kubernetes-dashboard:https/proxy/#!/login
```
+
+## Cert Manager
+https://cert-manager.io/docs/installation/kubernetes/
+
+```CLI
+$ kubectl apply --validate=false -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.12/deploy/manifests/00-crds.yaml --kubeconfig="kubeconfig.yaml"
+$ kubectl create namespace cert-manager --kubeconfig="kubeconfig.yaml"
+```
+
+ The we need tp deploy the cert manager to our cluster
+
+```CLI
+$ helm repo add jetstack https://charts.jetstack.io
+$ helm install --name cert-manager --namespace cert-manager --version v0.12.0 \ jetstack/cert-manager --kubeconfig="kubeconfig.yaml"
+```
+
+lets check if everything is working
+
+```CLI
+$ kubectl get pods --namespace cert-manager --kubeconfig="kubeconfig.yaml"
+$ kubectl describe certificate -n dev --kubeconfig="kubeconfig.yaml"
+```
+
## Deploying trough helm
-First we always need to update our dependencys
+First we always need to update our dependencies
```CLI
$ helm dependency update ./api/helm
-
+```
If you want to create a new instance
```CLI
$ helm install --name vtc-dev ./api/helm --kubeconfig="api/helm/kubeconfig.yaml" --namespace=dev --set settings.env=dev,settings.debug=1
@@ -87,19 +126,19 @@ $ helm del vtc-prod --purge --kubeconfig="api/helm/kubeconfig.yaml --namespace=p
## Making your app known on NLX
-The proto component commes with an default NLX setup, if you made your own component however you might want to provide it trough the [NLX](https://www.nlx.io/) service. Furntunatly the proto component commes with an nice setup for NLX integration.
+The proto component comes with an default NLX setup, if you made your own component however you might want to provide it trough the [NLX](https://www.nlx.io/) service. Fortunately the proto component comes with an nice setup for NLX integration.
-First of all change the nececery lines in the [.env](.env) file, basiccaly everything under the NLX setup tag. Keep in mind that you wil need to have your component available on an (sub)domain name (a simple IP wont sufice).
+First of all change the necessary lines in the [.env](.env) file, basically everything under the NLX setup tag. Keep in mind that you wil need to have your component available on an (sub)domain name (a simple IP wont sufice).
-To force the re-generation of certificates simply delete the org.crt en org.key in the api/nlx-setup folder
+To force the re-generation of certificates simply delete the org.crt en org.key in the api/nlx-setup folder.
## Deploying trough common-ground.dev
## Setting up analytics and a help chat function
-As a developer you might be intrested to know how your application documentation is used, so you can see which parts of your documentation are most read and which parts might need some additional love. You can measure this (and other user interactions) with google tag manager. Just add your google tag id to the .env file (replacing the default) under GOOGLE_TAG_MANAGER_ID.
+As a developer you might be interested to know how your application documentation is used, so you can see which parts of your documentation are most read and which parts might need some additional love. You can measure this (and other user interactions) with google tag manager. Just add your google tag id to the .env file (replacing the default) under GOOGLE_TAG_MANAGER_ID.
-Have you seen our sweet support-chat on the documentation page? We didn't build that ourselves ;) We use a Hubspot chat for that, just head over to Hubspot, create an account and enter your Hubspot embed code in het .env file (replacing the default) under HUBSPOT_EMBED_CODE.
+Have you seen our sweet support-chat on the documentation page? We didn't build that ourselves ;). We use a Hubspot chat for that, just head over to Hubspot, create an account and enter your Hubspot embed code in het .env file (replacing the default) under HUBSPOT_EMBED_CODE.
-Would you like to use a different analytics or chat-tool? Just shoot us a [feature request](https://github.com/ConductionNL/commonground-component/issues/new?assignees=&labels=&template=feature_request.md&title=New Analytics or Chat provider)
+Would you like to use a different analytics or chat-tool? Just shoot us a [feature request](https://github.com/ConductionNL/commonground-component/issues/new?assignees=&labels=&template=feature_request.md&title=New%20Analytics%20or%20Chat%20provider)!
diff --git a/README.md b/README.md
index 05a32c9b..9a4f20df 100644
--- a/README.md
+++ b/README.md
@@ -1,63 +1,7 @@
+# About this component
-# Readme
--------
-Welcome to the the VNG Common Ground proto component!
-This "proto" component provides a plug and play solution for component generation on Common Ground. That means that it takes away all the hassle of setting op codebases, containers and following the VNG Api Standaard. It does all that for you!
+## License
+Copyright � [Gemeente 's-Hertogenbosch](https://www.s-hertogenbosch.nl/) 2019
-For that we use **[Api Platform](https://api-platform.com)**, a next-generation web framework designed to easily create API-first projects, without compromising extensibility and flexibility.
-
-Getting started
--------
-Do you want to create your own Commonground component? Take a look at our in depht [tutorial](TUTORIAL.md) on spinning up your own component!
-
-The commonground bundle
--------
-This repository uses the power of conductions [commonground bundle](https://packagist.org/packages/conduction/commongroundbundle) for symfony to provide common ground specific functionality based on the [VNG Api Strategie](https://docs.geostandaarden.nl/api/API-Strategie/). Including
-
-* Build in support for public API's like BAG (Kadaster), KVK (Kamer van Koophandel)
-* Build in validators for common dutch variables like BSN (Burger service nummer), RSIN(), KVK(), BTW()
-* AVG and VNG proof audit trails
-* And [muchs more](https://packagist.org/packages/conduction/commongroundbundle) ....
-
-Be sure to read our [design considerations](/design.md) concerning the [VNG Api Strategie](https://docs.geostandaarden.nl/api/API-Strategie/).
-
-
-Requesting features
--------
-Do you need a feature that is not on this list? don't hesitate to send us a [feature request](https://github.com/ConductionNL/commonground-component/issues/new?assignees=&labels=&template=feature_request.md&title=).
-
-Staying up to date
--------
-
-## Features
--------
-API Platform embraces open web standards (OpenAPI, JSON-LD, GraphQL, Hydra, HAL, JSONAPI, JWT, OAuth, HTTP...) and the [Linked Data](https://www.w3.org/standards/semanticweb/data) movement. Your API will automatically expose structured data in Schema.org/JSON-LD.
-It means that your commonground application is usable **out of the box** with technologies of the semantic web.
-
-* Comes with a paired [React](https://reactjs.org/) application, to provide face to your code
-* And a fully functional (and automatically updated) [React Admin](https://marmelab.com/react-admin/) backend to easily test and proof your component
-* Design your own data model as plain old PHP classes or [**import an existing one**](https://api-platform.com/docs/schema-generator)
- from the [Schema.org](https://schema.org/) vocabulary
-* **Expose in minutes a hypermedia REST or a GraphQL API** with pagination, data validation, access control, relation embedding,
- filters and error handling...
-* Benefit from Content Negotiation: [GraphQL](http://graphql.org), [JSON-LD](http://json-ld.org), [Hydra](http://hydra-cg.com),
- [HAL](http://stateless.co/hal_specification.html), [JSONAPI](https://jsonapi.org/), [YAML](http://yaml.org/), [JSON](http://www.json.org/), [XML](https://www.w3.org/XML/) and [CSV](https://www.ietf.org/rfc/rfc4180.txt) are supported out of the box
-* Enjoy the **beautiful automatically generated API documentation** (Swagger/[OpenAPI](https://www.openapis.org/))
-* Add [**a convenient Material Design administration interface**](https://api-platform.com/docs/admin) built with [React](https://reactjs.org/)
- without writing a line of code
-* **Scaffold fully functional Progressive-Web-Apps and mobile apps** built with [React](https://api-platform.com/docs/client-generator/react), [Vue.js](https://api-platform.com/docs/client-generator/vuejs) or [React Native](https://api-platform.com/docs/client-generator/react-native) thanks to [the client
- generator](https://api-platform.com/docs/client-generator) (a Vue.js generator is also available)
-* Install a development environment and deploy your project in production using **[Docker](https://api-platform.com/docs/distribution#using-the-official-distribution-recommended)** and [Kubernetes](https://api-platform.com/docs/deployment/kubernetes)
-* Easily add **[JSON Web Token](https://api-platform.com/docs/core/jwt) or [OAuth](https://oauth.net/) authentication**
-* Create specs and tests with a **developer friendly API testing tool** on top of [Behat](http://behat.org/)
-* use **thousands of Symfony bundles and React components** with API Platform
-* reuse **all your Symfony and React skills**, benefit of the incredible amount of documentation available
-* enjoy the popular [Doctrine ORM](http://www.doctrine-project.org/projects/orm.html) (used by default, but fully optional:
- you can use the data provider you want, including but not limited to MongoDB and ElasticSearch)
-
-
-Credits
--------
-
-Created by [Ruben van der Linde](https://www.conduction.nl/team) for conduction. But based on [api platform](https://api-platform.com) by [Kévin Dunglas](https://dunglas.fr). Commercial support for common ground components available from [Conduction](https://www.conduction.nl).
+[Licensed under the EUPL](LICENCE.md)
diff --git a/SECURITY.md b/SECURITY.md
index 0c41cb8e..f72a06d9 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,6 +1,6 @@
# SECURITY
-Security of your common ground component henchmen’s on a few factors and is (in fact) for the most part provided by the common ground ecosystem. But there are definitely some steps that you should undertake yourself. We will however first briefly explain the security principles set in place so that you understand how you are being supported and what the limitation of that support is.
+Security of your common ground component henchmens on a few factors and is (in fact) for the most part provided by the common ground ecosystem. But there are definitely some steps that you should undertake yourself. We will however first briefly explain the security principles set in place so that you understand how you are being supported and what the limitation of that support is.
## Codebase
First of the code base, if you are extending the common ground-proto-component your code base will exist out of three parts.
diff --git a/TUTORIAL.md b/TUTORIAL.md
index 8c4f391c..356121e3 100644
--- a/TUTORIAL.md
+++ b/TUTORIAL.md
@@ -8,11 +8,11 @@ What do you need for this tutorial?
* Docker for desktop
## Before you begin
-For the steps consirning the generation of entities an example entity a availale, feel free to [take a look](https://github.com/ConductionNL/Proto-component-commonground/blob/master/api/src/Entity/ExampleEntity.php) at it if you have trouble figuring out the code.
+For the steps considering the generation of resources (or entities as symfony calls them) an example resource a availale, feel free to [take a look](https://github.com/ConductionNL/Proto-component-commonground/blob/master/api/src/Entity/ExampleEntity.php) at it if you have trouble figuring out the code.
## Setting up your enviroment
-You can install docker-desktop from [the docker website]().
+You can install docker-desktop from [the docker website](https://hub.docker.com/editions/community/docker-ce-desktop-windows).
## Generating your component (repository/codebase)
@@ -26,16 +26,16 @@ After that you should be redirected to your own brand new repository.
We ran a fork of the base Common Ground component, that means that we copied the code of the original project into a new repository. By doing so we made sure we have all the necessities for our component, including security and compliance with international standards.
## Spinning up your component
-Before we can spin up our component we must first get a local copy from our repository, we can either do this through the command line (example here) or use a Git client.
+Before we can spin up our component we must first get a local copy from our repository, we can either do this through the command line or use a Git client.
-For this example where going to use GitKraken but you can use any tool you like, feel free to skip this part if you are already familiar with setting up a local clone of your repository.
+For this example we're going to use GitKraken but you can use any tool you like, feel free to skip this part if you are already familiar with setting up a local clone of your repository.
-Open gitkraken press "clone a repro" and fill in the form (select where on your local machine you want the repository to be stored, and fill in the link of your repository on github), press "clone a repro" and you should then see GitKraken downloading your code. After it's done press "open now" (in the box on top) and voilá your codebase (you should see an initial commit on a master branche).
+Open gitkraken press "clone a repo" and fill in the form (select where on your local machine you want the repository to be stored, and fill in the link of your repository on github), press "clone a repo" and you should then see GitKraken downloading your code. After it's done press "open now" (in the box on top) and voilá your codebase (you should see an initial commit on a master branch).
You can now navigate to the folder where you just installed your code, it should contain some folders and files and generally look like this. We will get into the files later, lets first spin up our component!
Open a command window (example) and browse to the folder where you just stuffed your code, navigating in a command window is done by cd, so for our example we could type
-cd c:\repos\common-ground\my-component (if you installed your code on a different disk then where the cmd window opens first type : for example D: and hit enter to go to that disk, D in this case). We are now in our folder, so let's go! Type docker-compose up and hit enter. From now on whenever we describe a command line command we will document it as follows:
+cd c:\repos\common-ground\my-component (if you installed your code on a different disk then where the cmd window opens first type : for example D: and hit enter to go to that disk, D in this case). We are now in our folder, so let's go! Type docker-compose up and hit enter. From now on whenever we describe a command line command we will document it as follows (the $ isn't actually typed but represents your folder structure):
```CLI
$ docker-compose up
@@ -45,8 +45,9 @@ Your computer should now start up your local development environment. Don't worr
Open your browser type http://localhost/ as address and hit enter, you should now see your common ground component up and running.
-### trouble shooting
-When spinning up components we make extensive use of the cashing of docker, and use volumes to reprecent server disks. When running in to unexpected trouble always remmember to clear your local docker vm with the -a command (removing image cash)
+### Trouble shooting
+When spinning up components we make extensive use of the cashing of docker, and use volumes to represent server disks. When running in to unexpected trouble always remember to clear your local docker vm with the -a command (removing image cash)
+
```CLI
$ docker system prune -a
```
@@ -57,30 +58,30 @@ $ docker volume prune
**What are we looking at?**
The Common Ground base component provides a bit more than just a development interface, it also includes an example application and a backend that automatically hooks into your api. For now we're just going to focus on our api, but is good to read up on all the features of the Common Ground base component here.
-## Adding your own objects
-You can now access your api at http://localhost:8080/, as you can see it's pre-loaded with some example objects. Let's replace them with your own objects!
+## Adding your own resources
+You can now access your api at http://localhost:8080/, as you can see it's pre-loaded with some example resources. Let's replace them with your own resources!
-First let's remove the objects currently in the api, we can do that by just removing the entities form our code base, navigate to the folder where you stored your code and open the folder api/src/Entity , you can find the example entities (our name for objects) there. Just delete all the php files in that folder.
+First let's remove the resources currently in the api, we can do that by just removing the resources form our code base, navigate to the folder where you stored your code and open the folder api/src/Entity , you can find the example entities (the symfony name for resources) there. Just delete all the php files in that folder.
-Next let's add our own entities, we can do this in two ways, we can do old fashioned coding, but we can also use the build in maker bundle of the proto component, to quickly generate our entities for us (without the fuss of actual coding).
+Next let's add our own resources, we can do this in two ways, we can do old fashioned coding, but we can also use the build in maker bundle of the proto component, to quickly generate our entities for us (without the fuss of actual coding).
Let's open a new command line window and navigate to our root folder, exactly like we did under "spinning up your component". And then lets fire up maker bundle (make sure that your component is still running in your other command window). We can do so by the following command:
```CLI
$ docker-compose exec php bin/console make:entity
```
-We should now see a wizward that allows us to either make new entities, or add parameters to existing entities (by supplying the name of an existing entity).
+We should now see a wizard that allows us to either make new entities, or add parameters to existing entities (by supplying the name of an existing resource).
## Keeping your repository up to date with the Conduction Common Ground component
There are basically three reasons why you should want to keep your repository up to date with the Conduction proto component
* Security, Conduction performs regular security updates on
* Functionality we strive to make regular
-* Compliance, as discussions in the broader Common Ground community progress API standars might advance or change. Conduction will regularly update the Common Ground component with those changes.
+* Compliance, as discussions in the broader Common Ground community progress API standards might advance or change. Conduction will regularly update the Common Ground component with those changes.
Best practice is to fetch the Conduction Common Ground component into a local upstream/master branch through Git. So let's first add the original Common Ground component as an remote called upstream, and create a local branch for that remote.
-__Please make sure the you have commited al your changes to your current codebase and pushed a backup copy to your Git repo before continuing__
+__Please make sure the you have committed al your changes to your current codebase and pushed a backup copy to your Git repo before continuing__
```CLI
git remote add upstream https://github.com/ConductionNL/Proto-component-commonground.git
@@ -88,7 +89,7 @@ git fetch upstream
git branch upstream upstream/master
```
-You can then use your favorite Git tool to merge this branch into your normal working branche without the danger of overwriting your local code. Or alternatively you can use your GIT CLI (not recommended)
+You can then use your favorite Git tool to merge this branch into your normal working branch without the danger of overwriting your local code. Or alternatively you can use your GIT CLI (not recommended)
```CLI
git checkout master
@@ -107,43 +108,20 @@ git merge upstream --allow-unrelated-histories
Keep in mind that you wil need to make sure to stay up to date about changes on the Common Ground component repository.
## Renaming your component
-Right now the name of your component is 'commonground' that's thats fine while running it localy or in its own kubernetes cluster but wil get you in when running it with other components when it without using a name space. So its good practice to name your component distinctifly. But besides al of these practical reasons its of course also just cool to name your child before you unleas it on the unsuspecting commonground community.
+Right now the name of your component is `commonground component` and its unique id `cg` that's that's fine while running it locally or in its own kubernetes cluster but wil get you in when running it with other components when it without using a name space. So its good practice to name your component distinctly. But besides al of these practical reasons its of course also just cool to name your child before you unleash it on the unsuspecting common ground community.
-Oke, so before we can nae the component we need to come up with a name. There are a couple of conventions here. Firts of the name should tell us what the component does, or is suposede to do with one or two words. So we would normaly call an componant aboute dogs the DogComponent and one about cats te CatComponent. The second convention is that we don't usually actually name our component 'component' but indicate its position in de commonground architecture. For that we have the following options
+Oke, so before we can nae the component we need to come up with a name. There are a couple of conventions here. First of the name should tell us what the component does, or is supposed to do with one or two words. So we would normally call an component about dogs the DogComponent and one about cats te CatComponent. The second convention is that we don't usually actually name our component 'component' but indicate its position in de common ground architecture. For that we have the following options:
* Catalogus
* RegistratieComponent
* Service
* Application
* Tool
-The we need to touch te following files
+The actual name change is rather simple doh, just head over to the .env that contains all our config and change the apropriate variables
* .env
-* dockercompose.yaml
-* api/.env
-* api/helm/values.yaml
-* api/docker/nginx/
-
-## Adding more openapi documantation
-
-```php
-//...
- /**
- * @ApiProperty(
- * attributes={
- * "openapi_context"={
- * "description" = "The name of a organisation",
- * "type"="string",
- * "format"="string",
- * "example"="My Organisation"
- * }
- * }
- * )
- */
- private $name;
-//...
-```
-## Setting up security and acces (also helps with serialization)
+## Setting up security and access
+We want to secure our resources in such a way that only users or applications with propper right can acces and update properties.
```PHP
// src/Entity/Organisation.php
@@ -169,7 +147,7 @@ class Organisation
```
## Using validation
-Right now we are just accepting data and passing them on to the database, and in a mock or poc context this is fine. Most of the calls will end up being get requests anyway. But in case that we actually want our clients to make post to the api it would be wise to add some validation to the fields we are recieving. Luckely for us the component comes pre packed with a valdiation tool that we can configure from our entity through annotion. If we for example want to make a field required we could do so as follows:
+Right now we are just accepting data and passing them on to the database, and in a mock or poc context this is fine. Most of the calls will end up being get requests anyway. But in case that we actually want our clients to make post to the api it would be wise to add some validation to the fields we are recieving. Luckely for us the component comes pre packed with a valdiation tool that we can configure from our resources through annotion. If we for example want to make a field required we could do so as follows:
```PHP
// src/Entity/Organisation.php
@@ -193,12 +171,12 @@ class Organisation
Keep in mind that we need to add the assert annotation to our class dependencies under 'use'.
-More inforation on using validation can be found at the [symfony website](https://symfony.com/doc/current/validation.html), but it is als worth notting that tis commonent comes pre packed with some typical NL valdidators like BSN. You can find those [here]().
+More information on using validation can be found at the [symfony website](https://symfony.com/doc/current/validation.html), but it is als worth nothing that tis component comes pre packed with some typical NL validators like BSN. You can find those [here]().
## Using UUID
-As default doctrine uses auto increment integers as identifiers (1,2, etc). For modern webapplications we howver prefer the use of UUID's. (e.g. e2984465-190a-4562-829e-a8cca81aa35d). Why? Wel for one it is more secure integer id's are easly gasable and make it posible to "aks" endpoint about objects that you should know about. But UUID's also have a benifit in futere proofing the application. If we in the futere want to merge a table with another table (for example becouse two organisations using a component perform a merger) then we would have to reasign al id's and relations if we where using int based id's (both tables would have a row 1,2 etc) with UUID's however the change of doubles range somwhere in the biljons. Meaning that it i likly that we oly need to either re identify only a handful of rows or more likely none at al! Turning our entire migration into a copy pase action.
+As default doctrine uses auto increment integers as identifiers (1,2, etc). For modern web applications we however prefer the use of UUID's. (e.g. e2984465-190a-4562-829e-a8cca81aa35d). Why? Wel for one it is more secure integer id's are easily guessable and make it possible to "ask" endpoint about resources that you should not know about. But UUID's also have a benefit in future proofing the application. If we in the future want to merge a table with another table (for example because two organisations using a component perform a merger) then we would have to reassign al id's and relations if we where using int based id's (both tables would have a row 1,2 etc) with UUID's however the change of doubles range somewhere in the billions. Meaning that it is likely that we only need to either reidentify only a handful of rows or more likely none at al! Turning our entire migration into a copy paste action.
-The proto component supports ramsy's uuid objects stratagy out of the box, so to use UUID's as intifier simply we need to add the ApiProperty as a dependecy
+The proto component supports Ramsey's uuid objects strategy out of the box, so to use UUID's as identifier simply we need to add the ApiProperty as a dependency
```PHP
@@ -222,20 +200,9 @@ with
```PHP
//...
- /**
- * @var \Ramsey\Uuid\UuidInterface
- *
- * @ApiProperty(
- * identifier=true,
- * attributes={
- * "openapi_context"={
- * "description" = "The UUID identifier of this object",
- * "type"="string",
- * "format"="uuid",
- * "example"="e2984465-190a-4562-829e-a8cca81aa35d"
- * }
- * }
- * )
+ /**
+ * @var \Ramsey\Uuid\UuidInterface The UUID identifier of this resource
+ * @example e2984465-190a-4562-829e-a8cca81aa35d
*
* @Groups({"read"})
* @ORM\Id
@@ -247,7 +214,7 @@ with
//..
```
-and remove the integer on the getter turning this:
+and remove the : ?integer on the getter turning this:
```PHP
//...
@@ -269,10 +236,10 @@ into this
//...
```
-and your all done
+and you're all done
-### Rrouble shooting
-If you have already spunn your component including your new entity your going to run into some trouble becouse doctrine is going to try changing your primary key collum (id) from an integer to string (tables tend not to like that). In that case its best to just drop your database and reinstall it using the following commands:
+### Trouble shooting
+If you have already spun your component including your new resource your going to run into some trouble because doctrine is going to try changing your primary key column (id) from an integer to string (tables tend not to like that). In that case its best to just drop your database and reinstall it using the following commands:
```CLI
$ bin/console doctrine:schema:drop
@@ -281,13 +248,13 @@ $ bin/console doctrine:schema:update --force
## Advanced data sets
-Oke lets make it complex, until now we have just added some simple entities to our component, but what if we want to ataches one entity to another? Fortunatly our build in database engine support rather complex senarios called associations. So let [take a look](https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/association-mapping.html) at that.
+Oke lets make it complex, until now we have just added some simple entities to our component, but what if we want to attaches one resource to another? Fortunately our build in database engine support rather complex scenarios called associations. So let [take a look](https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/association-mapping.html) at that.
-Bafled? Wel its rather complex. But remember that Make:entity command that we used earlier? That actuelly accepts relations as a data type. Or to but it simply instead of using the default 'string' we could just type "ManyToOne" and it will just fire up some qoustions that will help it determine how you want your relations to be.
+Baffled? Wel its rather complex. But remember that make:entity command that we used earlier? That actually accepts relations as a data type. Or to but it simply instead of using the default 'string' we could just type "ManyToOne" and it will just fire up some questions that will help it determine how you want your relations to be.
### Trouble shooting
-A very common error when linking entities togehter is circle refrances, those will break our serializatoin. Furtunaltly we have a need way to prevent that. Even better symfony gives us exact control of how deep we want the circular refereance to go. To do this we need to use the `MaxDepth()` annotation. So lets import that
+A very common error when linking entities together is circle references, those will break our serialization. Fortunately we have a need way to prevent that. Even better symfony gives us exact control of how deep we want the circular reference to go. To do this we need to use the `MaxDepth()` annotation. So lets import that
```PHP
//...
@@ -311,11 +278,11 @@ class ExampleEntity
//...
```
-We can now prevent circular referances by setting a max depth on the properties cousing the circular refrance.
-
+We can now prevent circular references by setting a max depth on the properties causing the circular reference.
+```PHP
//...
/**
- * @var ArrayCollection $stuffs Some stuff that is atached to this example object
+ * @var ArrayCollection $stuffs Some stuff that is attached to this example resource
*
* @MaxDepth(1)
* @Groups({"read","write"})
@@ -325,21 +292,21 @@ We can now prevent circular referances by setting a max depth on the properties
//...
```
-## Datafixtures
-For testing cases it can be usefull to use datafixtures a predefined set of data that fills the database of your component at startup. Since we use php classes to describe our objects creating fixtures is easy (you can find an example in your project folder at api/src/DataFixtures). We simply go trough some classes asign values and persist them to the database. Once we have written our fixtures we can use a single command to load them
+## Data fixtures
+For testing cases it can be useful to use data fixtures a predefined set of data that fills the database of your component at startup. Since we use php classes to describe our resources creating fixtures is easy (you can find an example in your project folder at api/src/DataFixtures). We simply go trough some classes assign values and persist them to the database. Once we have written our fixtures we can use a single command to load them
```CLI
$ bin/console doctrine:fixtures:load --env=dev
```
-Be mindfull of the --env=dev here! Doctrine wil only allow fixture loading on a dev enviroment (for obvius security reasons)
+Be mindful of the --env=dev here! Doctrine wil only allow fixture loading on a dev environment (for obvious security reasons)
-More inforation on using datafixtures can be found at the [symfony website](https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html)(you can skipp the instalation instructions) we also enourage you to take a look at the [tabbelen component](https://github.com/ConductionNL/landelijketabellencatalogus) that makes extansive use of datafixtures.
+More information on using data fixtures can be found at the [symfony website](https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html) (you can skipp the installation instructions) we also encourage you to take a look at the [tabellen component](https://github.com/ConductionNL/landelijketabellencatalogus) that makes extensive use of data fixtures.
## Sharing your work
-A vital part of te common ground community is sharing your work, and telling other people what you are working. This way people can help you wiht problems that you run into. And keep tabs on any (security) updates that you make to you code. Sounds like a lot of work right?
+A vital part of te common ground community is sharing your work, and telling other people what you are working. This way people can help you with problems that you run into. And keep tabs on any (security) updates that you make to you code. Sounds like a lot of work right?
-Wel it actually isn't, there is a specific commonground platform over at common-gorund.dev that reads repositorys and updates user. So the only thing we need to do is tell this platform that we have started a new common ground repository. And tell it when we have updates ours. We can do all that by simply adding a webhook to our component.
+Wel it actually isn't, there is a specific common ground platform over at common-ground.dev that reads repositories and updates user. So the only thing we need to do is tell this platform that we have started a new common ground repository. And tell it when we have updates ours. We can do all that by simply adding a webhook to our component.
When using Github. To set up a webhook, go to the settings page of your repository or organization. From there, click Webhooks, then Add webhook. Use te following settings:
* Payload URL: https://www.common-ground.dev/webhook/github
@@ -347,44 +314,42 @@ When using Github. To set up a webhook, go to the settings page of your reposito
* Secret: [leave blanck]
* Events: [just the push event]
-Now every time you update your repository the commonground dev page will allerted, rescan your repository and do al the apropriate platform actions. It just as easy as that.
+Now every time you update your repository the commonground dev page will alerted, rescan your repository and do al the appropriate platform actions. It just as easy as that.
-Automated Testing and Deployment (continues integration)
+Continues integration
-------
-The following bit of the tutorial requires two additional accounts
-- [https://hub.docker.com/](https://hub.docker.com/) (You might already have this for docker for desktop)
-- [https://travis-ci.org](https://travis-ci.org) (You can use you github account)
+> The following bit of the tutorial requires an additional account
+> - [https://hub.docker.com/](https://hub.docker.com/) (You might already have this for docker for desktop)
-The proto component ships with a pre-fab continues integration script based on travis. What does this mean you ask? Continuous integration (or CI for short) is an optimized and automated way for your code to become part of your projects. In the case of your commonground component that means that we will automatically validate new code commites or pushes and (if everything checks out) build that code and deploy the containers thereof to docker hub. Making is possible to update al the environments that use those components.
+The proto component ships with a pre-fab continues integration script based on github action (there is also a travis script in here if you want it). What does this mean you ask? Continuous integration (or CI for short) is an optimized and automated way for your code to become part of your projects. In the case of your commonground component that means that we will automatically validate new code commits or pushes and (if everything checks out) build that code and deploy the containers thereof to docker hub. Making is possible to update al the environments that use those components. Whats even better is that we check your code for known security issues, so whenever a dependency or libary has a security issue you will be notified to take action.
-Oke that's nice, but how do we do that? Actually it is very simple. First of all make sure you have a docker account, log into [docker hub](https://hub.docker.com/) and have a look around. We don't need to create anything just yet'but it is nice to get a feeling of the place. As you can see docker hub also uses repositories etc. So that recognizable.
+Okay, that's nice, but how do we do that? Actually it is very simple. You do nothing. The scripts are already enabled by default. Just go to the actions tab of your github repository to see the results whenever you push code.
-Next we need to prepare our github repository that holds our code. For the travis script to work as intended we need to create a couple of branches(if we don't have those already) open up yout git interface and create a branch called 'development' and a branch called 'staging'. Don't forget to push the branches so that they are present on github (and not just on your local machine).
-
-Oke just one more place to go and that is travis, head over to [https://travis-ci.org](https://travis-ci.org) and login with your gitacount. If everything is alright you should see your repository there. Activate it by pressing 'activate repository' and then go to 'More options' -> 'Settings' and scroll down to enviroment variables. Here we can present travis wit the variables that it need to execute our build script. Lets first set the common variables that we need for all our branches: `DOCKER_PASSWORD` your docker password,`DOCKER_REGISTRY` docker.io/[your username] ,`DOCKER_USERNAME` your docker user name. This will be used by travis to push the completed containers into docker hub. Next we need to specify a couple of variables that are branch specific. Or to be more exact, set the same variable `APP_ENV` with different values for different branches. It needs to be 'staging'->stag,'master'->prod,'development'->dev.
-
-And all done! Head over back to the code on your computer and make a small change. Then commit push that change into github. Travis should automatically pick op your change and start a build.
+There is however a bit of extra here that you can do and that is to insert your docker hub credentials into the repository. You can do that under the settings->secrets tab of yout repoistory by setting a `DOCKERHUB_USERNAME` and `DOCKERHUB_PASSWORD` secret containing (you might have guesed it) your dockerhub username and secret. And all done! Head over back to the code on your computer and make a small change. Then commit push that change into github. Wait for the action to complete and head over to your docker hub repository page. You should find your build containers ready for you.
+Continues deployment
+-------
+> The following bit of the tutorial requires an additional account
+> - [https://www.digitalocean.com/](https://www.digitalocean.com/)
-### Unit / Behat
+Actually the repository goes a bit further then just getting your containers ready to deploy, it can acctually deploy them for you! Again all the code is already there. The only thing that you need to do is add a kubeconfig file. You can get a kubeconfig file from a running kubernetes clusters, it provides your repository with both the credentials and endpoints it needs to deploy the application. How you get a Kubeconfig file difers a bit from provider to provider. But you can get more information on that here
-adas
+- [Digitalocean](https://www.digitalocean.com/docs/kubernetes/how-to/connect-to-cluster/)
+- [Google Cloud](https://cloud.google.com/sdk/gcloud/reference/container/clusters/get-credentials)
+- [Amazone AWS](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html)
-### Postman
-ad
+Afther you have abtained a kuneconfig you need to save it to your repository as a secret (NEVER COMMIT A KUBECONFIG FILE), use the secret `KUBECONFIG` to save your cubeconfig file. Now simply commit and push your code to your repository and presto! You have a working common-ground component online.
-### Trouble shooting
-Please make sure that your github repositry is set to public, and keep in mind that a complex travis build (and sertenly one that includes a pushing of containers can take up to 20 minutes).
Documentation and dockblocks
-------
-asdsa
+You want both your redoc documentation and your code to be readable and reausable to other developers. To this effect we use docblok annotation. You can read more about that [here](https://docs.phpdoc.org/references/phpdoc/basic-syntax.html) but the basic is this, we supply each class and propery with a docblock contained within /\* \* / characters. At the very least we want to describe our properties, the expected results and example data (see the example under [audittrail](#audittrail)
Audittrail
-------
As you might expect the proto-component ships with a neat function for generating audit trails, that basically exist of three parts.
-First we need to activate logging on the entities that we want logged (for obvious security reasons we don't log entity changes by default) to do that by adding the `@Gedmo\Loggable` annotation to our php class, which should then look something like:
+First we need to activate logging on the entities that we want logged (for obvious security reasons we don't log resource changes by default) to do that by adding the `@Gedmo\Loggable` annotation to our php class, which should then look something like:
```PHP
//...
@@ -401,7 +366,7 @@ class ExampleEntity
//...
```
-Next we need to tell the specific properties that we want to log that they are loggable (again this is a conscious choice, to prevent us from accidently logging stuff like bsn numbers), we do that by adding the `@Gedmo\Versioned` annotation to those specific properties. That would then look something like this:
+Next we need to tell the specific properties that we want to log that they are loggable (again this is a conscious choice, to prevent us from accidentally logging stuff like bsn numbers), we do that by adding the `@Gedmo\Versioned` annotation to those specific properties. That would then look something like this:
```PHP
//...
@@ -421,7 +386,7 @@ Next we need to tell the specific properties that we want to log that they are l
//...
```
-Okay actually we are now good to go, at least we are logging those things that we want logged. But.... How do we view those logs? In commonground we have a [convention](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/audit-trail) to expose a /audittrail subresource on resources that are logged. So lets add that trough our `@ApiResource` anotation.
+Okay actually we are now good to go, at least we are logging those things that we want logged. But.... How do we view those logs? In common ground we have a [convention](https://zaakgerichtwerken.vng.cloud/themas/achtergronddocumentatie/audit-trail) to expose a /audittrail subresource on resources that are logged. So lets add that trough our `@ApiResource` annotation.
```PHP
//...
@@ -438,17 +403,4 @@ class ExampleEntity
//...
```
-And now we have a fully nl api strategie integrated audit trail!
-
-
-Setting up automated deployment (continues delivery)
--------
-adasd
-
-## Commonground specific data types
-
-
-### incompleteDate
-
-### underInvestigation
-
+And now we have a fully nl api strategy integrated audit trail!
diff --git a/api/.env b/api/.env
index d4acf7ef..fa3421d5 100644
--- a/api/.env
+++ b/api/.env
@@ -29,8 +29,8 @@ CONDUCTION_COMMONGROUND_BAG_APIKEY=!ChangeMe!
#APP_NAME='pc'
APP_DESCRIPTION='Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.'
APP_SECRET=!ChangeMe!
-TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
-TRUSTED_HOSTS='^(.+\.)?localhost|api$'
+#TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
+#TRUSTED_HOSTS='^(.+\.)?localhost|api$'
###< symfony/framework-bundle ###
###> symfony/framework-bundle ###
diff --git a/api/composer.json b/api/composer.json
index 08220e05..bc7545a9 100644
--- a/api/composer.json
+++ b/api/composer.json
@@ -10,8 +10,10 @@
"doctrine/doctrine-fixtures-bundle": "^3.2",
"guzzlehttp/guzzle": "^6.3",
"lexik/jwt-authentication-bundle": "^2.6",
+ "phpdocumentor/reflection-docblock": "^4.3",
"ramsey/uuid": "^3.8",
"ramsey/uuid-doctrine": "^1.5",
+ "sensio/framework-extra-bundle": "^5.5",
"sensiolabs/security-checker": "^6.0",
"stof/doctrine-extensions-bundle": "^1.3",
"symfony/console": "4.3.*",
diff --git a/api/composer.lock b/api/composer.lock
index 584d5646..9297560f 100644
--- a/api/composer.lock
+++ b/api/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f3b8b4fa5bc19705f8f77ba64ce249e5",
+ "content-hash": "a5cf6c5b0e2fcb4b7558cd2635260c67",
"packages": [
{
"name": "api-platform/api-pack",
@@ -3251,6 +3251,84 @@
],
"time": "2018-08-11T21:01:22+00:00"
},
+ {
+ "name": "sensio/framework-extra-bundle",
+ "version": "v5.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git",
+ "reference": "dfc2c4df9f7d465a65c770e9feb578fe071636f7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/dfc2c4df9f7d465a65c770e9feb578fe071636f7",
+ "reference": "dfc2c4df9f7d465a65c770e9feb578fe071636f7",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/annotations": "^1.0",
+ "php": ">=7.1.3",
+ "symfony/config": "^4.3|^5.0",
+ "symfony/dependency-injection": "^4.3|^5.0",
+ "symfony/framework-bundle": "^4.3|^5.0",
+ "symfony/http-kernel": "^4.3|^5.0"
+ },
+ "conflict": {
+ "doctrine/doctrine-cache-bundle": "<1.3.1"
+ },
+ "require-dev": {
+ "doctrine/doctrine-bundle": "^1.11|^2.0",
+ "doctrine/orm": "^2.5",
+ "nyholm/psr7": "^1.1",
+ "symfony/browser-kit": "^4.3|^5.0",
+ "symfony/dom-crawler": "^4.3|^5.0",
+ "symfony/expression-language": "^4.3|^5.0",
+ "symfony/finder": "^4.3|^5.0",
+ "symfony/monolog-bridge": "^4.0|^5.0",
+ "symfony/monolog-bundle": "^3.2",
+ "symfony/phpunit-bridge": "^4.3.5|^5.0",
+ "symfony/psr-http-message-bridge": "^1.1",
+ "symfony/security-bundle": "^4.3|^5.0",
+ "symfony/twig-bundle": "^4.3|^5.0",
+ "symfony/yaml": "^4.3|^5.0",
+ "twig/twig": "^1.34|^2.4|^3.0"
+ },
+ "suggest": {
+ "symfony/expression-language": "",
+ "symfony/psr-http-message-bridge": "To use the PSR-7 converters",
+ "symfony/security-bundle": ""
+ },
+ "type": "symfony-bundle",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.5.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Sensio\\Bundle\\FrameworkExtraBundle\\": "src/"
+ },
+ "exclude-from-classmap": [
+ "/tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "This bundle provides a way to configure your controllers with annotations",
+ "keywords": [
+ "annotations",
+ "controllers"
+ ],
+ "time": "2019-10-16T18:54:45+00:00"
+ },
{
"name": "sensiolabs/security-checker",
"version": "v6.0.3",
diff --git a/api/config/bundles.php b/api/config/bundles.php
index 426c3ab7..b3f9617a 100644
--- a/api/config/bundles.php
+++ b/api/config/bundles.php
@@ -1,19 +1,20 @@
['all' => true],
- Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
- Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true],
- Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
- Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
- Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
- ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
- Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
- Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
- Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
- Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true],
- Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
- Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
- Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true],
- Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true],
+ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
+ Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
+ Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
+ Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true],
+ Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
+ Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
+ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
+ ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
+ Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
+ Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
+ Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
+ Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true],
+ Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
+ Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
+ Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true],
+ Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true],
];
diff --git a/api/config/packages/api_platform.yaml b/api/config/packages/api_platform.yaml
index de2b19c8..6fd42010 100644
--- a/api/config/packages/api_platform.yaml
+++ b/api/config/packages/api_platform.yaml
@@ -4,16 +4,21 @@ parameters:
# environment variables are not available yet.
# You should not need to change this value.
env(VARNISH_URL): ''
- env(APP_VERSION): ''
+ env(APP_VERSION): '
+ env(APP_NAME): '''
env(APP_TITLE): ''
env(APP_DESCRIPTION): ''
env(APP_REPRO): ''
env(APP_DEMO): ''
env(APP_ENV): ''
+ env(AUTH_ENABLED): ''
+ env(AUDITTRAIL_ENABLED): ''
+ env(NOTIFICATION_ENABLED): ''
+ env(HEALTH_ENABLED): ''
+ env(ARCHIVE_ENABLED): ''
env(CONTAINER_REGISTRY_BASE): ''
- env(CONTAINER_PROJECT_TITLE): ''
env(CONTAINER_PROJECT_NAME): ''
- env(CONTAINER_PROJECT_VERSION): ''
+ env(CONTAINER_REPRO): ''
api_platform:
mapping:
@@ -23,19 +28,15 @@ api_platform:
title: '%env(APP_TITLE)%'
description: |
API Details
- - Component: %env(CONTAINER_PROJECT_TITLE)%
- - Reference: %env(CONTAINER_PROJECT_NAME)%
+ - Component: %env(APP_TITLE)%
+ - Reference: %env(APP_NAME)%
- Enviroment: %env(APP_ENV)%
- - Version: %env(CONTAINER_PROJECT_VERSION)%
- - Repository: [%env(APP_REPRO)%](%env(APP_REPRO)%) / [zip](%env(APP_REPRO)%/archive/master.zip)
+ - Version: %env(APP_VERSION)%
+ - Repository: [online](%env(APP_REPRO)%) / [zip](%env(APP_REPRO)%/archive/master.zip)
+ - Docker Image: [online](%env(CONTAINER_REPRO)%)
- Datamodel: [postman](/schema/openapi.postman_collection) / [oas](/schema/openapi.yaml) / [pdf](/schema/datamodel.pdf) / [mwb](/schema/datamodel.mwb)
- %env(APP_DESCRIPTION)%
-
- Voor het gebruik van deze applicatie is een JWT Token nodig, deze hangt altijd vast aan een applicatie, ofwel user. Geldige JWT Tokens worden aangemaakt bij het registreren van een applicatie en kennen een beperkte houdbaarheid.
- JWT Tokens kunnen zowel worden verlengd, als opnieuw worden aangevraagd, dit aan de hand van de applicatie id en sleutel.
- Let er bij het meegeven van JWT tokens op dat deze moet worden voorafgegaan door een Bearer en een spatie, onder de header Authorization. De volledig naam wordt daarmee: 'Authorization: Bearer [TOKEN]'.
-
+ %env(APP_DESCRIPTION)%
version: '%env(APP_VERSION)%'
diff --git a/api/config/packages/sensio_framework_extra.yaml b/api/config/packages/sensio_framework_extra.yaml
new file mode 100644
index 00000000..1821ccc0
--- /dev/null
+++ b/api/config/packages/sensio_framework_extra.yaml
@@ -0,0 +1,3 @@
+sensio_framework_extra:
+ router:
+ annotations: false
diff --git a/api/config/packages/twig.yaml b/api/config/packages/twig.yaml
index d58f0a2d..26f06175 100644
--- a/api/config/packages/twig.yaml
+++ b/api/config/packages/twig.yaml
@@ -5,15 +5,35 @@ twig:
globals:
google_tag_manager_id: '%env(GOOGLE_TAG_MANAGER_ID)%'
hubspot_embed_code: '%env(HUBSPOT_EMBED_CODE)%'
- container_registry_base: '%env(CONTAINER_REGISTRY_BASE)%'
- container_project_title: '%env(CONTAINER_PROJECT_TITLE)%'
+
+ container_registry_base: '%env(CONTAINER_REGISTRY_BASE)%'
container_project_name: '%env(CONTAINER_PROJECT_NAME)%'
- container_project_version: '%env(CONTAINER_PROJECT_VERSION)%'
+
+ organization_name: '%env(ORGANIZATION_NAME)%'
+ organization_email: '%env(ORGANIZATION_EMAIL_ADDRESS)%'
+ organization_country: '%env(ORGANIZATION_COUNTRY_NAME)%'
+ organization_state: '%env(ORGANIZATION_STATE)%'
+ organization_locality: '%env(ORGANIZATION_LOCALITY)%'
+ organization_unit: '%env(ORGANIZATION_UNIT_NAME)%'
+
+ app_name: '%env(APP_NAME)%'
+ app_title: '%env(APP_TITLE)%'
+ app_version: '%env(APP_VERSION)%'
app_env: '%env(APP_ENV)%'
app_debug: '%env(APP_DEBUG)%'
+ app_domain: '%env(APP_DOMAIN)%'
app_demo: '%env(APP_DEMO)%'
app_repro: '%env(APP_REPRO)%'
app_description: '%env(APP_DESCRIPTION)%'
+
+ app_auth: '%env(AUTH_ENABLED)%'
+ app_audittrail: '%env(AUDITTRAIL_ENABLED)%'
+ app_notification: '%env(NOTIFICATION_ENABLED)%'
+ app_health: '%env(HEALTH_ENABLED)%'
+
+ trusted_hosts: '%env(TRUSTED_HOSTS)%'
+ trusted_proxies: '%env(TRUSTED_PROXIES)%'
+
nlx_outway: '%env(NLX_OUTWAY)%'
nlx_inway: '%env(NLX_INWAY)%'
form_themes:
diff --git a/api/docker/php/docker-entrypoint.sh b/api/docker/php/docker-entrypoint.sh
index 459dee21..2f39d520 100755
--- a/api/docker/php/docker-entrypoint.sh
+++ b/api/docker/php/docker-entrypoint.sh
@@ -62,14 +62,13 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
echo "Loading fixtures"
bin/console doctrine:fixtures:load --no-interaction
- # echo "Creating OAS documentation"
# Lets update the docs to show the latest chages
- # bin/console api:openapi:export --output=/srv/api/public/schema/openapi.yaml --yaml --spec-version=3
+ echo "Creating OAS documentation"
+ bin/console api:openapi:export --output=/srv/api/public/schema/openapi.yaml --yaml --spec-version=3
# this should only be done in an build
- # echo "Updating Helm charts"
- # Lets update the docs to show the latest chages
- # bin/console app:helm:update --location=/srv/api/helm --spec-version=3
+ echo "Updating Helm charts"
+ bin/console app:helm:update --location=/srv/api/helm --spec-version=3
fi
fi
diff --git a/api/helm/Chart.yaml b/api/helm/Chart.yaml
index 3a93e818..7c3c8a6a 100644
--- a/api/helm/Chart.yaml
+++ b/api/helm/Chart.yaml
@@ -1,7 +1,7 @@
apiVersion: v1
-appVersion: 0.1.0
-description: A Helm chart for an Common Ground VTC API component
-name: verzoektypecatalogus
+appVersion: V.0.1
+description: ''Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.''
+name: pc
version: 0.1.0
home: https://common-ground.dev
icon: https://common-ground.dev/logo-250x250.png
\ No newline at end of file
diff --git a/api/helm/templates/cert-issuer.yaml b/api/helm/templates/cert-issuer.yaml
new file mode 100644
index 00000000..804486a2
--- /dev/null
+++ b/api/helm/templates/cert-issuer.yaml
@@ -0,0 +1,16 @@
+apiVersion: cert-manager.io/v1alpha2
+kind: ClusterIssuer
+metadata:
+ name: {{ include "name" . }}-{{ .Values.settings.env }}-letsencrypt
+spec:
+ acme:
+ email: {{ .Values.settings.email }}
+ http01: {}
+ privateKeySecretRef:
+ name: letsencrypt-private-key
+ server: https://acme-v02.api.letsencrypt.org/directory
+ solvers:
+ - selector: {}
+ http01:
+ ingress:
+ class: nginx
\ No newline at end of file
diff --git a/api/helm/templates/certificate.yaml b/api/helm/templates/certificate.yaml
new file mode 100644
index 00000000..43dacaf8
--- /dev/null
+++ b/api/helm/templates/certificate.yaml
@@ -0,0 +1,22 @@
+apiVersion: cert-manager.io/v1alpha2
+kind: Certificate
+metadata:
+ name: {{ include "name" . }}-acme-cert
+spec:
+ secretName: {{ include "name" . }}-tls-cert
+ duration: 24h
+ renewBefore: 12h
+ {{- if eq .Values.settings.env "prod" }}
+ commonName: {{ .Values.settings.name }}.{{ .Values.settings.domain }}
+ {{- else }}
+ commonName: {{ .Values.settings.name }}.{{ .Values.settings.env }}.{{ .Values.settings.domain }}
+ {{- end }}
+ dnsNames:
+ {{- if eq .Values.settings.env "prod" }}
+ - {{ .Values.settings.name }}.{{ .Values.settings.domain }}
+ {{- else }}
+ - {{ .Values.settings.name }}.{{ .Values.settings.env }}.{{ .Values.settings.domain }}
+ {{- end }}
+ issuerRef:
+ name: {{ include "name" . }}-{{ .Values.settings.env }}-letsencrypt
+ kind: ClusterIssuer
\ No newline at end of file
diff --git a/api/helm/templates/configmap.yaml b/api/helm/templates/configmap.yaml
index 462fedb6..39c5e996 100644
--- a/api/helm/templates/configmap.yaml
+++ b/api/helm/templates/configmap.yaml
@@ -11,14 +11,33 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
project_name: {{ .Values.settings.projectName | quote }}
+ app-name: {{ .Values.settings.name | quote }}
+ app-title: {{ .Values.settings.title | quote }}
+ app-version: {{ .Values.settings.version | quote }}
+ app-repro: {{ .Values.settings.repro | quote }}
+ app-demo: {{ .Values.settings.demo | quote }}
+ app-domain: {{ .Values.settings.domain | quote }}
+ app-description: {{ .Values.settings.description | quote }}
+
+ app-auth: {{ .Values.settings.authorisationEnabled | quote }}
+ app-audittrail: {{ .Values.settings.audittrailEnabled | quote }}
+ app-notification: {{ .Values.settings.notificationEnabled | quote }}
+ app-health: {{ .Values.settings.healthEnabled | quote }}
+ app-archive: {{ .Values.settings.archiveEnabled | quote }}
+
+ organization-name: {{ .Values.settings.organisationMame | quote }}
+ organization-email: {{ .Values.settings.email | quote }}
+ organization-country: {{ .Values.settings.country | quote }}
+ organization-state: {{ .Values.settings.state | quote }}
+ organization-locality: {{ .Values.settings.locality | quote }}
+ organization-unit: {{ .Values.settings.unit | quote }}
+
env: {{ .Values.settings.env | quote }}
debug: {{ .Values.settings.debug | quote }}
cors-allow-origin: {{ .Values.settings.corsAllowOrigin | quote }}
trusted-proxies: {{ join "," .Values.settings.trustedProxies }}
trusted-hosts: {{ .Values.settings.trustedHosts | quote }}
- project-name: {{ .Values.settings.projectName | quote }}
- php-service: {{ include "name" . }}-{{ .Values.settings.env }}-php
-
+ php-service: {{ include "name" . }}-{{ .Values.settings.env }}-php
varnish-url: {{ if .Values.varnish.enabled }}http://varnish{{ else }}{{ .Values.varnish.url | quote }}{{ end }}
mercure-publish-url: {{ .Values.mercure.publishUrl | quote }}
mercure-subscribe-url: {{ .Values.mercure.subscribeUrl | quote }}
diff --git a/api/helm/templates/ingress.yaml b/api/helm/templates/ingress.yaml
index 4437f785..5c76e036 100644
--- a/api/helm/templates/ingress.yaml
+++ b/api/helm/templates/ingress.yaml
@@ -1,7 +1,11 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
- name: {{ template "fullname" . }}
+ annotations:
+ # add an annotation indicating the issuer to use.
+ cert-manager.io/acme-challenge-type: http01
+ cert-manager.io/cluster-issuer: {{ include "name" . }}-{{ .Values.settings.env }}-letsencrypt
+ name: {{ include "name" . }}-{{ .Values.settings.env }}-ingress
labels:
app.kubernetes.io/name: {{ include "name" . }}-ingress
app.kubernetes.io/part-of: {{ include "name" . }}
@@ -13,23 +17,89 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
-{{- if .Values.ingress.tls }}
- tls:
- {{- range .Values.ingress.tls }}
- - hosts:
- {{- range .hosts }}
- - {{ .host | quote }}
- {{- end }}
- secretName: {{ .secretName }}
- {{- end }}
-{{- end }}
+ tls:
+ - hosts:
+ - {{ .Values.settings.domain }}
+ secretName: {{ include "name" . }}-tls-cert
rules:
- {{- range .Values.ingress.hosts }}
- - host: {{ .host | quote }}
+# - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.{{ .Values.settings.domain }}
+# http:
+# paths:
+# - backend:
+# serviceName: {{ include "name" . }}
+# servicePort: 80
+ {{- if eq .Values.settings.env "prod" }}
+ - host: {{ .Values.settings.name }}.{{ .Values.settings.domain }}
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.huwelijksplanner.online
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.trouwplanner.online
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.common-ground.nl
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.larping.eu
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.zaakonline.eu
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ {{- else }}
+ - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.{{ .Values.settings.domain }}
http:
paths:
- - path: /*
- backend:
- serviceName: {{ .serviceName }}
- servicePort: {{ .servicePort | default 80 }}
- {{- end }}
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.huwelijksplanner.online
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.trouwplanner.online
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.common-ground.nl
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.larping.eu
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.zaakonline.nl
+ http:
+ paths:
+ - backend:
+ serviceName: {{ include "name" . }}
+ servicePort: 80
+ {{- end }}
diff --git a/api/helm/templates/php-deployment.yaml b/api/helm/templates/php-deployment.yaml
index bd471b70..611e5d39 100644
--- a/api/helm/templates/php-deployment.yaml
+++ b/api/helm/templates/php-deployment.yaml
@@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
- replicas: {{ .Values.php.replicaCount }}
+ replicas: 3
template:
metadata:
labels:
@@ -46,7 +46,22 @@ spec:
valueFrom:
configMapKeyRef:
name: {{ template "fullname" . }}
- key: project-name
+ key: app-name
+ - name: APP_TITLE
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-title
+ - name: APP_DESCRIPTION
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-description
+ - name: APP_VERSION
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-version
- name: APP_ENV
valueFrom:
configMapKeyRef:
@@ -57,6 +72,75 @@ spec:
configMapKeyRef:
name: {{ template "fullname" . }}
key: debug
+ - name: APP_DEMO
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-demo
+ - name: APP_DOMAIN
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-domain
+ # organization
+ - name: ORGANIZATION_NAME
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: organization-name
+ - name: ORGANIZATION_EMAIL_ADDRESS
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: organization-email
+ - name: ORGANIZATION_COUNTRY_NAME
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: organization-country
+ - name: ORGANIZATION_STATE
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: organization-state
+ - name: ORGANIZATION_LOCALITY
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: organization-locality
+ - name: ORGANIZATION_UNIT_NAME
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: organization-unit
+ # config
+ - name: AUTH_ENABLED
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-auth
+ - name: AUDITTRAIL_ENABLED
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-audittrail
+ - name: NOTIFICATION_ENABLED
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-notification
+ - name: HEALTH_ENABLED
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-health
+ - name: ARCHIVE_ENABLED
+ valueFrom:
+ configMapKeyRef:
+ name: {{ template "fullname" . }}
+ key: app-archive
+
+ # bla bla
- name: CORS_ALLOW_ORIGIN
valueFrom:
configMapKeyRef:
diff --git a/api/helm/values.yaml b/api/helm/values.yaml
index 98ff5b0a..3bd2f92b 100644
--- a/api/helm/values.yaml
+++ b/api/helm/values.yaml
@@ -5,27 +5,44 @@
settings:
registryBase: docker.io/conduction
projectName: vtc
- version: dev
+ name: vtc
+ title: Verzoek Type Catalogus
+ version: V.0.1
+ description: ''Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.''
+ repro: 'https://github.com/ConductionNL/Proto-component-commonground'
+ domain: conduction.nl
+ organisationName: Conduction
+ email: info@conduction.nl
+ country: Netherlands
+ state: Noord-Holland
+ locality: Amsterdam
+ unit: Common-Ground
+ demo: pc.zaakonline.nl
env: dev
debug: 1
replicaCount: 1
corsAllowOrigin: ['*']
- trustedHosts: '^(.+\.)?common-ground\.dev$|^(.+\.)?zaakonline\.nl$|^(.+\.)?conduction\.nl$|^example\.com$|^(.+\.)?178.128.142.152$|178.128.142.152|localhost'
+ trustedHosts: '^(.+\.)?conduction\.nl$|^(.+\.)?huwelijksplanner\.online$|^(.+\.)?larping\.eu$|^(.+\.)?common-ground\.nl$|^(.+\.)?trouwplanner\.online$|^(.+\.)?zaakonline\.nl$|localhost'
pullPolicy: Always
# You will need these proxies on kubernetes
trustedProxies:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
- # If you are runnig a single component on a kubernetes cluster you can just easaliy enable the load balancer, if not you need to set up a multi component load balancer
+ # If you are runnig a single component on a kubernetes cluster you can just easaliy enable the load balancer, if not you need to set up a multi component load balancer
loadbalancerEnabled: false
# If you want to enable NLX you are requered to add the appropreate certificates to you nlx-settings folder (located in the /api folder)
nlxInwayEnabled: false
- nlxOutwayEnabled: true
-
+ # If you are runnig a single component on a kubernetes cluster you can just easaliy enable the load balancer, if not you need to set up a multi component load balancer
+ notificationEnabled: false
+ audittrailEnabled: false
+ authorisationEnabled: false
+ healthEnabled: false
+ archiveEnabled: false
+
php:
- repository: docker.io/conduction/protocomponent-php
+ repository: docker.io/conduction/vtc-php
tag: latest
mercure:
jwtSecret: ""
@@ -41,7 +58,7 @@ nginx:
varnish:
enabled: true
#url: https://example.com
- repository: docker.io/conduction/protocomponent-varnish
+ repository: docker.io/conduction/vtc-varnish
tag: latest
pullPolicy: Always
replicaCount: 1
diff --git a/api/public/schema/openapi.yaml b/api/public/schema/openapi.yaml
index b6158435..91450395 100644
--- a/api/public/schema/openapi.yaml
+++ b/api/public/schema/openapi.yaml
@@ -16,6 +16,7 @@ info:
Voor het gebruik van deze applicatie is een JWT Token nodig, deze hangt altijd vast aan een applicatie, ofwel user. Geldige JWT Tokens worden aangemaakt bij het registreren van een applicatie en kennen een beperkte houdbaarheid.
JWT Tokens kunnen zowel worden verlengd, als opnieuw worden aangevraagd, dit aan de hand van de applicatie id en sleutel.
Let er bij het meegeven van JWT tokens op dat deze moet worden voorafgegaan door een Bearer en een spatie, onder de header Authorization. De volledig naam wordt daarmee: 'Authorization: Bearer [TOKEN]'.
+
paths:
/properties:
@@ -108,9 +109,13 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
+ -
+ name: Link
+ description: 'A [websub](https://www.w3.org/TR/websub/#discovery) header like ; rel="hub"'
+ in: header
-
name: 'extend[]'
required: false
@@ -149,6 +154,8 @@ paths:
type: string
format: date-time
in: query
+ produces:
+ - application/health+json
post:
tags:
- Property
@@ -246,7 +253,7 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
'/properties/{id}':
@@ -288,9 +295,13 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
+ -
+ name: Link
+ description: 'A [websub](https://www.w3.org/TR/websub/#discovery) header like ; rel="hub"'
+ in: header
-
name: 'extend[]'
required: false
@@ -359,6 +370,8 @@ paths:
$ref: '#/components/schemas/Property-read'
404:
description: 'Resource not found'
+ produces:
+ - application/health+json
delete:
tags:
- Property
@@ -402,7 +415,7 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
put:
@@ -443,7 +456,7 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
responses:
@@ -543,7 +556,7 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
responses:
@@ -641,13 +654,13 @@ paths:
$ref: '#/components/schemas/RequestType-read'
parameters:
-
- name: source_organization
+ name: sourceOrganization
in: query
required: false
schema:
type: string
-
- name: 'source_organization[]'
+ name: 'sourceOrganization[]'
in: query
required: false
schema:
@@ -690,9 +703,13 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
+ -
+ name: Link
+ description: 'A [websub](https://www.w3.org/TR/websub/#discovery) header like ; rel="hub"'
+ in: header
-
name: 'extend[]'
required: false
@@ -731,6 +748,8 @@ paths:
type: string
format: date-time
in: query
+ produces:
+ - application/health+json
post:
tags:
- RequestType
@@ -828,7 +847,7 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
'/request_types/{id}':
@@ -870,9 +889,13 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
+ -
+ name: Link
+ description: 'A [websub](https://www.w3.org/TR/websub/#discovery) header like ; rel="hub"'
+ in: header
-
name: 'extend[]'
required: false
@@ -941,6 +964,8 @@ paths:
$ref: '#/components/schemas/RequestType-read'
404:
description: 'Resource not found'
+ produces:
+ - application/health+json
put:
tags:
- RequestType
@@ -979,7 +1004,7 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
responses:
@@ -1084,7 +1109,7 @@ paths:
description: 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`'
in: header
-
- name: X-Audit-Clarification
+ name: X-NLX-Audit-Clarification
description: 'A clarification as to why a request has been made (doelbinding)'
in: header
components:
@@ -1096,25 +1121,22 @@ components:
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
https://tools.ietf.org/html/draft-wright-json-schema-validation-00
http://json-schema.org/
- required:
- - request_type
- - title
- - type
- - format
properties:
- request_type:
+ id:
+ readOnly: true
+ description: 'The UUID identifier of this object'
+ externalDocs:
+ url: 'http://schema.org/identifier'
+ type: string
+ requestType:
description: 'The requestType that this property belongs to'
$ref: '#/components/schemas/RequestType-read'
title:
description: 'The title of this property'
- externalDocs:
- url: 'http://schema.org/name'
type: string
name:
readOnly: true
- description: '*'
- externalDocs:
- url: 'http://schema.org/name'
+ description: 'The name of the property as used in api calls, extracted from title on snake_case basis'
type: string
type:
description: 'The type of this property'
@@ -1122,45 +1144,46 @@ components:
format:
description: 'The swagger type of the property as used in api calls'
type: string
- multiple_of:
+ multipleOf:
description: '*Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5'
type: integer
maximum:
description: '*Can only be used in combination with type integer* The maximum allowed value'
type: integer
- exclusive_maximum:
+ exclusiveMaximum:
description: '*Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4'
type: boolean
minimum:
description: '*Can only be used in combination with type integer* The minimum allowed value'
type: integer
- exclusive_minimum:
+ exclusiveMinimum:
description: '*Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6'
type: boolean
- max_length:
+ maxLength:
description: 'The maximum amount of characters in the value'
type: integer
- min_length:
+ minLength:
description: 'The minimal amount of characters in the value'
type: integer
pattern:
+ description: 'A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to'
type: string
- additional_items:
+ additionalItems:
description: 'Not yet supported by business logic'
type: boolean
- max_items:
+ maxItems:
description: '*Can only be used in combination with type array* The maximum array length'
type: integer
- min_items:
+ minItems:
description: '*Can only be used in combination with type array* The minimum allowed value'
type: integer
- unique_items:
+ uniqueItems:
description: '*Can only be used in combination with type array* Define whether or not values in an array should be unique'
type: boolean
- max_properties:
+ maxProperties:
description: '*Can only be used in combination with type integer* The maximum amount of properties an object should contain'
type: integer
- min_properties:
+ minProperties:
description: '*Can only be used in combination with type object* The minimum amount of properties an object should contain'
type: integer
required:
@@ -1169,20 +1192,21 @@ components:
properties:
description: 'Not yet supported by business logic'
type: string
- additional_properties:
+ additionalProperties:
description: 'Not yet supported by business logic'
type: string
object:
description: 'Not yet supported by business logic'
type: string
enum:
+ description: 'An array of possible values, input is limited to this array'
type: array
items:
type: string
description:
description: 'An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)'
type: string
- default_value:
+ defaultValue:
description: 'An default value for this value that will be used if a user doesn''t supply a value'
type: string
nullable:
@@ -1191,16 +1215,16 @@ components:
discriminator:
description: 'To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name'
type: string
- read_only:
+ readOnly:
description: 'Whether or not this property is read only'
type: boolean
- write_only:
+ writeOnly:
description: 'Whether or not this property is write only'
type: boolean
xml:
description: 'An XML representation of the swagger docs'
type: string
- external_doc:
+ externalDoc:
description: 'An link to any external documentation for the value'
type: string
example:
@@ -1209,24 +1233,29 @@ components:
deprecated:
description: 'Whether or not this property has been deprecated and wil be removed in the future'
type: boolean
- available_from:
+ availableFrom:
description: 'The moment from which this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- available_until:
+ availableUntil:
description: '*should be used in combination with deprecated* The moment where until this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- min_date:
+ minDate:
description: 'The minimal date for value, either a date, datetime or duration (ISO_8601)'
type: string
- max_date:
+ maxDate:
description: 'The maximum date for value, either a date, datetime or duration (ISO_8601)'
type: string
+ required:
+ - requestType
+ - title
+ - type
+ - format
Property-write:
type: object
description: |
@@ -1235,18 +1264,16 @@ components:
https://tools.ietf.org/html/draft-wright-json-schema-validation-00
http://json-schema.org/
required:
- - request_type
+ - requestType
- title
- type
- format
properties:
- request_type:
+ requestType:
description: 'The requestType that this property belongs to'
$ref: '#/components/schemas/RequestType-write'
title:
description: 'The title of this property'
- externalDocs:
- url: 'http://schema.org/name'
type: string
type:
description: 'The type of this property'
@@ -1254,45 +1281,46 @@ components:
format:
description: 'The swagger type of the property as used in api calls'
type: string
- multiple_of:
+ multipleOf:
description: '*Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5'
type: integer
maximum:
description: '*Can only be used in combination with type integer* The maximum allowed value'
type: integer
- exclusive_maximum:
+ exclusiveMaximum:
description: '*Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4'
type: boolean
minimum:
description: '*Can only be used in combination with type integer* The minimum allowed value'
type: integer
- exclusive_minimum:
+ exclusiveMinimum:
description: '*Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6'
type: boolean
- max_length:
+ maxLength:
description: 'The maximum amount of characters in the value'
type: integer
- min_length:
+ minLength:
description: 'The minimal amount of characters in the value'
type: integer
pattern:
+ description: 'A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to'
type: string
- additional_items:
+ additionalItems:
description: 'Not yet supported by business logic'
type: boolean
- max_items:
+ maxItems:
description: '*Can only be used in combination with type array* The maximum array length'
type: integer
- min_items:
+ minItems:
description: '*Can only be used in combination with type array* The minimum allowed value'
type: integer
- unique_items:
+ uniqueItems:
description: '*Can only be used in combination with type array* Define whether or not values in an array should be unique'
type: boolean
- max_properties:
+ maxProperties:
description: '*Can only be used in combination with type integer* The maximum amount of properties an object should contain'
type: integer
- min_properties:
+ minProperties:
description: '*Can only be used in combination with type object* The minimum amount of properties an object should contain'
type: integer
required:
@@ -1301,20 +1329,21 @@ components:
properties:
description: 'Not yet supported by business logic'
type: string
- additional_properties:
+ additionalProperties:
description: 'Not yet supported by business logic'
type: string
object:
description: 'Not yet supported by business logic'
type: string
enum:
+ description: 'An array of possible values, input is limited to this array'
type: array
items:
type: string
description:
description: 'An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)'
type: string
- default_value:
+ defaultValue:
description: 'An default value for this value that will be used if a user doesn''t supply a value'
type: string
nullable:
@@ -1323,16 +1352,16 @@ components:
discriminator:
description: 'To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name'
type: string
- read_only:
+ readOnly:
description: 'Whether or not this property is read only'
type: boolean
- write_only:
+ writeOnly:
description: 'Whether or not this property is write only'
type: boolean
xml:
description: 'An XML representation of the swagger docs'
type: string
- external_doc:
+ externalDoc:
description: 'An link to any external documentation for the value'
type: string
example:
@@ -1341,22 +1370,22 @@ components:
deprecated:
description: 'Whether or not this property has been deprecated and wil be removed in the future'
type: boolean
- available_from:
+ availableFrom:
description: 'The moment from which this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- available_until:
+ availableUntil:
description: '*should be used in combination with deprecated* The moment where until this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- min_date:
+ minDate:
description: 'The minimal date for value, either a date, datetime or duration (ISO_8601)'
type: string
- max_date:
+ maxDate:
description: 'The maximum date for value, either a date, datetime or duration (ISO_8601)'
type: string
'Property:jsonld-read':
@@ -1366,11 +1395,6 @@ components:
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
https://tools.ietf.org/html/draft-wright-json-schema-validation-00
http://json-schema.org/
- required:
- - request_type
- - title
- - type
- - format
properties:
'@context':
readOnly: true
@@ -1381,19 +1405,21 @@ components:
'@type':
readOnly: true
type: string
- request_type:
+ id:
+ readOnly: true
+ description: 'The UUID identifier of this object'
+ externalDocs:
+ url: 'http://schema.org/identifier'
+ type: string
+ requestType:
description: 'The requestType that this property belongs to'
$ref: '#/components/schemas/RequestType:jsonld-read'
title:
description: 'The title of this property'
- externalDocs:
- url: 'http://schema.org/name'
type: string
name:
readOnly: true
- description: '*'
- externalDocs:
- url: 'http://schema.org/name'
+ description: 'The name of the property as used in api calls, extracted from title on snake_case basis'
type: string
type:
description: 'The type of this property'
@@ -1401,45 +1427,46 @@ components:
format:
description: 'The swagger type of the property as used in api calls'
type: string
- multiple_of:
+ multipleOf:
description: '*Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5'
type: integer
maximum:
description: '*Can only be used in combination with type integer* The maximum allowed value'
type: integer
- exclusive_maximum:
+ exclusiveMaximum:
description: '*Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4'
type: boolean
minimum:
description: '*Can only be used in combination with type integer* The minimum allowed value'
type: integer
- exclusive_minimum:
+ exclusiveMinimum:
description: '*Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6'
type: boolean
- max_length:
+ maxLength:
description: 'The maximum amount of characters in the value'
type: integer
- min_length:
+ minLength:
description: 'The minimal amount of characters in the value'
type: integer
pattern:
+ description: 'A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to'
type: string
- additional_items:
+ additionalItems:
description: 'Not yet supported by business logic'
type: boolean
- max_items:
+ maxItems:
description: '*Can only be used in combination with type array* The maximum array length'
type: integer
- min_items:
+ minItems:
description: '*Can only be used in combination with type array* The minimum allowed value'
type: integer
- unique_items:
+ uniqueItems:
description: '*Can only be used in combination with type array* Define whether or not values in an array should be unique'
type: boolean
- max_properties:
+ maxProperties:
description: '*Can only be used in combination with type integer* The maximum amount of properties an object should contain'
type: integer
- min_properties:
+ minProperties:
description: '*Can only be used in combination with type object* The minimum amount of properties an object should contain'
type: integer
required:
@@ -1448,20 +1475,21 @@ components:
properties:
description: 'Not yet supported by business logic'
type: string
- additional_properties:
+ additionalProperties:
description: 'Not yet supported by business logic'
type: string
object:
description: 'Not yet supported by business logic'
type: string
enum:
+ description: 'An array of possible values, input is limited to this array'
type: array
items:
type: string
description:
description: 'An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)'
type: string
- default_value:
+ defaultValue:
description: 'An default value for this value that will be used if a user doesn''t supply a value'
type: string
nullable:
@@ -1470,16 +1498,16 @@ components:
discriminator:
description: 'To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name'
type: string
- read_only:
+ readOnly:
description: 'Whether or not this property is read only'
type: boolean
- write_only:
+ writeOnly:
description: 'Whether or not this property is write only'
type: boolean
xml:
description: 'An XML representation of the swagger docs'
type: string
- external_doc:
+ externalDoc:
description: 'An link to any external documentation for the value'
type: string
example:
@@ -1488,24 +1516,29 @@ components:
deprecated:
description: 'Whether or not this property has been deprecated and wil be removed in the future'
type: boolean
- available_from:
+ availableFrom:
description: 'The moment from which this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- available_until:
+ availableUntil:
description: '*should be used in combination with deprecated* The moment where until this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- min_date:
+ minDate:
description: 'The minimal date for value, either a date, datetime or duration (ISO_8601)'
type: string
- max_date:
+ maxDate:
description: 'The maximum date for value, either a date, datetime or duration (ISO_8601)'
type: string
+ required:
+ - requestType
+ - title
+ - type
+ - format
'Property:jsonld-write':
type: object
description: |
@@ -1514,7 +1547,7 @@ components:
https://tools.ietf.org/html/draft-wright-json-schema-validation-00
http://json-schema.org/
required:
- - request_type
+ - requestType
- title
- type
- format
@@ -1528,13 +1561,11 @@ components:
'@type':
readOnly: true
type: string
- request_type:
+ requestType:
description: 'The requestType that this property belongs to'
$ref: '#/components/schemas/RequestType:jsonld-write'
title:
description: 'The title of this property'
- externalDocs:
- url: 'http://schema.org/name'
type: string
type:
description: 'The type of this property'
@@ -1542,45 +1573,46 @@ components:
format:
description: 'The swagger type of the property as used in api calls'
type: string
- multiple_of:
+ multipleOf:
description: '*Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5'
type: integer
maximum:
description: '*Can only be used in combination with type integer* The maximum allowed value'
type: integer
- exclusive_maximum:
+ exclusiveMaximum:
description: '*Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4'
type: boolean
minimum:
description: '*Can only be used in combination with type integer* The minimum allowed value'
type: integer
- exclusive_minimum:
+ exclusiveMinimum:
description: '*Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6'
type: boolean
- max_length:
+ maxLength:
description: 'The maximum amount of characters in the value'
type: integer
- min_length:
+ minLength:
description: 'The minimal amount of characters in the value'
type: integer
pattern:
+ description: 'A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to'
type: string
- additional_items:
+ additionalItems:
description: 'Not yet supported by business logic'
type: boolean
- max_items:
+ maxItems:
description: '*Can only be used in combination with type array* The maximum array length'
type: integer
- min_items:
+ minItems:
description: '*Can only be used in combination with type array* The minimum allowed value'
type: integer
- unique_items:
+ uniqueItems:
description: '*Can only be used in combination with type array* Define whether or not values in an array should be unique'
type: boolean
- max_properties:
+ maxProperties:
description: '*Can only be used in combination with type integer* The maximum amount of properties an object should contain'
type: integer
- min_properties:
+ minProperties:
description: '*Can only be used in combination with type object* The minimum amount of properties an object should contain'
type: integer
required:
@@ -1589,20 +1621,21 @@ components:
properties:
description: 'Not yet supported by business logic'
type: string
- additional_properties:
+ additionalProperties:
description: 'Not yet supported by business logic'
type: string
object:
description: 'Not yet supported by business logic'
type: string
enum:
+ description: 'An array of possible values, input is limited to this array'
type: array
items:
type: string
description:
description: 'An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)'
type: string
- default_value:
+ defaultValue:
description: 'An default value for this value that will be used if a user doesn''t supply a value'
type: string
nullable:
@@ -1611,16 +1644,16 @@ components:
discriminator:
description: 'To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name'
type: string
- read_only:
+ readOnly:
description: 'Whether or not this property is read only'
type: boolean
- write_only:
+ writeOnly:
description: 'Whether or not this property is write only'
type: boolean
xml:
description: 'An XML representation of the swagger docs'
type: string
- external_doc:
+ externalDoc:
description: 'An link to any external documentation for the value'
type: string
example:
@@ -1629,56 +1662,58 @@ components:
deprecated:
description: 'Whether or not this property has been deprecated and wil be removed in the future'
type: boolean
- available_from:
+ availableFrom:
description: 'The moment from which this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- available_until:
+ availableUntil:
description: '*should be used in combination with deprecated* The moment where until this value is available'
externalDocs:
url: 'http://schema.org/DateTime'
type: string
format: date-time
- min_date:
+ minDate:
description: 'The minimal date for value, either a date, datetime or duration (ISO_8601)'
type: string
- max_date:
+ maxDate:
description: 'The maximum date for value, either a date, datetime or duration (ISO_8601)'
type: string
RequestType-read:
type: object
description: ''
- required:
- - source_organization
properties:
- source_organization:
+ id:
+ readOnly: true
+ description: 'The UUID identifier of this object'
+ externalDocs:
+ url: 'http://schema.org/identifier'
+ type: string
+ sourceOrganization:
description: 'The RSIN of the organization that owns this process'
type: string
name:
readOnly: true
description: 'The name of this RequestType'
- externalDocs:
- url: 'http://schema.org/name'
type: string
description:
readOnly: true
description: 'An short description of this RequestType'
- externalDocs:
- url: 'https://schema.org/description'
type: string
properties:
type: array
items:
$ref: '#/components/schemas/Property-read'
+ required:
+ - sourceOrganization
RequestType-write:
type: object
description: ''
required:
- - source_organization
+ - sourceOrganization
properties:
- source_organization:
+ sourceOrganization:
description: 'The RSIN of the organization that owns this process'
type: string
properties:
@@ -1688,8 +1723,6 @@ components:
'RequestType:jsonld-read':
type: object
description: ''
- required:
- - source_organization
properties:
'@context':
readOnly: true
@@ -1700,30 +1733,34 @@ components:
'@type':
readOnly: true
type: string
- source_organization:
+ id:
+ readOnly: true
+ description: 'The UUID identifier of this object'
+ externalDocs:
+ url: 'http://schema.org/identifier'
+ type: string
+ sourceOrganization:
description: 'The RSIN of the organization that owns this process'
type: string
name:
readOnly: true
description: 'The name of this RequestType'
- externalDocs:
- url: 'http://schema.org/name'
type: string
description:
readOnly: true
description: 'An short description of this RequestType'
- externalDocs:
- url: 'https://schema.org/description'
type: string
properties:
type: array
items:
$ref: '#/components/schemas/Property:jsonld-read'
+ required:
+ - sourceOrganization
'RequestType:jsonld-write':
type: object
description: ''
required:
- - source_organization
+ - sourceOrganization
properties:
'@context':
readOnly: true
@@ -1734,13 +1771,245 @@ components:
'@type':
readOnly: true
type: string
- source_organization:
+ sourceOrganization:
description: 'The RSIN of the organization that owns this process'
type: string
properties:
type: array
items:
$ref: '#/components/schemas/Property:jsonld-write'
+definitions:
+ Property-read:
+ properties:
+ id:
+ example: e2984465-190a-4562-829e-a8cca81aa35d
+ format: uuid
+ title:
+ example: 'My Property'
+ maxLength: 255
+ minLength: 15
+ type:
+ example: string
+ maxLength: 255
+ format:
+ example: string
+ maxLength: 255
+ multipleOf:
+ example: '2'
+ maximum:
+ example: '2'
+ exclusiveMaximum:
+ example: 'true'
+ minimum:
+ example: '2'
+ exclusiveMinimum:
+ example: 'true'
+ maxLength:
+ example: '2'
+ minLength:
+ example: '2'
+ pattern:
+ example: '''[+-]?(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?'''
+ maxLength: 255
+ additionalItems: []
+ maxItems:
+ example: '2'
+ minItems:
+ example: '2'
+ uniqueItems:
+ example: 'false'
+ maxProperties:
+ example: '2'
+ minProperties:
+ example: '2'
+ required:
+ example: 'false'
+ properties: []
+ additionalProperties: []
+ object: []
+ enum: []
+ description:
+ example: 'My value'
+ defaultValue:
+ example: 'My value'
+ maxLength: 255
+ nullable:
+ example: 'false'
+ discriminator:
+ example: name
+ maxLength: 255
+ readOnly:
+ example: 'false'
+ writeOnly:
+ example: 'false'
+ xml:
+ example: ''''''
+ externalDoc:
+ example: 'https://www.w3.org/TR/NOTE-datetime'
+ maxLength: 255
+ example:
+ example: 'My value'
+ maxLength: 255
+ deprecated:
+ example: 'false'
+ availableFrom:
+ example: '2019-09-16T14:26:51+00:00'
+ availableUntil:
+ example: '2019-09-16T14:26:51+00:00'
+ minDate:
+ example: '2019-09-16T14:26:51+00:00'
+ maxDate:
+ example: '2019-09-16T14:26:51+00:00'
+ requestType: []
+ required: []
+ Property-write:
+ properties:
+ title:
+ example: 'My Property'
+ maxLength: 255
+ minLength: 15
+ type:
+ example: string
+ maxLength: 255
+ format:
+ example: string
+ maxLength: 255
+ multipleOf:
+ example: '2'
+ maximum:
+ example: '2'
+ exclusiveMaximum:
+ example: 'true'
+ minimum:
+ example: '2'
+ exclusiveMinimum:
+ example: 'true'
+ maxLength:
+ example: '2'
+ minLength:
+ example: '2'
+ pattern:
+ example: '''[+-]?(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?'''
+ maxLength: 255
+ additionalItems: []
+ maxItems:
+ example: '2'
+ minItems:
+ example: '2'
+ uniqueItems:
+ example: 'false'
+ maxProperties:
+ example: '2'
+ minProperties:
+ example: '2'
+ required:
+ example: 'false'
+ properties: []
+ additionalProperties: []
+ object: []
+ enum: []
+ description:
+ example: 'My value'
+ defaultValue:
+ example: 'My value'
+ maxLength: 255
+ nullable:
+ example: 'false'
+ discriminator:
+ example: name
+ maxLength: 255
+ readOnly:
+ example: 'false'
+ writeOnly:
+ example: 'false'
+ xml:
+ example: ''''''
+ externalDoc:
+ example: 'https://www.w3.org/TR/NOTE-datetime'
+ maxLength: 255
+ example:
+ example: 'My value'
+ maxLength: 255
+ deprecated:
+ example: 'false'
+ availableFrom:
+ example: '2019-09-16T14:26:51+00:00'
+ availableUntil:
+ example: '2019-09-16T14:26:51+00:00'
+ minDate:
+ example: '2019-09-16T14:26:51+00:00'
+ maxDate:
+ example: '2019-09-16T14:26:51+00:00'
+ requestType: []
+ required: []
+ RequestType-read:
+ properties:
+ id:
+ example: e2984465-190a-4562-829e-a8cca81aa35d
+ format: uuid
+ sourceOrganization:
+ example: '002851234'
+ maxLength: 11
+ minLength: 8
+ name:
+ example: 'My RequestType'
+ maxLength: 255
+ description:
+ example: 'This is the best request ever'
+ maxLength: 2550
+ properties: []
+ required:
+ - sourceOrganization
+ - name
+ RequestType-write:
+ properties:
+ sourceOrganization:
+ example: '002851234'
+ maxLength: 11
+ minLength: 8
+ properties: []
+ required:
+ - sourceOrganization
+ - name
+ RequestType-write-requesttype:
+ properties:
+ extends: []
+ required:
+ - sourceOrganization
+ - name
+tags:
+ -
+ name: Property
+ description: |
+ This property follows the following schemes (in order of importance)
+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
+ https://tools.ietf.org/html/draft-wright-json-schema-validation-00
+ http://json-schema.org/
+
+
+ -
+ name: RequestType
+ description: |
+
+
+
+securityDefinitions:
+ JWT-Oauth:
+ type: oauth2
+ authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
+ flow: implicit
+ scopes:
+ read: 'read right to the RequestType resource'
+ write: 'write right to the RequestType resource'
+ write-requesttype: 'write-requesttype right to the RequestType resource'
+ JWT-Token:
+ type: apiKey
+ in: header
+ name: Authorization
+ scopes:
+ read: 'read right to the RequestType resource'
+ write: 'write right to the RequestType resource'
+ write-requesttype: 'write-requesttype right to the RequestType resource'
host: irc.zaakonline.nl
servers:
-
diff --git a/api/src/Command/ApiHelmCommand.php b/api/src/Command/ApiHelmCommand.php
index 6bac5366..0caa16f6 100644
--- a/api/src/Command/ApiHelmCommand.php
+++ b/api/src/Command/ApiHelmCommand.php
@@ -1,5 +1,7 @@
twig= $twig;
-
- parent::__construct();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function configure()
- {
- $this
- ->setName('app:helm:update')
- // the short description shown while running "php bin/console list"
- ->setDescription('Creates a new helm chart.')
-
- // the full command description shown when running the command with
- // the "--help" option
- ->setHelp('This command allows you to create a new hel chart from the helm template')
- ->setAliases(['app:helm:export'])
- ->setDescription('Dump the OpenAPI documentation')
- ->addOption('location', null, InputOption::VALUE_OPTIONAL, 'Write output to files in the given location','/srv/api/helm')
- ->addOption('spec-version', null, InputOption::VALUE_OPTIONAL, 'Helm version to use ("0.1.0")', '0.1.0')
- ;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $io = new SymfonyStyle($input, $output);
- /** @var string $version */
- $version = $input->getOption('spec-version');
-
- //if (!\in_array($version, ['0.1.0'], true)) {
- // throw new InvalidOptionException(sprintf('This tool only supports version 2 and 3 of the OpenAPI specification ("%s" given).', $version));
- //}
-
- $values = $this->twig->render('helm/Values.yaml.twig');
- $chart = $this->twig->render('helm/Chart.yaml.twig');
-
-
- if (!empty($location= $input->getOption('location')) && \is_string($location)) {
- file_put_contents($location.'/values.yaml', $values);
- file_put_contents($location.'/Chart.yaml', $chart);
- $io->success(sprintf('Data written to %s (specification version %s).', $location, $version));
- } else {
- // outputs multiple lines to the console (adding "\n" at the end of each line)
- $output->writeln([
- 'Helm Chart Creator',
- '============',
- $chart,
- ]);
- }
- }
+ private $twig;
+
+ public function __construct(Environment $twig)
+ {
+ $this->twig = $twig;
+
+ parent::__construct();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('app:helm:update')
+ // the short description shown while running "php bin/console list"
+ ->setDescription('Creates a new helm chart.')
+
+ // the full command description shown when running the command with
+ // the "--help" option
+ ->setHelp('This command allows you to create a new hel chart from the helm template')
+ ->setAliases(['app:helm:export'])
+ ->setDescription('Dump the OpenAPI documentation')
+ ->addOption('location', null, InputOption::VALUE_OPTIONAL, 'Write output to files in the given location', '/srv/api/helm')
+ ->addOption('spec-version', null, InputOption::VALUE_OPTIONAL, 'Helm version to use ("0.1.0")', '0.1.0');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $io = new SymfonyStyle($input, $output);
+ /** @var string $version */
+ $version = $input->getOption('spec-version');
+
+ //if (!\in_array($version, ['0.1.0'], true)) {
+ // throw new InvalidOptionException(sprintf('This tool only supports version 2 and 3 of the OpenAPI specification ("%s" given).', $version));
+ //}
+
+ $values = $this->twig->render('helm/Values.yaml.twig');
+ $chart = $this->twig->render('helm/Chart.yaml.twig');
+
+ if (!empty($location = $input->getOption('location')) && \is_string($location)) {
+ file_put_contents($location.'/values.yaml', $values);
+ file_put_contents($location.'/Chart.yaml', $chart);
+ $io->success(sprintf('Data written to %s (specification version %s).', $location, $version));
+ } else {
+ // outputs multiple lines to the console (adding "\n" at the end of each line)
+ $output->writeln([
+ 'Helm Chart Creator',
+ '============',
+ $chart,
+ ]);
+ }
+ }
}
diff --git a/api/src/DataFixtures/AppFixtures.php b/api/src/DataFixtures/AppFixtures.php
index 6c2a0f4c..55a2d323 100644
--- a/api/src/DataFixtures/AppFixtures.php
+++ b/api/src/DataFixtures/AppFixtures.php
@@ -5,6 +5,7 @@
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
+use Ramsey\Uuid\Uuid;
use App\Entity\RequestType;
use App\Entity\Property;
@@ -16,8 +17,10 @@ public function load(ObjectManager $manager)
/*
* Verhuizen
*/
+ $id = Uuid::fromString('2bfb3cea-b5b5-459c-b3e0-e1100089a11a');
+
$verhuizenNL = new RequestType();
- $verhuizenNL->setId('2bfb3cea-b5b5-459c-b3e0-e1100089a11a');
+ $verhuizenNL->setId($id);
$verhuizenNL->setSourceOrganization('0000');
$verhuizenNL->setName('Verhuizen');
$verhuizenNL->setDescription('Het doorgeven van een verhuizing aan een gemeente');
@@ -52,20 +55,43 @@ public function load(ObjectManager $manager)
$property->setRequestType($verhuizenNL);
$manager->persist($property);
+ $id = Uuid::fromString('9d76fb58-0711-4437-acc4-9f4d9d403cdf');
$verhuizenDenBosh = new RequestType();
- $verhuizenDenBosh->setId('939f5d60-e5bd-40b2-9ccd-117cea8b3cbe');
$verhuizenDenBosh->setName('Verhuizen');
$verhuizenDenBosh->setDescription('Het doorgeven van een verhuizing aan de gemeente \'s-Hertogenbosch');
$verhuizenDenBosh->setSourceOrganization('001709124');
$verhuizenDenBosh->setExtends($verhuizenNL);
$manager->persist($verhuizenDenBosh);
+ $verhuizenDenBosh->setId($id);
+ $manager->persist($verhuizenDenBosh);
+
+
+ $property = new Property();
+ //$verhuizenNL->setId('');
+ $property->setTitle('Email');
+ $property->setDescription('Het e-mail addres dat wordt gebruikt om contact op te nemen (indien nodig) over deze verhuizing');
+ $property->setType('string');
+ $property->setFormat('email');
+ $property->setRequired(true);
+ $property->setRequestType($verhuizenNL);
+ $manager->persist($property);
+
+
+ $property = new Property();
+ //$verhuizenNL->setId('');
+ $property->setTitle('Telefoon');
+ $property->setDescription('Het telefoon nummer dat wordt gebruikt om contact op te nemen (indien nodig) over deze verhuizing');
+ $property->setType('string');
+ $property->setFormat('string');
+ $property->setRequired(true);
+ $property->setRequestType($verhuizenNL);
+ $manager->persist($property);
$verhuizenEindhoven = new RequestType();
- $verhuizenEindhoven->setId('2bfb3cea-b5b5-459c-b3e0-e1100089a11a');
+ //$verhuizenEindhoven->setId('fc79c4c9-b3b3-4258-bdbb-449262f3e5d7');
$verhuizenEindhoven->setName('Verhuizen');
$verhuizenEindhoven->setDescription('Het doorgeven van een verhuizing aan de gemeente Eindhoven');
$verhuizenEindhoven->setSourceOrganization('001902763');
- $verhuizenEindhoven->setId('fc79c4c9-b3b3-4258-bdbb-449262f3e5d7');
$verhuizenEindhoven->setExtends($verhuizenNL);
$manager->persist($verhuizenEindhoven);
@@ -92,7 +118,7 @@ public function load(ObjectManager $manager)
* Trouwen
*/
$meldingTrouwenNL= new RequestType();
- $meldingTrouwenNL->setId('d009032d-8fdd-4d09-bf43-5000f19737a7');
+ //$meldingTrouwenNL->setId('d009032d-8fdd-4d09-bf43-5000f19737a7');
$meldingTrouwenNL->setSourceOrganization('0000');
$meldingTrouwenNL->setName('Melding voorgenomen huwelijk');
$meldingTrouwenNL->setDescription('Melding voorgenomen huwelijk');
@@ -118,7 +144,7 @@ public function load(ObjectManager $manager)
$manager->persist($property);
$omzettingNL = new RequestType();
- $omzettingNL->setId('dc65cbe9-d608-4946-b3d4-368b5b0c4061');
+ //$omzettingNL->setId('dc65cbe9-d608-4946-b3d4-368b5b0c4061');
$omzettingNL->setSourceOrganization('0000');
$omzettingNL->setName('Omzetting');
$omzettingNL->setDescription('Het omzetten van een bestaand partnerschap in een huwelijk.');
@@ -154,7 +180,7 @@ public function load(ObjectManager $manager)
$manager->persist($property);
$trouwenNL = new RequestType();
- $trouwenNL->setId('2a0efa35-e911-44d9-8cf1-54bea575be81');
+ //$trouwenNL->setId('2a0efa35-e911-44d9-8cf1-54bea575be81');
$trouwenNL->setSourceOrganization('000');
$trouwenNL->setName('Huwelijk / Partnerschap');
$trouwenNL->setDescription('Huwelijk / Partnerschap');
@@ -239,13 +265,15 @@ public function load(ObjectManager $manager)
$property->setRequestType($trouwenNL);
$manager->persist($property);
+ $id = Uuid::fromString('47577f44-0ede-4655-a629-027f051d2b07');
$trouwenUtrecht = new RequestType();
- $trouwenUtrecht->setId('eb9bdd00-40ce-4510-8555-cc74b2db61c4');
$trouwenUtrecht->setExtends($trouwenNL);
$trouwenUtrecht->setSourceOrganization('002220647');
$trouwenUtrecht->setName('Trouwen of Partnerschap in Utrecht');
$trouwenUtrecht->setDescription('Trouwen of Partnerschap in Utrecht');
$manager->persist($trouwenUtrecht);
+ $trouwenUtrecht->setId($id);
+ $manager->persist($trouwenUtrecht);
$property= new Property();
//$property->setId('');
diff --git a/api/src/Entity/NLXRequestLog.php b/api/src/Entity/NLXRequestLog.php
index c3c3a1c4..1d886b85 100644
--- a/api/src/Entity/NLXRequestLog.php
+++ b/api/src/Entity/NLXRequestLog.php
@@ -235,12 +235,12 @@ public function setEndpoint(string $endpoint): self
public function getMethod(): ?string
{
- return $this->method;
+ return $this->method;
}
public function setMethod(string $method): self
{
- $this->method = $method;
+ $this->method = $method;
return $this;
}
diff --git a/api/src/Entity/Property.php b/api/src/Entity/Property.php
index 02c84a65..7ab1f6e4 100644
--- a/api/src/Entity/Property.php
+++ b/api/src/Entity/Property.php
@@ -36,18 +36,7 @@ class Property
* @var UuidInterface $id The UUID identifier of this object
* @example e2984465-190a-4562-829e-a8cca81aa35d
*
- * @ApiProperty(
- * identifier=true,
- * attributes={
- * "swagger_context"={
- * "description" = "The UUID identifier of this object",
- * "type"="string",
- * "format"="uuid",
- * "example"="e2984465-190a-4562-829e-a8cca81aa35d"
- * }
- * }
- * )
- *
+ * @Groups({"read"})
* @Assert\Uuid
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
@@ -69,22 +58,8 @@ class Property
private $requestType;
/**
- * @var string $title The title of this property
+ * @var string The title of this property
* @example My Property
- *
- * @ApiProperty(
- * iri="http://schema.org/name",
- * attributes={
- * "swagger_context"={
- * "description" = "The title of this property",
- * "type"="string",
- * "example"="My Property",
- * "minLength"="15",
- * "maxLength"="255",
- * "required" = true
- * }
- * }
- * )
* @Assert\NotBlank
* @Assert\Length(min = 15, max = 255)
* @Groups({"read", "write"})
@@ -92,23 +67,9 @@ class Property
*/
private $title;
- /** *
- * @var string $name The name of the property as used in api calls, extracted from title on snake_case basis
+ /**
+ * @var string $name The name of the property as used in api calls, extracted from title on snake_case basis
* @example my_property
- *
- * @ApiProperty(
- * iri="http://schema.org/name",
- * attributes={
- * "swagger_context"={
- * "description" = "The name of the property as used in api calls, extracted from title on snake_case basis",
- * "type"="string",
- * "example"="my_property",
- * "minLength"="15",
- * "maxLength"="255",
- * "required" = true
- * }
- * }
- * )
* @Assert\Length(min = 15, max = 255)
* @Groups({"read"})
*/
@@ -117,19 +78,6 @@ class Property
/**
* @var string $type The type of this property
* @example string
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The type of this property",
- * "type"="string",
- * "example"="string",
- * "enum"={"string", "integer", "boolean", "number","array"},
- * "maxLength"="255",
- * "required" = true
- * }
- * }
- * )
*
* @Assert\NotBlank
* @Assert\Length(max = 255)
@@ -140,22 +88,9 @@ class Property
private $type;
/**
- * @var string $type The swagger type of the property as used in api calls
+ * @var string $type The swagger type of the property as used in api calls
* @example string
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The swagger type of the property as used in api calls",
- * "type"="string",
- * "example"="string",
- * "enum"={"int32","int64","float","double","byte","binary","date","duration","date-time","password","boolean","string","uuid","uri","email","rsin","bag","bsn","iban","challenge","service","assent"},
- * "maxLength"="255",
- * "required" = true
- * }
- * }
- * )
- *
+ *
* @Assert\NotBlank
* @Assert\Length(max = 255)
* @Assert\Choice({"int32","int64","float","double","byte","binary","date","date-time","duration","password","boolean","string","uuid","uri","email","rsin","bag","bsn","iban","challenge","service","assent"})
@@ -165,19 +100,9 @@ class Property
private $format;
/**
- * @var string $multipleOf *Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5
+ * @var string $multipleOf *Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5
* @example 2
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5",
- * "type"="integer",
- * "example"="2",
- * "maxLength"="255"
- * }
- * }
- * )
+ *
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -187,18 +112,8 @@ class Property
/**
* @var string $multipleOf *Can only be used in combination with type integer* The maximum allowed value
- * @example 2
+ * @example 2
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type integer* The maximum allowed value",
- * "type"="integer",
- * "example"="2",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -209,16 +124,6 @@ class Property
/**
* @var string $exclusiveMaximum *Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4
* @example true
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4",
- * "type"="boolean",
- * "example"=true
- * }
- * }
- * )
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -229,17 +134,6 @@ class Property
/**
* @var string $minimum *Can only be used in combination with type integer* The minimum allowed value
* @example 2
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type integer* The minimum allowed value",
- * "type"="integer",
- * "example"="2",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -248,19 +142,9 @@ class Property
private $minimum;
/**
- *
- * @var string $exclusiveMinimum *Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6
+ * @var string $exclusiveMinimum *Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6
* @example true
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 4",
- * "type"="boolean",
- * "example"=true
- * }
- * }
- * )
+ *
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -269,18 +153,9 @@ class Property
private $exclusiveMinimum;
/**
- * @var string $maxLength The maximum amount of characters in the value
+ * @var string $maxLength The maximum amount of characters in the value
* @example 2
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The maximum amount of characters in the value",
- * "type"="integer",
- * "example"="2"
- * }
- * }
- * )
+ *
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -289,18 +164,8 @@ class Property
private $maxLength;
/**
- * @var string $minLength The minimal amount of characters in the value
+ * @var int $minLength The minimal amount of characters in the value
* @example 2
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The minimal amount of characters in the value",
- * "type"="integer",
- * "example"="2"
- * }
- * }
- * )
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -312,16 +177,6 @@ class Property
* @var string $pattern A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to
* @example [+-]?(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to",
- * "type"="string",
- * "example"="[+-]?(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Length(max = 255)
* @Groups({"read", "write"})
@@ -349,16 +204,6 @@ class Property
* @var string $maxItems *Can only be used in combination with type array* The maximum array length
* @example 2
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type array* The maximum array length ",
- * "type"="integer",
- * "example"="2",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -370,16 +215,6 @@ class Property
* @var string $minItems *Can only be used in combination with type array* The minimum allowed value
* @example 2
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type array* The minimum allowed value",
- * "type"="integer",
- * "example"="2",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -388,18 +223,8 @@ class Property
private $minItems;
/**
- * @var boolean $uniqueItems *Can only be used in combination with type array* Define whether or not values in an array should be unique
+ * @var boolean *Can only be used in combination with type array* Define whether or not values in an array should be unique
* @example false
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type array* Define whether or not values in an array should be unique",
- * "type"="boolean",
- * "example"=false
- * }
- * }
- * )
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -411,16 +236,6 @@ class Property
* @var string $maxProperties *Can only be used in combination with type integer* The maximum amount of properties an object should contain
* @example 2
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type integer* The maximum amount of properties an object should contain",
- * "type"="integer",
- * "example"="2",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -429,19 +244,8 @@ class Property
private $maxProperties;
/**
- * @var string $minProperties *Can only be used in combination with type object* The minimum amount of properties an object should contain
+ * @var int $minProperties *Can only be used in combination with type object* The minimum amount of properties an object should contain
* @example 2
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*Can only be used in combination with type object* The minimum amount of properties an object should contain",
- * "type"="integer",
- * "example"="2",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Type("integer")
* @Groups({"read", "write"})
@@ -452,16 +256,6 @@ class Property
/**
* @var boolean $required Only whether or not this property is required
* @example false
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "Whether or not this property is required",
- * "type"="boolean",
- * "example"=false
- * }
- * }
- * )
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -497,15 +291,6 @@ class Property
* @var array $enum An array of possible values, input is limited to this array
* @example ['first','second]
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "An array of possible values, input is limited to this array",
- * "type"="array",
- * "example"="['first','second]'"
- * }
- * }
- * )
*
* @Groups({"read", "write"})
* @ORM\Column(type="array", nullable=true)
@@ -516,15 +301,6 @@ class Property
* @var array $allOf *mutually exclusive with using type* An array of possible types that an property should confirm to
* @example ['string','boolean']
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*mutually exclusive with using type* An array of possible types that an property should confirm to",
- * "type"="array",
- * "example"="['string','boolean']"
- * }
- * }
- * )
*
* @ORM\Column(type="array", nullable=true)
*/
@@ -534,15 +310,6 @@ class Property
* @var array $anyOf *mutually exclusive with using type* An array of possible types that an property might confirm to
* @example ['string','boolean']
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*mutually exclusive with using type* An array of possible types that an property might confirm to",
- * "type"="array",
- * "example"="['string','boolean']"
- * }
- * }
- * )
*
* @ORM\Column(type="array", nullable=true)
*/
@@ -552,15 +319,6 @@ class Property
* @var array $oneOf *mutually exclusive with using type* An array of possible types that an property must confirm to
* @example ['string','boolean']
*
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*mutually exclusive with using type* An array of possible types that an property must confirm to",
- * "type"="array",
- * "example"="['string','boolean']"
- * }
- * }
- * )
*
* @ORM\Column(type="array", nullable=true)
*/
@@ -574,19 +332,8 @@ class Property
private $definitions;
/**
- * @var string $description An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)
+ * @var string An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)
* @example My value
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)",
- * "type"="string",
- * "example"="My value",
- * "maxLength"="2555"
- * }
- * }
- * )
*
* @Groups({"read", "write"})
* @ORM\Column(type="text", nullable=true)
@@ -594,19 +341,8 @@ class Property
private $description;
/**
- * @var string $defaultValue An default value for this value that will be used if a user doesn't supply a value
+ * @var string An default value for this value that will be used if a user doesn't supply a value
* @example My value
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "An default value for this value that will be used if a user doesn't supply a value",
- * "type"="string",
- * "example"="My value",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Length(max = 255)
* @Groups({"read", "write"})
@@ -616,18 +352,8 @@ class Property
/**
- * @var boolean $nullable Whether or not this property can be left empty
+ * @var boolean Whether or not this property can be left empty
* @example false
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "Whether or not this property can be left empty",
- * "type"="boolean",
- * "example"=false
- * }
- * }
- * )
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -636,19 +362,8 @@ class Property
private $nullable;
/**
- * @var string $discriminator To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name
+ * @var string To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name
* @example name
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name",
- * "type"="string",
- * "example"="name",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Length(max = 255)
* @Groups({"read", "write"})
@@ -657,18 +372,8 @@ class Property
private $discriminator;
/**
- * @var boolean $readOnly Whether or not this property is read only
+ * @var boolean Whether or not this property is read only
* @example false
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "Whether or not this property is read only",
- * "type"="boolean",
- * "example"=false
- * }
- * }
- * )
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -677,18 +382,8 @@ class Property
private $readOnly;
/**
- * @var boolean $writeOnly Whether or not this property is write only
+ * @var boolean Whether or not this property is write only
* @example false
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "Whether or not this property is wite only",
- * "type"="boolean",
- * "example"=false
- * }
- * }
- * )
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -697,20 +392,8 @@ class Property
private $writeOnly;
/**
- * @var string $xml An XML representation of the swagger docs
- * @example
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "An XML representation of the swagger docs",
- * "type"="string",
- * "format"="xml",
- * "example"="",
- * "maxLength"="255"
- * }
- * }
- * )
+ * @var string An XML representation of the swagger docs
+ * @example ''
*
* @Groups({"read", "write"})
* @ORM\Column(type="text", nullable=true)
@@ -718,20 +401,8 @@ class Property
private $xml;
/**
- * @var string $externalDoc An link to any external documentation for the value
+ * @var string An link to any external documentation for the value
* @example https://www.w3.org/TR/NOTE-datetime
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "An link to any external documentation for the value",
- * "type"="string",
- * "format"="url",
- * "example"="https://www.w3.org/TR/NOTE-datetime",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Assert\Length(max = 255)
* @Groups({"read", "write"})
@@ -740,20 +411,9 @@ class Property
private $externalDoc;
/**
- * @var string $example An example of the value that should be supplied
+ * @var string An example of the value that should be supplied
* @example My value
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "An example of the value that should be supplied",
- * "type"="string",
- * "example"="My value",
- * "maxLength"="255"
- * }
- * }
- * )
- *
+ *
* @Assert\Length(max = 255)
* @Groups({"read", "write"})
* @ORM\Column(type="string", length=255, nullable=true)
@@ -761,18 +421,8 @@ class Property
private $example;
/**
- * @var boolean $deprecated Whether or not this property has been deprecated and wil be removed in the future
+ * @var boolean Whether or not this property has been deprecated and wil be removed in the future
* @example false
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "Whether or not this property has been deprecated and wil be removed in the future",
- * "type"="boolean",
- * "example"=false
- * }
- * }
- * )
*
* @Assert\Type("bool")
* @Groups({"read", "write"})
@@ -781,19 +431,8 @@ class Property
private $deprecated;
/**
- * @var string $availableUntil The moment from which this value is available
+ * @var string The moment from which this value is available
* @example 2019-09-16T14:26:51+00:00
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The moment from which this value is available",
- * "type"="string",
- * "format"="date-time",
- * "example"="2019-09-16T14:26:51+00:00"
- * }
- * }
- * )
*
* @Groups({"read", "write"})
* @Assert\DateTime
@@ -802,19 +441,8 @@ class Property
private $availableFrom;
/**
- * @var string $availableUntil *should be used in combination with deprecated* The moment where until this value is available
+ * @var string *should be used in combination with deprecated* The moment where until this value is available
* @example 2019-09-16T14:26:51+00:00
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "*should be used in combination with deprecated* The moment where until this value is available",
- * "type"="string",
- * "format"="date-time",
- * "example"="2019-09-16T14:26:51+00:00"
- * }
- * }
- * )
*
* @Groups({"read", "write"})
* @Assert\DateTime
@@ -823,19 +451,8 @@ class Property
private $availableUntil;
/**
- * @var string $minDate The minimal date for value, either a date, datetime or duration (ISO_8601)
+ * @var string The minimal date for value, either a date, datetime or duration (ISO_8601)
* @example 2019-09-16T14:26:51+00:00
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The minimal date for value, either a date, datetime or duration (ISO_8601)",
- * "type"="string",
- * "example"="2019-09-16T14:26:51+00:00",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Groups({"read", "write"})
* @ORM\Column(type="string", length=255, nullable=true)
@@ -843,19 +460,8 @@ class Property
private $minDate;
/**
- * @var string $maxDate The maximum date for value, either a date, datetime or duration (ISO_8601)
+ * @var string The maximum date for value, either a date, datetime or duration (ISO_8601)
* @example 2019-09-16T14:26:51+00:00
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The maximum date for value, either a date, datetime or duration (ISO_8601)",
- * "type"="string",
- * "example"="2019-09-16T14:26:51+00:00",
- * "maxLength"="255"
- * }
- * }
- * )
*
* @Groups({"read", "write"})
* @ORM\Column(type="string", length=255, nullable=true)
diff --git a/api/src/Entity/RequestType.php b/api/src/Entity/RequestType.php
index 314944ba..07d8026f 100644
--- a/api/src/Entity/RequestType.php
+++ b/api/src/Entity/RequestType.php
@@ -14,6 +14,7 @@
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\MaxDepth;
+use Ramsey\Uuid\Uuid;
/**
* @ApiResource(
@@ -48,19 +49,8 @@ class RequestType
/**
* @var \Ramsey\Uuid\UuidInterface $id The UUID identifier of this object
* @example e2984465-190a-4562-829e-a8cca81aa35d
- *
- * @ApiProperty(
- * identifier=true,
- * attributes={
- * "swagger_context"={
- * "description" = "The UUID identifier of this object",
- * "type"="string",
- * "format"="uuid",
- * "example"="e2984465-190a-4562-829e-a8cca81aa35d"
- * }
- * }
- * )
- *
+ *
+ * @Groups({"read"})
* @Assert\Uuid
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
@@ -72,18 +62,6 @@ class RequestType
/**
* @var string $sourceOrganization The RSIN of the organization that owns this process
* @example 002851234
- *
- * @ApiProperty(
- * attributes={
- * "swagger_context"={
- * "description" = "The RSIN of the organization that owns this process",
- * "type"="string",
- * "example"="002851234",
- * "maxLength"="255"
- * }
- * }
- * )
- *
* @Assert\NotNull
* @Assert\Length(
* min = 8,
@@ -98,20 +76,6 @@ class RequestType
/**
* @var string $name The name of this RequestType
* @example My RequestType
- *
- * @ApiProperty(
- * iri="http://schema.org/name",
- * attributes={
- * "swagger_context"={
- * "description" = "The name of this RequestType",
- * "type"="string",
- * "example"="My RequestType",
- * "maxLength"="255",
- * "required" = true
- * }
- * }
- * )
- *
* @Assert\NotNull
* @Assert\Length(
* max = 255
@@ -124,19 +88,6 @@ class RequestType
/**
* @var string $description An short description of this RequestType
* @example This is the best request ever
- *
- * @ApiProperty(
- * iri="https://schema.org/description",
- * attributes={
- * "swagger_context"={
- * "description" = "An short description of this RequestType",
- * "type"="string",
- * "example"="This is the best request ever",
- * "maxLength"="2550"
- * }
- * }
- * )
- *
* @Assert\Length(
* max = 2550
* )
@@ -185,12 +136,12 @@ public function __construct()
$this->extendedBy = new ArrayCollection();
}
- public function getId()
+ public function getId(): Uuid
{
return $this->id;
}
-
- public function setId(string $id): self
+
+ public function setId(Uuid $id): self
{
$this->id = $id;
diff --git a/api/src/Filter/LikeFilter.php b/api/src/Filter/LikeFilter.php
index 1496dd18..029c73e9 100644
--- a/api/src/Filter/LikeFilter.php
+++ b/api/src/Filter/LikeFilter.php
@@ -1,4 +1,5 @@
isPropertyEnabled($property, $resourceClass) ||
- !$this->isPropertyMapped($property, $resourceClass)
- ) {
- return;
- }
-
- $parameterName = $queryNameGenerator->generateParameterName($property); // Generate a unique parameter name to avoid collisions with other filters
- $queryBuilder
- ->andWhere(sprintf('o.%s LIKE :%s', $property, $parameterName))
- ->setParameter($parameterName, $value);
- }
-
- // This function is only used to hook in documentation generators (supported by Swagger and Hydra)
- public function getDescription(string $resourceClass): array
- {
- if (!$this->properties) {
- return [];
- }
-
- $description = [];
- foreach ($this->properties as $property => $strategy) {
- $description["like_$property"] = [
- 'property' => $property,
- 'type' => 'string',
- 'required' => false,
- 'swagger' => [
- 'description' => 'This filter narows your result using the * and _ wildcards, where * is assumed to be one or more characters and _ is assumed to be a single character',
- 'name' => $property,
- 'type' => 'string',
- ],
- ];
- }
-
- return $description;
- }
-}
\ No newline at end of file
+ protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null)
+ {
+ // otherwise filter is applied to order and page as well
+ if (
+ !$this->isPropertyEnabled($property, $resourceClass) ||
+ !$this->isPropertyMapped($property, $resourceClass)
+ ) {
+ return;
+ }
+
+ $parameterName = $queryNameGenerator->generateParameterName($property); // Generate a unique parameter name to avoid collisions with other filters
+ $queryBuilder
+ ->andWhere(sprintf('o.%s LIKE :%s', $property, $parameterName))
+ ->setParameter($parameterName, $value);
+ }
+
+ // This function is only used to hook in documentation generators (supported by Swagger and Hydra)
+ public function getDescription(string $resourceClass): array
+ {
+ if (!$this->properties) {
+ return [];
+ }
+
+ $description = [];
+ foreach ($this->properties as $property => $strategy) {
+ $description["like_$property"] = [
+ 'property' => $property,
+ 'type' => 'string',
+ 'required' => false,
+ 'swagger' => [
+ 'description' => 'This filter narows your result using the * and _ wildcards, where * is assumed to be one or more characters and _ is assumed to be a single character',
+ 'name' => $property,
+ 'type' => 'string',
+ ],
+ ];
+ }
+
+ return $description;
+ }
+}
diff --git a/api/src/Filter/RegexpFilter.php b/api/src/Filter/RegexpFilter.php
index ffda6ff7..da1f747e 100644
--- a/api/src/Filter/RegexpFilter.php
+++ b/api/src/Filter/RegexpFilter.php
@@ -1,4 +1,5 @@
isPropertyEnabled($property, $resourceClass) ||
- !$this->isPropertyMapped($property, $resourceClass)
- ) {
- return;
- }
-
- $parameterName = $queryNameGenerator->generateParameterName($property); // Generate a unique parameter name to avoid collisions with other filters
- $queryBuilder
- ->andWhere(sprintf('REGEXP(o.%s, :%s) = 1', $property, $parameterName))
- ->setParameter($parameterName, $value);
- }
-
- // This function is only used to hook in documentation generators (supported by Swagger and Hydra)
- public function getDescription(string $resourceClass): array
- {
- if (!$this->properties) {
- return [];
- }
-
- $description = [];
- foreach ($this->properties as $property => $strategy) {
- $description["regexp_$property"] = [
- 'property' => $property,
- 'type' => 'string',
- 'required' => false,
- 'swagger' => [
- 'description' => 'Filter for an exact match using a [Regular expression](https://en.wikipedia.org/wiki/Regular_expression).',
- 'name' => $property,
- 'type' => 'string',
- ],
- ];
- }
-
- return $description;
- }
-}
\ No newline at end of file
+ protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null)
+ {
+ // otherwise filter is applied to order and page as well
+ if (
+ !$this->isPropertyEnabled($property, $resourceClass) ||
+ !$this->isPropertyMapped($property, $resourceClass)
+ ) {
+ return;
+ }
+
+ $parameterName = $queryNameGenerator->generateParameterName($property); // Generate a unique parameter name to avoid collisions with other filters
+ $queryBuilder
+ ->andWhere(sprintf('REGEXP(o.%s, :%s) = 1', $property, $parameterName))
+ ->setParameter($parameterName, $value);
+ }
+
+ // This function is only used to hook in documentation generators (supported by Swagger and Hydra)
+ public function getDescription(string $resourceClass): array
+ {
+ if (!$this->properties) {
+ return [];
+ }
+
+ $description = [];
+ foreach ($this->properties as $property => $strategy) {
+ $description["regexp_$property"] = [
+ 'property' => $property,
+ 'type' => 'string',
+ 'required' => false,
+ 'swagger' => [
+ 'description' => 'Filter for an exact match using a [Regular expression](https://en.wikipedia.org/wiki/Regular_expression).',
+ 'name' => $property,
+ 'type' => 'string',
+ ],
+ ];
+ }
+
+ return $description;
+ }
+}
diff --git a/api/src/Repository/NLXRequestLogRepository.php b/api/src/Repository/NLXRequestLogRepository.php
index ed8d0a95..bc1dad3c 100644
--- a/api/src/Repository/NLXRequestLogRepository.php
+++ b/api/src/Repository/NLXRequestLogRepository.php
@@ -20,19 +20,18 @@ public function __construct(RegistryInterface $registry)
}
/**
- * @return NLXRequestLog[] Returns an array of NLXRequestLog objects
- */
+ * @return NLXRequestLog[] Returns an array of NLXRequestLog objects
+ */
public function getLogEntries($entity)
{
- return $this->createQueryBuilder('l')
- ->where('l.objectClass = :objectClass')
- ->setParameter('objectClass', $this->getEntityManager()->getMetadataFactory()->getMetadataFor(get_class($entity))->getName())
- ->andWhere('l.objectId = :objectId')
- ->setParameter('objectId', $entity->getId())
- ->orderBy('l.loggedAt', 'DESC')
- ->getQuery()
- ->getResult();
-
+ return $this->createQueryBuilder('l')
+ ->where('l.objectClass = :objectClass')
+ ->setParameter('objectClass', $this->getEntityManager()->getMetadataFactory()->getMetadataFor(get_class($entity))->getName())
+ ->andWhere('l.objectId = :objectId')
+ ->setParameter('objectId', $entity->getId())
+ ->orderBy('l.loggedAt', 'DESC')
+ ->getQuery()
+ ->getResult();
}
/*
diff --git a/api/src/Repository/PropertyRepository.php b/api/src/Repository/PropertyRepository.php
index 8bcb8840..d1d281fa 100644
--- a/api/src/Repository/PropertyRepository.php
+++ b/api/src/Repository/PropertyRepository.php
@@ -4,7 +4,7 @@
use App\Entity\Property;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
-use Symfony\Bridge\Doctrine\RegistryInterface;
+use Doctrine\Common\Persistence\ManagerRegistry;
/**
* @method Property|null find($id, $lockMode = null, $lockVersion = null)
@@ -14,7 +14,7 @@
*/
class PropertyRepository extends ServiceEntityRepository
{
- public function __construct(RegistryInterface $registry)
+ public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Property::class);
}
diff --git a/api/src/Service/NLXLogService.php b/api/src/Service/NLXLogService.php
index 24c5cff1..3f2d2e3c 100644
--- a/api/src/Service/NLXLogService.php
+++ b/api/src/Service/NLXLogService.php
@@ -1,4 +1,5 @@
em = $em;
- }
-
+ private $em;
+
+ public function __construct(EntityManagerInterface $em)
+ {
+ $this->em = $em;
+ }
}
diff --git a/api/src/Subscriber/FieldsSubscriber.php b/api/src/Subscriber/FieldsSubscriber.php
index 1372fd99..f842a8e2 100644
--- a/api/src/Subscriber/FieldsSubscriber.php
+++ b/api/src/Subscriber/FieldsSubscriber.php
@@ -2,73 +2,67 @@
namespace App\Subscriber;
-use ApiPlatform\Core\Exception\InvalidArgumentException;
use ApiPlatform\Core\EventListener\EventPriorities;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Serializer\SerializerInterface;
-use Doctrine\ORM\EntityManagerInterface;
-use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
-
-use App\Service\RequestTypeService;
class FieldsSubscriber implements EventSubscriberInterface
{
- private $params;
- private $serializer;
-
- public function __construct(ParameterBagInterface $params, SerializerInterface $serializer)
- {
- $this->params = $params;
- $this->serializer= $serializer;
- }
-
- public static function getSubscribedEvents()
- {
- return [
- KernelEvents::VIEW => ['FilterFields', EventPriorities::PRE_SERIALIZE],
- ];
-
- }
-
- public function FilterFields(GetResponseForControllerResultEvent $event)
- {
- $result = $event->getControllerResult();
- $fields = $event->getRequest()->query->get('fields');
-
- // Only do somthing if fields is query supplied
- if (!$fields) {
- return $result;
- }
-
- // let turn fields into an array if it isn't one already
- if(!is_array($fields)){
- $fields = explode(",", $fields);
- }
-
-
- // we always need to return an id and links (in order not to break stuff)
- if(!in_array("id",$fields)){$fields[]='id';}
- if(!in_array("_links",$fields)){$fields[]='_links';}
-
- // now we need to overide the normal subscriber
- $json = $this->serializer->serialize(
- $result,
- 'jsonhal',['enable_max_depth' => true,'attributes'=> $fields]
- );
-
- $response = new Response(
- $json,
- Response::HTTP_OK,
- ['content-type' => 'application/json+hal']
- );
-
- $event->setResponse($response);
-
- return;
- }
+ private $params;
+ private $serializer;
+
+ public function __construct(ParameterBagInterface $params, SerializerInterface $serializer)
+ {
+ $this->params = $params;
+ $this->serializer = $serializer;
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return [
+ KernelEvents::VIEW => ['FilterFields', EventPriorities::PRE_SERIALIZE],
+ ];
+ }
+
+ public function FilterFields(GetResponseForControllerResultEvent $event)
+ {
+ $result = $event->getControllerResult();
+ $fields = $event->getRequest()->query->get('fields');
+
+ // Only do somthing if fields is query supplied
+ if (!$fields) {
+ return $result;
+ }
+
+ // let turn fields into an array if it isn't one already
+ if (!is_array($fields)) {
+ $fields = explode(',', $fields);
+ }
+
+ // we always need to return an id and links (in order not to break stuff)
+ if (!in_array('id', $fields)) {
+ $fields[] = 'id';
+ }
+ if (!in_array('_links', $fields)) {
+ $fields[] = '_links';
+ }
+
+ // now we need to overide the normal subscriber
+ $json = $this->serializer->serialize(
+ $result,
+ 'jsonhal', ['enable_max_depth' => true, 'attributes'=> $fields]
+ );
+
+ $response = new Response(
+ $json,
+ Response::HTTP_OK,
+ ['content-type' => 'application/json+hal']
+ );
+
+ $event->setResponse($response);
+ }
}
diff --git a/api/src/Subscriber/LogSubscriber.php b/api/src/Subscriber/LogSubscriber.php
deleted file mode 100644
index c58d7d1c..00000000
--- a/api/src/Subscriber/LogSubscriber.php
+++ /dev/null
@@ -1,84 +0,0 @@
-params = $params;
- $this->em= $em;
- $this->serializer= $serializer;
- $this->annotationReader = $annotationReader;
- }
-
- public static function getSubscribedEvents()
- {
- return [
- KernelEvents::VIEW => ['Log', EventPriorities::PRE_SERIALIZE],
- ];
-
- }
-
- public function Log(GetResponseForControllerResultEvent $event)
- {
- $result = $event->getControllerResult();
- $showLogs= $event->getRequest()->query->get('showLogs');
-
- // Lets see if this class has a Loggableannotation
- $loggable = false;
- $reflClass = new \ReflectionClass($result);
- $annotations = $this->annotationReader->getClassAnnotations($reflClass);
-
- foreach($annotations as $annotation ){
- if(get_class($annotation) == "Gedmo\Mapping\Annotation\Loggable"){
- $loggable = true;
- }
- }
-
- // Only do somthing if we are on te log route and the entity is logable
- /* @todo we should trhow errors here foruser feedback */
- if (!$showLogs || !$loggable) {
- return $result;
- }
-
- $repo = $this->em->getRepository('Gedmo\Loggable\Entity\LogEntry'); // we use default log entry class
- $logs = $repo->getLogEntries($result);
-
- // now we need to overide the normal subscriber
- $json = $this->serializer->serialize(
- $logs,
- 'jsonhal',['enable_max_depth' => true]
- );
-
- $response = new Response(
- $json,
- Response::HTTP_OK,
- ['content-type' => 'application/json+hal']
- );
-
- $event->setResponse($response);
-
- return;
- }
-}
diff --git a/api/src/Subscriber/NLXSubscriber.php b/api/src/Subscriber/NLXSubscriber.php
index d846884b..5411001e 100644
--- a/api/src/Subscriber/NLXSubscriber.php
+++ b/api/src/Subscriber/NLXSubscriber.php
@@ -2,118 +2,109 @@
namespace App\Subscriber;
-use ApiPlatform\Core\Exception\InvalidArgumentException;
use ApiPlatform\Core\EventListener\EventPriorities;
+use App\Entity\NLXRequestLog;
+use App\Service\NLXLogService;
+use Doctrine\ORM\EntityManagerInterface;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Serializer\SerializerInterface;
-use Doctrine\ORM\EntityManagerInterface;
-use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
-use Symfony\Component\HttpFoundation\Session\Session;
-
-
-use App\Service\NLXLogService;
-use App\Entity\NLXRequestLog;
class NLXSubscriber implements EventSubscriberInterface
{
- private $params;
- private $em;
- private $serializer;
- private $nlxLogService;
-
- public function __construct(ParameterBagInterface $params, EntityManagerInterface $em, SerializerInterface $serializer,NLXLogService $nlxLogService)
- {
- $this->params = $params;
- $this->em = $em;
- $this->serializer = $serializer;
- $this->nlxLogService = $nlxLogService;
- }
-
- public static function getSubscribedEvents()
- {
- return [
- KernelEvents::VIEW => ['NLXLog', EventPriorities::PRE_VALIDATE],
- KernelEvents::VIEW => ['NLXAudit', EventPriorities::PRE_SERIALIZE],
- ];
-
- }
-
- public function NLXAudit(GetResponseForControllerResultEvent $event){
-
- $result = $event->getControllerResult();
- $auditTrail= $event->getRequest()->query->get('auditTrail');
-
- // Only do somthing if we are on te log route and the entity is logable
- /* @todo we should trhow errors here foruser feedback */
- if (!$auditTrail ) {
- return $result;
- }
-
- $repo = $this->em->getRepository('App\Entity\NLXRequestLog');
- $logs = $repo->getLogEntries($result);
-
-
- // now we need to overide the normal subscriber
- $json = $this->serializer->serialize(
- $logs,
- 'jsonhal',['enable_max_depth' => true]
- );
-
- $response = new Response(
- $json,
- Response::HTTP_OK,
- ['content-type' => 'application/json+hal']
- );
-
- $event->setResponse($response);
-
- return;
- }
-
-
- public function NLXLog(GetResponseForControllerResultEvent $event)
- {
- $result = $event->getControllerResult();
-
- $session = new Session();
- $session->start();
- // See: https://docs.nlx.io/further-reading/transaction-logs/
-
- $log = New NLXRequestLog;
- $log->setApplicationId ($event->getRequest()->headers->get('X-NLX-Application-Id'));
- $log->setRequestId ($event->getRequest()->headers->get('X-NLX-Request-Id'));
- $log->setUserId ($event->getRequest()->headers->get('X-NLX-Request-User-Id'));
- $log->setSubjectId ($event->getRequest()->headers->get('X-NLX-Request-Subject-Identifier'));
- $log->setProcessId ($event->getRequest()->headers->get('X-NLX-Request-Process-Id'));
- $log->setDataElements ($event->getRequest()->headers->get('X-NLX-Request-Data-Elements'));
- $log->setDataSubjects ($event->getRequest()->headers->get('X-NLX-Request-Data-Subject'));
- $log->setObjectId ($result->getid());
- $log->setObjectClass ($this->em->getMetadataFactory()->getMetadataFor(get_class($result))->getName());
- $log->setRoute ($event->getRequest()->attributes->get('_route'));
- $log->setEndpoint ($event->getRequest()->getPathInfo());
- $log->setMethod ($event->getRequest()->getMethod());
- $log->setContentType ($event->getRequest()->headers->get('Content-Type'));
- $log->setContent ($event->getRequest()->getContent());
- $log->setSession ($session->getId());
- $log->setLoggedAt (new \DateTime() );
-
- $this->em->persist($log);
- $this->em->flush($log);
-
- // $authorization = $this->params->get('nlx.components.authorization.');
- // We need to do serveral things for nlx
-
- // First of all we need to log this request to our audit trial, where at minimal level we need to log who (application) asked what (data) for wich reasons (goal). We also need to consider that the requestee might have used the field query parmeter. So we need to log what fields of the object where actually returned.
-
- // Then we need to authenticate the request against a common ground authentication component
-
- // In the current common ground we dont bother with authorization (every one may do anything as long as we know who it is)
-
- return $result;
- }
+ private $params;
+ private $em;
+ private $serializer;
+ private $nlxLogService;
+
+ public function __construct(ParameterBagInterface $params, EntityManagerInterface $em, SerializerInterface $serializer, NLXLogService $nlxLogService)
+ {
+ $this->params = $params;
+ $this->em = $em;
+ $this->serializer = $serializer;
+ $this->nlxLogService = $nlxLogService;
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return [
+ KernelEvents::VIEW => ['NLXLog', EventPriorities::PRE_VALIDATE],
+ KernelEvents::VIEW => ['NLXAudit', EventPriorities::PRE_SERIALIZE],
+ ];
+ }
+
+ public function NLXAudit(GetResponseForControllerResultEvent $event)
+ {
+ $result = $event->getControllerResult();
+ $auditTrail = $event->getRequest()->query->get('auditTrail');
+
+ // Only do somthing if we are on te log route and the entity is logable
+ /* @todo we should trhow errors here foruser feedback */
+ if (!$auditTrail) {
+ return $result;
+ }
+
+ $repo = $this->em->getRepository('App\Entity\NLXRequestLog');
+ $logs = $repo->getLogEntries($result);
+
+ // now we need to overide the normal subscriber
+ $json = $this->serializer->serialize(
+ $logs,
+ 'jsonhal', ['enable_max_depth' => true]
+ );
+
+ $response = new Response(
+ $json,
+ Response::HTTP_OK,
+ ['content-type' => 'application/json+hal']
+ );
+
+ $event->setResponse($response);
+ }
+
+ public function NLXLog(GetResponseForControllerResultEvent $event)
+ {
+ $result = $event->getControllerResult();
+
+ $session = new Session();
+ $session->start();
+ // See: https://docs.nlx.io/further-reading/transaction-logs/
+
+ $log = new NLXRequestLog();
+ $log->setApplicationId($event->getRequest()->headers->get('X-NLX-Application-Id'));
+ $log->setRequestId($event->getRequest()->headers->get('X-NLX-Request-Id'));
+ $log->setUserId($event->getRequest()->headers->get('X-NLX-Request-User-Id'));
+ $log->setSubjectId($event->getRequest()->headers->get('X-NLX-Request-Subject-Identifier'));
+ $log->setProcessId($event->getRequest()->headers->get('X-NLX-Request-Process-Id'));
+ $log->setDataElements($event->getRequest()->headers->get('X-NLX-Request-Data-Elements'));
+ $log->setDataSubjects($event->getRequest()->headers->get('X-NLX-Request-Data-Subject'));
+ $log->setObjectId($result->getid());
+ $log->setObjectClass($this->em->getMetadataFactory()->getMetadataFor(get_class($result))->getName());
+ $log->setRoute($event->getRequest()->attributes->get('_route'));
+ $log->setEndpoint($event->getRequest()->getPathInfo());
+ $log->setMethod($event->getRequest()->getMethod());
+ $log->setContentType($event->getRequest()->headers->get('Content-Type'));
+ $log->setContent($event->getRequest()->getContent());
+ $log->setSession($session->getId());
+ $log->setLoggedAt(new \DateTime());
+
+ $this->em->persist($log);
+ $this->em->flush($log);
+
+ // $authorization = $this->params->get('nlx.components.authorization.');
+ // We need to do serveral things for nlx
+
+ // First of all we need to log this request to our audit trial, where at minimal level we need to log who (application) asked what (data) for wich reasons (goal). We also need to consider that the requestee might have used the field query parmeter. So we need to log what fields of the object where actually returned.
+
+ // Then we need to authenticate the request against a common ground authentication component
+
+ // In the current common ground we dont bother with authorization (every one may do anything as long as we know who it is)
+
+ return $result;
+ }
}
diff --git a/api/src/Subscriber/ValidOnSubscriber.php b/api/src/Subscriber/ValidOnSubscriber.php
index 220b5288..4aac9f15 100644
--- a/api/src/Subscriber/ValidOnSubscriber.php
+++ b/api/src/Subscriber/ValidOnSubscriber.php
@@ -2,105 +2,96 @@
namespace App\Subscriber;
-use ApiPlatform\Core\Exception\InvalidArgumentException;
use ApiPlatform\Core\EventListener\EventPriorities;
+use Doctrine\Common\Annotations\Reader;
+use Doctrine\ORM\EntityManagerInterface;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Serializer\SerializerInterface;
-use Doctrine\ORM\EntityManagerInterface;
-use Doctrine\Common\Annotations\Reader;
-use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
-
-use App\Service\RequestService;
class ValidOnSubscriber implements EventSubscriberInterface
{
- private $params;
- private $em;
- private $serializer;
- private $annotationReader;
-
- public function __construct(ParameterBagInterface $params, EntityManagerInterface $em, SerializerInterface $serializer, Reader $annotationReader)
- {
- $this->params = $params;
- $this->em= $em;
- $this->serializer= $serializer;
- $this->annotationReader = $annotationReader;
- }
-
- public static function getSubscribedEvents()
- {
- return [
- KernelEvents::VIEW => ['validOn', EventPriorities::PRE_SERIALIZE],
- ];
-
- }
-
- public function validOn(GetResponseForControllerResultEvent $event)
- {
- $result = $event->getControllerResult();
-
- // Lets get validOn from the query but deafult back to geldig op (for backward compatibality with api standaard)
- $geldigOp = $event->getRequest()->query->get('geldigOp', false);
- $validOn = $event->getRequest()->query->get('validOn', $geldigOp);
-
- // Lets see if this class has a Loggableannotation
- $loggable = false;
- $reflClass = new \ReflectionClass($result);
- $annotations = $this->annotationReader->getClassAnnotations($reflClass);
-
- foreach($annotations as $annotation ){
- if(get_class($annotation) == "Gedmo\Mapping\Annotation\Loggable"){
- $loggable = true;
- }
- }
-
- // Only do somthing if fields is query supplied
- if (!$validOn) {
- return $result;
- }
-
- /* @todo propper error handling */
- if(!$loggable){
- throw new \Exception('This enity is not loggable therefore no previus versions can be obtained');
- }
-
- // Lets turn valid on into a date
- try{
- $date = strtotime($validOn);
- $date = date("Y-m-d H:i:s", $date);
-
- } catch (Exception $e) {
- /* @todo thow propper exeption */
- throw new \Exception('Caught exception: ', $e->getMessage(), "\n");
- }
-
- // Lets try to get an version valid on that date
- $queryBuilder= $this->em->getRepository('Gedmo\Loggable\Entity\LogEntry')->createQueryBuilder('l')
- ->where('l.objectClass = :objectClass')
- ->setParameter('objectClass', $this->em->getMetadataFactory()->getMetadataFor(get_class($result))->getName())
- ->andWhere('l.objectId = :objectId')
- ->setParameter('objectId', $result->getId())
- ->andWhere('l.loggedAt <= :loggedAt')
- ->setParameter('loggedAt', $date)
- ->setMaxResults(1)
- ->orderBy('l.loggedAt', 'DESC');
-
- $version = $queryBuilder->getQuery()->getOneOrNullResult();
-
- /* @todo propper error handling */
- if(!$version){
- throw new \Exception('Could not find a valid version for date: '.$date);
- }
-
- // Lets use the found version to rewind the object and return is
- $repo = $this->em->getRepository('\Gedmo\Loggable\Entity\LogEntry'); // we use default log entry class
- $repo->revert($result, $version->getVersion());
-
- return $result;
- }
+ private $params;
+ private $em;
+ private $serializer;
+ private $annotationReader;
+
+ public function __construct(ParameterBagInterface $params, EntityManagerInterface $em, SerializerInterface $serializer, Reader $annotationReader)
+ {
+ $this->params = $params;
+ $this->em = $em;
+ $this->serializer = $serializer;
+ $this->annotationReader = $annotationReader;
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return [
+ KernelEvents::VIEW => ['validOn', EventPriorities::PRE_SERIALIZE],
+ ];
+ }
+
+ public function validOn(GetResponseForControllerResultEvent $event)
+ {
+ $result = $event->getControllerResult();
+
+ // Lets get validOn from the query but deafult back to geldig op (for backward compatibality with api standaard)
+ $geldigOp = $event->getRequest()->query->get('geldigOp', false);
+ $validOn = $event->getRequest()->query->get('validOn', $geldigOp);
+
+ // Only do somthing if fields is query supplied
+ if (!$validOn) {
+ return $result;
+ }
+
+ // Lets see if this class has a Loggableannotation
+ $loggable = false;
+ $reflClass = new \ReflectionClass($result);
+ $annotations = $this->annotationReader->getClassAnnotations($reflClass);
+
+ foreach ($annotations as $annotation) {
+ if (get_class($annotation) == "Gedmo\Mapping\Annotation\Loggable") {
+ $loggable = true;
+ }
+ }
+ /* @todo propper error handling */
+ if (!$loggable) {
+ throw new \Exception('This enity is not loggable therefore no previus versions can be obtained');
+ }
+
+ // Lets turn valid on into a date
+ try {
+ $date = strtotime($validOn);
+ $date = date('Y-m-d H:i:s', $date);
+ } catch (Exception $e) {
+ /* @todo thow propper exeption */
+ throw new \Exception('Caught exception: ', $e->getMessage(), "\n");
+ }
+
+ // Lets try to get an version valid on that date
+ $queryBuilder = $this->em->getRepository('Gedmo\Loggable\Entity\LogEntry')->createQueryBuilder('l')
+ ->where('l.objectClass = :objectClass')
+ ->setParameter('objectClass', $this->em->getMetadataFactory()->getMetadataFor(get_class($result))->getName())
+ ->andWhere('l.objectId = :objectId')
+ ->setParameter('objectId', $result->getId())
+ ->andWhere('l.loggedAt <= :loggedAt')
+ ->setParameter('loggedAt', $date)
+ ->setMaxResults(1)
+ ->orderBy('l.loggedAt', 'DESC');
+
+ $version = $queryBuilder->getQuery()->getOneOrNullResult();
+
+ /* @todo propper error handling */
+ if (!$version) {
+ throw new \Exception('Could not find a valid version for date: '.$date);
+ }
+
+ // Lets use the found version to rewind the object and return is
+ $repo = $this->em->getRepository('\Gedmo\Loggable\Entity\LogEntry'); // we use default log entry class
+ $repo->revert($result, $version->getVersion());
+
+ return $result;
+ }
}
diff --git a/api/src/Swagger/SwaggerDecorator.php b/api/src/Swagger/SwaggerDecorator.php
index f0c871be..28b4d3e5 100644
--- a/api/src/Swagger/SwaggerDecorator.php
+++ b/api/src/Swagger/SwaggerDecorator.php
@@ -1,182 +1,488 @@
decorated = $decorated;
- $this->params = $params;
- $this->cash = $cache;
- }
-
- public function normalize($object, $format = null, array $context = [])
- {
- $docs = $this->decorated->normalize($object, $format, $context);
-
- // Lest add an host
- if($this->params->get('common_ground.oas.host')){
- $docs['host']= $this->params->get('common_ground.oas.host');
- }
-
- // Lets set the servers
- if(array_key_exists ('servers',$docs)){$docs['servers']=[];}
- foreach($this->params->get('common_ground.oas.servers') as $key => $value){
- $docs['servers'][$key] = $value;
-
- }
-
- // Lets set the external documentation
- if(array_key_exists ('externalDocs',$docs)){$docs['externalDocs']=[];}
- foreach($this->params->get('common_ground.oas.externalDocs') as $key => $value){
- $docs['externalDocs'][$key] = $value;
-
- }
-
- // Lets add the commonground codes
- if(array_key_exists ('x-commonground',$docs)){$docs['x-commonground']=[];}
-
- // Lets set the component type
- $docs['x-commonground']['type'] = $this->params->get('common_ground.oas.type');
-
- // Lets set the devolopers
- if(array_key_exists ('developers',$docs['x-commonground'])){$docs['developers']=[];}
- foreach($this->params->get('common_ground.oas.developers') as $key => $value){
- $docs['x-commonground']['developers'][$key] = $value;
-
- }
-
- // Lets set the build checks
- if(array_key_exists ('builds',$docs['x-commonground'])){$docs['builds']=[];}
- foreach($this->params->get('common_ground.oas.builds') as $key => $value){
- $docs['x-commonground']['builds'][$key] = $value;
- }
-
- /*todo a loop within a lopo is butt ugly */
- foreach($docs['paths'] as $path => $calls){
-
- foreach($calls as $method => $call){
-
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'Authorization',
- 'description' => 'The JWT of the entity performing the request',
- 'in' => 'header',
- ];
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'API-Version',
- 'description' => 'The version of the API conform [Landelijke API-strategie.](https://geonovum.github.io/KP-APIs/#versioning)',
- 'example'=>'1.0.1',
- 'in' => 'header',
- ];
- /*
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'X-NLX-Request-Application-Id',
- 'description' => 'The id of the application performing the request',
- 'in' => 'header',
- ];
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'X-NLX-Request-Subject-Identifier',
- 'description' => 'An subject identifier for purpose registration (doelbinding)',
- 'in' => 'header',
- ];
- */
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'X-NLX-Logrecord-ID',
- 'description' => 'A globally unique id of the request, which makes a request traceable throughout the network.',
- 'in' => 'header',
- ];
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'X-NLX-Request-Process-Id',
- 'description' => 'A process id for purpose registration (doelbinding)',
- 'in' => 'header',
- ];
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'X-NLX-Request-Data-Elements',
- 'description' => 'A list of requested data elements',
- 'in' => 'header',
- ];
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'X-NLX-Request-Data-Subject',
- 'description' => 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`',
- 'in' => 'header',
- ];
- // NLX loging headers
- $call['parameters'][] = [
- 'name' => 'X-Audit-Clarification',
- 'description' => 'A clarification as to why a request has been made (doelbinding)',
- 'in' => 'header',
- ];
-
-
- if($method == "get"){
- // Lets add the extend functionality
- $call['parameters'][] = [
- 'name' => 'extend[]',
- 'required' => false,
- 'description' => 'An array of nested objects to include in the return object',
- 'in' => 'query',
- 'schema'=>['type'=>'array']
- ];
- // Lets add the fields functionality
- $call['parameters'][] = [
- 'name' => 'fields[]',
- 'required' => false,
- 'description' => 'An array of fields to return in output, wil return all fields is not supplied',
- 'in' => 'query',
- 'schema'=>['type'=>'array']
- ];
- // Lets add some time travel
- $call['parameters'][] = [
- 'name' => 'validOn',
- 'required' => false,
- 'description' => 'Returns object as valid on a given date time',
- 'schema'=>['type'=>'string', 'format' => 'date-time'],
- 'in' => 'query',
- ];
- $call['parameters'][] = [
- 'name' => 'validFrom',
- 'required' => false,
- 'description' => 'Returns objects valid from a given date time',
- 'schema'=>['type'=>'string', 'format' => 'date-time'],
- 'in' => 'query',
- ];
- $call['parameters'][] = [
- 'name' => 'validUntil',
- 'required' => false,
- 'description' => 'Returns objects valid until a given date time',
- 'schema'=>['type'=>'string', 'format' => 'date-time'],
- 'in' => 'query',
- ];
- }
-
- }
-
-
-
- }
- return $docs;
- }
-
- public function supportsNormalization($data, $format = null)
- {
- return $this->decorated->supportsNormalization($data, $format);
- }
-}
\ No newline at end of file
+ private $metadataFactory;
+ private $documentationNormalizer;
+ private $decorated;
+ private $params;
+ private $cash;
+ private $em;
+ private $annotationReader;
+ private $camelCaseToSnakeCaseNameConverter;
+
+ public function __construct(
+ NormalizerInterface $decorated,
+ ParameterBagInterface $params,
+ CacheInterface $cache,
+ EntityManagerInterface $em,
+ AnnotationReader $annotationReader,
+ CamelCaseToSnakeCaseNameConverter $camelCaseToSnakeCaseNameConverter
+ ) {
+ $this->decorated = $decorated;
+ $this->params = $params;
+ $this->cash = $cache;
+ $this->em = $em;
+ $this->annotationReader = $annotationReader;
+ $this->camelCaseToSnakeCaseNameConverter = $camelCaseToSnakeCaseNameConverter;
+ }
+
+ public function normalize($object, $format = null, array $context = [])
+ {
+ $docs = $this->decorated->normalize($object, $format, $context);
+
+ /* The we need to enrich al the entities and add the autoated routes */
+
+ //var_dump($docs);
+
+ // Lets make sure that we have definitions
+ if (!array_key_exists('definitions', $docs)) {
+ $docs['definitions'] = [];
+ }
+
+ // Lets make sure that we have tags
+ if (!array_key_exists('tags', $docs)) {
+ $docs['tags'] = [];
+ }
+
+ // Lets make sure that we have security and JWT-Claims
+ if (!array_key_exists('securityDefinitions', $docs)) {
+ $docs['securityDefinitions'] = [];
+ }
+
+ // Lets add JWT-Oauth
+ $docs['securityDefinitions']['JWT-Oauth'] = [
+ 'type' => 'oauth2',
+ 'authorizationUrl'=> 'http://petstore.swagger.io/api/oauth/dialog',
+ 'flow' => 'implicit',
+ 'scopes' => [], //scopes will be filled later autmaticly
+ ];
+
+ $docs['securityDefinitions']['JWT-Token'] = [
+ 'type' => 'apiKey',
+ 'in' => 'header', // can be "header", "query" or "cookie"
+ 'name' => 'Authorization', // name of the header, query parameter or cookie
+ 'scopes'=> [], //scopes will be filled later autmaticly
+ ];
+
+ // Lets get al the entities known to doctrine
+ $entities = $this->em->getConfiguration()->getMetadataDriverImpl()->getAllClassNames();
+
+ $additionalDocs = [];
+
+ // Then we loop trough the entities to find the api platform entities
+ foreach ($entities as $entity) {
+ //$reflector = new \ReflectionClass($entity);
+ $metadata = $this->em->getClassMetadata($entity);
+ $reflector = $metadata->getReflectionClass();
+
+ $properties = $metadata->getReflectionProperties();
+ $annotations = $this->annotationReader->getClassAnnotations($reflector);
+
+ foreach ($annotations as $annotation) {
+ $annotationReflector = new \ReflectionClass($annotation);
+ if ($annotationReflector->name == "ApiPlatform\Core\Annotation\ApiResource") {
+
+ // Lets add the class info to the tag
+ $shortName = $reflector->getShortName();
+
+ $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
+ $docblock = $factory->create($reflector->getDocComment());
+ $summary = $docblock->getSummary();
+ $description = $docblock->getDescription()->render();
+ $description = $summary."\n\n".$description;
+
+ $tag = [];
+ $tag['name'] = $shortName;
+ $tag['description'] = $description;
+
+ $docs['tags'][] = $tag;
+
+ // And lets add the aditional docs
+
+ //$additionalEntityDocs = $this->getAdditionalEntityDocs($entity);
+ $entityDocs = $this->getAdditionalEntityDocs($entity);
+ $additionalDocs = array_merge($additionalDocs, $entityDocs['properties']);
+
+ // Security
+ $docs['securityDefinitions']['JWT-Oauth']['scopes'] = array_merge($docs['securityDefinitions']['JWT-Oauth']['scopes'], $entityDocs['security']);
+ $docs['securityDefinitions']['JWT-Token']['scopes'] = array_merge($docs['securityDefinitions']['JWT-Token']['scopes'], $entityDocs['security']);
+
+ break;
+ }
+ }
+ }
+
+ // Oke dit is echt but lelijk
+ $schemas = (array) $docs['definitions'];
+ foreach ($schemas as $schemaName => $schema) {
+
+ // We can only merge if we actually have content
+ if (!in_array($schemaName, $additionalDocs)) {
+ continue;
+ }
+
+ $additionalDocs[$schemaName] = array_merge((array) $schema, $additionalDocs[$schemaName]);
+
+ $properties = (array) $schema['properties'];
+ foreach ($properties as $propertyName => $property) {
+ $additionalDocs[$schemaName]['properties'][$propertyName] = array_merge((array) $property, $additionalDocs[$schemaName]['properties'][$propertyName]);
+ }
+ }
+ $docs['definitions'] = $additionalDocs;
+
+ // Lest add an host
+ if ($this->params->get('common_ground.oas.host')) {
+ $docs['host'] = $this->params->get('common_ground.oas.host');
+ }
+
+ // Lets set the servers
+ if (array_key_exists('servers', $docs)) {
+ $docs['servers'] = [];
+ }
+ foreach ($this->params->get('common_ground.oas.servers') as $key => $value) {
+ $docs['servers'][$key] = $value;
+ }
+
+ // Lets set the external documentation
+ if (array_key_exists('externalDocs', $docs)) {
+ $docs['externalDocs'] = [];
+ }
+ foreach ($this->params->get('common_ground.oas.externalDocs') as $key => $value) {
+ $docs['externalDocs'][$key] = $value;
+ }
+
+ // Lets add the commonground codes
+ if (array_key_exists('x-commonground', $docs)) {
+ $docs['x-commonground'] = [];
+ }
+
+ // Lets set the component type
+ $docs['x-commonground']['type'] = $this->params->get('common_ground.oas.type');
+
+ // Lets set the devolopers
+ if (array_key_exists('developers', $docs['x-commonground'])) {
+ $docs['developers'] = [];
+ }
+ foreach ($this->params->get('common_ground.oas.developers') as $key => $value) {
+ $docs['x-commonground']['developers'][$key] = $value;
+ }
+
+ // Lets set the build checks
+ if (array_key_exists('builds', $docs['x-commonground'])) {
+ $docs['builds'] = [];
+ }
+ foreach ($this->params->get('common_ground.oas.builds') as $key => $value) {
+ $docs['x-commonground']['builds'][$key] = $value;
+ }
+
+ /*todo a loop within a lopo is butt ugly */
+ foreach ($docs['paths'] as $path => $calls) {
+ foreach ($calls as $method => $call) {
+
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'Authorization',
+ 'description' => 'The JWT of the entity performing the request',
+ 'in' => 'header',
+ ];
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'API-Version',
+ 'description' => 'The version of the API conform [Landelijke API-strategie.](https://geonovum.github.io/KP-APIs/#versioning)',
+ 'example' => '1.0.1',
+ 'in' => 'header',
+ ];
+ /*
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'X-NLX-Request-Application-Id',
+ 'description' => 'The id of the application performing the request',
+ 'in' => 'header',
+ ];
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'X-NLX-Request-Subject-Identifier',
+ 'description' => 'An subject identifier for purpose registration (doelbinding)',
+ 'in' => 'header',
+ ];
+ */
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'X-NLX-Logrecord-ID',
+ 'description' => 'A globally unique id of the request, which makes a request traceable throughout the network.',
+ 'in' => 'header',
+ ];
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'X-NLX-Request-Process-Id',
+ 'description' => 'A process id for purpose registration (doelbinding)',
+ 'in' => 'header',
+ ];
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'X-NLX-Request-Data-Elements',
+ 'description' => 'A list of requested data elements',
+ 'in' => 'header',
+ ];
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'X-NLX-Request-Data-Subject',
+ 'description' => 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`',
+ 'in' => 'header',
+ ];
+ // NLX loging headers
+ $call['parameters'][] = [
+ 'name' => 'X-NLX-Audit-Clarification',
+ 'description' => 'A clarification as to why a request has been made (doelbinding)',
+ 'in' => 'header',
+ ];
+
+ if ($method == 'get') {
+
+ // Health JSON
+ $call['produces'][] = 'application/health+json';
+
+ // WEBSUB header
+ $call['parameters'][] = [
+ 'name' => 'Link',
+ 'description' => 'A [websub](https://www.w3.org/TR/websub/#discovery) header like ; rel="hub"',
+ 'in' => 'header',
+ ];
+
+ // Lets add the extend functionality
+ $call['parameters'][] = [
+ 'name' => 'extend[]',
+ 'required' => false,
+ 'description' => 'An array of nested objects to include in the return object',
+ 'in' => 'query',
+ 'schema' => ['type'=>'array'],
+ ];
+ // Lets add the fields functionality
+ $call['parameters'][] = [
+ 'name' => 'fields[]',
+ 'required' => false,
+ 'description' => 'An array of fields to return in output, wil return all fields is not supplied',
+ 'in' => 'query',
+ 'schema' => ['type'=>'array'],
+ ];
+ // Lets add some time travel
+ $call['parameters'][] = [
+ 'name' => 'validOn',
+ 'required' => false,
+ 'description' => 'Returns object as valid on a given date time',
+ 'schema' => ['type'=>'string', 'format' => 'date-time'],
+ 'in' => 'query',
+ ];
+ $call['parameters'][] = [
+ 'name' => 'validFrom',
+ 'required' => false,
+ 'description' => 'Returns objects valid from a given date time',
+ 'schema' => ['type'=>'string', 'format' => 'date-time'],
+ 'in' => 'query',
+ ];
+ $call['parameters'][] = [
+ 'name' => 'validUntil',
+ 'required' => false,
+ 'description' => 'Returns objects valid until a given date time',
+ 'schema' => ['type'=>'string', 'format' => 'date-time'],
+ 'in' => 'query',
+ ];
+ }
+ }
+ }
+
+ /* @todo dit afbouwen */
+
+ /*
+ if(config heltchecks is true){
+ $tag=[];
+ $tag['name']='';
+ $tag['description']='';
+ array_unshift($fruits_list, $tag);
+
+ }
+
+ if(config audittrail is true){
+ $tag=[];
+ $tag['name']='';
+ $tag['description']='';
+ array_unshift($fruits_list, $tag);
+
+ }
+
+ if(config notifications is true){
+ $tag=[];
+ $tag['name']='';
+ $tag['description']='';
+ array_unshift($fruits_list, $tag);
+
+ }
+
+ if(config authorization is true){
+ $tag=[];
+ $tag['name']='';
+ $tag['description']='';
+ array_unshift($fruits_list, $tag);
+ }
+ */
+ //var_dump($docs);
+
+ // Aditional tags
+
+ // Security tag
+ if (getenv('HEALTH_ENABLED') == 'true') {
+ $tag = [];
+ $tag['name'] = 'Health Checks';
+ $tag['description'] = 'Authorization';
+ $tag['externalDocs'] = [];
+ $tag['externalDocs'][] = ['url'=>'http://docs.my-api.com/pet-operations.htm'];
+ array_unshift($docs['tags'], $tag);
+ }
+
+ // Security tag
+ if (getenv('NOTIFICATION_ENABLED') == 'true') {
+ $tag = [];
+ $tag['name'] = 'Notifications';
+ $tag['description'] = 'Authorization';
+ $tag['externalDocs'] = [];
+ $tag['externalDocs'][] = ['url'=>'http://docs.my-api.com/pet-operations.htm'];
+ array_unshift($docs['tags'], $tag);
+ }
+
+ // Security tag
+ if (getenv('AUDITTRAIL_ENABLED') == 'true') {
+ $tag = [];
+ $tag['name'] = 'Audit trail';
+ $tag['description'] = 'Authorization';
+ $tag['externalDocs'] = [];
+ $tag['externalDocs'][] = ['url'=>'http://docs.my-api.com/pet-operations.htm'];
+ array_unshift($docs['tags'], $tag);
+ }
+
+ // Security tag
+ if (getenv('AUTH_ENABLED') == 'true') {
+ $tag = [];
+ $tag['name'] = 'Authorization';
+ $tag['description'] = 'Authorization';
+ $tag['externalDocs'] = [];
+ $tag['externalDocs'][] = ['url'=>'http://docs.my-api.com/pet-operations.htm'];
+ array_unshift($docs['tags'], $tag);
+ }
+
+ //var_dump($docs);
+ return $docs;
+ }
+
+ public function supportsNormalization($data, $format = null)
+ {
+ return $this->decorated->supportsNormalization($data, $format);
+ }
+
+ private function getAdditionalEntityDocs($entity)
+ {
+ $metadata = $this->em->getClassMetadata($entity);
+ $reflector = $metadata->getReflectionClass();
+ $properties = $metadata->getReflectionProperties();
+ $annotations = $this->annotationReader->getClassAnnotations($reflector);
+ $additionalDocs = ['properties', 'security'=>[]];
+ $required = [];
+
+ // Add audittrail
+ // Add healthcheck
+
+ $class = $reflector->getShortName();
+ $path = '/'.$this->camelCaseToSnakeCaseNameConverter->normalize($class);
+
+ // Lets take a look at the properties an annotions,
+ foreach ($properties as $property) {
+
+ // The dockBlocks for thie property
+ $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
+ $docblock = $factory->create($property->getDocComment());
+ $tags = $docblock->getTags();
+ $atributes = [];
+ $groups = [];
+
+ foreach ($tags as $tag) {
+ $name = $tag->getName();
+ $description = $tag->getDescription();
+ //
+ //$description = (string) $description;
+
+ switch ($name) {
+ // Docblocks
+ case 'example':
+ $atributes['example'] = (string) $description;
+ break;
+
+ // Groups
+ case 'Groups':
+ $propertyAnnotation = $this->annotationReader->getPropertyAnnotation($property, "Symfony\Component\Serializer\Annotation\Groups");
+ $groups = $propertyAnnotation->getGroups();
+ break;
+
+ // Constrainds (Validation)
+ case "Assert\Uuid":
+ $atributes['format'] = 'uuid';
+ break;
+ case "Assert\Email":
+ $atributes['format'] = 'email';
+ break;
+ case "Assert\Url":
+ $atributes['format'] = 'url';
+ break;
+ case "Assert\Regex":
+ $atributes['format'] = 'regex';
+ break;
+ case "Assert\Ip":
+ $atributes['format'] = 'ip';
+ break;
+ case "Assert\Json":
+ $atributes['format'] = 'json';
+ break;
+ case "Assert\Choice":
+ //@todo
+ //$atributes['format'] = 'json';
+ break;
+
+ case "Assert\NotNull":
+ $required[] = $property->name;
+ break;
+ case "Assert\Length":
+ $propertyAnnotation = $this->annotationReader->getPropertyAnnotation($property, "Symfony\Component\Validator\Constraints\Length");
+ if ($propertyAnnotation->max) {
+ $atributes['maxLength'] = $propertyAnnotation->max;
+ }
+ if ($propertyAnnotation->min) {
+ $atributes['minLength'] = $propertyAnnotation->min;
+ }
+ break;
+ }
+ }
+ // Lets write everything to the docs
+ foreach ($groups as $group) {
+ //$additionalDocs["components"]['schemas'][$class."-".$group] = $atributes;
+ $additionalDocs['properties'][$class.'-'.$group]['properties'][$property->name] = $atributes;
+ $additionalDocs['properties'][$class.'-'.$group]['required'] = $required;
+
+ if (!array_key_exists($group, $additionalDocs['security'])) {
+ $additionalDocs['security'][$group] = $group.' right to the '.$class.' resource';
+ }
+ }
+ }
+
+ return $additionalDocs;
+ }
+}
diff --git a/api/src/Types/IncompleteDateType.php b/api/src/Types/IncompleteDateType.php
index 8badbc8e..88f66c3c 100644
--- a/api/src/Types/IncompleteDateType.php
+++ b/api/src/Types/IncompleteDateType.php
@@ -2,54 +2,58 @@
namespace App\Types;
-use Doctrine\DBAL\Types\Type;
-use Doctrine\DBAL\Platforms\AbstractPlatform;
-
use App\ValueObject\IncompleteDate;
+use Doctrine\DBAL\Platforms\AbstractPlatform;
+use Doctrine\DBAL\Types\Type;
class IncompleteDateType extends Type
{
- const INCOMPLETEDATE = 'incompleteDate';
-
- public function getName()
- {
- return self::INCOMPLETEDATE;
- }
-
- public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
- {
- return 'INTEGER';
- }
-
- public function convertToPHPValue($value, AbstractPlatform $platform)
- {
- // Lets make this nullable
- if(!$value){
- return null;
- }
- // We save incomplete date's as YYYYMMDD integer values so that we can easily index and order on them
- list($year, $month, $day) = sscanf($value, '%04u%02u%02u');
-
- return new IncompleteDate($year, $month, $day);
- }
-
- public function convertToDatabaseValue($value, AbstractPlatform $platform)
- {
- // Lets make this nullable
- if(!$value){
- return null;
- }
- // We save incomplete date's as YYYYMMDD integer values so that we can easily index and order on them
- if ($value instanceof IncompleteDate) {
- $value = sprintf('%04u%02u%02u', $value->getYear(), $value->getMonth(), $value->getDay());
- }
- else{
- if(!array_key_exists("year",$value)){ $value['year']=0;}
- if(!array_key_exists("month",$value)){ $value['month']=0;}
- if(!array_key_exists("day",$value)){ $value['day']=0;}
- $value = sprintf('%04u%02u%02u', (int) $value['year'], (int) $value['month'], (int) $value['day']);
- }
-
- return $value;
- }
-}
\ No newline at end of file
+ const INCOMPLETEDATE = 'incompleteDate';
+
+ public function getName()
+ {
+ return self::INCOMPLETEDATE;
+ }
+
+ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
+ {
+ return 'INTEGER';
+ }
+
+ public function convertToPHPValue($value, AbstractPlatform $platform)
+ {
+ // Lets make this nullable
+ if (!$value) {
+ return;
+ }
+ // We save incomplete date's as YYYYMMDD integer values so that we can easily index and order on them
+ list($year, $month, $day) = sscanf($value, '%04u%02u%02u');
+
+ return new IncompleteDate($year, $month, $day);
+ }
+
+ public function convertToDatabaseValue($value, AbstractPlatform $platform)
+ {
+ // Lets make this nullable
+ if (!$value) {
+ return;
+ }
+ // We save incomplete date's as YYYYMMDD integer values so that we can easily index and order on them
+ if ($value instanceof IncompleteDate) {
+ $value = sprintf('%04u%02u%02u', $value->getYear(), $value->getMonth(), $value->getDay());
+ } else {
+ if (!array_key_exists('year', $value)) {
+ $value['year'] = 0;
+ }
+ if (!array_key_exists('month', $value)) {
+ $value['month'] = 0;
+ }
+ if (!array_key_exists('day', $value)) {
+ $value['day'] = 0;
+ }
+ $value = sprintf('%04u%02u%02u', (int) $value['year'], (int) $value['month'], (int) $value['day']);
+ }
+
+ return $value;
+ }
+}
diff --git a/api/src/Types/UnderInvestigationType.php b/api/src/Types/UnderInvestigationType.php
index e66e7e7c..4717bf51 100644
--- a/api/src/Types/UnderInvestigationType.php
+++ b/api/src/Types/UnderInvestigationType.php
@@ -2,66 +2,69 @@
namespace App\Types;
-use Doctrine\DBAL\Types\Type;
-use Doctrine\DBAL\Platforms\AbstractPlatform;
-
use App\ValueObject\UnderInvestigation;
+use Doctrine\DBAL\Platforms\AbstractPlatform;
+use Doctrine\DBAL\Types\Type;
class UnderInvestigationType extends Type
{
- const UNDERINVESTIGATION = 'underInvestigation';
-
- public function getName()
- {
- return self::UNDERINVESTIGATION;
- }
-
- public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
- {
- return 'JSON';
- }
-
- public function convertToPHPValue($value, AbstractPlatform $platform)
- {
- // Lets make this nullable
- if(!$value){
- return null;
- }
- //list($longitude, $latitude) = sscanf($value, 'JSON(%s)');
- $value= json_decode ($value, true);
- //var_dump($data);
- $date = $value['date'];
- $properties = $value['properties'];
- return new UnderInvestigation($properties, $date);
- }
-
- public function convertToDatabaseValue($value, AbstractPlatform $platform)
- {
- // Lets make this nullable
- if(!$value){
- return null;
- }
- if ($value instanceof UnderInvestigation) {
- /* @todo throw an error ir the property isn't a boolean*/
- $value= ["properties"=> $value->getProperties(),"date"=> $value->getDate()];
- $value = json_encode($value);
- }
- else{
- // lets make sure we have a properties array
- if(!array_key_exists("properties",$value)){ $value['properties']=[];}
- // Lets analyse this dataset
- foreach ($value as $key => $property){
- // lets skip the date and propertieskeys
- if($key=='date' || $key=='properties'){continue;}
- /* @todo throw an error ir the property isn't a boolean*/
-
- // lets add the property to the stack
- $value['properties'][$key] = $property;
- unset($value[$key]);
- }
- $value = json_encode($value);
- }
-
- return $value;
- }
-}
\ No newline at end of file
+ const UNDERINVESTIGATION = 'underInvestigation';
+
+ public function getName()
+ {
+ return self::UNDERINVESTIGATION;
+ }
+
+ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
+ {
+ return 'JSON';
+ }
+
+ public function convertToPHPValue($value, AbstractPlatform $platform)
+ {
+ // Lets make this nullable
+ if (!$value) {
+ return;
+ }
+ //list($longitude, $latitude) = sscanf($value, 'JSON(%s)');
+ $value = json_decode($value, true);
+ //var_dump($data);
+ $date = $value['date'];
+ $properties = $value['properties'];
+
+ return new UnderInvestigation($properties, $date);
+ }
+
+ public function convertToDatabaseValue($value, AbstractPlatform $platform)
+ {
+ // Lets make this nullable
+ if (!$value) {
+ return;
+ }
+ if ($value instanceof UnderInvestigation) {
+ /* @todo throw an error ir the property isn't a boolean*/
+ $value = ['properties'=> $value->getProperties(), 'date'=> $value->getDate()];
+ $value = json_encode($value);
+ } else {
+ // lets make sure we have a properties array
+ if (!array_key_exists('properties', $value)) {
+ $value['properties'] = [];
+ }
+ // Lets analyse this dataset
+ foreach ($value as $key => $property) {
+ // lets skip the date and propertieskeys
+ if ($key == 'date' || $key == 'properties') {
+ continue;
+ }
+ /* @todo throw an error ir the property isn't a boolean*/
+
+ // lets add the property to the stack
+ $value['properties'][$key] = $property;
+ unset($value[$key]);
+ }
+ $value = json_encode($value);
+ }
+
+ return $value;
+ }
+}
diff --git a/api/src/ValueObject/IncompleteDate.php b/api/src/ValueObject/IncompleteDate.php
index 97149fc6..c9fbb072 100644
--- a/api/src/ValueObject/IncompleteDate.php
+++ b/api/src/ValueObject/IncompleteDate.php
@@ -2,64 +2,72 @@
namespace App\ValueObject;
-
/*
* Incomplomplete data class
- *
+ *
* This doctrine value object is designd to work in tendem with the incompleteData mapping type to provide doctrine support for the working with incomplete date objects
- *
- *
+ *
+ *
*/
-class IncompleteDate
+class IncompleteDate
{
- /**
- * @param integer $day
- * @param integer $month
- * @param integer $year
- */
- public function __construct($year, $month, $day)
- {
- $this->day = $day;
- $this->month= $month;
- $this->year = $year;
- }
-
- /**
- * @return integer
- */
- public function getDay()
- {
- // If the day is missing we return zero
- if(!$this->day){return 0;}
- return $this->day;
- }
-
- /**
- * @return integer
- */
- public function getMonth()
- {
- // If the month is missing we return zero
- if(!$this->month){return 0;}
- return $this->month;
- }
-
- /**
- * @return integer
- */
- public function getYear()
- {
- // If the year is missing we return zero
- if(!$this->year){return 0;}
- return $this->year;
- }
-
- /**
- * @return string
- */
- public function getDate()
- {
- return sprintf('%04u-%02u-%02u', $this->getYear(), $this->getMonth(), $this->getDay());
- }
-}
\ No newline at end of file
+ /**
+ * @param int $day
+ * @param int $month
+ * @param int $year
+ */
+ public function __construct($year, $month, $day)
+ {
+ $this->day = $day;
+ $this->month = $month;
+ $this->year = $year;
+ }
+
+ /**
+ * @return int
+ */
+ public function getDay()
+ {
+ // If the day is missing we return zero
+ if (!$this->day) {
+ return 0;
+ }
+
+ return $this->day;
+ }
+
+ /**
+ * @return int
+ */
+ public function getMonth()
+ {
+ // If the month is missing we return zero
+ if (!$this->month) {
+ return 0;
+ }
+
+ return $this->month;
+ }
+
+ /**
+ * @return int
+ */
+ public function getYear()
+ {
+ // If the year is missing we return zero
+ if (!$this->year) {
+ return 0;
+ }
+
+ return $this->year;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDate()
+ {
+ return sprintf('%04u-%02u-%02u', $this->getYear(), $this->getMonth(), $this->getDay());
+ }
+}
diff --git a/api/src/ValueObject/UnderInvestigation.php b/api/src/ValueObject/UnderInvestigation.php
index 63912361..bbbb98f1 100644
--- a/api/src/ValueObject/UnderInvestigation.php
+++ b/api/src/ValueObject/UnderInvestigation.php
@@ -2,32 +2,31 @@
namespace App\ValueObject;
-
-class UnderInvestigation
+class UnderInvestigation
{
- /**
- * @param array $properties
- * @param string $date
- */
- public function __construct($properties, $date)
- {
- $this->properties= $properties;
- $this->date= $date;
- }
-
- /**
- * @return array
- */
- public function getProperties()
- {
- return $this->properties;
- }
-
- /**
- * @return string
- */
- public function getDate()
- {
- return $this->date;
- }
-}
\ No newline at end of file
+ /**
+ * @param array $properties
+ * @param string $date
+ */
+ public function __construct($properties, $date)
+ {
+ $this->properties = $properties;
+ $this->date = $date;
+ }
+
+ /**
+ * @return array
+ */
+ public function getProperties()
+ {
+ return $this->properties;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDate()
+ {
+ return $this->date;
+ }
+}
diff --git a/api/symfony.lock b/api/symfony.lock
index 2eea0b38..da9d92cf 100644
--- a/api/symfony.lock
+++ b/api/symfony.lock
@@ -226,6 +226,18 @@
"config/packages/ramsey_uuid_doctrine.yaml"
]
},
+ "sensio/framework-extra-bundle": {
+ "version": "5.2",
+ "recipe": {
+ "repo": "github.com/symfony/recipes",
+ "branch": "master",
+ "version": "5.2",
+ "ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b"
+ },
+ "files": [
+ "config/packages/sensio_framework_extra.yaml"
+ ]
+ },
"sensiolabs/security-checker": {
"version": "4.0",
"recipe": {
diff --git a/api/templates/helm/Chart.yaml.twig b/api/templates/helm/Chart.yaml.twig
index 7795e920..821c26b2 100644
--- a/api/templates/helm/Chart.yaml.twig
+++ b/api/templates/helm/Chart.yaml.twig
@@ -1,7 +1,7 @@
apiVersion: v1
-appVersion: {{ container_project_version }}
-description: {{ app_description }}
-name: {{ container_project_title|replace({' ': ''})|lower }}
+appVersion: {{ app_version }}
+description: '{{ app_description }}'
+name: {{ app_name|replace({' ': ''})|lower }}
version: 0.1.0
home: https://common-ground.dev
icon: https://common-ground.dev/logo-250x250.png
\ No newline at end of file
diff --git a/api/templates/helm/values.yaml.twig b/api/templates/helm/Values.yaml.twig
similarity index 78%
rename from api/templates/helm/values.yaml.twig
rename to api/templates/helm/Values.yaml.twig
index 1d024ae9..37ec6129 100644
--- a/api/templates/helm/values.yaml.twig
+++ b/api/templates/helm/Values.yaml.twig
@@ -5,23 +5,41 @@
settings:
registryBase: {{ container_registry_base }}
projectName: {{ container_project_name }}
+ name: {{ app_name }}
+ title: {{ app_title }}
+ version: {{ app_version }}
+ description: '{{ app_description }}'
+ repro: '{{ app_repro }}'
+ domain: {{ app_domain }}
+ organisationName: {{ organization_name }}
+ email: {{ organization_email }}
+ country: {{ organization_country }}
+ state: {{ organization_state }}
+ locality: {{ organization_locality }}
+ unit: {{ organization_unit }}
+ demo: {{ app_demo }}
env: {{ app_env }}
debug: {{ app_debug }}
replicaCount: 1
corsAllowOrigin: ['*']
- trustedHosts: '^(.+\.)?common-ground\.dev$|^(.+\.)?zaakonline\.nl$|^(.+\.)?conduction\.nl$|^example\.com$|^(.+\.)?178.128.142.152$|178.128.142.152|localhost'
+ trustedHosts: '{{ trusted_hosts }}'
pullPolicy: Always
# You will need these proxies on kubernetes
trustedProxies:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
- # If you are runnig a single component on a kubernetes cluster you can just easaliy enable the load balancer, if not you need to set up a multi component load balancer
+ # If you are runnig a single component on a kubernetes cluster you can just easaliy enable the load balancer, if not you need to set up a multi component load balancer
loadbalancerEnabled: false
# If you want to enable NLX you are requered to add the appropreate certificates to you nlx-settings folder (located in the /api folder)
nlxInwayEnabled: {{ nlx_inway }}
- nlxOutwayEnabled: {{ nlx_outway }}
-
+ # If you are runnig a single component on a kubernetes cluster you can just easaliy enable the load balancer, if not you need to set up a multi component load balancer
+ notificationEnabled: false
+ audittrailEnabled: false
+ authorisationEnabled: false
+ healthEnabled: false
+ archiveEnabled: false
+
php:
repository: docker.io/conduction/protocomponent-php
diff --git a/docker-compose.yml b/docker-compose.yml
index 1506d754..4d7436b7 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -27,18 +27,34 @@ services:
# If you develop on Linux, uncomment the following line to use a bind-mounted host directory instead
# - ./api/var:/srv/api/var:rw
environment:
+ - CONTAINER_REGISTRY_BASE=${CONTAINER_REGISTRY_BASE}
+ - CONTAINER_PROJECT_NAME=${CONTAINER_PROJECT_NAME}
+ - CONTAINER_REPRO=${CONTAINER_REPRO}
+ - DATABASE_URL=postgres://api-platform:!ChangeMe!@db/api?serverVersion=10.1
- APP_ENV=${APP_ENV}
- APP_DEBUG=${APP_DEBUG}
- - APP_VERSION=${CONTAINER_PROJECT_VERSION}
- - APP_TITLE=${CONTAINER_PROJECT_TITLE}
- - APP_NAME=${CONTAINER_PROJECT_NAME}
+ - APP_VERSION=${APP_VERSION}
+ - APP_NAME=${APP_NAME}
+ - APP_TITLE=${APP_TITLE}
+ - APP_DOMAIN=${APP_DOMAIN}
+ - APP_DEMO=${APP_DEMO}
+ - APP_REPRO=${APP_REPRO}
+ - APP_DESCRIPTION=${APP_DESCRIPTION}
+ - ORGANIZATION_NAME=${ORGANIZATION_NAME}
+ - ORGANIZATION_EMAIL_ADDRESS=${ORGANIZATION_EMAIL_ADDRESS}
+ - ORGANIZATION_COUNTRY_NAME=${ORGANIZATION_COUNTRY_NAME}
+ - ORGANIZATION_STATE=${ORGANIZATION_STATE}
+ - ORGANIZATION_LOCALITY=${ORGANIZATION_LOCALITY}
+ - ORGANIZATION_UNIT_NAME=${ORGANIZATION_UNIT_NAME}
+ - TRUSTED_PROXIES=${TRUSTED_PROXIES}
+ - TRUSTED_HOSTS=${TRUSTED_HOSTS}
+ - AUTH_ENABLED=${AUTH_ENABLED}
+ - AUDITTRAIL_ENABLED=${AUDITTRAIL_ENABLED}
+ - NOTIFICATION_ENABLED=${NOTIFICATION_ENABLED}
+ - HEALTH_ENABLED=${HEALTH_ENABLED}
+ - ARCHIVE_ENABLED=${ARCHIVE_ENABLED}
- NLX_OUTWAY=${NLX_OUTWAY}
- NLX_INWAY=${NLX_INWAY}
- - CONTAINER_REGISTRY_BASE=${CONTAINER_REGISTRY_BASE}
- - CONTAINER_PROJECT_TITLE=${CONTAINER_PROJECT_TITLE}
- - CONTAINER_PROJECT_NAME=${CONTAINER_PROJECT_NAME}
- - CONTAINER_PROJECT_VERSION=${CONTAINER_PROJECT_VERSION}
- - DATABASE_URL=postgres://api-platform:!ChangeMe!@db/api?serverVersion=10.1
ports:
- "8082:80"