You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ This repository is designed to be used with file-based data programmatically; fo
10
10
📦common-identifier-algorithm-shared
11
11
┣ 📂src
12
12
┃ ┣ 📂config # functions related to the handling of configuration files
13
+
┃ ┣ 📂crypto # functions related to encryption & signing of files
13
14
┃ ┣ 📂decoding # reading and decoding files - CSV or XLSX
14
15
┃ ┣ 📂encoding # encoding and writing files - CSV or XLSX
15
16
┃ ┣ 📂hashing # base hashing logic and supporting utilities
@@ -46,4 +47,8 @@ This repository is designed to be used with file-based data programmatically; fo
46
47
- The `src/processing` processing function identifies if the target is a mapping document based on the current configuration and the data in the file. Using the active configuration it collects data into `static``to_translate` and `reference` buckets per-row and passes it to the active algorithm for processing
47
48
- The active algorithm takes the `{ static:[...], to_translate:[...], reference: [...] }` per-row data and returns a map with the columns it wants to add -- ex: `{ USCADI: "....", DOCUMENT_HASH: "..." }`
48
49
- The data returned by the algorithm is merged into the source rows so the encoders can package multiple different outputs
49
-
- The `src/encoding` Encoders (CSV and XLSX) write the output based on the relevant `[destination]` / `[destination_map]` section of the active configuration.
50
+
- The `src/encoding` Encoders (CSV and XLSX) write the output based on the relevant `[destination]` / `[destination_map]` section of the active configuration.
51
+
52
+
### Post-processing
53
+
54
+
- Any post-processing steps (e.g. encryption, signing, etc.) are handled after the encoding step, using the relevant classes in `src/crypto` (e.g. `GpgWrapper` for GPG encryption/signing)
Copy file name to clipboardExpand all lines: docs/configuration-files.md
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,26 +10,24 @@ Look in any of the existing algorithm implementation repositories for examples o
10
10
11
11
The meta section of the file contains information related to application versioning.
12
12
13
-
```
13
+
```toml
14
14
[meta]
15
-
region="ABC" # application installations are region dependent, the value specified here MUST match the built-in region.
15
+
id="ABC"# application installations are typically region dependent, the value specified here MUST match the built-in region.
16
16
version="1.0.0"# the version information is shown in the top-right of the desktop UI for user visibility.
17
17
signature = "aaabbb"
18
18
```
19
-
The signature is the calculated `md5` hash value of the configuration file itself, computed using the `src/config/generateConfigHash.ts` utility. This feature exists to reduce the likelihood of accidental changes to the config file causing issues in the deterministic processing of input data.
19
+
The signature is the calculated `md5` hash value of the configuration file itself, computed using the [`generateConfigHash`](../src/config/utils.ts) utility. This feature exists to reduce the likelihood of accidental changes to the config file causing issues in the deterministic processing of input data.
20
20
21
21
When a change is made to the configuration file, a new signature value must be created to reflect its new content.
22
22
23
-
> TODO: git pre-commit hook to validate the config file on commit and throw an error if values don't match.
24
-
25
23
### Messages
26
24
27
25
> [!IMPORTANT]
28
26
> If you are intending on using the UI component of this application, the messages section in the configuration file is NOT optional. The values for `terms_and_conditions`, `error_in_config`, and `error_in_salt` MUST be defined.
29
27
30
28
Messages are an optional field used to set the default error and terms & conditions messages within the UI application. Each of these fields supports `HTML` tag syntax.
31
29
32
-
```
30
+
```toml
33
31
[messages]
34
32
# terms and conditions are shown to the user on first start and upon configuration file changes.
35
33
terms_and_conditions="""
@@ -46,9 +44,7 @@ error_in_salt=""
46
44
47
45
The `source` sections defines the expected input columns in the source dataset. The `name` key is the human readable name in the header of the CSV file, `alias` is the more machine-friendly name used by the application internally, and `default` is the default value to use for empty cells where necessary.
48
46
49
-
> TODO: make `alias` an optional parameter - it is not relevant for programmatic usage.
50
-
51
-
```
47
+
```toml
52
48
[source]
53
49
# an array of column names, their aliases, and default values where necessary.
54
50
columns = [
@@ -62,7 +58,7 @@ columns = [
62
58
63
59
This file section details which validation rules to apply to which columns in the input file.
64
60
65
-
```
61
+
```toml
66
62
[validations]
67
63
# per column name to apply validation rules to, define an array of validation rules
68
64
column_name = [
@@ -74,7 +70,7 @@ column_name = [
74
70
]
75
71
```
76
72
77
-
```
73
+
```toml
78
74
# the structure of a validation rule is as follows:
79
75
{
80
76
# the name of the validation rule, from the supported list.
@@ -107,7 +103,7 @@ This is the list of currently supported validation rules, these are further desc
107
103
108
104
### Algorithm
109
105
110
-
```
106
+
```toml
111
107
[algorithm]
112
108
# the aliased columns to use as part of the algo implementation.
113
109
[algorithm.columns]
@@ -119,7 +115,7 @@ static = [ "col_b" ]
119
115
reference = [ "col_c" ]
120
116
```
121
117
122
-
```
118
+
```toml
123
119
[algorithm.hash]
124
120
# the hashing algorithm to use, currently only SHA256 is supported
125
121
strategy = "SHA256"
@@ -146,7 +142,7 @@ darwin = "$APPDATA/<path_to_file>/file.asc"
146
142
147
143
Define the columns to include in the output file, including the human-readable names to convert to where necessary.
148
144
149
-
```
145
+
```toml
150
146
[destination]
151
147
# array of column names and aliases to include in the output file
152
148
columns = [
@@ -163,7 +159,7 @@ postfix = "_OUTPUT"
163
159
164
160
Define the columns to include in the output mapping file, including the human-readable names to convert to where necessary.
165
161
166
-
```
162
+
```toml
167
163
[destination_map]
168
164
# array of column names and aliases to include in the output mapping file
169
165
columns = [
@@ -183,7 +179,7 @@ Define the columns to include in the error report, including the human-readable
183
179
> [!IMPORTANT]
184
180
> Make sure to include the `Errors | errors` column in the output configuration, otherwise they will not be included in the output file.
185
181
186
-
```
182
+
```toml
187
183
[destination_errors]
188
184
# array of column names and aliases to include in the errors file
189
185
columns = [
@@ -195,4 +191,15 @@ columns = [
195
191
# suffix that is appended to the errors filename -> <input_file_name><postfix>.csv
196
192
# for XLSX, this is also the name of the sheet containing the final data
197
193
postfix = "_ERRORS"
194
+
```
195
+
196
+
### Post-processing
197
+
198
+
#### Encryption / Signing
199
+
200
+
```toml
201
+
[post_processing]
202
+
[post_processing.encryption]
203
+
recipient = "QWERTY" # the fingerprint or identifier of the recipient to encrypt the file for
204
+
gpgBinaryPath = "" # optional path to gpg binary, overrides system path lookup
0 commit comments