Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
fc0dd53
fix: package json update
dwedr Nov 6, 2025
87610e9
fix: tests adjustment
dwedr Nov 6, 2025
25c25b2
Merge branch 'feature/TKN/OGUI-1715/central-system-structure' of gith…
dwedr Nov 6, 2025
dd9ae08
fix: repaired github actions
dwedr Nov 6, 2025
64f8537
fix: deleted copy of proto file
dwedr Nov 6, 2025
04de147
fix: changed port forwarding
dwedr Nov 6, 2025
f7d4f7d
fix: adjusted tests backedn install for webapp
dwedr Nov 6, 2025
4823ea0
fix: updated docker backend install service for webapp tests
dwedr Nov 6, 2025
765ffd8
feat: added backend test to github actions
dwedr Nov 6, 2025
dc50ac5
update: moved jest to dependencies for testing in workflow
dwedr Nov 6, 2025
d4a57fe
update: moved other dependecies
dwedr Nov 6, 2025
f5143a2
update: revoked pakcage.json changes and added npm i to workflow tests
dwedr Nov 6, 2025
c093a37
feat: added npm scirpts shortcuts
dwedr Nov 7, 2025
8550cd5
init: first vault docker setup
dwedr Oct 6, 2025
c4ec6cd
feat: divided docker-compose files and added working mariadb image
dwedr Oct 7, 2025
018a1ae
feat: npm scripts for automatic docker-compose
dwedr Oct 10, 2025
5debe91
feat: added necessary node dependencies for sequalize and MariaDB
dwedr Oct 10, 2025
14529d8
update: added or/and moved dependencies
dwedr Oct 29, 2025
9188697
update: change gitingore and added license
dwedr Oct 29, 2025
e4658b8
feat: created config helper
dwedr Oct 29, 2025
4490ce2
feat: created expiring funciton helper
dwedr Oct 29, 2025
32df2d8
feat: added models
dwedr Oct 29, 2025
efdf9da
feat: created sequalize functionalities
dwedr Oct 29, 2025
2cb0495
feat: added job scheduler for setting delay for expirting token
dwedr Oct 29, 2025
4761ed2
feat: added interfrace
dwedr Oct 29, 2025
6258639
feat: added umzug
dwedr Oct 29, 2025
9f4b465
feat: adjusted scripts for dokcer up and down
dwedr Nov 8, 2025
43680d0
fix: removed cached files
dwedr Nov 8, 2025
2cbc657
fix: quotes adjustment and script fix
dwedr Nov 8, 2025
cd5d505
fix: recreated the sctrucure of database creation files and creation way
dwedr Nov 8, 2025
20b8b29
feat:added 2 first migrations
dwedr Nov 8, 2025
49b974c
update: added db instance to central system module
dwedr Nov 8, 2025
042d89a
fix: database works on docker
dwedr Nov 8, 2025
6e85b43
fix: removed unnecesarry import and type
dwedr Nov 8, 2025
3523ce7
fix: removed unnecessary import and type
dwedr Nov 8, 2025
66103b5
fix: in progress fronted test repairs
dwedr Nov 8, 2025
cf9eb12
update: mover environment
dwedr Nov 8, 2025
76cc4ca
feat: added vault unseal
dwedr Nov 8, 2025
b948f1c
fix: removed unseal key from gitthub
dwedr Nov 8, 2025
6915fa3
fix: adjusted frontend test environment
dwedr Nov 8, 2025
9f2e502
fix; removed vault from testing
dwedr Nov 8, 2025
3ceaff9
Revert "update: mover environment"
dwedr Nov 8, 2025
f19cefa
Revert "feat: added vault unseal"
dwedr Nov 8, 2025
2faf6aa
fix: added network aliases
dwedr Nov 8, 2025
0e487f4
Revert "fix: removed unseal key from gitthub"
dwedr Nov 8, 2025
3592483
fix: added env for Vault_Unseal
dwedr Nov 8, 2025
0471a7d
Revert "update: mover environment"
dwedr Nov 8, 2025
caf1815
Revert "feat: added vault unseal"
dwedr Nov 8, 2025
afd61c4
Revert "fix: removed unseal key from gitthub"
dwedr Nov 8, 2025
79a84f5
update: adjusted docker-compose for vault and database
dwedr Nov 8, 2025
e37d991
fix: repaired docker-compose files
dwedr Nov 8, 2025
800b265
update:github changes and vualt unseal script
dwedr Nov 8, 2025
3595b4c
init: first vault docker setup
dwedr Oct 6, 2025
b4502d6
feat: renamed tokenContoller to ConnectionController
dwedr Oct 10, 2025
ded56b4
feat: added vault controller
dwedr Oct 10, 2025
053b245
feat: renamed imports
dwedr Oct 10, 2025
2ab54fe
feat: added vault services for authenctication and signing token
dwedr Oct 10, 2025
38d7c96
feat: added vault get credentials service
dwedr Oct 10, 2025
80e1866
fix: updated services
dwedr Oct 10, 2025
c899fdd
fix: moved wrapper into new lib directory
dwedr Oct 10, 2025
2c62e0c
feat: added events helpers
dwedr Oct 10, 2025
1605318
feat: vreated register function for TokenController
dwedr Oct 10, 2025
a2f5354
feat: added event based logic to vault requests
dwedr Oct 10, 2025
e21492d
feat: refactored structure of register for more readability
dwedr Oct 10, 2025
b10065c
feat: added encryption helper
dwedr Oct 10, 2025
c3bb31b
feat: moved the event names into external file enum
dwedr Oct 10, 2025
17cf0fa
feat: added initial login in module
dwedr Oct 10, 2025
d8b45c2
feat: added initial vault login and token renewal interval as well as…
dwedr Oct 10, 2025
d879c45
fear: comitted preavious changes
dwedr Oct 10, 2025
15d7bb8
update: reorganized directories
dwedr Oct 29, 2025
c2a4952
fix: fixed names
dwedr Oct 29, 2025
71edd72
fix: improve import
dwedr Nov 8, 2025
afa62ba
fix: remaned enum file and removed redundancy in docker-compose
dwedr Nov 8, 2025
90d48d8
fix: frontend test fix
dwedr Nov 9, 2025
3e89f98
fix: changed frontend tests deployment
dwedr Nov 9, 2025
802e2d0
fix: added missing healthcheck
dwedr Nov 9, 2025
b2b3802
fix: changed dev password for database
dwedr Nov 13, 2025
e3dfde3
fix: repaired unclosed quote
dwedr Nov 13, 2025
4084a07
Reverted changed to dev-branch version
dwedr Nov 13, 2025
839028a
fix: revert other porject changes
dwedr Nov 13, 2025
e20eea5
fix: reverted changes in other projects
dwedr Nov 13, 2025
80064eb
Merge branch 'feature/TKN/OGUI-1715/central-system-structure' of gith…
dwedr Nov 13, 2025
942288a
fix: added wrapper git ignore
dwedr Nov 13, 2025
627d660
Merge branch 'dev' of github.com:AliceO2Group/WebUi into feature/TKN/…
dwedr Nov 13, 2025
d78cf2a
fix: removed unnecessary index.js from backend directory
dwedr Nov 13, 2025
332d8f9
fix: fixed proto id
dwedr Nov 13, 2025
86b9735
fix: changed index js for frontend tests
dwedr Nov 13, 2025
56a2cab
fix: test adjustment
dwedr Nov 13, 2025
1efef6b
init: first vault docker setup
dwedr Oct 6, 2025
3e04836
feat: divided docker-compose files and added working mariadb image
dwedr Oct 7, 2025
a12856a
feat: npm scripts for automatic docker-compose
dwedr Oct 10, 2025
6ff9e18
feat: added necessary node dependencies for sequalize and MariaDB
dwedr Oct 10, 2025
1e2e4a1
update: added or/and moved dependencies
dwedr Oct 29, 2025
f9a6fb9
update: change gitingore and added license
dwedr Oct 29, 2025
c06a7ee
feat: created config helper
dwedr Oct 29, 2025
53e0a79
feat: created expiring funciton helper
dwedr Oct 29, 2025
445fc45
feat: added models
dwedr Oct 29, 2025
d384ebc
feat: created sequalize functionalities
dwedr Oct 29, 2025
420c4c6
feat: added job scheduler for setting delay for expirting token
dwedr Oct 29, 2025
4456a00
feat: added interfrace
dwedr Oct 29, 2025
10fe461
feat: added umzug
dwedr Oct 29, 2025
a009e80
feat: adjusted scripts for dokcer up and down
dwedr Nov 8, 2025
0e33093
fix: removed cached files
dwedr Nov 8, 2025
99ad011
fix: quotes adjustment and script fix
dwedr Nov 8, 2025
47fae32
fix: recreated the sctrucure of database creation files and creation way
dwedr Nov 8, 2025
a429c95
feat:added 2 first migrations
dwedr Nov 8, 2025
7b1d0fd
update: added db instance to central system module
dwedr Nov 8, 2025
072f72c
fix: database works on docker
dwedr Nov 8, 2025
36aecbc
fix: in progress fronted test repairs
dwedr Nov 8, 2025
be12dc7
update: mover environment
dwedr Nov 8, 2025
7132879
feat: added vault unseal
dwedr Nov 8, 2025
83f6a21
fix: removed unseal key from gitthub
dwedr Nov 8, 2025
2332896
fix: adjusted frontend test environment
dwedr Nov 8, 2025
3cef0bd
fix; removed vault from testing
dwedr Nov 8, 2025
c537830
Revert "update: mover environment"
dwedr Nov 8, 2025
7b570fe
Revert "feat: added vault unseal"
dwedr Nov 8, 2025
fb6ce04
fix: added network aliases
dwedr Nov 8, 2025
785ac4a
Revert "fix: removed unseal key from gitthub"
dwedr Nov 8, 2025
6ef867a
fix: added env for Vault_Unseal
dwedr Nov 8, 2025
4970487
Revert "update: mover environment"
dwedr Nov 8, 2025
3b367d6
Revert "feat: added vault unseal"
dwedr Nov 8, 2025
1127395
Revert "fix: removed unseal key from gitthub"
dwedr Nov 8, 2025
383c14f
update: adjusted docker-compose for vault and database
dwedr Nov 8, 2025
cec705b
fix: repaired docker-compose files
dwedr Nov 8, 2025
6dca385
update:github changes and vualt unseal script
dwedr Nov 8, 2025
d44f888
fix: frontend test fix
dwedr Nov 9, 2025
5209966
fix: added missing healthcheck
dwedr Nov 9, 2025
7e603ba
fix: changed dev password for database
dwedr Nov 13, 2025
cede411
fix: repaired unclosed quote
dwedr Nov 13, 2025
2a02b69
Merge branch 'feature/TKN/OGUI-1785/vault-and-mariadb-config' of gith…
dwedr Nov 13, 2025
622263a
update: rebase + vault fix/adjustment for automatic initialization + …
dwedr Nov 13, 2025
2a67b64
Merge branch 'dev' into feature/TKN/OGUI-1785/vault-and-mariadb-config
dwedr Nov 17, 2025
8d9da06
Merge branch 'dev' into feature/TKN/OGUI-1785/vault-and-mariadb-config
dwedr Nov 20, 2025
9f00d03
update: added secrets to git ignore for now
dwedr Nov 20, 2025
73507c3
fix: removed redundant package.json
dwedr Nov 20, 2025
45e0175
update: added secrets to gitignore
dwedr Nov 20, 2025
031350d
init: first vault docker setup
dwedr Oct 6, 2025
0be43aa
feat: renamed tokenContoller to ConnectionController
dwedr Oct 10, 2025
0429013
feat: added vault controller
dwedr Oct 10, 2025
28a08df
feat: renamed imports
dwedr Oct 10, 2025
0f5f586
feat: added vault services for authenctication and signing token
dwedr Oct 10, 2025
cfd1bd6
feat: added vault get credentials service
dwedr Oct 10, 2025
bd5b21e
fix: updated services
dwedr Oct 10, 2025
64b868f
fix: moved wrapper into new lib directory
dwedr Oct 10, 2025
8c72d99
feat: added events helpers
dwedr Oct 10, 2025
9bb5528
feat: vreated register function for TokenController
dwedr Oct 10, 2025
b7713c9
feat: added event based logic to vault requests
dwedr Oct 10, 2025
1533a8a
feat: refactored structure of register for more readability
dwedr Oct 10, 2025
f2c99ca
feat: added encryption helper
dwedr Oct 10, 2025
4e60133
feat: moved the event names into external file enum
dwedr Oct 10, 2025
d1e212e
feat: added initial login in module
dwedr Oct 10, 2025
8c1ab72
feat: added initial vault login and token renewal interval as well as…
dwedr Oct 10, 2025
52c6fac
fear: comitted preavious changes
dwedr Oct 10, 2025
8c28c70
update: reorganized directories
dwedr Oct 29, 2025
8e11da7
fix: fixed names
dwedr Oct 29, 2025
93efc1e
fix: improve import
dwedr Nov 8, 2025
332301e
fix: remaned enum file and removed redundancy in docker-compose
dwedr Nov 8, 2025
9e3394a
update: adjsuted central system model
dwedr Nov 20, 2025
cf5999c
update: adjusted logic and added types
dwedr Nov 20, 2025
459a52a
Merge branch 'feature/TKN/OGUI-1788/vault-services' of github.com:Ali…
dwedr Nov 20, 2025
f418aa2
update: index controller name changes, removed redundant vault image
dwedr Nov 25, 2025
ee0638b
feat: added tests
dwedr Nov 25, 2025
11f2f88
Merge branch 'dev' into feature/TKN/OGUI-1785/vault-and-mariadb-config
dwedr Nov 26, 2025
f9104de
update: github actions change - certificate generation v1
dwedr Nov 26, 2025
a53be5f
fix: delted unncessary import
dwedr Nov 26, 2025
fca30aa
fix: script name fix
dwedr Nov 26, 2025
c8c2eaf
fix: actions fix
dwedr Nov 26, 2025
59cdc08
fix: fixed actions folder naming
dwedr Nov 26, 2025
96158e1
fix: added missing package for CI
dwedr Nov 26, 2025
b434a48
fix: added delayed-strem dependecy for CI
dwedr Nov 26, 2025
61f378d
fix: adjusted packages
dwedr Nov 26, 2025
c601069
Update: github actions and integrations test update
dwedr Nov 26, 2025
2088c2b
Merge branch 'dev' into feature/TKN/OGUI-1785/vault-and-mariadb-config
dwedr Nov 26, 2025
0301089
fix: repaired merge redundancies
dwedr Nov 26, 2025
3998695
update: moved to axios instead of node-fetch because of test issues
dwedr Dec 4, 2025
28a0ef4
Merge branch 'dev' into feature/TKN/OGUI-1785/vault-and-mariadb-config
dwedr Dec 4, 2025
dadacaa
update: fix/adjusted tests and controllers and service as well as end…
dwedr Dec 4, 2025
d9563e9
Merge branch 'dev' into feature/TKN/OGUI-1788/vault-services
dwedr Dec 4, 2025
37407bc
fix: copilot suggested changes with typos and also actions checkout -…
dwedr Dec 4, 2025
25bac4d
Update Tokenization/backend/central-system/src/lib/database/Sequalize…
dwedr Dec 4, 2025
7fdaeb7
fiix: implemented copilot adjustments
dwedr Dec 4, 2025
f274d04
Merge branch 'feature/TKN/OGUI-1785/vault-and-mariadb-config' of gith…
dwedr Dec 4, 2025
86ec86d
fix: removed network from compose
dwedr Dec 4, 2025
f85b732
fix: added database image
dwedr Dec 4, 2025
c074f70
fix: removed dependency from docker-compose
dwedr Dec 4, 2025
39343a7
fix: frontend test fixes
dwedr Dec 5, 2025
ad7399e
fix: frontend tests fixes
dwedr Dec 5, 2025
da1396a
fix: adjusted health check dependencies in docker-compose
dwedr Dec 5, 2025
8a600fa
fix: frontend tests fixes
dwedr Dec 5, 2025
957aff1
fix: frontend tests fixes
dwedr Dec 5, 2025
51bfd75
init: first vault docker setup
dwedr Oct 6, 2025
fd476f2
feat: renamed tokenContoller to ConnectionController
dwedr Oct 10, 2025
4d850f5
feat: added vault controller
dwedr Oct 10, 2025
c708bec
feat: renamed imports
dwedr Oct 10, 2025
47fd6c8
feat: added vault services for authenctication and signing token
dwedr Oct 10, 2025
6ea9842
feat: added vault get credentials service
dwedr Oct 10, 2025
7a8f535
fix: updated services
dwedr Oct 10, 2025
fde8b72
fix: moved wrapper into new lib directory
dwedr Oct 10, 2025
4fb3290
feat: added events helpers
dwedr Oct 10, 2025
4559b4c
feat: vreated register function for TokenController
dwedr Oct 10, 2025
88d2f68
feat: added event based logic to vault requests
dwedr Oct 10, 2025
406b927
feat: refactored structure of register for more readability
dwedr Oct 10, 2025
249fffa
feat: added encryption helper
dwedr Oct 10, 2025
b7bdefb
feat: moved the event names into external file enum
dwedr Oct 10, 2025
064bbe2
feat: added initial login in module
dwedr Oct 10, 2025
a4a252f
feat: added initial vault login and token renewal interval as well as…
dwedr Oct 10, 2025
fd9d7c0
fear: comitted preavious changes
dwedr Oct 10, 2025
19882a0
update: reorganized directories
dwedr Oct 29, 2025
dadab00
fix: fixed names
dwedr Oct 29, 2025
a4f3439
fix: improve import
dwedr Nov 8, 2025
0464231
fix: remaned enum file and removed redundancy in docker-compose
dwedr Nov 8, 2025
14b8dcd
update: adjsuted central system model
dwedr Nov 20, 2025
de721e4
update: adjusted logic and added types
dwedr Nov 20, 2025
1a731e9
init: first vault docker setup
dwedr Oct 6, 2025
101eec2
fix: updated services
dwedr Oct 10, 2025
783d5ea
feat: added events helpers
dwedr Oct 10, 2025
1bc4903
feat: added event based logic to vault requests
dwedr Oct 10, 2025
9844272
feat: refactored structure of register for more readability
dwedr Oct 10, 2025
8662130
feat: added encryption helper
dwedr Oct 10, 2025
59ef834
feat: moved the event names into external file enum
dwedr Oct 10, 2025
c1fe18b
feat: added initial vault login and token renewal interval as well as…
dwedr Oct 10, 2025
d72ecda
fear: comitted preavious changes
dwedr Oct 10, 2025
88f3916
update: reorganized directories
dwedr Oct 29, 2025
c4aeeff
fix: fixed names
dwedr Oct 29, 2025
1f01722
fix: remaned enum file and removed redundancy in docker-compose
dwedr Nov 8, 2025
92b2f7f
update: index controller name changes, removed redundant vault image
dwedr Nov 25, 2025
837a92f
feat: added tests
dwedr Nov 25, 2025
8d7d106
update: github actions change - certificate generation v1
dwedr Nov 26, 2025
cc84131
fix: delted unncessary import
dwedr Nov 26, 2025
e1ddc9d
fix: script name fix
dwedr Nov 26, 2025
172dee7
fix: actions fix
dwedr Nov 26, 2025
6f9c2f2
fix: fixed actions folder naming
dwedr Nov 26, 2025
c7cc1b8
fix: added missing package for CI
dwedr Nov 26, 2025
f5d9e51
fix: added delayed-strem dependecy for CI
dwedr Nov 26, 2025
9410ca2
fix: adjusted packages
dwedr Nov 26, 2025
37076be
Update: github actions and integrations test update
dwedr Nov 26, 2025
bb6ae47
update: moved to axios instead of node-fetch because of test issues
dwedr Dec 4, 2025
735d1cc
update: fix/adjusted tests and controllers and service as well as end…
dwedr Dec 4, 2025
db824cc
fix: copilot suggested changes with typos and also actions checkout -…
dwedr Dec 4, 2025
0c2925a
fix: frontend test fixes
dwedr Dec 5, 2025
4e31bf6
fix: frontend tests fixes
dwedr Dec 5, 2025
df85aa4
update: tests adjustements
dwedr Dec 5, 2025
9be6326
fix: adjusted compose for testing ui
dwedr Dec 5, 2025
7c89bb7
Merge branch 'feature/TKN/OGUI-1788/vault-services' of github.com:Ali…
dwedr Dec 5, 2025
c48ae0a
update: adjusted github actions so it preserves envs and secrets betw…
dwedr Dec 5, 2025
1b4a62b
fix: actions preserve env
dwedr Dec 5, 2025
f4460f4
update: workflow wihtout preserving env
dwedr Dec 5, 2025
2fe05e0
fix: manually added env to central-system tests
dwedr Dec 5, 2025
fa733dc
update: return to first working actions with removed unnecessary job
dwedr Dec 5, 2025
2891fe2
Merge branch 'dev' into feature/TKN/OGUI-1788/vault-services
dwedr Dec 18, 2025
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
57 changes: 47 additions & 10 deletions .github/workflows/tokenization.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Tokenization

on:
pull_request:
paths:
Expand All @@ -19,7 +20,10 @@ jobs:
uses: actions/setup-node@v6
with:
node-version: '22.x'
- run: (cd Tokenization/backend/central-system; npm i)

- name: Install backend dependencies
run: (cd Tokenization/backend/central-system; npm i)

lint-check-webapp:
name: Check eslint rules for webapp on ubuntu-latest
runs-on: ubuntu-latest
Expand All @@ -30,32 +34,65 @@ jobs:
uses: actions/setup-node@v6
with:
node-version: '22.x'
- run: (cd Tokenization/webapp; npm i )
- run: (cd Tokenization/webapp; npm run typecheck)
- run: (cd Tokenization/webapp; npm run lint)

- name: Install webapp dependencies
run: (cd Tokenization/webapp; npm i)

- name: Typecheck webapp
run: (cd Tokenization/webapp; npm run typecheck)

- name: Lint webapp
run: (cd Tokenization/webapp; npm run lint)

ui-test:
needs: lint-check-webapp
needs:
- lint-check-webapp
name: UI-tests for webapp application
runs-on: ubuntu-latest
timeout-minutes: 6
timeout-minutes: 10
steps:
- uses: actions/checkout@v6

- name: Setup node
uses: actions/setup-node@v6
with:
node-version: '22.x'
- run: (cd Tokenization/webapp; npm run docker:test)

- name: Generate test Vault certificates for UI docker:test
run: |
bash Tokenization/scripts/actions-certificates-creation.sh

- name: Run webapp UI tests (docker)
run: (cd Tokenization/webapp; npm run docker:test)

central-system-test:
needs: lint-check-backend
needs:
- lint-check-backend
name: Central System backend tests
runs-on: ubuntu-latest
timeout-minutes: 6
timeout-minutes: 20
steps:
- uses: actions/checkout@v6

- name: Setup node
uses: actions/setup-node@v6
with:
node-version: '22.x'
- run: (cd Tokenization/backend/central-system; npm i; npm run test)

- name: Generate test Vault certificates
run: |
bash Tokenization/scripts/actions-certificates-creation.sh

echo "VAULT_ADDR=https://vault.local:9300" >> $GITHUB_ENV
echo "VAULT_AUTH_METHOD=cert" >> $GITHUB_ENV
echo "VAULT_ROLE=central-system" >> $GITHUB_ENV

echo "VAULT_CACERT_B64=$(base64 -w0 Tokenization/docker/vault/ca.crt)" >> $GITHUB_ENV
echo "VAULT_CENTRAL_SYSTEM_CERT_B64=$(base64 -w0 Tokenization/docker/vault/central-system.crt)" >> $GITHUB_ENV
echo "VAULT_CENTRAL_SYSTEM_KEY_B64=$(base64 -w0 Tokenization/docker/vault/central-system.key)" >> $GITHUB_ENV

- name: Install backend dependencies
run: (cd Tokenization/backend/central-system; npm i)

- name: Run all backend tests (unit + Vault integration via docker)
run: (cd Tokenization/backend/central-system; npm run test:all)
14 changes: 13 additions & 1 deletion Tokenization/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ backend/wrapper/dist/
backend/wrapper/node_modules/
backend/wrapper/src/run_tests/
backend/node_modules
backend/certs
backend/central-system/dist
backend/central-system/node_modules
backend/certs
backend/central-system/ca
backend/central-system/vault/vault*
backend/central-system/crt
backend/central-system/policies
central-system.hcl
backend/central-system/.env
database/*
banner.js
.env
*.crt
*.key
*.pem
6 changes: 6 additions & 0 deletions Tokenization/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ FROM nginx:1.27 AS reverse-proxy
COPY ./docker/provisioning/nginx/conf.d/default.conf /etc/nginx/conf.d
EXPOSE 8080

# ---- Vault ----
FROM hashicorp/vault:1.20
COPY ./docker/vault/vault.crt ./docker/vault/vault.key ./docker/vault/ca.crt /vault/config/
COPY ./docker/vault/central-system-client.crt /vault/config/central-system-client.crt
COPY ./docker/vault/vault-init.sh /usr/local/bin/vault-init.sh
RUN chmod +x /usr/local/bin/vault-init.sh
73 changes: 73 additions & 0 deletions Tokenization/backend/central-system/banner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* @license
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
* All rights not expressly granted are reserved.
*
* This software is distributed under the terms of the GNU General Public
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

import fs from "fs";
import path from "path";

const banner = `/**
* @license
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
* All rights not expressly granted are reserved.
*
* This software is distributed under the terms of the GNU General Public
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/
`;

const processFile = (filePath) => {
try {
const content = fs.readFileSync(filePath, "utf8");

if (
content.includes(`@license`) &&
content.includes(
`Copyright 2019-2020 CERN and copyright holders of ALICE O2.`
)
) {
return;
}

const newContent = banner + "\n" + content;
fs.writeFileSync(filePath, newContent, "utf8");
console.log(`Added banner to: ${filePath}`);
} catch (err) {
console.error(`Error with file ${filePath}:`, err);
}
};

const excludedDirs = ["node_modules", "dist"];
const walkDir = (dir) => {
const files = fs.readdirSync(dir, { withFileTypes: true });

for (const file of files) {
const fullPath = path.join(dir, file.name);

if (file.isDirectory() && !excludedDirs.includes(fullPath)) {
walkDir(fullPath);
} else if (file.isFile()) {
if (/\.(js|ts|jsx|tsx|mjs|cjs|proto)$/.test(file.name)) {
processFile(fullPath);
}
}
}
};

const startDir = "./src/";
walkDir(startDir);
console.log("Banners processed.");
20 changes: 9 additions & 11 deletions Tokenization/backend/central-system/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ http.get(
const centralSystemModel = new CentralSystem(4041);
http.get(
'/tokens/get',
centralSystemModel.tokenController.getTokensHandler.bind(
centralSystemModel.tokenController
centralSystemModel.connectionController.getTokensHandler.bind(
centralSystemModel.connectionController
),
{
public: true,
Expand All @@ -39,16 +39,16 @@ http.get(

http.post(
'/tokens/create',
centralSystemModel.tokenController.createTokenHandler.bind(
centralSystemModel.tokenController
centralSystemModel.connectionController.createTokenHandler.bind(
centralSystemModel.connectionController
),
{ public: true }
);

http.post(
'/tokens/revoke',
centralSystemModel.tokenController.revokeTokenHandler.bind(
centralSystemModel.tokenController
centralSystemModel.connectionController.revokeTokenHandler.bind(
centralSystemModel.connectionController
),
{ public: true }
);
Expand Down Expand Up @@ -156,11 +156,9 @@ http.get(

// Artificially add an error
if (tokenId === 3) {
res
.status(500)
.json({
error: `An error occurred when trying to load logs for token ${tokenId}`,
});
res.status(500).json({
error: `An error occurred when trying to load logs for token ${tokenId}`,
});
return;
}

Expand Down
Loading