Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Aronsson84 committed Nov 17, 2023
0 parents commit 621f724
Show file tree
Hide file tree
Showing 11 changed files with 2,800 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parserOptions": {
"ecmaVersion": 2020
},
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"unicode-bom": ["error", "never"]
}
}

20 changes: 20 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test suite

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
name: run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 18
- run: npm ci
- run: npm test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_lab/*
node_modules
.env
.eslintcache
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Onify

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
84 changes: 84 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
![Onify Blueprints](https://files.readme.io/8ba3f14-onify-blueprints-logo.png)

[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
![Test suite](https://github.com/onify/blueprint-bolagsverket-get-ssbtgu/workflows/Test%20suite/badge.svg)

# Onify Blueprint: Get SSBTGU data Bolagsverket

Bolagsverket's [SSBT (Sammansatt bastjänst) service](https://bolagsverket.se/omoss/utvecklingavdigitalatjanster/densammansattabastjanstenforgrundlaggandeuppgifteromforetag/saharfungerardensammansattabastjansten.2229.html) was created with the aim to streamline companies reporting to the government and reducing their administrative burden. SSBT delivers consolidated company information based on source data from Bolagsverket, Skatteverket, and SCB.

> Note: SSBT is an information service only for public actors based in Sweden, that is to say, authorities, municipalities, and regions.
This blueprint primarily demonstrates how to retrieve company details for a specified company via SSBTGU ("grundläggande uppgifter").

> Note: This has only been tested against SSBTGU testversion using Bolagsverket fixed test scenarios, see [connection guide (swedish)](https://bolagsverket.se/download/18.46f4138717c599ee403ab292/1688449960663/anslutningsanvisning-for-atkomst-till-ssbt.pdf) and [checklist (swedish)](https://bolagsverket.se/download/18.46f4138717c599ee403ab290/1638951612751/checklista-for-test-vid-anvandning-av-ssbt.pdf) for more information.
![Onify Blueprint: Get SSBTGU data Bolagsverket](blueprint.png "Blueprint")

## Requirements

These are the technical requirements.

* [Onify Hub](https://github.com/onify/install)
* [Onify Hub Functions](https://github.com/onify/hub-functions)
* [Camunda Modeler](https://camunda.com/download/modeler/)

* Certificate via TeliaSonera (root certificate)
* Firewall opening (external ip allowed by Bolagsverket in their firewall)

## Setup

### Bolagsverket

As mentioned in the requirements, you need a certificate from TeliaSonera. Here is how you prepare the certificate for use against test service (SSBTGU TEST).

**Download and prepare certificate for Onify**

Go to https://repository.trust.teliasonera.com/teliasonerarootcav1.cer and download the certificate.

Now when you have downloaded (replace `<path_to_teliasonerarootcav1.cer>` below) the certificate you need to convert it to base64 format so it can be used as a setting in Onify. Here is how you do it with powershell:

```powershell
$cerContent = Get-Content -Path "path_to_teliasonerarootcav1.cer" -AsByteStream
$base64Content = [System.Convert]::ToBase64String($cerContent)
$pemContent = "-----BEGIN CERTIFICATE-----`n"
$pemContent += ($base64Content -split '(.{64})' | Where-Object { $_ }) -join "`n"
$pemContent += "`n-----END CERTIFICATE-----"
$certObject = [PSCustomObject]@{
certificate = $pemContent
}
$jsonContent = $certObject | ConvertTo-Json
$jsonContent
```

> Note: Keep the json for for later...
### Onify

Add the following settings in Onify:

|Key|Value|Type|Tag|Role|
|---|-----|----|---|----|
|bolagsverket_ssbt_certificate_authority|`{certificate": "-----BEGIN CERTIFICATE-----\nMIIFODCCAyC.....}` (the json output from the powershell snippet above)|object|ssbt, bolagsverket|admin|
|bolagsverket_ssbtgu_url|`https://ssbtgu-accept2.bolagsverket.se/ssbtgu-dft-web-2/SsbtServicePorts/Test/SsbtTestService?wsdl` - URL to SSBTGU service|string|ssbt, bolagsverket|admin

> Note: Create settings via admin interface and add a leading `_` in key. This is required for flow to work.
## Test

1. Open the BPMN diagram in Camunda Modeler.
2. Deploy the BPMN diagram (click `Deploy current diagram` and follow the steps).
3. Run it (click `Start current diagram`).

## Support

* Community/forum: https://support.onify.co/discuss
* Documentation: https://support.onify.co/docs
* Support and SLA: https://support.onify.co/docs/get-support

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Binary file added blueprint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 621f724

Please sign in to comment.