Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
266 commits
Select commit Hold shift + click to select a range
1b9f574
Merge pull request #1978 from neicnordic/dependabot/maven/sda-sftp-in…
jbygdell Sep 23, 2025
aa1d837
Merge pull request #1979 from neicnordic/dependabot/go_modules/sda/al…
jbygdell Sep 23, 2025
67bc544
Rollback AWS library
jbygdell Sep 23, 2025
b3424cc
feat(sda-download): optimise getFiles query, remove unneeded join, an…
KarlG-nbis Sep 23, 2025
fe6557c
feat(sda-download): remove TestGetFiles unit test which just verifies…
KarlG-nbis Sep 23, 2025
64db0ba
feat(sda-download): remove datasetId, encryptedFileSize, encryptedFil…
KarlG-nbis Sep 23, 2025
a54aadc
Merge pull request #1987 from neicnordic/hotfix/rollback-aws-library
jbygdell Sep 24, 2025
40c820f
Bump chart version
Sep 24, 2025
1c0ff2b
Create new function for ingest message and correlation id
kostas-kou Aug 21, 2025
92022fb
Create function for retrieving user and path
kostas-kou Aug 21, 2025
9384310
Tests for the db function
kostas-kou Aug 21, 2025
b37b827
Create function in api for accepting file id as parameter
kostas-kou Aug 22, 2025
0bb5ea8
Unit tests for the msgInfoFileID function
kostas-kou Aug 22, 2025
57665af
Modify unit tests for ingestFile function
kostas-kou Aug 25, 2025
9098641
Add test for ingesting file via file id
kostas-kou Aug 26, 2025
62c8572
Modify swagger
kostas-kou Aug 26, 2025
9aed12d
Update readme for file/ingest
kostas-kou Aug 28, 2025
425bc45
Refactor setAccession function to extract JSON parsing and correlatio…
kostas-kou Aug 28, 2025
af49e8e
Replace db function for finding checksum with a simpler one
kostas-kou Aug 28, 2025
5b763f1
Add accessionMsgFileID function which creates accession payload from …
kostas-kou Aug 28, 2025
a886ed5
Enhance setAccession function to handle query parameters and update r…
kostas-kou Aug 29, 2025
e1c4cc1
Add tests for accession message file path handling and create helper …
kostas-kou Sep 1, 2025
0819583
Add tests for accessionMsgFileID function and handle invalid fileID s…
kostas-kou Sep 1, 2025
01afc29
Update accession endpoint tests to handle wildcard paths and improve …
kostas-kou Sep 1, 2025
e5b292f
Add test for finalizing file using accession ID via file ID
kostas-kou Sep 2, 2025
f07a437
Update file accession endpoint description and parameters for clarity
kostas-kou Sep 2, 2025
b218118
Update `/file/accession` endpoint to support query parameters and imp…
kostas-kou Sep 2, 2025
f8adf25
Close db connections in a couple of tests
kostas-kou Sep 4, 2025
40f85c4
Apply suggestions from code review
kostas-kou Sep 8, 2025
bc78c32
Remove wildcard from ingest and accession endpoint
kostas-kou Sep 8, 2025
03596fc
Fixes for review commit
kostas-kou Sep 8, 2025
47b5bc9
Refactor db function for returning structured FileDetails with correl…
kostas-kou Sep 12, 2025
f604d5d
Update db function test
kostas-kou Sep 12, 2025
8482f68
Refactor ingestFile and setAccession functions
kostas-kou Sep 12, 2025
fb3b716
Update unit tests
kostas-kou Sep 12, 2025
b6fac68
Update document and swagger
kostas-kou Sep 12, 2025
21fdb08
Update integration test
kostas-kou Sep 14, 2025
73261f3
Add validation for missing accession ID in setAccession function and …
kostas-kou Sep 15, 2025
d099de4
Move FileDetails struct definition to database.go
kostas-kou Sep 15, 2025
f85d1a6
Apply suggestions from code review
kostas-kou Sep 15, 2025
73c8b40
Small fixes
kostas-kou Sep 15, 2025
64517ef
Apply suggestions from code review
kostas-kou Sep 15, 2025
a8b0a22
Apply suggestions from code review
kostas-kou Sep 15, 2025
1310410
Fixes mainly for correlation id and checksum
kostas-kou Sep 15, 2025
a39cf54
Add return in the default case of ingestFile
kostas-kou Sep 17, 2025
8e4173d
Rename functions in comments and tests for clarity
kostas-kou Sep 18, 2025
0be5676
Apply suggestions from code review
kostas-kou Sep 18, 2025
f6d2855
Merge pull request #1986 from neicnordic/bump
jbygdell Sep 24, 2025
73ad802
Disable service links for all deployments
jbygdell Sep 19, 2025
f9ce6f1
Bump chart version.
jbygdell Sep 19, 2025
e4b0a8b
feat(sda-download): update comment for FileInfo
KarlG-nbis Sep 25, 2025
6195a7f
feat(sda-download): remove DatasetFile struct infavour of updating Fi…
KarlG-nbis Sep 25, 2025
b901330
feat(sda-download): remove database.GetDatasetFileInfo func and repla…
KarlG-nbis Sep 25, 2025
3f817d6
Add IngestFileInfo struct and improve PostReq request handling
kostas-kou Sep 25, 2025
9910b99
Add test case for nil jsonBody in PostReq function
kostas-kou Sep 25, 2025
8b50e72
Refactor Ingest function
kostas-kou Sep 25, 2025
93f11d5
Update Ingest unit tests for using struct
kostas-kou Sep 25, 2025
3a61982
Rename Ingest test functions for clarity and add new tests for Ingest…
kostas-kou Sep 25, 2025
c7dd78d
Merge pull request #1974 from neicnordic/hotfix/charts-disable-servic…
jbygdell Sep 26, 2025
9d03ae2
Enhance file ingestion command to support both filepath/user and file…
kostas-kou Sep 26, 2025
77ab322
Rename and refactor struct to include Accession field
kostas-kou Sep 26, 2025
d1d4357
Refactor SetAccession function to handle finalize by providing file id
kostas-kou Sep 26, 2025
d11f4c2
Update SetAccession unit tests for using FileInfo struct
kostas-kou Sep 26, 2025
7fe7b89
Add new unit tests for SetAccession with file id functionality
kostas-kou Sep 26, 2025
4267727
Enhance file set-accession command to support both filepath/user and …
kostas-kou Sep 26, 2025
621d7a1
Update README
kostas-kou Sep 26, 2025
793c726
feat(sda-download): update api.md update the /metadata/datasets/{data…
KarlG-nbis Sep 29, 2025
8760665
Bump the all-modules group in /sda-doa with 2 updates
dependabot[bot] Sep 29, 2025
f244a52
Bump snok/container-retention-policy from 3.0.0 to 3.0.1
dependabot[bot] Sep 29, 2025
e0dfdea
add okhttp jvm dependency
Parisa68 Sep 30, 2025
f917b69
Merge pull request #1999 from neicnordic/dependabot/maven/sda-doa/all…
kjellp Sep 30, 2025
2dc3f00
feat(sda-download): update variable/func naming Id -> ID
KarlG-nbis Oct 2, 2025
e040906
Merge pull request #2004 from neicnordic/dependabot/github_actions/sn…
jbygdell Oct 3, 2025
ea4a94a
Merge pull request #1993 from neicnordic/feature/sda-download_query_o…
jbygdell Oct 3, 2025
df668f7
Bump the all-modules group in /sda-sftp-inbox with 2 updates
dependabot[bot] Oct 6, 2025
703704e
Bump the all-modules group in /sda-doa with 2 updates
dependabot[bot] Oct 6, 2025
4d5d8c9
Merge pull request #2017 from neicnordic/dependabot/maven/sda-doa/all…
jbygdell Oct 8, 2025
09aa45c
Merge pull request #2015 from neicnordic/dependabot/maven/sda-sftp-in…
jbygdell Oct 8, 2025
ffb9507
Update .github/integration/tests/sda/60_api_admin_test.sh
kostas-kou Oct 9, 2025
d311418
Linter fixes
kostas-kou Oct 10, 2025
54dc153
Bump github.com/quic-go/quic-go
dependabot[bot] Oct 10, 2025
d4c0392
Bump github.com/quic-go/quic-go
dependabot[bot] Oct 10, 2025
ec01065
Fix finalize with json payload
kostas-kou Oct 11, 2025
2e4592b
Add api integration test for finalize (json payload)
kostas-kou Oct 11, 2025
a9a0c7d
Refactor GetFileDetailsFromUUID to accept event type and update relat…
kostas-kou Oct 13, 2025
3d3cf5d
Merge branch 'main' into feature/admin-api-UUIDs
kostas-kou Oct 13, 2025
a9f9291
Bump github/codeql-action from 3 to 4
dependabot[bot] Oct 13, 2025
5a1a10f
Bump com.squareup.okhttp3:okhttp-jvm
dependabot[bot] Oct 13, 2025
c0039cd
Merge pull request #2028 from neicnordic/dependabot/go_modules/sda/go…
jbygdell Oct 14, 2025
3473f7d
Merge pull request #2032 from neicnordic/dependabot/maven/sda-doa/all…
kjellp Oct 14, 2025
a45925f
Merge pull request #2027 from neicnordic/dependabot/go_modules/sda-do…
jbygdell Oct 14, 2025
29ed268
Merge pull request #2030 from neicnordic/dependabot/github_actions/gi…
jbygdell Oct 14, 2025
108fc7c
Bump the all-modules group across 1 directory with 3 updates
dependabot[bot] Oct 19, 2025
720b8bb
Merge pull request #2031 from neicnordic/dependabot/go_modules/sda-do…
jbygdell Oct 19, 2025
eeb6a45
Update sda/cmd/api/api.go
kostas-kou Oct 20, 2025
a1a033c
Bump no.elixir:crypt4gh in /sda-doa in the all-modules group
dependabot[bot] Oct 20, 2025
eef4d8d
Merge pull request #2040 from neicnordic/dependabot/maven/sda-doa/all…
jbygdell Oct 21, 2025
b034cb3
make GetC4GHPublicKey work for different apps
aaperis Aug 28, 2025
e7b3a88
get keyhash for a file from db
aaperis Aug 29, 2025
9d2496e
get stableID by FileID from db
aaperis Aug 29, 2025
344fc06
close db connection after each test
aaperis Aug 29, 2025
b3e0d1b
add rotatekey stream and queue
aaperis Aug 29, 2025
906641a
create role rotatekey for sda schema
aaperis Aug 29, 2025
108c41b
add rotatekey service
aaperis Aug 29, 2025
1ecd711
add setup for rotatekey integration tests
aaperis Sep 1, 2025
659f12f
cleanup temporary create_role function
aaperis Sep 23, 2025
5284c27
register rotation key in the db during test setup
aaperis Sep 1, 2025
194e450
send msg to erorr queue of get keyhash fails
aaperis Sep 1, 2025
2b5cdc9
fix linting
aaperis Sep 1, 2025
d8aa861
checks target key hash both at startup and before processing messages
aaperis Sep 4, 2025
da29787
nack after some error messages
aaperis Sep 4, 2025
c920bd0
add rotatekey integration tests
aaperis Sep 4, 2025
227e1f2
reencrypt headers using the reencrypt service
aaperis Sep 9, 2025
b3707c6
add config unittests for rotatekey
aaperis Sep 9, 2025
f12c28c
throw an error if call to reencrypt returns an empty header
aaperis Sep 9, 2025
1c57182
enforce processing only one file per message
aaperis Sep 12, 2025
a4db996
rework nacking mechanism
aaperis Sep 14, 2025
556feff
add error cases in rotatekey integration tests
aaperis Sep 14, 2025
34f12e5
add rotatekey documentation
aaperis Sep 15, 2025
cc4e90d
separate logging from nacking function
aaperis Sep 17, 2025
4bd6ab2
handle case with already encrypted with key at info level
aaperis Sep 17, 2025
3785914
integration test fixes from review suggestions
aaperis Sep 17, 2025
855f794
add CheckKeyHash function
aaperis Sep 17, 2025
1321cdf
use db.CheckKeyHash instead of getKeyHash
aaperis Sep 17, 2025
64460ea
get file corrID from delivered message
aaperis Sep 17, 2025
6968dce
add rotatekey-key json schema
aaperis Sep 18, 2025
68ed6a7
add GetAccessionID db function
aaperis Sep 18, 2025
a96b12e
rotatekey consumes rotate-key messages
aaperis Sep 18, 2025
26b866e
remove rotatekey_stream
aaperis Sep 18, 2025
3bdd1d8
add utility function CallReencryptHeader to reencrypt
aaperis Sep 19, 2025
a46b25c
replace reencrypt logic with CallReencryptHeader
aaperis Sep 19, 2025
769ab48
terminate app if target key is deprecated at runtime
aaperis Sep 21, 2025
5d59aa5
refactoring suggestions frm review
aaperis Sep 22, 2025
0777092
update rotatekey docs with suggestions from review
aaperis Sep 23, 2025
6e52c6b
have the input to GetC4GHPublicKey be the pubkey path
aaperis Sep 24, 2025
c110a86
sync: load the pubkey from config
aaperis Sep 24, 2025
ae85b5f
rework pub key handling logic
aaperis Sep 24, 2025
397e0b8
remove obsolete c4gh test key
aaperis Sep 24, 2025
c040a11
add logic to exit gracefully
aaperis Sep 28, 2025
d716864
more suggestions from review
aaperis Sep 28, 2025
ec6cbbd
add test for reencrypt_utils
pahatz Sep 29, 2025
83ad4d0
check that fileID is uuid conformant
aaperis Sep 29, 2025
d1253e5
add RotateHeaderKey function
aaperis Sep 30, 2025
29b271e
update header and keyhash together
aaperis Sep 30, 2025
86a2978
refactor rotatekey to ease unittesting
aaperis Oct 1, 2025
5b7c625
refactor message handling
aaperis Oct 2, 2025
dd80f8c
requeue message if db error is recoverable and don't otherwise
aaperis Oct 2, 2025
f3b6291
add func to get reverification data from fileID
aaperis Oct 2, 2025
79ae6f4
remove any dependency on accessionID as input
aaperis Oct 2, 2025
8b23ac8
[Test CallReEncryptHeader] ensure correct error response
jbygdell Oct 10, 2025
a0a5468
[reencrypt] ensure an error message is always returned on error
jbygdell Oct 10, 2025
ce42231
[reencrypt] add test for failed reencryption due to no matching key
jbygdell Oct 10, 2025
3e9ee50
[rotateKey] remove check for non exiting nil value
jbygdell Oct 10, 2025
93609c3
[rotateKey] failure to trigger re-validation needs to go to error
jbygdell Oct 10, 2025
636698c
[rotateKey] rename rotateHeader to reEncryptHeader
jbygdell Oct 10, 2025
f93b4aa
[rotate key] add basic test suite.
jbygdell Oct 13, 2025
8a092b9
Merge pull request #1918 from neicnordic/rotate-key-service
aaperis Oct 22, 2025
937ca6e
Bump the all-modules group in /sda-sftp-inbox with 2 updates
dependabot[bot] Oct 27, 2025
796d9f3
Bump the all-modules group in /sda-doa with 2 updates
dependabot[bot] Oct 27, 2025
4a94a66
Merge pull request #2053 from neicnordic/dependabot/maven/sda-doa/all…
kjellp Oct 28, 2025
ceffb10
Merge branch 'main' into feature/admin-api-UUIDs
kostas-kou Oct 28, 2025
86fcb4a
Minor linter fix
kostas-kou Oct 28, 2025
8c59aa2
Merge pull request #2051 from neicnordic/dependabot/maven/sda-sftp-in…
jbygdell Oct 29, 2025
1b53e85
Bump chart version
Oct 29, 2025
c2b9670
Merge pull request #2013 from neicnordic/bump
jbygdell Oct 29, 2025
e48edf7
Bump the all-modules group in /sda-sftp-inbox with 2 updates
dependabot[bot] Nov 3, 2025
079a1a4
Bump the all-modules group in /sda-doa with 2 updates
dependabot[bot] Nov 3, 2025
61511cb
Merge pull request #2061 from neicnordic/dependabot/maven/sda-doa/all…
jbygdell Nov 4, 2025
e326441
Merge pull request #2060 from neicnordic/dependabot/maven/sda-sftp-in…
nanjiangshu Nov 4, 2025
611684d
feat: add middleware for checking client version
nanjiangshu Oct 22, 2025
bf7c84d
feat: update default SelectedMiddleware
nanjiangshu Oct 22, 2025
b6237e3
feat: update go mod
nanjiangshu Oct 23, 2025
f75688d
feat: add unit tests for ClientVersionMiddleware
nanjiangshu Oct 23, 2025
de1496e
feat: add unit tests for ChainDefaultMiddleware
nanjiangshu Oct 23, 2025
3a5bc7e
refactor: parse expectedClientVersion in the config
nanjiangshu Oct 24, 2025
f50f887
feat: update unit tests
nanjiangshu Oct 24, 2025
4a9845f
feat: fix integration test for sda-download
nanjiangshu Oct 24, 2025
46847f2
fix: unit test for config
nanjiangshu Oct 24, 2025
679ca1e
feat: add integration test for client version header
nanjiangshu Oct 24, 2025
762e5d7
fix: lint, gofmt for sda-download
nanjiangshu Oct 24, 2025
df527f2
fix: lint, unhandled-error, for sda-download
nanjiangshu Oct 24, 2025
d0a63b3
fix: correctly sanitize userID in removeUserIDPrefix
nanjiangshu Oct 24, 2025
b60e9b7
refactor: rename expectedcliversion to minimalcliversion
nanjiangshu Oct 27, 2025
cc8e54b
feat: check token before cli version in the middleware
nanjiangshu Oct 27, 2025
84b7cdc
fix: integration test after changing the order of check
nanjiangshu Oct 27, 2025
66f0f06
refactor: merge unit tests for ChainDefaultMiddleware
nanjiangshu Oct 27, 2025
cecbe91
feat: remove duplicated logic to return http code
nanjiangshu Oct 28, 2025
2e5b967
refactor: use a more idiomatic approach for the middleware
nanjiangshu Oct 28, 2025
65e5d73
feat: apply reviewers comments
nanjiangshu Nov 3, 2025
1927dc8
feat: improve name and logic for middleware
nanjiangshu Nov 3, 2025
754a908
feat: log error message to debug
nanjiangshu Nov 4, 2025
63e7b5d
Merge pull request #2047 from neicnordic/feature/download-block-non-s…
nanjiangshu Nov 4, 2025
bb7b0a8
Merge branch 'main' into feature/admin-api-UUIDs
kostas-kou Nov 5, 2025
8d45b77
Bump github.com/opencontainers/runc
dependabot[bot] Nov 5, 2025
e39dbff
Merge pull request #1934 from neicnordic/feature/admin-api-UUIDs
kostas-kou Nov 6, 2025
3377387
Merge pull request #2072 from neicnordic/dependabot/go_modules/sda/go…
pahatz Nov 7, 2025
8e64920
Bump chart version
Nov 7, 2025
44f0fd6
Merge branch 'main' into enhancement/sda-admin-use-ids
kostas-kou Nov 7, 2025
eb3e69a
Merge pull request #2068 from neicnordic/bump
jbygdell Nov 7, 2025
21ddf94
Merge branch 'main' into enhancement/sda-admin-use-ids
kostas-kou Nov 10, 2025
9dd6a7b
Bump golangci/golangci-lint-action from 8.0.0 to 9.0.0
dependabot[bot] Nov 10, 2025
d91b448
Bump commons-io:commons-io in /sda-sftp-inbox in the all-modules group
dependabot[bot] Nov 10, 2025
058c9f0
Bump the all-modules group in /sda-doa with 2 updates
dependabot[bot] Nov 10, 2025
56a8d5f
Update sda-admin/helpers/helpers.go
kostas-kou Nov 11, 2025
5ac4af4
Merge pull request #2073 from neicnordic/dependabot/github_actions/go…
jbygdell Nov 12, 2025
3f95ebc
Merge pull request #2074 from neicnordic/dependabot/maven/sda-sftp-in…
jbygdell Nov 12, 2025
ec1f47e
Merge pull request #2075 from neicnordic/dependabot/maven/sda-doa/all…
nanjiangshu Nov 12, 2025
a600687
Bump chart version
Nov 12, 2025
fcda64f
Merge branch 'main' into enhancement/sda-admin-use-ids
kostas-kou Nov 14, 2025
2d1d913
Merge pull request #2026 from neicnordic/enhancement/sda-admin-use-ids
kostas-kou Nov 14, 2025
d350e32
Merge pull request #2082 from neicnordic/bump
jbygdell Nov 17, 2025
28d1c61
build(deps): bump golang.org/x/crypto
dependabot[bot] Nov 17, 2025
29fb122
build(deps): bump com.squareup.okhttp3:okhttp-jvm
dependabot[bot] Nov 17, 2025
ab218d9
Merge pull request #2086 from neicnordic/dependabot/go_modules/sda-do…
jbygdell Nov 18, 2025
b3c69a8
Merge pull request #2087 from neicnordic/dependabot/maven/sda-doa/all…
jbygdell Nov 18, 2025
9999cfc
build(deps): bump golang.org/x/crypto
dependabot[bot] Nov 20, 2025
eed51dd
build(deps): bump golang.org/x/crypto from 0.42.0 to 0.45.0 in /sda
dependabot[bot] Nov 20, 2025
a389c9e
build(deps): bump golang.org/x/crypto in /sda-download
dependabot[bot] Nov 20, 2025
7a75061
build(deps): bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
c4bd66b
Merge pull request #2104 from neicnordic/dependabot/github_actions/ac…
jbygdell Nov 25, 2025
2ce25bf
build(deps): bump golangci/golangci-lint-action from 9.0.0 to 9.1.0
dependabot[bot] Nov 25, 2025
e74313b
Merge pull request #2099 from neicnordic/dependabot/go_modules/sda-do…
jbygdell Nov 25, 2025
1c59f60
Merge branch 'main' into dependabot/go_modules/sda/golang.org/x/crypt…
pahatz Nov 25, 2025
ab06e9d
build(deps): bump google.golang.org/grpc
dependabot[bot] Nov 25, 2025
6c0142e
Merge pull request #2103 from neicnordic/dependabot/github_actions/go…
jbygdell Nov 26, 2025
6734a7c
build(deps): bump the all-modules group in /sda-doa with 2 updates
dependabot[bot] Nov 24, 2025
71f59ce
replace gson with spring-boot-starter-gson
Parisa68 Nov 27, 2025
ba30378
Merge pull request #2114 from neicnordic/dependabot/go_modules/sda-do…
jbygdell Nov 27, 2025
2e86116
Merge pull request #2098 from neicnordic/dependabot/go_modules/sda/go…
jbygdell Nov 27, 2025
f3cc388
Merge pull request #2110 from neicnordic/dependabot/maven/sda-doa/all…
jbygdell Nov 27, 2025
9a78ecd
Bump chart version
Nov 27, 2025
f81f5f2
Merge pull request #2097 from neicnordic/dependabot/go_modules/sda-ad…
jbygdell Nov 28, 2025
9eb80cb
feat(postgresql): update init of db to add new indexes and colum chan…
KarlG-nbis Nov 19, 2025
a1006e3
feat(sda-stack): WIP update sda stack to work with database changes
KarlG-nbis Nov 19, 2025
78416ff
feat(s3inbox): add back missing delete of file id from cache when upl…
KarlG-nbis Nov 27, 2025
87cba88
feat(database): fix get user files query, cast input param to text
KarlG-nbis Nov 27, 2025
897b451
feat(api): fix message being produced with empty correlation id when …
KarlG-nbis Nov 27, 2025
7e65ffa
feat(integration tests): update sda integration tests to work with da…
KarlG-nbis Nov 27, 2025
12fdac2
Merge pull request #2094 from neicnordic/bump
jbygdell Nov 29, 2025
203d702
feat(database): remove addition of submission_file_root_dir column, i…
KarlG-nbis Dec 1, 2025
1d85f53
feat(unit tests): fix unit tests to work with database changes, also …
KarlG-nbis Dec 1, 2025
56e49cf
feat(postgres): remove sda.prefix on index creation in 01_main.sql file
KarlG-nbis Dec 1, 2025
0721f93
feat(linting): fix golangci-lint issues accorrding to golangci.yml
KarlG-nbis Dec 1, 2025
1fb4ba5
feat(postgres): fix migration scripts version and comments, ensure th…
KarlG-nbis Dec 1, 2025
e69e455
feat(rotatekey): fix rotatekey test, and update reEncryptHeader func …
KarlG-nbis Dec 1, 2025
7ecbf3f
feat(api): revert change to getFileIDByUserPathAndStatus to check for…
KarlG-nbis Dec 2, 2025
b08814c
feat: update some comments, and logs to say fileID instead of correla…
KarlG-nbis Dec 3, 2025
91ff1bd
feat(postgres): fix typo in changes messages for previous migrations …
KarlG-nbis Dec 3, 2025
5963077
Merge pull request #2115 from neicnordic/feature/ingestion_pipeline_d…
KarlG-nbis Dec 4, 2025
9e69d80
Merge remote-tracking branch 'upstream/main' into synck-fork-8
kkochel Dec 4, 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
2 changes: 1 addition & 1 deletion .github/integration/scripts/make_db_credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
apt-get -o DPkg::Lock::Timeout=60 update > /dev/null
apt-get -o DPkg::Lock::Timeout=60 install -y postgresql-client >/dev/null

for n in api auth download finalize inbox ingest mapper sync verify; do
for n in api auth download finalize inbox ingest mapper rotatekey sync verify; do
echo "creating credentials for: $n"
psql -U postgres -h migrate -d sda -c "ALTER ROLE $n LOGIN PASSWORD '$n';"
psql -U postgres -h postgres -d sda -c "ALTER ROLE $n LOGIN PASSWORD '$n';"
Expand Down
25 changes: 18 additions & 7 deletions .github/integration/scripts/make_sda_credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ if [ -n "$PGSSLCERT" ]; then
fi

apt-get -o DPkg::Lock::Timeout=60 update > /dev/null
apt-get -o DPkg::Lock::Timeout=60 install -y curl jq openssh-client openssl postgresql-client >/dev/null
apt-get -o DPkg::Lock::Timeout=60 install -y curl jq openssh-client openssl postgresql-client xxd >/dev/null

pip install --upgrade pip > /dev/null
pip install aiohttp Authlib joserfc requests > /dev/null

for n in api auth download finalize inbox ingest mapper sync verify; do
for n in api auth download finalize inbox ingest mapper rotatekey sync verify; do
echo "creating credentials for: $n"
psql -U postgres -h postgres -d sda -c "ALTER ROLE $n LOGIN PASSWORD '$n';"
psql -U postgres -h postgres -d sda -c "GRANT base TO $n;"
Expand Down Expand Up @@ -106,11 +106,6 @@ if [ ! -f "/shared/c4gh.sec.pem" ]; then
/shared/crypt4gh generate -n /shared/c4gh -p c4ghpass
fi

if [ ! -f "/shared/c4gh1.sec.pem" ]; then
echo "creating crypth4gh key"
/shared/crypt4gh generate -n /shared/c4gh1 -p c4ghpass
fi

if [ ! -f "/shared/client.sec.pem" ]; then # client key for re-encryption
echo "creating client crypth4gh key"
/shared/crypt4gh generate -n /shared/client -p c4ghpass
Expand All @@ -121,6 +116,22 @@ if [ ! -f "/shared/sync.sec.pem" ]; then
/shared/crypt4gh generate -n /shared/sync -p syncPass
fi

if [ ! -f "/shared/rotatekey.sec.pem" ]; then
echo "creating rotatekey crypth4gh key"
/shared/crypt4gh generate -n /shared/rotatekey -p rotatekeyPass
fi

# register the rotation key in the db
resp=$(psql -U postgres -h postgres -d sda -At -c "SELECT description FROM sda.encryption_keys;")
if ! echo "$resp" | grep -q 'this is the new key to rotate to'; then
rotateKeyHash=$(cat /shared/rotatekey.pub.pem | awk 'NR==2' | base64 -d | xxd -p -c256)
resp=$(psql -U postgres -h postgres -d sda -At -c "INSERT INTO sda.encryption_keys(key_hash, description) VALUES('$rotateKeyHash', 'this is the new key to rotate to');")
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then
echo "insert keyhash failed"
exit 1
fi
fi

if [ ! -f "/shared/keys/ssh" ]; then
ssh-keygen -o -a 256 -t ed25519 -f /shared/keys/ssh -N ""
pubKey="$(cat /shared/keys/ssh.pub)"
Expand Down
27 changes: 26 additions & 1 deletion .github/integration/sda-s3-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
condition: service_healthy
environment:
- PGPASSWORD=rootpasswd
image: python:3.11-slim
image: python:3.11-slim-bookworm
volumes:
- ./scripts:/scripts
- shared:/shared
Expand Down Expand Up @@ -253,6 +253,29 @@ services:
- ./sda/config.yaml:/config.yaml
- shared:/shared

rotatekey:
image: ghcr.io/neicnordic/sensitive-data-archive:PR${PR_NUMBER}
command: [sda-rotatekey]
container_name: rotatekey
depends_on:
credentials:
condition: service_completed_successfully
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
environment:
- BROKER_PASSWORD=rotatekey
- BROKER_USER=rotatekey
- BROKER_QUEUE=rotatekey
- BROKER_ROUTINGKEY=rotatekey
- DB_PASSWORD=rotatekey
- DB_USER=rotatekey
restart: always
volumes:
- ./sda/config.yaml:/config.yaml
- shared:/shared

cega-nss:
container_name: cega-nss
depends_on:
Expand Down Expand Up @@ -384,6 +407,8 @@ services:
condition: service_started
reencrypt:
condition: service_started
rotatekey:
condition: service_started
extra_hosts:
- "localhost:host-gateway"
environment:
Expand Down
5 changes: 3 additions & 2 deletions .github/integration/sda/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ c4gh:
filePath: /shared/c4gh.sec.pem
passphrase: "c4ghpass"
syncPubKeyPath: /shared/sync.pub.pem
rotatePubKeyPath: /shared/rotatekey.pub.pem
privateKeys:
- filePath: /shared/c4gh.sec.pem
passphrase: "c4ghpass"
- filePath: /shared/c4gh1.sec.pem
passphrase: "c4ghpass"
- filePath: /shared/rotatekey.sec.pem
passphrase: "rotatekeyPass"

oidc:
id: XC56EL11xx
Expand Down
2 changes: 1 addition & 1 deletion .github/integration/sda/rbac.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@
"rolebinding": "admin"
}
]
}
}
2 changes: 1 addition & 1 deletion .github/integration/tests/postgres/10_sanity_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ "$status" -eq 0 ]; then
fi

## verify that migrations worked
migratedb=$(find /migratedb.d/ -name "*.sql" -printf '%f\n' | sort -n | tail -1 | cut -d '.' -f1)
migratedb=$(find /migratedb.d/ -name "*.sql" -printf '%f\n' | sort -n | tail -1 | cut -d '.' -f1 | cut -d '_' -f1)
version=$(psql -U postgres -h migrate -d sda -At -c "select max(version) from sda.dbschema_version;")
if [ "$version" -ne "$migratedb" ]; then
echo "Migration scripts failed"
Expand Down
6 changes: 3 additions & 3 deletions .github/integration/tests/postgres/20_inbox_queries.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh
set -eou pipefail

fileID="33d29907-c565-4a90-98b4-e31b992ab376"
export PGPASSWORD=inbox

for host in migrate postgres; do
fileID=$(psql -U inbox -h "$host" -d sda -At -c "SELECT sda.register_file('inbox/test-file.c4gh', 'test-user');")
fileID=$(psql -U inbox -h "$host" -d sda -At -c "SELECT sda.register_file('$fileID', 'inbox/test-file.c4gh', 'test-user');")
if [ -z "$fileID" ]; then
echo "register_file failed"
exit 1
fi

newFileID=$(psql -U inbox -h "$host" -d sda -At -c "SELECT sda.register_file('inbox/test-file.c4gh', 'other-user');")
newFileID=$(psql -U inbox -h "$host" -d sda -At -c "SELECT sda.register_file(null, 'inbox/test-file.c4gh', 'other-user');")
if [ -z "$newFileID" ]; then
echo "register_file failed"
exit 1
Expand Down
24 changes: 18 additions & 6 deletions .github/integration/tests/postgres/30_ingest_queries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ set -eou pipefail

export PGPASSWORD=ingest
user="test-user"
corrID="33d29907-c565-4a90-98b4-e31b992ab376"
fileID="33d29907-c565-4a90-98b4-e31b992ab376"

for host in migrate postgres; do
## insert file
fileID=$(psql -U ingest -h "$host" -d sda -At -c "SELECT sda.register_file('inbox/test-file.c4gh', '$user');")
fileID=$(psql -U ingest -h "$host" -d sda -At -c "SELECT sda.register_file('$fileID', 'inbox/test-file.c4gh', '$user');")
if [ -z "$fileID" ]; then
echo "register_file failed"
exit 1
fi

resp=$(psql -U ingest -h "$host" -d sda -At -c "INSERT INTO sda.file_event_log(file_id, event, correlation_id, user_id, message) VALUES('$fileID', 'submitted', '$corrID', '$user', '{}');")
resp=$(psql -U ingest -h "$host" -d sda -At -c "INSERT INTO sda.file_event_log(file_id, event, user_id, message) VALUES('$fileID', 'submitted', '$user', '{}');")
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then
echo "insert file failed"
exit 1
Expand All @@ -30,11 +30,23 @@ for host in migrate postgres; do
archive_path=d853c51b-6aed-4243-b427-177f5e588857
size="2035150"
checksum="f03775a50feea74c579d459fdbeb27adafd543b87f6692703543a6ebe7daa1ff"
resp=$(psql -U ingest -h "$host" -d sda -At -c "SELECT sda.set_archived('$fileID', '$corrID', '$archive_path', '$size', '$checksum', 'SHA256');")
if [ "$resp" != "" ]; then
echo "mark file archived failed"

resp=$(psql -U ingest -h "$host" -d sda -At -c "UPDATE sda.files SET archive_file_path = '$archive_path', archive_file_size = '$size' WHERE id = '$fileID';")
if [ "$resp" != "UPDATE 1" ]; then
echo "update of files.archive_file_path, archive_file_size failed: $resp"
exit 1
fi
resp=$(psql -U ingest -h "$host" -d sda -At -c "INSERT INTO sda.checksums(file_id, checksum, type, source) VALUES('$fileID', '$checksum', upper('SHA256')::sda.checksum_algorithm, upper('UPLOADED')::sda.checksum_source);")
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then
echo "insert of archived checksum failed: $resp"
exit 1
fi
resp=$(psql -U ingest -h "$host" -d sda -At -c "INSERT INTO sda.file_event_log(file_id, event) VALUES('$fileID', 'archived');")
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then
echo "insert of file_event_log failed: $resp"
exit 1
fi

done

echo "30_ingest_queries completed successfully"
36 changes: 28 additions & 8 deletions .github/integration/tests/postgres/40_verify_queries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,55 @@
set -eou pipefail

export PGPASSWORD=verify
corrID="33d29907-c565-4a90-98b4-e31b992ab376"
fileID="33d29907-c565-4a90-98b4-e31b992ab376"

for host in migrate postgres; do
fileID=$(psql -U verify -h "$host" -d sda -At -c "SELECT DISTINCT file_id from sda.file_event_log WHERE correlation_id = '$corrID';")

## get file status
status=$(psql -U verify -h "$host" -d sda -At -c "SELECT event from sda.file_event_log WHERE correlation_id = '$corrID' ORDER BY id DESC LIMIT 1;")
status=$(psql -U verify -h "$host" -d sda -At -c "SELECT event from sda.file_event_log WHERE file_id = '$fileID' ORDER BY id DESC LIMIT 1;")
if [ "$status" = "" ]; then
echo "get file status failed"
echo "get file status failed: $resp"
exit 1
fi

## get file header
header="637279707434676801000000010000006c00000000000000"
dbheader=$(psql -U verify -h "$host" -d sda -At -c "SELECT header from sda.files WHERE id = '$fileID';")
if [ "$dbheader" != "$header" ]; then
echo "wrong header received"
echo "wrong header received: $resp"
exit 1
fi

## mark file as 'COMPLETED'
archive_checksum="64e56b0d245b819c116b5f1ad296632019490b57eeaebb419a5317e24a153852"
decrypted_size="2034254"
decrypted_checksum="febee6829a05772eea93c647e38bf5cc5bf33d1bcd0ea7d7bdd03225d84d2553"
resp=$(psql -U verify -h "$host" -d sda -At -c "SELECT sda.set_verified('$fileID', '$corrID', '$archive_checksum', 'SHA256', '$decrypted_size', '$decrypted_checksum', 'SHA256')")
if [ "$resp" != "" ]; then
echo "set_verified failed"

resp=$(psql -U verify -h "$host" -d sda -At -c "UPDATE sda.files SET decrypted_file_size = '$decrypted_size' WHERE id = '$fileID';")
if [ "$resp" != "UPDATE 1" ]; then
echo "update of files.decrypted_file_size failed: $resp"
exit 1
fi

resp=$(psql -U verify -h "$host" -d sda -At -c "INSERT INTO sda.checksums(file_id, checksum, type, source) VALUES('$fileID', '$archive_checksum', upper('SHA256')::sda.checksum_algorithm, upper('ARCHIVED')::sda.checksum_source);")
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then
echo "insert of archived checksum failed: $resp"
exit 1
fi

resp=$(psql -U verify -h "$host" -d sda -At -c "INSERT INTO sda.checksums(file_id, checksum, type, source) VALUES('$fileID', '$decrypted_checksum', upper('SHA256')::sda.checksum_algorithm, upper('UNENCRYPTED')::sda.checksum_source);")
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then
echo "insert of decrypted checksum failed: $resp"
exit 1
fi

resp=$(psql -U verify -h "$host" -d sda -At -c "INSERT INTO sda.file_event_log(file_id, event) VALUES('$fileID', 'verified');")
if [ "$(echo "$resp" | tr -d '\n')" != "INSERT 0 1" ]; then
echo "insert of file_event_log failed: $resp"
exit 1
fi


done

echo "40_verify_queries completed successfully"
2 changes: 1 addition & 1 deletion .github/integration/tests/sda/21_cancel_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ curl -k -u guest:guest "http://rabbitmq:15672/api/exchanges/sda/sda/publish" \
-d "$cancel_body" | jq

# check database to verify file status
if [ "$(psql -U postgres -h postgres -d sda -At -c "select event from sda.file_event_log where correlation_id = '$CORRID' order by id DESC LIMIT 1")" != "disabled" ]; then
if [ "$(psql -U postgres -h postgres -d sda -At -c "select event from sda.file_event_log where file_id = '$CORRID' order by id DESC LIMIT 1")" != "disabled" ]; then
echo "canceling file failed"
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/integration/tests/sda/22_error_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ curl -k -u guest:guest "$URI/api/exchanges/sda/sda/publish" \
-d "$ingest_body" | jq

# check database to verify file status
until [ "$(psql -U postgres -h postgres -d sda -At -c "SELECT event FROM sda.file_event_log WHERE correlation_id = '$CORRID' ORDER BY ID DESC LIMIT 1;")" = "error" ]; do
until [ "$(psql -U postgres -h postgres -d sda -At -c "SELECT event FROM sda.file_event_log WHERE file_id = '$CORRID' ORDER BY ID DESC LIMIT 1;")" = "error" ]; do
echo "waiting for file error to be logged by ingest"
RETRY_TIMES=$((RETRY_TIMES + 1))
if [ "$RETRY_TIMES" -eq 30 ]; then
Expand All @@ -83,7 +83,7 @@ done

## give the file a non existing archive path
psql -U postgres -h postgres -d sda -Atq -c "UPDATE sda.files SET archive_file_path = '$CORRID', header = '637279707434676801000000010000006c00000000000000' WHERE id = '$CORRID';"
psql -U postgres -h postgres -d sda -Atq -c "INSERT INTO sda.file_event_log(file_id, correlation_id, event) VALUES('$CORRID', '$CORRID', 'archived');"
psql -U postgres -h postgres -d sda -Atq -c "INSERT INTO sda.file_event_log(file_id, event) VALUES('$CORRID', 'archived');"

encrypted_checksums=$(
jq -c -n \
Expand Down Expand Up @@ -119,7 +119,7 @@ curl -k -u guest:guest "$URI/api/exchanges/sda/sda/publish" \

# check database to verify file status
RETRY_TIMES=0
until [ "$(psql -U postgres -h postgres -d sda -At -c "SELECT event FROM sda.file_event_log WHERE correlation_id = '$CORRID' ORDER BY ID DESC LIMIT 1;")" = "error" ]; do
until [ "$(psql -U postgres -h postgres -d sda -At -c "SELECT event FROM sda.file_event_log WHERE file_id = '$CORRID' ORDER BY ID DESC LIMIT 1;")" = "error" ]; do
echo "waiting for file error to be logged by verify"
date
RETRY_TIMES=$((RETRY_TIMES + 1))
Expand Down
8 changes: 4 additions & 4 deletions .github/integration/tests/sda/31_cancel_test2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ ENC_SHA=$(sha256sum NA12878.bam.c4gh | cut -d' ' -f 1)
ENC_MD5=$(md5sum NA12878.bam.c4gh | cut -d' ' -f 1)

## get correlation id from message
CORRID=$(psql -U postgres -h postgres -d sda -At -c "select id from sda.files where submission_file_path = 'NA12878.bam.c4gh';")
FILEID=$(psql -U postgres -h postgres -d sda -At -c "select id from sda.files where submission_file_path = 'NA12878.bam.c4gh';")


properties=$(
jq -c -n \
--argjson delivery_mode 2 \
--arg correlation_id "$CORRID" \
--arg correlation_id "$FILEID" \
--arg content_encoding UTF-8 \
--arg content_type application/json \
'$ARGS.named'
Expand Down Expand Up @@ -52,7 +52,7 @@ curl -k -u guest:guest "http://rabbitmq:15672/api/exchanges/sda/sda/publish" \

# check database to verify file status
RETRY_TIMES=0
until [ "$(psql -U postgres -h postgres -d sda -At -c "select event from sda.file_event_log where correlation_id = '$CORRID' order by id DESC LIMIT 1;")" = "disabled" ]; do
until [ "$(psql -U postgres -h postgres -d sda -At -c "select event from sda.file_event_log where file_id = '$FILEID' order by id DESC LIMIT 1;")" = "disabled" ]; do
echo "canceling file failed"
RETRY_TIMES=$((RETRY_TIMES + 1))
if [ "$RETRY_TIMES" -eq 30 ]; then
Expand Down Expand Up @@ -132,7 +132,7 @@ curl -s -u guest:guest "http://rabbitmq:15672/api/exchanges/sda/sda/publish" \
-d "$accession_body" | jq

RETRY_TIMES=0
until [ "$(psql -U postgres -h postgres -d sda -At -c "select event from sda.file_event_log where correlation_id = '$CORRID' order by id DESC LIMIT 1")" = "ready" ]; do
until [ "$(psql -U postgres -h postgres -d sda -At -c "select event from sda.file_event_log where file_id = '$FILEID' order by id DESC LIMIT 1")" = "ready" ]; do
echo "waiting for re-ingested file to become ready"
RETRY_TIMES=$((RETRY_TIMES + 1))
if [ "$RETRY_TIMES" -eq 30 ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/integration/tests/sda/45_sync_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
# check bucket for synced files
for file in NA12878.bai NA12878_20k_b37.bai; do
RETRY_TIMES=0
until [ "$(s3cmd -c direct ls s3://sync/test_dummy.org/"$file")" != "" ]; do
until [ "$(s3cmd -c direct ls s3://sync/"$file")" != "" ]; do
RETRY_TIMES=$((RETRY_TIMES + 1))
if [ "$RETRY_TIMES" -eq 30 ]; then
echo "::error::Time out while waiting for files to be synced"
Expand Down
Loading
Loading