-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/audit-log-digital-post
- Loading branch information
Showing
22 changed files
with
1,579 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# OS2Forms Fasit | ||
|
||
Adds [Fasit Schultz](https://schultz.dk/loesninger/schultz-fasit/) | ||
handler for archiving purposes. | ||
|
||
For usage in danish, see [BENYTTELSE](docs/BENYTTELSE.md). | ||
|
||
## Installation | ||
|
||
```sh | ||
drush pm:enable os2forms_fasit | ||
``` | ||
|
||
## Settings | ||
|
||
Configure Fasit API `base url` and a way of getting | ||
certificate on `/admin/os2forms_fasit/settings`. | ||
|
||
### Certificate | ||
|
||
The certificate must be in `pem` or `cer` format and | ||
must be whitelisted by Fasit Schultz. | ||
For this the certificate thumbprint, | ||
in lowercase and without colons, is needed. | ||
To get the thumbprint in the correct format from the command line run | ||
|
||
```sh | ||
openssl x509 -in SOME_CERTIFICATE.pem -noout -fingerprint | cut -d= -f2 | sed 's/://g' | tr '[:upper:]' '[:lower:]' | ||
``` | ||
|
||
Example output | ||
|
||
```sh | ||
6acb261f393172d87fa3997cec86569759a8528a | ||
``` | ||
|
||
## Queue | ||
|
||
Archiving is done via an | ||
[Advanced Queue](https://www.drupal.org/project/advancedqueue) | ||
called `fasit_queue`. | ||
|
||
The queue should be processed with `drush`: | ||
|
||
```sh | ||
drush advancedqueue:queue:process fasit_queue | ||
``` | ||
|
||
List the queue (and all other queues) with | ||
|
||
```sh | ||
drush advancedqueue:queue:list | ||
``` | ||
|
||
or go to `/admin/config/system/queues/jobs/fasit_queue` | ||
for a graphical overview of jobs in the queue. | ||
|
||
### Cronjob | ||
|
||
Consider running the queue via a cronjob. | ||
|
||
```cron | ||
*/5 * * * * /path/to/drush advancedqueue:queue:process fasit_queue | ||
``` |
15 changes: 15 additions & 0 deletions
15
modules/os2forms_fasit/config/install/advancedqueue.advancedqueue_queue.fasit_queue.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
langcode: da | ||
status: true | ||
dependencies: { } | ||
id: fasit_queue | ||
label: 'Fasit Queue' | ||
backend: database | ||
backend_configuration: | ||
lease_time: 300 | ||
processor: daemon | ||
processing_time: 280 | ||
locked: false | ||
threshold: | ||
type: 0 | ||
limit: 0 | ||
state: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# OS2Forms Fasit | ||
|
||
Modulet OS2Forms Fasit giver muligheden for at videresende et genereret | ||
indsendelsesbilag til en borger i fagsystemet Fasit Schultz. | ||
|
||
## Krav | ||
|
||
For at kunne snakke sammen med Fasit skal kommunen og Fasit først indbyrdes | ||
aftale hvilke certifikater der anvendes. Disse certifikater skal være OCES-3, | ||
f.eks. FOCES-3, og skal bruges i pem- eller cer-format. | ||
|
||
Dernæst oplyses det anvendte certifikats thumbprint eller public-key til Fasit, | ||
som derefter aktiverer snitfladen. Se evt. | ||
[README#certificate](../README.md#certificate) | ||
for hvordan et certifikats thumbprint kan findes gennem kommandolinjen. | ||
|
||
## Konfiguration | ||
|
||
Integrationen konfigureres under | ||
**Indstillinger** > **OS2Forms Fasit** (/admin/os2forms_fasit/settings). | ||
Her skal følgende sættes op: | ||
|
||
* Fasit API base url | ||
* Basis url’en til Fasit. Denne specificeres af Fasit. | ||
* Eksempel: https://webservices.fasit.dk/ | ||
* Fasit API tenant | ||
* Fasit tenant. Denne specificeres af Fasit. | ||
* Eksempel: aarhus | ||
* Fasit API version | ||
* Hvilken version af af API’et der skal bruges. Her er mulighederne ’v1’ eller ’v2’. Der bør altid bruges ’v2’. | ||
* Eksempel: v2 | ||
* Certificate | ||
* Her kan angives detaljer til et azure key vault hvori certifikatet ligges (Azure key vault) eller en sti direkte til certifikatet (Filsystem) | ||
* Passphrase | ||
* Passphrase til certifikatet, hvis sådan et eksisterer. | ||
|
||
|
||
Se evt. Fasit Scultz dokumentationen for flere detaljer på opbygningen af endpoint url’er. | ||
|
||
Det er desuden muligt at teste om os2forms kan få fat i certifikatet på samme konfigurations-side. | ||
|
||
## Handler | ||
|
||
For at videresende noget til Fasit skal der på formular niveau opsættes en ’Fasit’-handler. | ||
Dette gøres på en formular under Indstillinger > Emails/Handlers > Add handler. | ||
På denne konfigureres følgende: | ||
|
||
* Document title | ||
* Dokumentets titel i Fasit | ||
* Document description | ||
* Dokumentets beskrivelse i Fasit | ||
* CPR element | ||
* Elementet der indeholdender det CPR-nummer der skal videresendes til i Fasit. | ||
* Her kan benyttes enten ’textfield’, ’os2forms_nemid_cpr’ eller ’os2forms_person_lookup’. | ||
* Attachment element | ||
* Elementet der står for at oprette et OS2Forms attachment, altså et ’os2forms_attachment’-element. | ||
|
||
Alle felter er obligatoriske. | ||
|
||
Når der indsendes en formular bliver et ‘job’ sat i en kø. | ||
Videresendelsen til Fasit sker først når dette job køres. | ||
Se [README#queue](../README.md#queue) for flere detaljer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: 'OS2Forms Fasit' | ||
type: module | ||
description: 'Fasit integration' | ||
package: OS2Forms | ||
core_version_requirement: ^9 || ^10 | ||
dependencies: | ||
- drupal:webform | ||
- drupal:advancedqueue | ||
- os2forms:os2forms_attachment | ||
configure: os2forms_fasit.admin.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
os2forms_fasit.admin.settings: | ||
title: OS2Forms Fasit | ||
description: Configure the OS2Forms Fasit module | ||
parent: system.admin_config_system | ||
route_name: os2forms_fasit.admin.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
os2forms_fasit.admin.settings: | ||
path: '/admin/os2forms_fasit/settings' | ||
defaults: | ||
_form: '\Drupal\os2forms_fasit\Form\SettingsForm' | ||
_title: 'Fasit settings' | ||
requirements: | ||
_permission: 'administer site configuration' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
services: | ||
Drupal\os2forms_fasit\Helper\Settings: | ||
arguments: | ||
- "@keyvalue" | ||
|
||
Drupal\os2forms_fasit\Helper\CertificateLocatorHelper: | ||
arguments: | ||
- "@Drupal\\os2forms_fasit\\Helper\\Settings" | ||
|
||
Drupal\os2forms_fasit\Helper\FasitHelper: | ||
arguments: | ||
- '@http_client' | ||
- '@entity_type.manager' | ||
- "@Drupal\\os2forms_fasit\\Helper\\Settings" | ||
- "@Drupal\\os2forms_fasit\\Helper\\CertificateLocatorHelper" |
10 changes: 10 additions & 0 deletions
10
modules/os2forms_fasit/src/Exception/CertificateLocatorException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_fasit\Exception; | ||
|
||
/** | ||
* Certificate locator exception. | ||
*/ | ||
class CertificateLocatorException extends Exception { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_fasit\Exception; | ||
|
||
/** | ||
* Certificate locator exception. | ||
*/ | ||
class Exception extends \Exception { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
modules/os2forms_fasit/src/Exception/FasitResponseException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_fasit\Exception; | ||
|
||
/** | ||
* Fasit response exception. | ||
*/ | ||
class FasitResponseException extends Exception { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
modules/os2forms_fasit/src/Exception/FasitXMLGenerationException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_fasit\Exception; | ||
|
||
/** | ||
* Fasit XML generation exception. | ||
*/ | ||
class FasitXMLGenerationException extends Exception { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
modules/os2forms_fasit/src/Exception/FileTypeException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_fasit\Exception; | ||
|
||
/** | ||
* File type exception. | ||
*/ | ||
class FileTypeException extends Exception { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
modules/os2forms_fasit/src/Exception/InvalidSettingException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_fasit\Exception; | ||
|
||
/** | ||
* Invalid setting exception. | ||
*/ | ||
class InvalidSettingException extends Exception { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
modules/os2forms_fasit/src/Exception/InvalidSubmissionException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_fasit\Exception; | ||
|
||
/** | ||
* Invalid submission exception. | ||
*/ | ||
class InvalidSubmissionException extends Exception { | ||
|
||
} |
Oops, something went wrong.