Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
7981fd1
feat: implement basic proto file
OmegaCreations Jun 8, 2025
3cc1b20
feat: Duplex stream with specific payload message events.
OmegaCreations Jun 10, 2025
c2d45ba
fix: fixed oneof variable naming
OmegaCreations Jun 10, 2025
e2263ae
feat: Duplex stream with specific payload message events.
OmegaCreations Jun 10, 2025
2bcebdf
feat: Create typescript interfaces for duplex stream message model
OmegaCreations Jun 10, 2025
8a81fab
feat: implement serialization and deserialization methods
OmegaCreations Jun 10, 2025
c7d9eeb
feat: add package dependencies and write unit tests for serialization…
OmegaCreations Jun 10, 2025
499a9e7
feat: Create grpc wrapper with basic connection manager and central s…
OmegaCreations Jun 10, 2025
163b4fb
fix: fix grpc addresses to properly connect both client and central s…
OmegaCreations Jun 10, 2025
931bef7
Added first version of implementetion structure
dwedr Jun 11, 2025
daab367
Fixed import mistake
dwedr Jun 11, 2025
a9395ba
Updated methods names
dwedr Jun 11, 2025
e92100a
Added descriptions and changed the wrapper name
dwedr Jun 11, 2025
4877413
fix: updated structure with according to meeting guidelines
dwedr Jun 18, 2025
7bafae6
tried to add grpc listening port outside docker
dwedr Jun 18, 2025
19ce9be
feat: passing gRPC port as parameter
dwedr Jun 18, 2025
6391081
fix: restructured the whole central system file structure and impleme…
dwedr Aug 26, 2025
75cb5c0
feat: compiling tsc upon src changes
dwedr Aug 27, 2025
fb59e46
feat: updated strucutre
dwedr Aug 27, 2025
67a5224
feat: added tests
dwedr Aug 27, 2025
ffd647e
fix: removed unnecessary imports
dwedr Aug 27, 2025
47c728b
Fix: imrpoved gitingores
dwedr Aug 27, 2025
06f5aa3
fix: added dist igonring
dwedr Aug 27, 2025
5d3fce7
fix: djusted gitignore
dwedr Aug 27, 2025
053c3d1
fix: adjsuted gitignore
dwedr Aug 27, 2025
14ab9fa
fix; removed unnecessary files and directories
dwedr Aug 27, 2025
8e3112b
feat: added license header for test files
dwedr Oct 31, 2025
5d75ea9
update: deleted unnecessary wrapper files creating conflicts
dwedr Oct 31, 2025
de2243e
Merge branch 'dev' into feature/TKN/OGUI-1715/central-system-structure
dwedr Oct 31, 2025
222abaf
update: added license header
dwedr Oct 31, 2025
4648f37
Merge branch 'feature/TKN/OGUI-1715/central-system-structure' of gith…
dwedr Oct 31, 2025
1d62e64
update: added changes discussed on todays meeting
dwedr Oct 31, 2025
d8a0c2f
fix: removed unused variables
dwedr Oct 31, 2025
7f60d3c
fix: changed double to single quotes
dwedr Nov 6, 2025
8d02754
fix: changed error handling accordingly to the meeting and added nece…
dwedr Nov 6, 2025
73fb3d6
fix: package json update
dwedr Nov 6, 2025
4f5a653
fix: tests adjustment
dwedr Nov 6, 2025
1d04b1e
feat: Duplex stream with specific payload message events.
OmegaCreations Jun 10, 2025
2698f63
feat: Create typescript interfaces for duplex stream message model
OmegaCreations Jun 10, 2025
3f35e1b
feat: Create typescript interfaces for duplex stream message model
OmegaCreations Jun 10, 2025
5a5c009
feat: implement serialization and deserialization methods
OmegaCreations Jun 10, 2025
9eaead3
feat: add package dependencies and write unit tests for serialization…
OmegaCreations Jun 10, 2025
04087e9
feat: Create grpc wrapper with basic connection manager and central s…
OmegaCreations Jun 10, 2025
f319c67
fix: fix grpc addresses to properly connect both client and central s…
OmegaCreations Jun 10, 2025
765b0fd
Added first version of implementetion structure
dwedr Jun 11, 2025
66a97cd
Fixed import mistake
dwedr Jun 11, 2025
45859e1
Updated methods names
dwedr Jun 11, 2025
413c55f
Added descriptions and changed the wrapper name
dwedr Jun 11, 2025
9aaa394
fix: updated structure with according to meeting guidelines
dwedr Jun 18, 2025
21fbdb2
tried to add grpc listening port outside docker
dwedr Jun 18, 2025
0c43571
feat: passing gRPC port as parameter
dwedr Jun 18, 2025
c23382f
fix: restructured the whole central system file structure and impleme…
dwedr Aug 26, 2025
56817e0
feat: compiling tsc upon src changes
dwedr Aug 27, 2025
bd7c2ec
feat: updated strucutre
dwedr Aug 27, 2025
28a0f1f
feat: added tests
dwedr Aug 27, 2025
b208747
fix: removed unnecessary imports
dwedr Aug 27, 2025
771eaa7
fix; removed unnecessary files and directories
dwedr Aug 27, 2025
ab171f9
feat: added license header for test files
dwedr Oct 31, 2025
66da072
update: deleted unnecessary wrapper files creating conflicts
dwedr Oct 31, 2025
ecc469a
update: added license header
dwedr Oct 31, 2025
7b2dff8
update: added changes discussed on todays meeting
dwedr Oct 31, 2025
b1e78bc
fix: removed unused variables
dwedr Oct 31, 2025
c13ccfa
fix: changed double to single quotes
dwedr Nov 6, 2025
7e355f8
fix: changed error handling accordingly to the meeting and added nece…
dwedr Nov 6, 2025
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
3523ce7
fix: removed unnecessary import and type
dwedr Nov 8, 2025
4084a07
Reverted changed to dev-branch version
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
a9a57c4
Merge branch 'dev' into feature/TKN/OGUI-1715/central-system-structure
dwedr Nov 17, 2025
7448cae
Merge branch 'dev' into feature/TKN/OGUI-1715/central-system-structure
dwedr Nov 17, 2025
37cc507
Merge branch 'dev' into feature/TKN/OGUI-1715/central-system-structure
dwedr Nov 20, 2025
b621278
Merge branch 'dev' into feature/TKN/OGUI-1715/central-system-structure
dwedr Nov 26, 2025
61c8dd6
Merge branch 'dev' into feature/TKN/OGUI-1715/central-system-structure
dwedr Nov 26, 2025
a33a34f
Merge branch 'dev' into feature/TKN/OGUI-1715/central-system-structure
dwedr Nov 26, 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
15 changes: 14 additions & 1 deletion .github/workflows/tokenization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-node@v5
with:
node-version: '22.x'
- run: (cd Tokenization/backend; npm i)
- 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 @@ -46,3 +46,16 @@ jobs:
with:
node-version: '22.x'
- run: (cd Tokenization/webapp; npm run docker:test)

central-system-test:
needs: lint-check-backend
name: Central System backend tests
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v5
- name: Setup node
uses: actions/setup-node@v5
with:
node-version: '22.x'
- run: (cd Tokenization/backend/central-system; npm i; npm run test)
7 changes: 5 additions & 2 deletions Tokenization/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
webapp/node_modules
webapp/.react-router
webapp/build
backend/node_modules
backend/wrapper/dist/
backend/wrapper/node_modules/
backend/wrapper/src/run_tests/
backend/wrapper/src/run_tests/
backend/node_modules
backend/certs
backend/central-system/dist
backend/central-system/node_modules
179 changes: 179 additions & 0 deletions Tokenization/backend/central-system/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
/**
* @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 { HttpServer } from '@aliceo2/web-ui';

import CentralSystem from './dist/modules/CentralSystem.js';

const http = new HttpServer({ port: 8080, allow: '*' });

http.get(
'/healthcheck',
(req, res) => {
res.status(200).send();
},
{ public: true }
);

const centralSystemModel = new CentralSystem(4041);
http.get(
'/tokens/get',
centralSystemModel.tokenController.getTokensHandler.bind(
centralSystemModel.tokenController
),
{
public: true,
}
);

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

http.post(
'/tokens/revoke',
centralSystemModel.tokenController.revokeTokenHandler.bind(
centralSystemModel.tokenController
),
{ public: true }
);

// frontend test endpoints below
const fakeTokens = new Map([
[
1,
{
tokenId: 1,
last4chars: 'abcd',
serviceFrom: 'Service 1',
serviceTo: 'Service 2',
exp: '2026-01-12T11:31:12',
issuer: 'central-system',
iat: '2025-10-01T10:00:00',
permissions: ['GET', 'POST'],
},
],
[
2,
{
tokenId: 2,
last4chars: 'wxyz',
serviceFrom: 'Service 3',
serviceTo: 'Service 4',
exp: '2025-11-15T08:45:30',
issuer: 'admin-portal',
iat: '2025-09-15T14:22:10',
permissions: ['GET'],
},
],
[
3,
{
tokenId: 3,
last4chars: 'efgh',
serviceFrom: 'Service 2',
serviceTo: 'Service 1',
exp: '2026-03-20T16:30:00',
issuer: 'central-system',
iat: '2025-10-02T09:15:00',
permissions: ['GET', 'POST', 'PUT', 'DELETE'],
},
],
[
4,
{
tokenId: 4,
last4chars: '1234',
serviceFrom: 'Service 1',
serviceTo: 'Service 3',
exp: '2026-02-05T12:00:00',
issuer: 'api-gateway',
iat: '2025-09-25T11:30:45',
permissions: ['GET', 'PUT'],
},
],
]);

const fakeLogs = new Map([
[1, []],
[
2,
[
{ id: 1, title: 'The first token ever', content: 'Log for token' },
{
id: 3,
title: 'No second log?',
content: 'Looks like second log is lost somewhere',
},
],
],
]);

http.get(
'/tokens',
(req, res) => {
// Fake long page load
setTimeout(() => res.status(200).json([...fakeTokens.values()]), 1000);
},
{ public: true }
);

http.get(
'/tokens/:tokenId',
(req, res) => {
const tokenId = parseInt(req.params.tokenId, 10);
const token = fakeTokens.get(tokenId) ?? null;

if (!token) {
res.status(404).json({ error: `No token found with id ${tokenId}` });
return;
}

res.status(200).json(token);
},
{ public: true }
);

http.get(
'/tokens/:tokenId/logs',
(req, res) => {
const tokenId = parseInt(req.params.tokenId, 10);

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

const logs = fakeLogs.get(tokenId) ?? [];

if (!logs) {
res
.status(404)
.json({ error: `No logs found found for token ${tokenId}` });
return;
}

setTimeout(() => res.status(200).json(logs), 1000);
},
{ public: true }
);
21 changes: 21 additions & 0 deletions Tokenization/backend/central-system/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
testEnvironment: "node",
roots: ["<rootDir>"],
moduleFileExtensions: ["ts", "js", "json"],
extensionsToTreatAsEsm: [".ts"],

moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},

transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "<rootDir>/tsconfig.json",
},
],
},
};
Loading