Skip to content

Commit

Permalink
External API (bcgov#1370)
Browse files Browse the repository at this point in the history
* Add encryption headers and proxy endpoint for external API

Signed-off-by: Jason Sherman <[email protected]>

* add unit tests.
refactor encryption service.
add database model/migration for the configuration of external apis.

Signed-off-by: Jason Sherman <[email protected]>

* Add documentation.

Signed-off-by: Jason Sherman <[email protected]>

* add status code, add backend tests.

Signed-off-by: Jason Sherman <[email protected]>

* Add UX to manage external apis per form.

Signed-off-by: Jason Sherman <[email protected]>

* add a CHEFS Admin UX for approving External APIs.

Signed-off-by: Jason Sherman <[email protected]>

* change layout of External API edit form.
add configuration for deployment.

Signed-off-by: Jason Sherman <[email protected]>

* documentation update mention UX

Signed-off-by: Jason Sherman <[email protected]>

* documentation update

Signed-off-by: Jason Sherman <[email protected]>

* Frontend Unit tests

Signed-off-by: Jason Sherman <[email protected]>

* allow public forms (no real user context) to use external apis

Signed-off-by: Jason Sherman <[email protected]>

* Update app/src/forms/form/controller.js

Co-authored-by: Walter Moar <[email protected]>

* Update app/src/forms/form/controller.js

Co-authored-by: Walter Moar <[email protected]>

* refactor external api into folder

Signed-off-by: Jason Sherman <[email protected]>

* Add CHEFS admin approval for Sending user token

Signed-off-by: Jason Sherman <[email protected]>

* Update app/frontend/src/internationalization/trans/chefs/en/en.json

Co-authored-by: Walter Moar <[email protected]>

* remove External API configuration for sending the user info encrypted (still sends user info).
add a few new user info headers.

Signed-off-by: Jason Sherman <[email protected]>

* validate the externalId parameter at the route level - consistency.

Signed-off-by: Jason Sherman <[email protected]>

* remove transaction/rollback/commit on single table service calls.

Signed-off-by: Jason Sherman <[email protected]>

* use cryptr library for encryption/decryption.
remove db encryption configuration.
update tests

Signed-off-by: Jason Sherman <[email protected]>

* add unit tests for admin functions

Signed-off-by: Jason Sherman <[email protected]>

* remove db from test config

Signed-off-by: Jason Sherman <[email protected]>

* remove db from encryption keys

Signed-off-by: Jason Sherman <[email protected]>

* remove encrypted db not from docs.

Signed-off-by: Jason Sherman <[email protected]>

* remove encrypted db ref

Signed-off-by: Jason Sherman <[email protected]>

---------

Signed-off-by: Jason Sherman <[email protected]>
Co-authored-by: Walter Moar <[email protected]>
  • Loading branch information
usingtechnology and WalterMoar committed Jun 24, 2024
1 parent 72889f8 commit 9ad7e80
Show file tree
Hide file tree
Showing 61 changed files with 4,001 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/chefs_local/local.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"windowMs": "900000",
"max": "100"
}
},
"encryption": {
"proxy": "352f7c24819086bf3df5a38c1a40586045f73e0007440c9d27d59ee8560e3fe7"
}
},
"serviceClient": {
Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/chefs_local/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"windowMs": "900000",
"max": "100"
}
},
"encryption": {
"proxy": "5fb2054478353fd8d514056d1745b3a9eef066deadda4b90967af7ca65ce6505"
}
},
"serviceClient": {
Expand Down
19 changes: 18 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
//"env": { "NODE_ENV": "test" },
"program": "${workspaceFolder}/app/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"${file}",
"--config",
"${workspaceFolder}/app/jest.config.js",
"--coverage=false"
Expand All @@ -59,6 +59,23 @@
"windows": {
"program": "${workspaceFolder}/app/node_modules/jest/bin/jest"
}
},
{
"type": "node",
"request": "launch",
"name": "VITest: current file",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceFolder}/app/frontend/node_modules/vitest/vitest.mjs",
"args": [
"run",
"${relativeFile}",
"-r",
"${workspaceFolder}/app/frontend",
"--coverage=false"
],
"smartStep": true,
"console": "integratedTerminal"
}
],
"version": "0.2.0"
Expand Down
7 changes: 5 additions & 2 deletions app/config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
},
"logFile": "SERVER_LOGFILE",
"logLevel": "SERVER_LOGLEVEL",
"port": "SERVER_PORT"
"port": "SERVER_PORT",
"encryption": {
"proxy": "SERVER_ENCRYPTION_PROXY"
}
},
"serviceClient": {
"commonServices": {
Expand All @@ -71,4 +74,4 @@
}
}
}
}
}
5 changes: 4 additions & 1 deletion app/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@
"issuer": "https://dev.loginproxy.gov.bc.ca/auth/realms/standard",
"audience": "chefs-frontend-localhost-5300",
"maxTokenAge": "300"
},
},
"logLevel": "http",
"port": "8080",
"rateLimit": {
"public": {
"windowMs": "60000",
"max": "120"
}
},
"encryption": {
"proxy": "352f7c24819086bf3df5a38c1a40586045f73e0007440c9d27d59ee8560e3fe7"
}
},
"serviceClient": {
Expand Down
Loading

0 comments on commit 9ad7e80

Please sign in to comment.