Skip to content
Snippets Groups Projects
Commit dfe1b3e1 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

Merge branch 'add-tech-konnector-section' into 'master'

feat(konnector): move section and add "Stimulate konnector errors in local"

See merge request !65
parents 840d9129 27bf8125
No related branches found
No related tags found
1 merge request!65feat(konnector): move section and add "Stimulate konnector errors in local"
Pipeline #97593 passed
......@@ -52,55 +52,6 @@ Once successful you can launch your local cozy with following url: [Cozy local u
Local database can also be consulted at the following url: [Cozy local DB](http://localhost:5984/_utils/)
## Use local konnectors
In most case you will use mocked konnectors with mock data, but for some testing goals you will need real accounts.
In local, it is possible to run EGL en SGE-Enedis konnectors, with real accounts, but it needs some specific manipulation as well as you'll need to use api secrets that are, of course, basically not available in the project. If you need to use konnectors with real accounts in testing goals, please follow the following steps. Otherwise, refer to the next two sections 'Import Mock Data' et 'Simulate konnector connections'.
First step, make sure your stack is running. Then open your [CouchDB](http://localhost:5984/_utils/) and look for the `secrets/io-cozy-account_types` entry.
Then add a new document like this :
EGL Example
```json
{
"_id": "eglgrandlyon",
"grant_mode": "secret",
"slug": "eglgrandlyon",
"secret": {
"eglBaseURL": "******",
"eglAPIAuthKey": "*****"
}
}
```
SGE Enedis example
```json
{
"_id": "enedis-sge-grandlyon",
"grant_mode": "secret",
"slug": "enedis-sge-grandlyon",
"secret": {
"loginUtilisateur": "******",
"wso2BaseUrl": "*****",
"contractId": "*****",
"apiToken": "*****"
}
}
```
:::info
You'll need to use konnector slug as is to make it work properly
:::
You can contact an administrator in order to get the proper information to fill in your secret.
Once it is done, you will be able to use these 2 Konnectors with real accounts.
:::warning You might see this message before trying to log with SGE Account
Make sure you have the person's consent to use their PDL number, as it is sensitive data.
:::
## Import mock data
:::info Requirement
......
# Konnectors
Konnectors are mocked in local with [createConnections](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/blob/dev/scripts/createConnections.js?ref_type=heads) script.
## Use local konnectors
:::warning Not complete yet.
This section is not fully fully tested.
:::
In most case you will use mocked konnectors with mock data, but for some testing goals you will need real accounts.
In local, it is possible to run EGL en SGE-Enedis konnectors, with real accounts, but it needs some specific manipulation as well as you'll need to use api secrets that are, of course, basically not available in the project. If you need to use konnectors with real accounts in testing goals, please follow the following steps. Otherwise, refer to the next two sections 'Import Mock Data' et 'Simulate konnector connections'.
First step, make sure your stack is running. Then open your [CouchDB](http://localhost:5984/_utils/) and look for the `secrets/io-cozy-account_types` entry.
Then add a new document like this :
EGL Example
```json
{
"_id": "eglgrandlyon",
"grant_mode": "secret",
"slug": "eglgrandlyon",
"secret": {
"eglBaseURL": "******",
"eglAPIAuthKey": "*****"
}
}
```
SGE Enedis example
```json
{
"_id": "enedis-sge-grandlyon",
"grant_mode": "secret",
"slug": "enedissgegrandlyon",
"secret": {
"loginUtilisateur": "******",
"wso2BaseUrl": "*****",
"contractId": "*****",
"apiToken": "*****"
}
}
```
:::info
You'll need to use konnector slug as is to make it work properly
:::
You can contact an administrator in order to get the proper information to fill in your secret.
Once it is done, you will be able to use these 2 Konnectors with real accounts.
:::warning You might see this message before trying to log with SGE Account
Make sure you have the person's consent to use their PDL number, as it is sensitive data.
:::
## Stimulate konnector errors in local
:::tip Mongo query to select GRDF related documents
```json
{
"selector": {
"worker": "konnector",
"message.konnector": "grdfgrandlyon"
}
}
```
:::
1. Consult the `triggers` table
1. Run a Query with Mongo
2. Check that only one GRDF trigger exists
3. Copy the trigger's ID
2. Consult the `jobs` table
1. Run a Query with Mongo
2. Check that only one job exists / delete other GRDF jobs
3. Verify that the 'trigger_id' corresponds to the previously copied trigger ID
4. Update the `state` to `errored` and set the `error` field to `CHALLENGE_ASKED`...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment