Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ before starting to add changes. Use example [placed in the end of the page](#exa
## [Unreleased]

- [#101](https://github.com/OS2Forms/os2forms/pull/101)
Added support for os2web_key
- Added support for `os2web_key` in Digital post
- Added support for `os2web_key` in Fasit handler.
- Switched from saving settings in key value store to config, i.e
the module needs to be reconfigured.
- Removed modules ldap_auth, logging_alerts, maillog

## [3.21.2] 2025-01-07
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dompdf/dompdf": "^2.0",
"drupal/admin_toolbar": "^3.0",
"drupal/advancedqueue": "^1.0",
"drupal/cache_control_override": "^1.1|^2.0",
"drupal/cache_control_override": "^1.1 || ^2.0",
"drupal/clientside_validation": "^4.0",
"drupal/coc_forms_auto_export": "^2.0@alpha",
"drupal/config_entity_revisions": "dev-2.0.x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Drupal\Core\File\FileSystem;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\key\KeyRepository;
use Drupal\key\KeyRepositoryInterface;
use Drupal\os2forms_dawa\Entity\DatafordelerMatrikula;
use Drupal\os2web_audit\Service\Logger;
Expand Down Expand Up @@ -43,7 +42,7 @@ public function __construct(
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
/** @var Logger $auditLogger */
/** @var \Drupal\os2web_audit\Service\Logger $auditLogger */
$auditLogger = $container->get('os2web_audit.logger');
/** @var \Drupal\key\KeyRepositoryInterface $keyRepository */
$keyRepository = $container->get('key.repository');
Expand Down
3 changes: 2 additions & 1 deletion modules/os2forms_digital_post/drush.services.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
Drupal\os2forms_digital_post\Drush\Commands\DigitalPostTestCommands:
os2forms_digital_post.commands:
class: \Drupal\os2forms_digital_post\Commands\DigitalPostTestCommands
arguments:
- '@Drupal\os2forms_digital_post\Helper\DigitalPostHelper'
- '@token'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Drupal\os2forms_digital_post\Drush\Commands;
namespace Drupal\os2forms_digital_post\Commands;

use Drupal\Component\Serialization\Yaml;
use Drupal\Core\Utility\Token;
Expand Down
24 changes: 10 additions & 14 deletions modules/os2forms_fasit/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
# OS2Forms Fasit

Adds [Fasit Schultz](https://schultz.dk/loesninger/schultz-fasit/)
handler for archiving purposes.
Adds [Fasit Schultz](https://schultz.dk/loesninger/schultz-fasit/) handler for archiving purposes.

For usage in danish, see [BENYTTELSE](docs/BENYTTELSE.md).

## Installation

```sh
```shell
drush pm:enable os2forms_fasit
```

## Settings

Configure Fasit API `base url` and a way of getting
certificate on `/admin/os2forms_fasit/settings`.
Go to `/admin/os2forms_fasit/settings` and configure the module.

### 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.
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
```shell
openssl x509 -in SOME_CERTIFICATE.pem -noout -fingerprint | cut -d= -f2 | sed 's/://g' | tr '[:upper:]' '[:lower:]'
```

Example output
Example output:

```sh
```shell
6acb261f393172d87fa3997cec86569759a8528a
```

Expand All @@ -42,13 +38,13 @@ called `fasit_queue`.

The queue should be processed with `drush`:

```sh
```shell
drush advancedqueue:queue:process fasit_queue
```

List the queue (and all other queues) with

```sh
```shell
drush advancedqueue:queue:list
```

Expand Down
1 change: 1 addition & 0 deletions modules/os2forms_fasit/os2forms_fasit.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dependencies:
- drupal:advancedqueue
- os2forms:os2forms_attachment
- os2web:os2web_audit
- os2web_key:os2web_key
configure: os2forms_fasit.admin.settings
15 changes: 15 additions & 0 deletions modules/os2forms_fasit/os2forms_fasit.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* @file
* Install hooks for os2forms_fasit.
*/

/**
* Implements hook_update_N().
*/
function os2forms_fasit_update_9001(): void {
\Drupal::service('module_installer')->install([
'key',
], TRUE);
}
13 changes: 5 additions & 8 deletions modules/os2forms_fasit/os2forms_fasit.services.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
services:
Drupal\os2forms_fasit\Helper\Settings:
autowire: true
arguments:
- "@keyvalue"
$keyRepository: "@key.repository"

Drupal\os2forms_fasit\Helper\CertificateLocatorHelper:
arguments:
- "@Drupal\\os2forms_fasit\\Helper\\Settings"
autowire: true

Drupal\os2forms_fasit\Helper\FasitHelper:
autowire: true
arguments:
- '@http_client'
- '@entity_type.manager'
- "@Drupal\\os2forms_fasit\\Helper\\Settings"
- "@Drupal\\os2forms_fasit\\Helper\\CertificateLocatorHelper"
- "@os2web_audit.logger"
$auditLogger: "@os2web_audit.logger"
49 changes: 49 additions & 0 deletions modules/os2forms_fasit/src/Drush/Commands/FasitTestCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace Drupal\os2forms_fasit\Drush\Commands;

use Drupal\os2forms_fasit\Helper\FasitHelper;
use Drush\Commands\DrushCommands;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* A Drush commandfile.
*/
final class FasitTestCommand extends DrushCommands {

/**
* Constructs a FasitTestCommand object.
*/
public function __construct(
private readonly FasitHelper $helper,
) {
parent::__construct();
}

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get(FasitHelper::class),
);
}

/**
* Test API access.
*
* @command os2forms-fasit:test:api
* @usage os2forms-fasit:test:api --help
*/
public function testApi(): void {
try {
$this->helper->pingApi();
$this->io()->success('Successfully connected to Fasit API');
}
catch (\Throwable $t) {
$this->io()->error($t->getMessage());
}

}

}
Loading
Loading