Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMN-522 - Improved typing client assertion validators #1021

Draft
wants to merge 317 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
317 commits
Select commit Hold shift + click to select a range
1b9bcb1
Export types
taglioni-r Aug 30, 2024
92ae7e4
Update mocks
taglioni-r Aug 30, 2024
8f7425a
Use new types
taglioni-r Aug 30, 2024
1a20141
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Aug 30, 2024
ad89d1b
Fix tests
taglioni-r Aug 30, 2024
8a50e45
Update logic
taglioni-r Aug 30, 2024
879fcac
Update logic
taglioni-r Aug 30, 2024
cba78ad
Renaming
taglioni-r Sep 2, 2024
b00d48f
Fix types usage
taglioni-r Sep 2, 2024
11bdd38
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 2, 2024
ddd873f
Add logic
taglioni-r Sep 2, 2024
f985c57
Improve tests
taglioni-r Sep 2, 2024
591f3e0
Add util function
taglioni-r Sep 2, 2024
ed2ce4d
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 2, 2024
655e7ac
Refactor
taglioni-r Sep 2, 2024
e4a0e39
Update utils
taglioni-r Sep 2, 2024
afcdc45
Fix logic
taglioni-r Sep 2, 2024
a8556fc
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 2, 2024
1ae0c40
Improve test
taglioni-r Sep 2, 2024
65dba57
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 2, 2024
16ed1e0
Fix
taglioni-r Sep 2, 2024
e43d3bb
Add logic
taglioni-r Sep 2, 2024
48ce748
Add comment
taglioni-r Sep 2, 2024
9decc20
Improve test cases
taglioni-r Sep 2, 2024
68d9aac
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 2, 2024
74aad05
Update logic
taglioni-r Sep 2, 2024
e643618
Improve test cases
taglioni-r Sep 2, 2024
4c0c11b
Improve test cases
taglioni-r Sep 2, 2024
7ded46e
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 3, 2024
3e394e0
Fix logic
taglioni-r Sep 3, 2024
460ac9d
Update test placeholders
taglioni-r Sep 3, 2024
49da587
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 3, 2024
4a21c34
Fix logic
taglioni-r Sep 3, 2024
ef07d3b
Add test placeholder
taglioni-r Sep 3, 2024
7124f2d
Add tests
taglioni-r Sep 3, 2024
61e3392
Remove log
taglioni-r Sep 3, 2024
ad23da6
Fix test
taglioni-r Sep 3, 2024
237e23f
Simplify tests
taglioni-r Sep 3, 2024
d31c24c
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 3, 2024
93d6f4a
Add test for EServiceDescriptorUpdated published
shuyec Sep 3, 2024
76b88ea
Use key types
taglioni-r Sep 3, 2024
94a328c
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 3, 2024
9c13548
Fix primaryKey type
shuyec Sep 3, 2024
49f9651
Improvements
shuyec Sep 3, 2024
aa7a310
Add utils tests
shuyec Sep 3, 2024
1fa67b6
Update utils
shuyec Sep 3, 2024
3e0631d
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 3, 2024
ba07d99
Add todos
shuyec Sep 3, 2024
3e72ad4
Add todos
shuyec Sep 3, 2024
2f8c848
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
shuyec Sep 3, 2024
38df8e8
Add utils tests logics
shuyec Sep 4, 2024
011b351
Fix comments
shuyec Sep 4, 2024
8ccda5b
Fix utils tests + change gsi index name
shuyec Sep 4, 2024
2362681
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
shuyec Sep 4, 2024
633ab8a
WIP: utils tests
shuyec Sep 4, 2024
c1a1641
Fix test utils
taglioni-r Sep 4, 2024
38c488f
Fix EServiceDescriptorUpdated (suspended) test
shuyec Sep 4, 2024
1f10e9a
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
shuyec Sep 4, 2024
18c0569
Replace if/else with switch/case
shuyec Sep 4, 2024
a4ec8a8
Revert "Replace if/else with switch/case"
shuyec Sep 5, 2024
67d4c1b
Revert "Merge branch 'IMN-798_catalog-platformstate-writer-v2' into I…
shuyec Sep 5, 2024
317b30d
Revert "Fix EServiceDescriptorUpdated (suspended) test"
shuyec Sep 5, 2024
b7ab65f
Fix match
shuyec Sep 5, 2024
7006aeb
Clean code
shuyec Sep 5, 2024
24a84e7
Reapply "Merge branch 'IMN-798_catalog-platformstate-writer-v2' into …
shuyec Sep 5, 2024
fcd43a3
Fix sleep
taglioni-r Sep 5, 2024
fce8932
Update docker compose
taglioni-r Sep 5, 2024
74650dc
Merge branch 'IMN-797_catalog-platformstate-writer-v1' of https://git…
taglioni-r Sep 5, 2024
b9363e8
Update docker compose
taglioni-r Sep 5, 2024
4e72c16
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
253542b
Improvements
taglioni-r Sep 5, 2024
a0da40c
Fix
taglioni-r Sep 5, 2024
8118156
Remove commented line
taglioni-r Sep 5, 2024
7ec1fb8
Remove commented line
taglioni-r Sep 5, 2024
28b4731
Minor improvements
taglioni-r Sep 5, 2024
b658355
Update docker-compose file
taglioni-r Sep 5, 2024
49ae8be
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
taglioni-r Sep 5, 2024
7ad0664
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
58ae56e
Add util test
taglioni-r Sep 5, 2024
2b8aadd
Merge branch 'IMN-798_catalog-platformstate-writer-v2' of https://git…
taglioni-r Sep 5, 2024
749af6d
Add test
taglioni-r Sep 5, 2024
9972587
Fix key
taglioni-r Sep 5, 2024
d374765
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
bceaf1c
Rename test
taglioni-r Sep 5, 2024
68d84eb
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
b1a0d8e
Fix tests
taglioni-r Sep 5, 2024
bb9481d
Fix test
taglioni-r Sep 5, 2024
d5264c5
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
67b3073
Fix token state entry pk type
shuyec Sep 5, 2024
3d87a14
Renaming
taglioni-r Sep 5, 2024
8833df0
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
25173ec
Merge branch 'IMN-797_catalog-platformstate-writer-v1' of https://git…
shuyec Sep 5, 2024
c753b4a
Merge branch 'IMN-797_catalog-platformstate-writer-v1' of https://git…
shuyec Sep 5, 2024
6b1ac08
Remove no-console
taglioni-r Sep 5, 2024
cc93507
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
43c2d97
Remove comments
taglioni-r Sep 5, 2024
d94247d
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 5, 2024
2b048fe
Remove console.log
shuyec Sep 5, 2024
2f9d377
Merge branch 'IMN-797_catalog-platformstate-writer-v1' of https://git…
shuyec Sep 5, 2024
6e51bd1
Remove comments
shuyec Sep 5, 2024
374d3ec
Minor improvement
taglioni-r Sep 5, 2024
4e8a362
Fix import
taglioni-r Sep 5, 2024
bea13d4
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
shuyec Sep 5, 2024
a6d8d65
Add api spec
taglioni-r Sep 5, 2024
b414e18
Adjust types
shuyec Sep 5, 2024
6470dcf
Fix client kind type
shuyec Sep 5, 2024
560330b
Fix tests
shuyec Sep 5, 2024
c992846
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 6, 2024
535e6de
Draft
taglioni-r Sep 6, 2024
a7a8efe
Resolve PR comments
shuyec Sep 6, 2024
7a17057
Fix
taglioni-r Sep 6, 2024
a938106
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
taglioni-r Sep 6, 2024
1e6d50a
Remove comment
taglioni-r Sep 6, 2024
f891ff1
Renaming
taglioni-r Sep 6, 2024
b046603
Fix
taglioni-r Sep 6, 2024
f7c21e1
Fix logic
taglioni-r Sep 6, 2024
6d009cf
Add tests
taglioni-r Sep 6, 2024
77d55d2
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 6, 2024
72a6177
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 6, 2024
5312b34
Draft
taglioni-r Sep 6, 2024
9c9bf27
Refactor tables setup
taglioni-r Sep 6, 2024
6fa4866
Add pagination
shuyec Sep 9, 2024
ba70501
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
shuyec Sep 9, 2024
135b036
WIP: add errors
shuyec Sep 9, 2024
ecc1093
Update package imports
shuyec Sep 9, 2024
1eb3762
Draft
taglioni-r Sep 10, 2024
a26f95d
WIP: add errors
shuyec Sep 10, 2024
e22b041
Update errors
taglioni-r Sep 10, 2024
b34ed35
Update utils
taglioni-r Sep 10, 2024
3c5ad7c
Draft test
taglioni-r Sep 10, 2024
02eeeb4
Add placeholders for tests
taglioni-r Sep 10, 2024
8562a57
Add type
taglioni-r Sep 10, 2024
060e2b7
Refactor
taglioni-r Sep 10, 2024
43d252a
Update tests
taglioni-r Sep 10, 2024
d09d7a2
Update comment
taglioni-r Sep 10, 2024
3bf72b3
Fix errors data
shuyec Sep 11, 2024
facb19c
Refactor
taglioni-r Sep 11, 2024
331b6b1
Merge branch 'IMN-522_client-assertion-validation' of https://github.…
taglioni-r Sep 11, 2024
59f0aa5
Update comment
taglioni-r Sep 11, 2024
c1c4c3e
Fix checks
taglioni-r Sep 11, 2024
b72c5dc
Update test utils
taglioni-r Sep 11, 2024
9ba64f6
Draft tests
taglioni-r Sep 11, 2024
feddfe6
Add errors
shuyec Sep 11, 2024
659d4d1
Fix algorithm error
shuyec Sep 11, 2024
8f774eb
Refactor validateSub
taglioni-r Sep 11, 2024
3991d66
Fix mock
taglioni-r Sep 11, 2024
c97619f
Update tests
taglioni-r Sep 11, 2024
5a49356
Remove printed errors
taglioni-r Sep 11, 2024
b12a6ea
Add errors
shuyec Sep 11, 2024
2060029
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 12, 2024
e2d2de3
Fix tests
shuyec Sep 12, 2024
c73ddf5
Merge branch 'IMN-522_client-assertion-validation' of https://github.…
shuyec Sep 12, 2024
0105452
Improvements
shuyec Sep 12, 2024
98784fc
Improvements
shuyec Sep 12, 2024
04c7aa4
Fix
taglioni-r Sep 12, 2024
762d65b
Fix import
taglioni-r Sep 12, 2024
8ea2212
Refactor
taglioni-r Sep 12, 2024
2fa65e0
Add check
taglioni-r Sep 12, 2024
1f8aa0e
Fix test
taglioni-r Sep 12, 2024
4784b7c
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
taglioni-r Sep 12, 2024
c3814e1
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 12, 2024
edcfd79
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 12, 2024
9a19717
Fix
taglioni-r Sep 12, 2024
6a08e96
Merge branch 'IMN-522_client-assertion-validation' of https://github.…
taglioni-r Sep 12, 2024
d212b09
Refactor
taglioni-r Sep 12, 2024
e2e50a3
Add tests
taglioni-r Sep 12, 2024
8b16304
Remove comment
taglioni-r Sep 12, 2024
4a44eb0
Refactor
taglioni-r Sep 13, 2024
8519e60
Refactor
taglioni-r Sep 13, 2024
9a72065
Add util tests
taglioni-r Sep 13, 2024
f4e37aa
Add test
taglioni-r Sep 13, 2024
7a8205f
Fix
taglioni-r Sep 13, 2024
5f62de0
Remove hardcoded string
taglioni-r Sep 13, 2024
7788383
Update comments
taglioni-r Sep 16, 2024
c27e3ad
Fix
taglioni-r Sep 16, 2024
ba9609f
Refactor
taglioni-r Sep 16, 2024
f9ba9db
Refactor
taglioni-r Sep 16, 2024
9bdea36
Renaming
taglioni-r Sep 17, 2024
7d5e486
Refactor
taglioni-r Sep 18, 2024
519870b
Fix tests
taglioni-r Sep 18, 2024
bf36128
Refactor
taglioni-r Sep 18, 2024
d8a2dcc
Comment function
taglioni-r Sep 18, 2024
7724295
Fix GSIPK_agreementTimestamp typo
shuyec Sep 20, 2024
97872cd
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
shuyec Sep 20, 2024
db0de47
Revert "Fix GSIPK_agreementTimestamp typo"
shuyec Sep 20, 2024
fd04e3b
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
shuyec Sep 20, 2024
ab92c54
Remove unused line
taglioni-r Sep 24, 2024
2ed47eb
Refactor
taglioni-r Sep 24, 2024
bb0ee8d
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
taglioni-r Sep 24, 2024
1860616
Refactor tables setup
taglioni-r Sep 24, 2024
f6e9a08
Update model
taglioni-r Sep 24, 2024
5dbf0bd
Update platform-states table
taglioni-r Sep 24, 2024
3d9664b
Fix
taglioni-r Sep 24, 2024
4f9904a
Update token-generation-states table
taglioni-r Sep 24, 2024
abc158a
Update aws config
taglioni-r Sep 24, 2024
8b6db83
Rename descriptorStateToItemState function
shuyec Sep 24, 2024
3d12bff
Update key types usage
taglioni-r Sep 24, 2024
fda73c2
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
taglioni-r Sep 24, 2024
7a3fc3e
Merge branch 'IMN-798_catalog-platformstate-writer-v2' of https://git…
taglioni-r Sep 24, 2024
6ad6e6f
Fix
taglioni-r Sep 24, 2024
b9b3c4b
Fix test split
taglioni-r Sep 24, 2024
80fd523
Remove describe utils in test file
shuyec Sep 24, 2024
2061be8
Merge branch 'IMN-798_catalog-platformstate-writer-v2' of https://git…
shuyec Sep 24, 2024
ddd4bdc
Minor fix
taglioni-r Sep 24, 2024
8e58388
Fix test structure
taglioni-r Sep 24, 2024
ab04510
Fix tests
taglioni-r Sep 24, 2024
3e3769f
Fix
taglioni-r Sep 24, 2024
daddb4b
Improve tests
taglioni-r Sep 24, 2024
c875827
Refactor
taglioni-r Sep 24, 2024
b2fe9a8
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 24, 2024
0b27fbe
Refactor test
taglioni-r Sep 24, 2024
d8a6f37
Rename test file for events V2
shuyec Sep 24, 2024
3d8d605
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 24, 2024
4c4d753
Fix typo
shuyec Sep 24, 2024
609b392
Fix
taglioni-r Sep 24, 2024
0f51a67
Update tests
taglioni-r Sep 24, 2024
ca4eac5
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 24, 2024
b0a0be9
Remove api spec
taglioni-r Sep 24, 2024
1b8b684
Refactor
taglioni-r Sep 24, 2024
0a046dc
Remove comment
taglioni-r Sep 24, 2024
b39d50f
Remove commented code
taglioni-r Sep 24, 2024
2780594
Fix comments
taglioni-r Sep 24, 2024
4bfcfd7
Revert string literal
taglioni-r Sep 24, 2024
6c445ed
Add env var
taglioni-r Sep 24, 2024
6917d52
WIP, broken commit
Carminepo2 Sep 24, 2024
09e27ea
Fix types
Carminepo2 Sep 25, 2024
1bbe00c
Revert "Fix types"
taglioni-r Sep 25, 2024
2b59066
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 25, 2024
ebb6db9
Revert "WIP, broken commit"
taglioni-r Sep 25, 2024
c745838
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 25, 2024
f05c1c7
Fix model
taglioni-r Sep 25, 2024
386639f
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
taglioni-r Sep 25, 2024
460fc94
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 25, 2024
f0a2a87
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 25, 2024
98cd82e
Reapply "WIP, broken commit"
taglioni-r Sep 25, 2024
c1c214e
Reapply "Fix types"
taglioni-r Sep 25, 2024
22d90e1
Draft
taglioni-r Sep 25, 2024
dde897a
wip
Carminepo2 Sep 25, 2024
905aa06
Fix agreementDescriptorId type
shuyec Sep 25, 2024
b2810da
Merge branch 'IMN-796_catalog-platform-state-writer-scaffold' into IM…
shuyec Sep 25, 2024
03426ba
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
shuyec Sep 25, 2024
ed4cb24
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
shuyec Sep 25, 2024
c3f442d
Update tables setup
taglioni-r Sep 25, 2024
121fdb8
Merge branch 'IMN-798_catalog-platformstate-writer-v2' into IMN-797_c…
taglioni-r Sep 25, 2024
fbb1c7c
Merge branch 'IMN-797_catalog-platformstate-writer-v1' into IMN-522_c…
taglioni-r Sep 25, 2024
4e3dcf1
Improved typing and logic
Carminepo2 Sep 26, 2024
caaeec8
Merge branch 'IMN-522_client-assertion-validation' into IMN-522_error…
Carminepo2 Sep 26, 2024
9aa6e32
Update validation.ts
Carminepo2 Sep 26, 2024
ce136f1
Merge branch 'IMN-522_errors-refactor' of https://github.com/pagopa/i…
Carminepo2 Sep 26, 2024
b0ba1a8
Fix type error
Carminepo2 Sep 26, 2024
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
53 changes: 51 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,56 @@ services:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example

token-generation-readmodel:
command: "-jar DynamoDBLocal.jar -inMemory -sharedDb"
image: "amazon/dynamodb-local:latest"
ports:
- 8085:8000

platform-states-table-init:
depends_on:
- token-generation-readmodel
restart: on-failure
image: amazon/aws-cli
working_dir: /home/tables
volumes:
- ./dynamoDB-tables:/home/tables
environment:
AWS_ACCESS_KEY_ID: keyid
AWS_SECRET_ACCESS_KEY: key
command: dynamodb create-table
--cli-input-json file://./platform-states.json
--endpoint-url http://token-generation-readmodel:8000
--region eu-central-1

token-generation-states-table-init:
depends_on:
- token-generation-readmodel
restart: on-failure
image: amazon/aws-cli
working_dir: /home/tables
volumes:
- ./dynamoDB-tables:/home/tables
environment:
AWS_ACCESS_KEY_ID: keyid
AWS_SECRET_ACCESS_KEY: key
command: dynamodb create-table
--cli-input-json file://./token-generation-states.json
--endpoint-url http://token-generation-readmodel:8000
--region eu-central-1

dynamodb-admin:
image: "aaronshaf/dynamodb-admin"
container_name: dynamodb-admin
depends_on:
- token-generation-readmodel
restart: always
ports:
- "8001:8001"
environment:
- DYNAMO_ENDPOINT=http://token-generation-readmodel:8000
- AWS_REGION=eu-west-1

# Mongo Express is a web-based MongoDB admin interface, included for convenience
mongo-express:
image: mongo-express:1.0.2-20
Expand Down Expand Up @@ -162,12 +212,11 @@ services:
KMS_REGION: eu-central-1
volumes:
- ./local-kms-seed/seed.yaml:/init/seed.yaml

# HTTP server to simulate well-known JWKS endpoint
jwks:
image: nginx:1.27.0
ports:
- 4500:80
volumes:
- ./local-kms-seed/jwks.json:/usr/share/nginx/html/jwks.json

24 changes: 24 additions & 0 deletions docker/dynamoDB-tables/platform-states.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"TableName": "platform-states",
"AttributeDefinitions": [
{ "AttributeName": "PK", "AttributeType": "S" },
{ "AttributeName": "GSIPK_consumerId_eserviceId", "AttributeType": "S" },
{ "AttributeName": "GSISK_agreementTimestamp", "AttributeType": "S" }
],
"KeySchema": [{ "AttributeName": "PK", "KeyType": "HASH" }],
"GlobalSecondaryIndexes": [
{
"IndexName": "GSIPK_consumerId_eserviceId",
"KeySchema": [
{ "AttributeName": "GSIPK_consumerId_eserviceId", "KeyType": "HASH" },
{ "AttributeName": "GSISK_agreementTimestamp", "KeyType": "HASH" }
],
"Projection": { "ProjectionType": "ALL" }
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 10,
"WriteCapacityUnits": 5
},
"BillingMode": "PAY_PER_REQUEST"
}
59 changes: 59 additions & 0 deletions docker/dynamoDB-tables/token-generation-states.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"TableName": "token-generation-states",
"AttributeDefinitions": [
{ "AttributeName": "PK", "AttributeType": "S" },
{ "AttributeName": "GSIPK_eserviceId_descriptorId", "AttributeType": "S" },
{ "AttributeName": "GSIPK_consumerId_eserviceId", "AttributeType": "S" },
{ "AttributeName": "GSIPK_purposeId", "AttributeType": "S" },
{ "AttributeName": "GSIPK_clientId", "AttributeType": "S" },
{ "AttributeName": "GSIPK_kid", "AttributeType": "S" },
{ "AttributeName": "GSIPK_clientId_purposeId", "AttributeType": "S" }
],
"KeySchema": [{ "AttributeName": "PK", "KeyType": "HASH" }],
"GlobalSecondaryIndexes": [
{
"IndexName": "GSIPK_eserviceId_descriptorId",
"KeySchema": [
{ "AttributeName": "GSIPK_eserviceId_descriptorId", "KeyType": "HASH" }
],
"Projection": { "ProjectionType": "ALL" }
},
{
"IndexName": "GSIPK_consumerId_eserviceId",
"KeySchema": [
{
"AttributeName": "GSIPK_consumerId_eserviceId",
"KeyType": "HASH"
}
],
"Projection": { "ProjectionType": "ALL" }
},
{
"IndexName": "GSIPK_purposeId",
"KeySchema": [{ "AttributeName": "GSIPK_purposeId", "KeyType": "HASH" }],
"Projection": { "ProjectionType": "ALL" }
},
{
"IndexName": "GSIPK_clientId",
"KeySchema": [{ "AttributeName": "GSIPK_clientId", "KeyType": "HASH" }],
"Projection": { "ProjectionType": "ALL" }
},
{
"IndexName": "GSIPK_kid",
"KeySchema": [{ "AttributeName": "GSIPK_kid", "KeyType": "HASH" }],
"Projection": { "ProjectionType": "ALL" }
},
{
"IndexName": "GSIPK_clientId_purposeId",
"KeySchema": [
{ "AttributeName": "GSIPK_clientId_purposeId", "KeyType": "HASH" }
],
"Projection": { "ProjectionType": "ALL" }
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 10,
"WriteCapacityUnits": 5
},
"BillingMode": "PAY_PER_REQUEST"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"start:catalog": "turbo start --filter pagopa-interop-catalog-process",
"start:catalog-readmodel-writer": "turbo start --filter pagopa-interop-catalog-readmodel-writer",
"start:catalog-platformstate-writer": "turbo start --filter pagopa-interop-catalog-platformstate-writer",
"start:agreement": "turbo start --filter pagopa-interop-agreement-process",
"start:agreement-readmodel-writer": "turbo start --filter pagopa-interop-agreement-readmodel-writer",
"start:agreement-email-sender": "turbo start --filter pagopa-interop-agreement-email-sender",
Expand Down
16 changes: 16 additions & 0 deletions packages/catalog-platformstate-writer/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
LOG_LEVEL=info

KAFKA_CLIENT_ID="catalog"
KAFKA_GROUP_ID="catalog-group-local"
KAFKA_BROKERS="localhost:9092"
KAFKA_DISABLE_AWS_IAM_AUTH="true"
CATALOG_TOPIC="event-store.catalog.events"
AWS_CONFIG_FILE=aws.config.local
TOKEN_GENERATION_READMODEL_HOST="localhost"
TOKEN_GENERATION_READMODEL_PORT=8085
TOKEN_GENERATION_READMODEL_TABLE_NAME_PLATFORM="platform-states"
TOKEN_GENERATION_READMODEL_TABLE_NAME_TOKEN_GENERATION="token-generation-states"

AWS_REGION="eu-central-1"
AWS_ACCESS_KEY_ID="key"
AWS_SECRET_ACCESS_KEY="secret"
44 changes: 44 additions & 0 deletions packages/catalog-platformstate-writer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM node:20.14.0-slim@sha256:5e8ac65a0231d76a388683d07ca36a9769ab019a85d85169fe28e206f7a3208e as build

RUN corepack enable

WORKDIR /app
COPY package.json /app/
COPY pnpm-lock.yaml /app/
COPY pnpm-workspace.yaml /app/

COPY ./packages/catalog-platformstate-writer/package.json /app/packages/catalog-platformstate-writer/package.json
COPY ./packages/commons/package.json /app/packages/commons/package.json
COPY ./packages/models/package.json /app/packages/models/package.json
COPY ./packages/kafka-iam-auth/package.json /app/packages/kafka-iam-auth/package.json

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

COPY tsconfig.json /app/
COPY turbo.json /app/
COPY ./packages/catalog-platformstate-writer /app/packages/catalog-platformstate-writer
COPY ./packages/commons /app/packages/commons
COPY ./packages/models /app/packages/models
COPY ./packages/kafka-iam-auth /app/packages/kafka-iam-auth

RUN pnpm build && \
rm -rf /app/node_modules/.modules.yaml && \
rm -rf /app/node_modules/.cache && \
mkdir /out && \
cp -a --parents -t /out \
node_modules packages/catalog-platformstate-writer/node_modules \
package*.json packages/catalog-platformstate-writer/package*.json \
packages/commons \
packages/models \
packages/kafka-iam-auth \
packages/catalog-platformstate-writer/dist && \
find /out -exec touch -h --date=@0 {} \;

FROM node:20.14.0-slim@sha256:5e8ac65a0231d76a388683d07ca36a9769ab019a85d85169fe28e206f7a3208e as final

COPY --from=build /out /app

WORKDIR /app/packages/catalog-platformstate-writer
EXPOSE 3000

CMD ["node", "."]
4 changes: 4 additions & 0 deletions packages/catalog-platformstate-writer/aws.config.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[default]
aws_access_key_id=key
aws_secret_access_key=secret
region=eu-central-1
48 changes: 48 additions & 0 deletions packages/catalog-platformstate-writer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "pagopa-interop-catalog-platformstate-writer",
"private": true,
"version": "1.0.0",
"description": "PagoPA Interoperability catalog consumer service that updates the token-generation-read-model",
"main": "dist",
"type": "module",
"scripts": {
"test": "vitest",
"test:it": "vitest integration",
"lint": "eslint . --ext .ts,.tsx",
"lint:autofix": "eslint . --ext .ts,.tsx --fix",
"format:check": "prettier --check src",
"format:write": "prettier --write src",
"start": "node --loader ts-node/esm -r 'dotenv-flow/config' --watch ./src/index.ts",
"build": "tsc",
"check": "tsc --project tsconfig.check.json"
},
"keywords": [],
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"@pagopa/eslint-config": "3.0.0",
"@types/node": "20.14.6",
"@types/uuid": "9.0.8",
"date-fns": "3.6.0",
"pagopa-interop-commons-test": "workspace:*",
"prettier": "2.8.8",
"testcontainers": "10.9.0",
"ts-node": "10.9.2",
"typescript": "5.4.5",
"uuid": "10.0.0",
"vitest": "1.6.0"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "3.637.0",
"@aws-sdk/util-dynamodb": "3.637.0",
"@protobuf-ts/runtime": "2.9.4",
"connection-string": "4.4.0",
"dotenv-flow": "4.1.0",
"kafka-iam-auth": "workspace:*",
"kafkajs": "2.2.4",
"pagopa-interop-commons": "workspace:*",
"pagopa-interop-models": "workspace:*",
"ts-pattern": "5.2.0",
"zod": "3.23.8"
}
}
15 changes: 15 additions & 0 deletions packages/catalog-platformstate-writer/src/config/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
CatalogTopicConfig,
PlatformStateWriterConfig,
} from "pagopa-interop-commons";
import { z } from "zod";

export const CatalogPlatformStateWriterConfig =
PlatformStateWriterConfig.and(CatalogTopicConfig);

export type CatalogPlatformStateWriterConfig = z.infer<
typeof CatalogPlatformStateWriterConfig
>;

export const config: CatalogPlatformStateWriterConfig =
CatalogPlatformStateWriterConfig.parse(process.env);
Loading
Loading