Compare commits

...
Sign in to create a new pull request.

257 commits

Author SHA1 Message Date
1e9ab13c97
ci(github-actions): simplify maven settings
All checks were successful
Build / build (push) Successful in 2m18s
2025-07-30 15:35:34 +02:00
58a53fe280
chore: prepare for next development iteration
Some checks failed
Build / build (push) Has been cancelled
2025-07-30 13:34:47 +00:00
584ffc85f2
chore: release 1.0.8
All checks were successful
Build / build (push) Successful in 2m10s
2025-07-30 13:34:45 +00:00
9621f913e3
chore: bump version to 1.0.8
All checks were successful
Release the current version / Execute the release (push) Successful in 1m46s
2025-07-30 15:33:00 +02:00
25ea6c556d
feat(deps): update quarkus.platform.version to 3.25.0
All checks were successful
Build / build (push) Successful in 2m14s
2025-07-30 15:27:53 +02:00
7a33e9cdbb
chore: prepare for next development iteration
All checks were successful
Build / build (push) Successful in 2m19s
2025-07-30 12:52:53 +00:00
6a3026de70
chore: release 1.0.7
All checks were successful
Build / build (push) Successful in 2m6s
2025-07-30 12:52:52 +00:00
8269687a6e Merge pull request 'chore: bump version to 1.0.7' (#100) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m31s
Reviewed-on: #100
2025-07-30 12:51:24 +00:00
3ae16bfa25
chore: bump version to 1.0.7
All checks were successful
Validate release versions / release (pull_request) Successful in 4s
Build / build (pull_request) Successful in 2m0s
2025-07-30 14:49:00 +02:00
ee96894e87 Merge pull request 'feat(client-logger): redact headers based on configuration' (#99) from redacting into main
All checks were successful
Build / build (push) Successful in 2m9s
Reviewed-on: #99
2025-07-30 12:47:49 +00:00
21913626ad
feat(client-logger): redact headers based on configuration
All checks were successful
Build / build (pull_request) Successful in 2m9s
2025-07-30 14:44:49 +02:00
d1acb1a0ee
chore(maven): enable jacoco rules for audit and tracing modules
All checks were successful
Build / build (push) Successful in 1m57s
2025-07-24 11:53:27 +02:00
bc0110cc29
chore: more sonarqube improvements, rename tracing service method
All checks were successful
Build / build (push) Successful in 2m23s
2025-07-24 11:11:53 +02:00
f591d514ec Merge pull request 'refactor: apply some suggestions from SonarQube' (#98) from sonarqube into main
All checks were successful
Build / build (push) Successful in 2m21s
Reviewed-on: #98
2025-07-23 12:52:04 +00:00
331a830c2b
refactor: apply some suggestions from SonarQube
All checks were successful
Build / build (pull_request) Successful in 1m49s
2025-07-23 14:27:42 +02:00
7d2cda5b20
docs(README): update sonarqube badges 2025-07-22 22:36:43 +02:00
ca915c4bf5
feat(deps): update io.smallrye:jandex-maven-plugin to 3.4.0
All checks were successful
Build / build (push) Successful in 2m6s
2025-07-22 22:31:39 +02:00
cf81524d86
feat(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.46.1
Some checks failed
Build / build (push) Has been cancelled
2025-07-22 22:30:56 +02:00
35d4e29a57
feat(deps): update palantir-java-format.version to 2.72.0
Some checks failed
Build / build (push) Has been cancelled
2025-07-22 22:30:44 +02:00
ed362d84b8
chore(maven): remove skip ci from release message
Some checks failed
Build / build (push) Has been cancelled
2025-07-22 22:30:15 +02:00
fc140833d5
chore: prepare for next development iteration [skip ci] 2025-07-18 12:03:03 +00:00
a0939d7729
chore: release 1.0.6
Some checks failed
Build / build (push) Failing after 1m43s
2025-07-18 12:03:02 +00:00
2d23835810
chore: bump version to 1.0.6
All checks were successful
Release the current version / Execute the release (push) Successful in 1m42s
2025-07-18 14:01:19 +02:00
5e8f8fefa8
ci(github-actions): fix jars not being published on tags
Some checks failed
Release the current version / Execute the release (push) Has been cancelled
Build / build (push) Successful in 1m44s
2025-07-18 14:01:02 +02:00
f6e85f2c00 Merge pull request 'ci(github-actions): revamp build.yaml to trigger on tags and do proper validation of version' (#96) from build into main
All checks were successful
Build / build (push) Successful in 2m7s
Reviewed-on: #96
2025-07-18 08:29:23 +00:00
a5e0c2672b
ci(github-actions): revamp build.yaml to trigger on tags and do proper validation of version
All checks were successful
Build / build (pull_request) Successful in 1m16s
2025-07-18 10:26:00 +02:00
1cc8a39c88 Merge pull request 'fix(deps): update quarkus.platform.version to 3.24.4' (#95) from quarkus-3.24.4 into main
All checks were successful
Build / build (push) Successful in 2m7s
Reviewed-on: #95
2025-07-18 08:04:57 +00:00
8aad75a493
fix(deps): update quarkus.platform.version to 3.24.4
All checks were successful
Build / build (pull_request) Successful in 2m17s
2025-07-18 09:43:50 +02:00
880df82728
chore: prepare for next development iteration [skip ci] 2025-07-12 16:29:59 +00:00
2d1f9a1417
chore: release 1.0.5
All checks were successful
Build / build (push) Successful in 1m57s
2025-07-12 16:29:58 +00:00
129fdb768f Merge pull request 'chore: bump version to 1.0.5' (#94) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m30s
Reviewed-on: #94
2025-07-12 16:28:30 +00:00
6d95a3b123
chore: bump version to 1.0.5
All checks were successful
Validate release versions / release (pull_request) Successful in 4s
Build / build (pull_request) Successful in 1m56s
2025-07-12 18:26:17 +02:00
9d84bb8c5e Merge pull request 'upgrade quarkus and other dependencies' (#93) from deps into main
All checks were successful
Build / build (push) Successful in 2m10s
Reviewed-on: #93
2025-07-12 16:25:06 +00:00
0fd62decaf
feat(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.45.0
All checks were successful
Build / build (pull_request) Successful in 1m59s
2025-07-12 18:20:23 +02:00
33e10b7a40
fix(deps): update palantir-java-format.version to 2.70.0 2025-07-12 18:19:18 +02:00
4d20a75f42
fix(deps): update quarkus.platform.version to 3.24.3 2025-07-12 18:18:59 +02:00
4b20f99856
chore: prepare for next development iteration [skip ci] 2025-07-04 16:47:33 +00:00
3bbdf7015a
chore: release 1.0.4
All checks were successful
Build / build (push) Successful in 1m49s
2025-07-04 16:47:32 +00:00
d7b6286546
chore: bump version to 1.0.4
Some checks failed
Build / build (push) Has been cancelled
Release the current version / Execute the release (push) Successful in 1m25s
2025-07-04 18:46:01 +02:00
cccd9dde98
fix(deps): update quarkus.platform.version to 3.24.2
All checks were successful
Build / build (push) Successful in 2m24s
2025-07-04 18:36:27 +02:00
f9734649f2 Merge pull request 'feat: add quarkus-client-logger module with RedactingClientLogger' (#91) from client-logger into main
Some checks failed
Build / build (push) Failing after 22s
Reviewed-on: #91
2025-07-04 16:35:12 +00:00
e6ec3f57f8
feat: add quarkus-client-logger module with RedactingClientLogger
Some checks failed
Build / build (pull_request) Failing after 25s
2025-07-04 18:34:48 +02:00
1f38615a15
chore: prepare for next development iteration [skip ci] 2025-06-28 03:06:34 +00:00
a22c070401
chore: release 1.0.3
All checks were successful
Build / build (push) Successful in 2m16s
2025-06-28 03:06:33 +00:00
d5053a3862
chore: bump version to 1.0.3
All checks were successful
Release the current version / Execute the release (push) Successful in 1m13s
2025-06-28 05:05:14 +02:00
a9e1f3d8fa Merge pull request 'fix(tracing): implement redact for query, add default values' (#89) from redact into main
All checks were successful
Build / build (push) Successful in 2m3s
Reviewed-on: #89
2025-06-28 02:34:16 +00:00
5ac5d90f97
fix(tracing): implement redact for query, add default values
All checks were successful
Build / build (pull_request) Successful in 1m50s
2025-06-28 04:22:36 +02:00
b813ed4347 Merge pull request 'feat(deps): update quarkus.platform.version to 3.24.1' (#88) from quarkus-3.24.1 into main
All checks were successful
Build / build (push) Successful in 1m52s
Reviewed-on: #88
2025-06-27 20:09:14 +00:00
6f7b048266
feat(deps): update quarkus.platform.version to 3.24.1
All checks were successful
Build / build (pull_request) Successful in 1m32s
2025-06-27 21:53:30 +02:00
3081156f9f
chore: prepare for next development iteration [skip ci] 2025-06-19 15:12:07 +00:00
c55e317c92
chore: release 1.0.2
All checks were successful
Build / build (push) Successful in 1m48s
2025-06-19 15:12:06 +00:00
66c190208b
chore: bump to 1.0.2
Some checks failed
Build / build (push) Has been cancelled
Release the current version / Execute the release (push) Successful in 1m9s
2025-06-19 17:10:52 +02:00
b56759c1e6 Merge pull request 'feat(clock): add local and zoned date methods to service' (#86) from clock into main
All checks were successful
Build / build (push) Successful in 3m22s
Reviewed-on: #86
2025-06-19 14:21:35 +00:00
6ac4bd783e
feat(clock): add local and zoned date methods to service
All checks were successful
Build / build (pull_request) Successful in 2m59s
2025-06-19 16:12:02 +02:00
bbd1d80d6c
chore: prepare for next development iteration [skip ci] 2025-06-18 00:18:21 +00:00
1bd06f1857
chore: release 1.0.1
All checks were successful
Build / build (push) Successful in 1m55s
2025-06-18 00:18:20 +00:00
acbe6c5ae2
chore: bump version to 1.0.1
All checks were successful
Release the current version / Execute the release (push) Successful in 1m48s
2025-06-18 02:16:31 +02:00
7c45b3e4ae
chore: bump to 1.0.1 2025-06-18 02:15:11 +02:00
2844cff58a
ci(github-actions): use project-metadata-action@main instead of master
Some checks failed
Build / build (push) Has been cancelled
Release the current version / Execute the release (push) Has been cancelled
2025-06-18 01:57:56 +02:00
a0006d4455
fix(tracing): use trace level instead of info on TracingServiceImpl
All checks were successful
Build / build (push) Successful in 2m30s
2025-06-18 01:54:21 +02:00
291e3b0712
docs(README): update modules list 2025-06-18 01:45:56 +02:00
eca733d2ce Merge pull request 'Create tracing and audit modules, upgrade quarkus to 3.23.3' (#84) from tracing-and-audit into main
All checks were successful
Build / build (push) Successful in 2m24s
Reviewed-on: #84
2025-06-17 23:44:29 +00:00
f268c4a27a
feat(audit): add quarkus-audit-tools module
All checks were successful
Build / build (pull_request) Successful in 1m57s
2025-06-18 01:41:16 +02:00
db0026b723
feat(tracing): add quarkus-tracing-service module 2025-06-18 01:40:26 +02:00
75a778296c
feat(deps): update quarkus.platform.version to 3.23.3 2025-06-18 01:39:59 +02:00
2ceace7ce7
chore: prepare for next development iteration [skip ci] 2025-05-15 14:31:36 +00:00
673f8afbd3
chore: release 1.0.0
All checks were successful
Build / build (push) Successful in 2m7s
2025-05-15 14:31:33 +00:00
eb4812a0ea
chore: release first version under phoenix-oss
All checks were successful
Release the current version / Execute the release (push) Successful in 1m22s
2025-05-15 16:30:12 +02:00
8b3e49d2d4
docs: update sonarqube badges
Some checks failed
Release the current version / Execute the release (push) Has been cancelled
Build / build (push) Has been cancelled
2025-05-15 16:17:06 +02:00
14c693117d Merge pull request 'fix(deps): update palantir-java-format.version to 2.66.0' (#82) from palantir into main
All checks were successful
Build / build (push) Successful in 2m13s
Reviewed-on: #82
2025-05-15 14:13:23 +00:00
c16419b9d0
fix(deps): update palantir-java-format.version to 2.66.0
All checks were successful
Build / build (pull_request) Successful in 1m37s
2025-05-15 16:06:48 +02:00
259366e53a Merge pull request 'fix(deps): update io.smallrye:jandex-maven-plugin to 3.3.1' (#79) from renovate/jandex-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m15s
Reviewed-on: #79
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-05-15 14:00:15 +00:00
84cbff6e98 fix(deps): update io.smallrye:jandex-maven-plugin to 3.3.1
All checks were successful
Build / build (pull_request) Successful in 2m0s
2025-05-15 13:56:48 +00:00
a2b8338ec9 Merge pull request 'fix(deps): update quarkus.platform.version to 3.22.3' (#80) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m36s
Reviewed-on: #80
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-05-15 13:56:16 +00:00
386f72992a fix(deps): update quarkus.platform.version to 3.22.3
All checks were successful
Build / build (pull_request) Successful in 1m40s
2025-05-15 13:51:55 +00:00
50061d3a55 Merge pull request 'chore: migrate project to phoenix-oss organization' (#81) from oss into main
All checks were successful
Build / build (push) Successful in 2m7s
Reviewed-on: #81
2025-05-15 13:51:31 +00:00
8396157611
chore: migrate project to phoenix-oss organization
All checks were successful
Build / build (pull_request) Successful in 1m56s
2025-05-15 15:48:37 +02:00
622ddf5cce
chore: prepare for next development iteration [skip ci] 2025-05-08 07:28:22 +00:00
009f25f448
chore: release 1.2.8
All checks were successful
Build / build (push) Successful in 2m28s
2025-05-08 07:28:19 +00:00
3d1910ab49 Merge pull request 'chore: bump version to 1.2.8' (#78) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m32s
Reviewed-on: phoenix/quarkus-commons#78
2025-05-08 07:26:56 +00:00
7947dc8df1
chore: bump version to 1.2.8
All checks were successful
Validate release versions / release (pull_request) Successful in 34s
Build / build (pull_request) Successful in 2m4s
2025-05-08 09:23:33 +02:00
7b32423be1 Merge pull request 'fix(deps): update quarkus.platform.version to 3.22.2' (#77) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m38s
Reviewed-on: phoenix/quarkus-commons#77
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-05-08 07:21:12 +00:00
393b866057 fix(deps): update quarkus.platform.version to 3.22.2
All checks were successful
Build / build (pull_request) Successful in 1m44s
2025-05-07 16:58:29 +00:00
ce8a87b1db
chore: prepare for next development iteration [skip ci] 2025-05-01 10:58:20 +00:00
00ce66f1b2
chore: release 1.2.7
All checks were successful
Build / build (push) Successful in 2m21s
2025-05-01 10:58:17 +00:00
28646cf254 Merge pull request 'chore: bump version to 1.2.7' (#76) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m34s
Reviewed-on: phoenix/quarkus-commons#76
2025-05-01 10:56:50 +00:00
71efdbfdfd
chore: bump version to 1.2.7
All checks were successful
Validate release versions / release (pull_request) Successful in 7s
Build / build (pull_request) Successful in 1m42s
2025-05-01 12:54:43 +02:00
943717354d Merge pull request 'feat(deps): update quarkus.platform.version to 3.22.1' (#75) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m19s
Reviewed-on: phoenix/quarkus-commons#75
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-05-01 10:54:20 +00:00
0621b5e4dc feat(deps): update quarkus.platform.version to 3.22.1
All checks were successful
Build / build (pull_request) Successful in 1m52s
2025-04-30 16:56:25 +00:00
e0a106233d Merge pull request 'fix(deps): update quarkus.platform.version to 3.21.4' (#74) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m40s
Reviewed-on: phoenix/quarkus-commons#74
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-04-24 08:29:48 +00:00
5f33dc17b6 fix(deps): update quarkus.platform.version to 3.21.4
All checks were successful
Build / build (pull_request) Successful in 1m52s
2025-04-24 00:46:28 +00:00
cfc84db08d
chore: prepare for next development iteration [skip ci] 2025-04-16 16:20:50 +00:00
615028ceae
chore: release 1.2.6
All checks were successful
Build / build (push) Successful in 2m25s
2025-04-16 16:20:46 +00:00
8c952a7e54 Merge pull request 'chore: bump version to 1.2.6' (#73) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m18s
Reviewed-on: phoenix/quarkus-commons#73
2025-04-16 16:19:33 +00:00
b43f8864ea
chore: bump version to 1.2.6
All checks were successful
Validate release versions / release (pull_request) Successful in 6s
Build / build (pull_request) Successful in 1m48s
2025-04-16 18:14:24 +02:00
f3ed6bb854 Merge pull request 'fix(deps): update quarkus.platform.version to 3.21.3' (#72) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m28s
Reviewed-on: phoenix/quarkus-commons#72
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-04-16 16:10:48 +00:00
f83210a82d fix(deps): update quarkus.platform.version to 3.21.3
All checks were successful
Build / build (pull_request) Successful in 1m59s
2025-04-16 15:54:07 +00:00
b9ee1b0d09
chore: prepare for next development iteration [skip ci] 2025-04-09 15:15:13 +00:00
7560df3a38
chore: release 1.2.5
All checks were successful
Build / build (push) Successful in 2m9s
2025-04-09 15:15:10 +00:00
41983e893b Merge pull request 'chore: bump version to 1.2.5' (#71) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m20s
Reviewed-on: phoenix/quarkus-commons#71
2025-04-09 15:13:55 +00:00
9fa90d05ab
chore: bump version to 1.2.5
All checks were successful
Validate release versions / release (pull_request) Successful in 7s
Build / build (pull_request) Successful in 1m37s
2025-04-09 17:12:01 +02:00
25befbf948 Merge pull request 'feat(deps): update io.smallrye:jandex-maven-plugin to 3.3.0' (#68) from renovate/jandex-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m19s
Reviewed-on: phoenix/quarkus-commons#68
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-04-09 15:11:13 +00:00
71c9670bfe feat(deps): update io.smallrye:jandex-maven-plugin to 3.3.0
All checks were successful
Build / build (pull_request) Successful in 1m44s
2025-04-09 15:08:06 +00:00
8b58eaa5d8 Merge pull request 'fix(deps): update quarkus.platform.version to 3.21.2' (#70) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m22s
Reviewed-on: phoenix/quarkus-commons#70
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-04-09 15:07:09 +00:00
cf2ed37c16 fix(deps): update quarkus.platform.version to 3.21.2
All checks were successful
Build / build (pull_request) Successful in 1m48s
2025-04-09 14:58:30 +00:00
bef4d1c3fe
fix(deps): update palantir-java-format.version to 2.61.0
All checks were successful
Build / build (push) Successful in 2m31s
2025-04-08 09:45:45 +02:00
7c8508015e Merge pull request 'fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.4' (#69) from renovate/spotless-plugin.version into main
Some checks failed
Build / build (push) Has been cancelled
Reviewed-on: phoenix/quarkus-commons#69
2025-04-08 07:45:24 +00:00
934fb65b02 fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.4 2025-04-08 07:45:24 +00:00
bfa057551a Merge pull request 'fix(deps): update org.jacoco:jacoco-maven-plugin to 0.8.13' (#65) from renovate/jacoco-plugin.version into main
Some checks failed
Build / build (push) Has been cancelled
Reviewed-on: phoenix/quarkus-commons#65
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-04-08 07:45:12 +00:00
d4b606cbc7 fix(deps): update org.jacoco:jacoco-maven-plugin to 0.8.13 2025-04-08 07:45:12 +00:00
3d2a3e98dd
chore: prepare for next development iteration [skip ci] 2025-04-03 09:04:59 +00:00
0d3a73be8d
chore: release 1.2.4
All checks were successful
Build / build (push) Successful in 2m14s
2025-04-03 09:04:56 +00:00
ef3765299d Merge pull request 'chore: bump version to 1.2.4' (#67) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m20s
Reviewed-on: phoenix/quarkus-commons#67
2025-04-03 09:03:41 +00:00
0e118f0d7f
chore: bump version to 1.2.4
All checks were successful
Validate release versions / release (pull_request) Successful in 6s
Build / build (pull_request) Successful in 1m41s
2025-04-03 09:55:50 +02:00
d608963610 Merge pull request 'fix(deps): update quarkus.platform.version to 3.21.1' (#66) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 3m38s
Reviewed-on: phoenix/quarkus-commons#66
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-04-03 07:30:26 +00:00
edef62f15c fix(deps): update quarkus.platform.version to 3.21.1
All checks were successful
Build / build (pull_request) Successful in 1m50s
2025-04-02 19:55:25 +00:00
cb2fc9ffab
chore: prepare for next development iteration [skip ci] 2025-03-31 09:50:37 +00:00
44b708800b
chore: release 1.2.3
All checks were successful
Build / build (push) Successful in 2m13s
2025-03-31 09:50:34 +00:00
a24441c8c5 Merge pull request 'chore: bump version to 1.2.4' (#64) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m28s
Reviewed-on: phoenix/quarkus-commons#64
2025-03-31 09:49:11 +00:00
7a5248769e
chore: bump version to 1.2.4
All checks were successful
Validate release versions / release (pull_request) Successful in 6s
Build / build (pull_request) Successful in 1m41s
2025-03-31 11:46:36 +02:00
d879cfd34d Merge pull request 'fix(deps): update org.apache.maven.plugins:maven-surefire-plugin to 3.5.3' (#63) from renovate/surefire-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m51s
Reviewed-on: phoenix/quarkus-commons#63
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-03-31 07:37:39 +00:00
15b8c34429 fix(deps): update org.apache.maven.plugins:maven-surefire-plugin to 3.5.3
All checks were successful
Build / build (pull_request) Successful in 1m51s
2025-03-31 00:53:12 +00:00
2daa7f2dc5 Merge pull request 'feat(deps): update quarkus.platform.version to 3.21.0' (#62) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m31s
Reviewed-on: phoenix/quarkus-commons#62
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-03-26 14:28:18 +00:00
7196f143b7 feat(deps): update quarkus.platform.version to 3.21.0
All checks were successful
Build / build (pull_request) Successful in 1m51s
2025-03-26 12:49:00 +00:00
5d3cd4e402 Merge pull request 'fix(deps): update quarkus.platform.version to 3.19.4' (#61) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m15s
Reviewed-on: phoenix/quarkus-commons#61
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-03-19 20:22:40 +00:00
6d8820ee94 fix(deps): update quarkus.platform.version to 3.19.4
All checks were successful
Build / build (pull_request) Successful in 2m3s
2025-03-19 16:55:54 +00:00
dd1adc3940
chore: prepare for next development iteration [skip ci] 2025-03-14 13:20:11 +00:00
08b8ce9b28
chore: release 1.2.2
All checks were successful
Build / build (push) Successful in 2m14s
2025-03-14 13:20:07 +00:00
4f420d5163 Merge pull request 'chore: bump version to 1.2.2' (#60) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m33s
Reviewed-on: phoenix/quarkus-commons#60
2025-03-14 13:18:40 +00:00
530d33ecbc
chore: bump version to 1.2.2
All checks were successful
Validate release versions / release (pull_request) Successful in 32s
Build / build (pull_request) Successful in 1m34s
2025-03-14 14:16:45 +01:00
ee20f00024 Merge pull request 'fix(deps): update quarkus.platform.version to 3.19.3' (#59) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m49s
Reviewed-on: phoenix/quarkus-commons#59
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-03-13 08:39:30 +00:00
4723a1502f fix(deps): update quarkus.platform.version to 3.19.3
All checks were successful
Build / build (pull_request) Successful in 1m49s
2025-03-12 23:00:03 +00:00
832fd133c0
chore: prepare for next development iteration [skip ci] 2025-03-06 08:39:40 +00:00
f978eec07a
chore: release 1.2.1
All checks were successful
Build / build (push) Successful in 2m6s
2025-03-06 08:39:37 +00:00
d0e6cc2802 Merge pull request 'chore: bump version to 1.2.1' (#58) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m17s
Reviewed-on: phoenix/quarkus-commons#58
2025-03-06 08:38:24 +00:00
032710a0bd
chore: bump version to 1.2.1
All checks were successful
Validate release versions / release (pull_request) Successful in 7s
Build / build (pull_request) Successful in 1m35s
2025-03-06 09:27:55 +01:00
53c63290ad Merge pull request 'fix(deps): update quarkus.platform.version to 3.19.2' (#57) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m47s
Reviewed-on: phoenix/quarkus-commons#57
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-03-06 08:24:10 +00:00
3edeafc5db fix(deps): update quarkus.platform.version to 3.19.2
All checks were successful
Build / build (pull_request) Successful in 1m42s
2025-03-05 15:59:09 +00:00
f3c569d07d
chore: prepare for next development iteration [skip ci] 2025-03-03 14:43:26 +00:00
6b35b8f7a1
chore: release 1.2.0
All checks were successful
Build / build (push) Successful in 2m30s
2025-03-03 14:43:23 +00:00
d6dc1f7627 Merge pull request 'chore: bump version to 1.2.0' (#56) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m50s
Reviewed-on: phoenix/quarkus-commons#56
2025-03-03 14:41:39 +00:00
15fc85d301
chore: bump version to 1.2.0
All checks were successful
Validate release versions / release (pull_request) Successful in 7s
Build / build (pull_request) Successful in 1m53s
2025-03-03 15:39:20 +01:00
086a2e3f2a Merge pull request 'feat(deps): update quarkus.platform.version to 3.19.1' (#55) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m25s
Reviewed-on: phoenix/quarkus-commons#55
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-03-03 13:07:03 +00:00
c477b9e908 feat(deps): update quarkus.platform.version to 3.19.1
All checks were successful
Build / build (pull_request) Successful in 1m49s
2025-02-26 15:41:45 +00:00
552a3b62ba Merge pull request 'feat(deps): update org.apache.maven.plugins:maven-compiler-plugin to 3.14.0' (#54) from renovate/compiler-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m16s
Reviewed-on: phoenix/quarkus-commons#54
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-02-21 13:00:31 +00:00
7faebe8c9a feat(deps): update org.apache.maven.plugins:maven-compiler-plugin to 3.14.0
All checks were successful
Build / build (pull_request) Successful in 1m28s
2025-02-21 10:39:10 +00:00
2e12ff563e Merge pull request 'fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.3' (#53) from renovate/spotless-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m38s
Reviewed-on: phoenix/quarkus-commons#53
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-02-21 09:15:25 +00:00
8ab489c27f fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.3
All checks were successful
Build / build (pull_request) Successful in 1m42s
2025-02-21 00:38:57 +00:00
c3ac127221
chore: prepare for next development iteration [skip ci] 2025-02-20 12:24:22 +00:00
40a2ccc201
chore: release 1.1.1
All checks were successful
Build / build (push) Successful in 2m14s
2025-02-20 12:24:19 +00:00
5a01d2461b Merge pull request 'chore: bump version to 1.1.1' (#52) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m18s
Reviewed-on: phoenix/quarkus-commons#52
2025-02-20 12:23:06 +00:00
2dc1794f90
chore: bump version to 1.1.1
All checks were successful
Validate release versions / release (pull_request) Successful in 7s
Build / build (pull_request) Successful in 1m29s
2025-02-20 13:20:11 +01:00
1e2c4746c1 Merge pull request 'fix(deps): update io.smallrye:jandex-maven-plugin to 3.2.7' (#49) from renovate/jandex-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m8s
Reviewed-on: phoenix/quarkus-commons#49
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-02-20 08:20:04 +00:00
8febf96d10 fix(deps): update io.smallrye:jandex-maven-plugin to 3.2.7
All checks were successful
Build / build (pull_request) Successful in 2m9s
2025-02-20 08:15:41 +00:00
f15f68b3ed Merge pull request 'fix(deps): update quarkus.platform.version to 3.18.4' (#50) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m33s
Reviewed-on: phoenix/quarkus-commons#50
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-02-20 08:13:49 +00:00
0add72c330 fix(deps): update quarkus.platform.version to 3.18.4
All checks were successful
Build / build (pull_request) Successful in 1m52s
2025-02-19 16:40:15 +00:00
732a0ed0b5
chore: prepare for next development iteration [skip ci] 2025-01-30 08:20:35 +00:00
741001627e
chore: release 1.1.0
All checks were successful
Build / build (push) Successful in 2m20s
2025-01-30 08:20:32 +00:00
42b3bcb38d Merge pull request 'chore: bump version to 1.1.0' (#48) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m11s
Reviewed-on: phoenix/quarkus-commons#48
2025-01-30 08:19:23 +00:00
c4eef322cf
chore: bump version to 1.1.0
All checks were successful
Validate release versions / release (pull_request) Successful in 29s
Build / build (pull_request) Successful in 1m22s
2025-01-30 09:17:43 +01:00
2563b3699c Merge pull request 'ci(github-actions): use multiple maven caches for increased hit rate, use forgejo checkout action' (#47) from cache into main
All checks were successful
Build / build (push) Successful in 1m59s
Reviewed-on: phoenix/quarkus-commons#47
2025-01-30 08:15:20 +00:00
3d569f7a35
ci(github-actions): use multiple maven caches for increased hit rate, use forgejo checkout action
All checks were successful
Build / build (pull_request) Successful in 1m32s
2025-01-30 09:12:56 +01:00
18bcf47b57 Merge pull request 'feat(deps): update quarkus.platform.version to 3.18.1' (#46) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m32s
Reviewed-on: phoenix/quarkus-commons#46
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-30 08:09:20 +00:00
2f40dab711 feat(deps): update quarkus.platform.version to 3.18.1
All checks were successful
Build / build (pull_request) Successful in 1m44s
2025-01-29 18:37:44 +00:00
9e008accfa
chore: prepare for next development iteration [skip ci] 2025-01-23 14:38:05 +00:00
a2a67d25be
chore: release 1.0.11
All checks were successful
Build / build (push) Successful in 2m24s
2025-01-23 14:38:02 +00:00
12b493ae43
chore: bump version to 1.0.11
All checks were successful
Release the current version / Execute the release (push) Successful in 1m24s
2025-01-23 15:36:39 +01:00
422e1c3479 Merge pull request 'fix(deps): update quarkus.platform.version to 3.17.8' (#45) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m31s
Reviewed-on: phoenix/quarkus-commons#45
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-22 19:59:04 +00:00
59a8c7d5a2 fix(deps): update quarkus.platform.version to 3.17.8
All checks were successful
Build / build (pull_request) Successful in 1m49s
2025-01-22 17:32:51 +00:00
43bf60469e Merge pull request 'fix(deps): update org.assertj:assertj-core to 3.27.3' (#44) from renovate/assertj-core.version into main
All checks were successful
Build / build (push) Successful in 3m0s
Reviewed-on: phoenix/quarkus-commons#44
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-20 07:44:37 +00:00
5a05e2118a fix(deps): update org.assertj:assertj-core to 3.27.3
All checks were successful
Build / build (pull_request) Successful in 2m25s
2025-01-18 11:35:50 +00:00
a3e4cdeffd
chore: prepare for next development iteration [skip ci] 2025-01-16 10:01:41 +00:00
17df7e23a3
chore: release 1.0.10
All checks were successful
Build / build (push) Successful in 2m34s
2025-01-16 10:01:38 +00:00
e3e6d37335
chore: bump version to 1.0.10
All checks were successful
Release the current version / Execute the release (push) Successful in 1m46s
2025-01-16 10:59:54 +01:00
7cb23cfda9 Merge pull request 'fix(deps): update quarkus.platform.version to 3.17.7' (#43) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m46s
Reviewed-on: phoenix/quarkus-commons#43
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-16 09:42:58 +00:00
22c2803ada fix(deps): update quarkus.platform.version to 3.17.7
All checks were successful
Build / build (pull_request) Successful in 1m38s
2025-01-15 17:34:41 +00:00
a30cc1db57 Merge pull request 'fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.2' (#42) from renovate/spotless-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m48s
Reviewed-on: phoenix/quarkus-commons#42
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-15 08:00:51 +00:00
4aae487289 fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.2
All checks were successful
Build / build (pull_request) Successful in 1m45s
2025-01-14 22:33:17 +00:00
c469b5c70c Merge pull request 'ci(github-actions): fix release workflow not using metadata versions' (#41) from release into main
All checks were successful
Build / build (push) Successful in 2m40s
Reviewed-on: phoenix/quarkus-commons#41
2025-01-09 09:20:00 +00:00
a624ca234a
ci(github-actions): fix release workflow not using metadata versions
All checks were successful
Build / build (pull_request) Successful in 1m56s
2025-01-09 10:19:36 +01:00
ba95e7aab2 Merge pull request 'fix(deps): update quarkus.platform.version to 3.17.6' (#40) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m46s
Reviewed-on: phoenix/quarkus-commons#40
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-09 08:04:43 +00:00
34c2db3c61 fix(deps): update quarkus.platform.version to 3.17.6
All checks were successful
Build / build (pull_request) Successful in 1m43s
2025-01-08 18:32:18 +00:00
cc8cbeb239 Merge pull request 'fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.1' (#39) from renovate/spotless-plugin.version into main
All checks were successful
Build / build (push) Successful in 3m14s
Reviewed-on: phoenix/quarkus-commons#39
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-08 08:10:46 +00:00
6125a55868 fix(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.1
All checks were successful
Build / build (pull_request) Successful in 1m52s
2025-01-07 17:40:41 +00:00
b3c77aa3b8
chore: prepare for next development iteration [skip ci] 2025-01-07 10:46:18 +00:00
bb7e222c55
chore: release 1.0.9
All checks were successful
Build / build (push) Successful in 2m19s
2025-01-07 10:46:15 +00:00
4273cc0f16 Merge pull request 'chore: bump version to 1.0.9' (#38) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m28s
Reviewed-on: phoenix/quarkus-commons#38
2025-01-07 10:44:51 +00:00
a23dfa5399
chore: bump version to 1.0.9
All checks were successful
Validate release versions / release (pull_request) Successful in 6s
Build / build (pull_request) Successful in 1m31s
2025-01-07 11:42:59 +01:00
019b0f8b17 Merge pull request 'upload sources jar and enable maven cache on ci' (#37) from sources into main
All checks were successful
Build / build (push) Successful in 2m12s
Reviewed-on: phoenix/quarkus-commons#37
2025-01-07 10:42:31 +00:00
0fa8453eec
ci(github-actions): enable maven caching on actions/setup-java
All checks were successful
Build / build (pull_request) Successful in 1m43s
2025-01-07 11:40:24 +01:00
070101f041
feat(plugins): add maven-source-plugin version 3.3.1 2025-01-07 11:39:38 +01:00
62f1c008d3 Merge pull request 'feat(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.0' (#36) from renovate/spotless-plugin.version into main
All checks were successful
Build / build (push) Successful in 2m32s
Reviewed-on: phoenix/quarkus-commons#36
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-07 08:10:44 +00:00
a5edd178da feat(deps): update com.diffplug.spotless:spotless-maven-plugin to 2.44.0
All checks were successful
Build / build (pull_request) Successful in 1m39s
2025-01-06 23:16:37 +00:00
d122200221 Merge pull request 'fix(deps): update org.assertj:assertj-core to 3.27.2' (#35) from renovate/assertj-core.version into main
All checks were successful
Build / build (push) Successful in 2m39s
Reviewed-on: phoenix/quarkus-commons#35
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-06 11:31:20 +00:00
9f1a89d255 fix(deps): update org.assertj:assertj-core to 3.27.2
All checks were successful
Build / build (pull_request) Successful in 2m14s
2025-01-04 12:17:36 +00:00
a8e526cf9f Merge pull request 'fix(deps): update org.assertj:assertj-core to 3.27.1' (#34) from renovate/assertj-core.version into main
All checks were successful
Build / build (push) Successful in 3m5s
Reviewed-on: phoenix/quarkus-commons#34
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2025-01-02 08:20:52 +00:00
6b6a46a860 fix(deps): update org.assertj:assertj-core to 3.27.1
All checks were successful
Build / build (pull_request) Successful in 1m40s
2025-01-01 19:17:20 +00:00
b1e87a2a44
chore: prepare for next development iteration [skip ci] 2024-12-20 08:31:17 +00:00
a497a4ba06
chore: release 1.0.8
All checks were successful
Build / build (push) Successful in 2m12s
2024-12-20 08:31:14 +00:00
81b1c13d8e Merge pull request 'chore: bump version to 1.0.8' (#33) from version into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m24s
Reviewed-on: phoenix/quarkus-commons#33
2024-12-20 08:29:54 +00:00
5bb53631a3
chore: bump version to 1.0.8
All checks were successful
Validate release versions / release (pull_request) Successful in 6s
Build / build (pull_request) Successful in 1m36s
2024-12-20 09:27:53 +01:00
d77e1f7909 Merge pull request 'fix(deps): update quarkus.platform.version to 3.17.5' (#31) from renovate/quarkus.platform.version into main
All checks were successful
Build / build (push) Successful in 2m20s
Reviewed-on: phoenix/quarkus-commons#31
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2024-12-20 08:26:06 +00:00
c91a9e136b fix(deps): update quarkus.platform.version to 3.17.5
All checks were successful
Build / build (pull_request) Successful in 1m42s
2024-12-20 08:22:29 +00:00
cb9da7e719 Merge pull request 'feat(deps): update org.assertj:assertj-core to 3.27.0' (#32) from renovate/assertj-core.version into main
All checks were successful
Build / build (push) Successful in 2m51s
Reviewed-on: phoenix/quarkus-commons#32
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2024-12-20 08:22:17 +00:00
5168f9c930 feat(deps): update org.assertj:assertj-core to 3.27.0
All checks were successful
Build / build (pull_request) Successful in 1m44s
2024-12-19 18:17:13 +00:00
8965706e7a
chore: prepare for next development iteration [skip ci] 2024-12-19 16:33:46 +00:00
0d93a2d540
chore: release 1.0.7
All checks were successful
Build / build (push) Successful in 2m19s
2024-12-19 16:33:43 +00:00
e5c3fc58ec Merge pull request 'ci(github-actions): add project.yaml' (#30) from project.yml into main
All checks were successful
Release the current version / Execute the release (push) Successful in 1m30s
Reviewed-on: phoenix/quarkus-commons#30
2024-12-19 16:32:17 +00:00
bc9577385c
ci(github-actions): add project.yaml
All checks were successful
Validate release versions / release (pull_request) Successful in 7s
Build / build (pull_request) Successful in 1m44s
2024-12-19 17:30:15 +01:00
ca5c9519d4 Merge pull request 'feat(plugins): add maven-release-plugin version 3.1.1' (#29) from release-plugin into main
All checks were successful
Build / build (push) Successful in 2m23s
Reviewed-on: phoenix/quarkus-commons#29
2024-12-19 16:29:28 +00:00
d2078337eb
fix: set autoVersionSubmodules to true
All checks were successful
Build / build (pull_request) Successful in 1m44s
2024-12-19 17:26:55 +01:00
01fe45047a
ci(github-actions): add actions to perform releases using maven-release-plugin
All checks were successful
Build / build (pull_request) Successful in 1m41s
2024-12-19 17:24:28 +01:00
c9995eb309
feat(plugins): add maven-release-plugin version 3.1.1
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m38s
2024-12-19 17:21:30 +01:00
9e6dd3dab1
chore: bump version to 1.0.7-SNAPSHOT
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m32s
2024-12-14 21:51:10 +01:00
44137d29e1
chore: release 1.0.6
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m36s
2024-12-14 21:48:35 +01:00
8ca36d0cc0
feat(plugins): add io.smallrye:jandex-maven-plugin version 3.2.3
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m17s
2024-12-14 21:48:09 +01:00
0013789f31
chore: bump version to 1.0.6-SNAPSHOT
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m9s
2024-12-11 17:06:39 +01:00
baf4f4c630
chore: release 1.0.5
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m44s
2024-12-11 17:04:16 +01:00
1b57649f2b Merge pull request 'fix(deps): update quarkus.platform.version to 3.17.4' (#28) from renovate/quarkus.platform.version into main
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m16s
Reviewed-on: phoenix/quarkus-commons#28
2024-12-11 15:58:17 +00:00
b9d4e6f6d3 fix(deps): update quarkus.platform.version to 3.17.4
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m40s
2024-12-11 15:16:53 +00:00
fa1578f667
test(json-service): increase coverage to 100%
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m1s
2024-12-10 17:09:35 +01:00
483c5b1b57
chore(maven): reorganize pom.xml properties
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m58s
2024-12-10 17:02:24 +01:00
5b0fca22d0
docs: create docs/ dir
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 3m25s
2024-12-09 13:34:40 +01:00
9d28933116
ci(github-actions): ignore certain paths on push workflow, add COMMON_MAVEN_OPTS
Some checks are pending
Build, test and publish the Quarkus libraries / build (push) Waiting to run
2024-12-09 13:34:01 +01:00
27de665903
chore(CODEOWNERS): move to repository root
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m20s
2024-12-06 10:18:43 +01:00
92ee17fb6f
chore: bump version to 1.0.5-SNAPSHOT
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m19s
2024-12-06 10:03:12 +01:00
b2d100499c
chore: release 1.0.4
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m43s
2024-12-06 09:55:18 +01:00
602c8ec1aa Merge pull request 'fix(deps): update quarkus.platform.version to 3.17.3' (#27) from renovate/quarkus.platform.version into main
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m20s
Reviewed-on: phoenix/quarkus-commons#27
2024-12-05 08:23:46 +00:00
5d93e7a8cf fix(deps): update quarkus.platform.version to 3.17.3
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m49s
2024-12-04 18:19:00 +00:00
fe96666d70
chore: bump version to 1.0.4-SNAPSHOT
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m19s
2024-11-29 11:11:08 +01:00
b16eae1b43
chore: release 1.0.3
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m46s
2024-11-29 11:05:07 +01:00
65d25d045b Merge pull request 'fix(deps): update quarkus.platform.version to 3.17.2' (#26) from renovate/quarkus.platform.version into main
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m15s
Reviewed-on: phoenix/quarkus-commons#26
2024-11-29 09:44:35 +00:00
7cf9b1e52b fix(deps): update quarkus.platform.version to 3.17.2
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m46s
2024-11-29 09:17:09 +00:00
2509843da4
chore: bump version to 1.0.3-SNAPSHOT
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m24s
2024-11-27 15:35:50 +01:00
efb25640dd
chore: release 1.0.2
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m42s
2024-11-27 15:34:49 +01:00
1ed8a8a12f Merge pull request 'feat(deps): update quarkus.platform.version to 3.17.0' (#25) from renovate/quarkus.platform.version into main
Some checks failed
Build, test and publish the Quarkus libraries / build (push) Has been cancelled
Reviewed-on: phoenix/quarkus-commons#25
2024-11-27 14:29:11 +00:00
e3abbf4b7f feat(deps): update quarkus.platform.version to 3.17.0
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m54s
2024-11-27 13:58:17 +00:00
39e2667a3e
docs: update badges on README.md
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 5m15s
2024-11-27 12:39:29 +01:00
e6b6d5f1e7
ci(github-actions): use only .github/ for consistency, replace host secrets with vars
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m29s
2024-11-26 13:26:11 +01:00
2cdf40e136 Merge pull request 'fix(deps): update quarkus.platform.version to 3.16.4' (#24) from renovate/quarkus.platform.version into main
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 3m8s
Reviewed-on: phoenix/quarkus-commons#24
2024-11-21 08:41:54 +00:00
f36d1843f6 fix(deps): update quarkus.platform.version to 3.16.4
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 3m5s
2024-11-20 15:52:16 +00:00
e59c3a2ce9
ci(forgejo-actions): add feature flag for Sonar
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m55s
2024-11-15 14:32:20 +01:00
9c3289f1ec
feat(deps): add quarkus-cyclonedx 2024-11-15 14:32:19 +01:00
6fc943ecbb Merge pull request 'fix(deps): update quarkus.platform.version to 3.16.3' (#23) from renovate/quarkus.platform.version into main
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m5s
Reviewed-on: phoenix/quarkus-commons#23
Reviewed-by: jorge.bornhausen <jorge.bornhausen@phoenix-technologies.ch>
2024-11-15 08:49:27 +00:00
a8d43b1bb9 fix(deps): update quarkus.platform.version to 3.16.3
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 3m50s
2024-11-13 17:16:17 +00:00
84deff212a
chore: bump version to 1.0.2-SNAPSHOT
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m14s
2024-11-12 17:29:10 +01:00
3454576dcb
chore: release 1.0.1
Some checks failed
Build, test and publish the Quarkus libraries / build (push) Has been cancelled
2024-11-12 16:51:31 +01:00
8eec3aeaf6
chore: release 1.0.1
Some checks failed
Build, test and publish the Quarkus libraries / build (push) Failing after 27s
2024-11-12 16:49:43 +01:00
d404db0e87 Merge pull request 'ci(forgejo-actions): analyze project with sonarqube' (#22) from sonarqube into main
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 2m12s
Reviewed-on: phoenix/quarkus-commons#22
2024-11-11 21:26:34 +00:00
25fe14a5a7
ci(forgejo-actions): analyze project with sonarqube
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m49s
2024-11-11 22:22:10 +01:00
797c3ed950
chore: add .gitattributes
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m21s
2024-11-11 09:43:38 +01:00
a18c903202
chore: bump version to 1.0.1-SNAPSHOT 2024-11-11 09:43:08 +01:00
7ec59eaef4
chore: bump version to 1.0.0
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m17s
2024-11-11 09:33:39 +01:00
1efdbf379d
chore: bump version to 1.0.0
Some checks failed
Build, test and publish the Quarkus libraries / build (push) Failing after 29s
2024-11-11 09:31:50 +01:00
0c3a30138a Merge pull request 'feat(deps): add spotless-maven-plugin 2.43.0 and palantir-java-format 2.50.0' (#21) from spotless into main
Some checks failed
Build, test and publish the Quarkus libraries / build (push) Has been cancelled
Reviewed-on: phoenix/quarkus-commons#21
2024-11-11 08:30:43 +00:00
40598dbe87
style: format code with spotless
All checks were successful
Build, test and publish the Quarkus libraries / build (push) Successful in 1m22s
2024-11-11 09:29:02 +01:00
e5e100076c
feat(deps): add spotless-maven-plugin 2.43.0 and palantir-java-format 2.50.0 2024-11-11 09:24:37 +01:00
88 changed files with 2911 additions and 314 deletions

3
.gitattributes vendored Normal file
View file

@ -0,0 +1,3 @@
mvnw text eol=lf
*.xml text eol=lf
*.java text diff=java eol=lf

View file

@ -1,42 +0,0 @@
name: Build, test and publish the Quarkus libraries
on: [ push, workflow_dispatch ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: https://github.com/actions/checkout@v4
- name: Set up JDK 21
uses: https://github.com/actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Configure Maven CI/CD settings
uses: https://github.com/s4u/maven-settings-action@v3.1.0
with:
servers: |
[{
"id": "kvant",
"configuration": {
"httpHeaders": {
"property": {
"name": "Authorization",
"value": "token ${{ secrets.PHOENIX_PACKAGE_WRITER_TOKEN }}"
}
}
}
}]
- name: Make maven wrapper executable
run: chmod +x mvnw
- name: Build and run tests
run: ./mvnw verify
- name: Upload libs to Gitea Maven Registry
if: gitea.ref == 'refs/heads/main'
run: ./mvnw deploy -Dmaven.test.skip=true -Dmaven.javadoc.skip=true

5
.github/project.yaml vendored Normal file
View file

@ -0,0 +1,5 @@
name: Quarkus Commons
release:
current-version: "1.0.8"
next-version: "1.0.9-SNAPSHOT"

99
.github/workflows/build.yaml vendored Normal file
View file

@ -0,0 +1,99 @@
name: Build
on:
push:
branches:
- "main"
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths-ignore:
- '.gitattributes'
- '.gitignore'
- '.github/renovate.json5'
- '.github/project.yaml'
- 'docs/**'
- 'README.md'
pull_request:
workflow_dispatch:
env:
COMMON_MAVEN_OPTS: "-e -B --fae"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: https://github.com/actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Generate cache keys
id: cache-key
run: |
CURRENT_BRANCH="${{ github.head_ref || github.ref_name }}"
CURRENT_MONTH=$(/bin/date -u "+%Y-%m")
CURRENT_DAY=$(/bin/date -u "+%d")
ROOT_CACHE_KEY="m2-cache-quarkus-commons"
echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
echo "m2-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
echo "m2-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
# The cache is per branch but in case we don't find a branch for a given branch, we will get a cache from another branch.
key: ${{ steps.cache-key.outputs.m2-cache-key }}
restore-keys: |
${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }}
${{ steps.cache-key.outputs.m2-monthly-cache-key }}
- name: Configure Maven CI/CD settings
uses: https://github.com/s4u/maven-settings-action@v3.1.0
with:
servers: |
[{
"id": "phoenix-oss",
"username": "${{ vars.ORG_PACKAGE_WRITER_USERNAME }}",
"password": "${{ secrets.ORG_PACKAGE_WRITER_TOKEN }}"
}]
- name: Make maven wrapper executable
run: chmod +x mvnw
- name: Validate tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF#refs/tags/}"
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ "$PROJECT_VERSION" != "$TAG_NAME" ]]; then
echo "::error::pom.xml version '$PROJECT_VERSION' does not match tag '$TAG_NAME'"
exit 1
fi
- name: Download dependencies
run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline
- name: Build and run tests
run: ./mvnw $COMMON_MAVEN_OPTS verify
- name: Analyze with Sonar
if: vars.SONAR_ENABLED == 'true'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
run: ./mvnw $COMMON_MAVEN_OPTS org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=quarkus-commons -Dsonar.projectName='quarkus-commons' -Dsonar.coverage.jacoco.xmlReportPaths=../**/target/jacoco-report/jacoco.xml
- name: Publish jars
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
run: ./mvnw $COMMON_MAVEN_OPTS deploy -Dmaven.test.skip=true -Dmaven.javadoc.skip=true

97
.github/workflows/release.yaml vendored Normal file
View file

@ -0,0 +1,97 @@
name: Release the current version
on:
push:
branches:
- "main"
paths:
- '.github/project.yaml'
env:
COMMON_MAVEN_OPTS: "-e -B --fae"
jobs:
release:
name: Execute the release
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Retrieve project metadata
uses: https://github.com/radcortez/project-metadata-action@main
id: metadata
with:
metadata-file-path: '.github/project.yaml'
local-file: true
- name: Validate current version
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
run: |
echo '::error::Cannot release a SNAPSHOT version.'
exit 1
- name: Validate next version
if: contains(steps.metadata.outputs.next-version, 'SNAPSHOT') == 'false'
run: |
echo '::error::Next development version should be a SNAPSHOT version.'
exit 1
- name: Set environment variables
run: |
echo "CURRENT_VERSION=${{steps.metadata.outputs.current-version}}" >> $GITHUB_ENV
echo "NEXT_VERSION=${{steps.metadata.outputs.next-version}}" >> $GITHUB_ENV
- name: Configure SSH and Git
env:
SSH_DIR: /root/.ssh
MAVEN_RELEASE_SSH_KEY: ${{ secrets.MAVEN_RELEASE_SSH_KEY }}
run: |
mkdir -p ${SSH_DIR}/
touch ${SSH_DIR}/known_hosts
ssh-keyscan -t rsa -p 2222 git-ssh.kvant.cloud >> ${SSH_DIR}/known_hosts
echo "${MAVEN_RELEASE_SSH_KEY}" | base64 -d >> ${SSH_DIR}/id_rsa
chmod 600 ${SSH_DIR}/id_rsa
git config --global user.name 'maven_release_technical_account'
git config --global user.email 'maven-release-bot@phoenix-technologies.ch'
git config --global commit.gpgsign true
git config --global gpg.format ssh
git config --global user.signingkey ${SSH_DIR}/id_rsa
- name: Set up JDK 21
uses: https://github.com/actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Generate cache keys
id: cache-key
run: |
CURRENT_BRANCH="${{ github.ref_name }}"
CURRENT_MONTH=$(/bin/date -u "+%Y-%m")
CURRENT_DAY=$(/bin/date -u "+%d")
ROOT_CACHE_KEY="m2-cache-quarkus-commons"
echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
echo "m2-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
echo "m2-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
# The cache is per branch but in case we don't find a branch for a given branch, we will get a cache from another branch.
key: ${{ steps.cache-key.outputs.m2-cache-key }}
restore-keys: |
${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }}
${{ steps.cache-key.outputs.m2-monthly-cache-key }}
- name: Make maven wrapper executable
run: chmod +x mvnw
- name: Download dependencies
run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline
- name: Prepare release
run: ./mvnw $COMMON_MAVEN_OPTS release:prepare -DreleaseVersion=${CURRENT_VERSION} -DdevelopmentVersion=${NEXT_VERSION}

View file

@ -0,0 +1,33 @@
name: Validate release versions
on:
pull_request:
paths:
- '.github/project.yaml'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: https://github.com/actions/checkout@v4
- name: Retrieve project metadata
uses: https://github.com/radcortez/project-metadata-action@main
id: metadata
with:
metadata-file-path: '.github/project.yaml'
local-file: true
- name: Validate current version
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
run: |
echo '::error::Cannot release a SNAPSHOT version.'
exit 1
- name: Validate next version
if: contains(steps.metadata.outputs.next-version, 'SNAPSHOT') == false
run: |
echo '::error::Next development version should be a SNAPSHOT version.'
exit 1

View file

@ -1,14 +1,13 @@
Quarkus Commons
===============
[![Java version](https://img.shields.io/badge/Java%20version-21-brightgreen?style=for-the-badge)](https://openjdk.org/projects/jdk/21/)
[![Quarkus version](https://img.shields.io/badge/Quarkus%20version-3.16.2-brightgreen?style=for-the-badge)](https://quarkus.io/guides/)
[![Maven Wrapper](https://img.shields.io/badge/Maven%20version-3.9.9-brightgreen?style=for-the-badge)](https://maven.apache.org/)
<!-- TOC -->
* [Quarkus Commons](#quarkus-commons)
* [Introduction](#introduction)
<!-- TOC -->
[![Java version](https://img.shields.io/badge/Java%20version-21-brightgreen)](https://openjdk.org/projects/jdk/21/)
[![Coverage](https://sonarqube.pub.basel.kvant.cloud/api/project_badges/measure?project=quarkus-commons&metric=coverage&token=sqb_b56d9ea175c7f51f522ce63acd7fe7807643ac9e)](https://sonarqube.pub.basel.kvant.cloud/dashboard?id=quarkus-commons)
[![Duplicated Lines (%)](https://sonarqube.pub.basel.kvant.cloud/api/project_badges/measure?project=quarkus-commons&metric=duplicated_lines_density&token=sqb_b56d9ea175c7f51f522ce63acd7fe7807643ac9e)](https://sonarqube.pub.basel.kvant.cloud/dashboard?id=quarkus-commons)
[![Quality Gate Status](https://sonarqube.pub.basel.kvant.cloud/api/project_badges/measure?project=quarkus-commons&metric=alert_status&token=sqb_b56d9ea175c7f51f522ce63acd7fe7807643ac9e)](https://sonarqube.pub.basel.kvant.cloud/dashboard?id=quarkus-commons)
[![Security Rating](https://sonarqube.pub.basel.kvant.cloud/api/project_badges/measure?project=quarkus-commons&metric=security_rating&token=sqb_b56d9ea175c7f51f522ce63acd7fe7807643ac9e)](https://sonarqube.pub.basel.kvant.cloud/dashboard?id=quarkus-commons)
[![Reliability Rating](https://sonarqube.pub.basel.kvant.cloud/api/project_badges/measure?project=quarkus-commons&metric=reliability_rating&token=sqb_b56d9ea175c7f51f522ce63acd7fe7807643ac9e)](https://sonarqube.pub.basel.kvant.cloud/dashboard?id=quarkus-commons)
[![Maintainability Rating](https://sonarqube.pub.basel.kvant.cloud/api/project_badges/measure?project=quarkus-commons&metric=sqale_rating&token=sqb_b56d9ea175c7f51f522ce63acd7fe7807643ac9e)](https://sonarqube.pub.basel.kvant.cloud/dashboard?id=quarkus-commons)
# Introduction
@ -17,9 +16,11 @@ that can be used by Quarkus applications.
The modules are:
* `quarkus-audit-tools`
* `quarkus-clock-service`
* `quarkus-json-service`
* `quarkus-message-digest-service`
* `quarkus-random-number-generator`
* `quarkus-tracing-service`
* `quarkus-uuid-generator`

122
pom.xml
View file

@ -1,49 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.phoenixtechnologies.quarkus</groupId>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.9-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>quarkus-audit-tools</module>
<module>quarkus-client-logger</module>
<module>quarkus-clock-service</module>
<module>quarkus-json-service</module>
<module>quarkus-message-digest-service</module>
<module>quarkus-random-number-generator</module>
<module>quarkus-tracing-service</module>
<module>quarkus-uuid-generator</module>
</modules>
<properties>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<compiler-plugin.version>3.13.0</compiler-plugin.version>
<surefire-plugin.version>3.5.2</surefire-plugin.version>
<jacoco-plugin.version>0.8.12</jacoco-plugin.version>
<!-- Quarkus properties -->
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.16.2</quarkus.platform.version>
<quarkus.platform.version>3.25.0</quarkus.platform.version>
<!-- Plugin versions -->
<compiler-plugin.version>3.14.0</compiler-plugin.version>
<surefire-plugin.version>3.5.3</surefire-plugin.version>
<spotless-plugin.version>2.46.1</spotless-plugin.version>
<palantir-java-format.version>2.72.0</palantir-java-format.version>
<jacoco-plugin.version>0.8.13</jacoco-plugin.version> <!-- Match with version from Quarkus BOM -->
<jandex-plugin.version>3.4.0</jandex-plugin.version>
<release-plugin.version>3.1.1</release-plugin.version>
<source-plugin.version>3.3.1</source-plugin.version>
<!-- Build properties -->
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<skipITs>true</skipITs>
<!-- Dependencies -->
<java-uuid-generator.version>5.1.0</java-uuid-generator.version>
<!-- Test dependencies -->
<assertj-core.version>3.26.3</assertj-core.version>
<assertj-core.version>3.27.3</assertj-core.version>
</properties>
<distributionManagement>
<repository>
<id>kvant</id>
<url>https://git.kvant.cloud/api/packages/phoenix/maven</url>
<id>phoenix-oss</id>
<url>https://git.kvant.cloud/api/packages/phoenix-oss/maven</url>
</repository>
<snapshotRepository>
<id>kvant</id>
<url>https://git.kvant.cloud/api/packages/phoenix/maven</url>
<id>phoenix-oss</id>
<url>https://git.kvant.cloud/api/packages/phoenix-oss/maven</url>
</snapshotRepository>
</distributionManagement>
@ -59,11 +69,22 @@
</dependencies>
</dependencyManagement>
<scm>
<connection>scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix-oss/quarkus-commons.git</connection>
<developerConnection>scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix-oss/quarkus-commons.git</developerConnection>
<url>https://git.kvant.cloud/phoenix-oss/quarkus-commons.git</url>
<tag>HEAD</tag>
</scm>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-cyclonedx</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
@ -117,7 +138,6 @@
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
@ -132,6 +152,68 @@
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
<configuration>
<java>
<removeUnusedImports />
<palantirJavaFormat>
<version>${palantir-java-format.version}</version>
<style>PALANTIR</style>
<formatJavadoc>false</formatJavadoc>
</palantirJavaFormat>
</java>
</configuration>
</plugin>
<plugin>
<groupId>io.smallrye</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>${jandex-plugin.version}</version>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${release-plugin.version}</version>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
<checkModificationExcludes>mvnw</checkModificationExcludes>
<scmReleaseCommitComment>chore: release @{releaseLabel}</scmReleaseCommitComment>
<scmDevelopmentCommitComment>chore: prepare for next development iteration</scmDevelopmentCommitComment>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-audit-tools</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-tracing-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-envers</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway-postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-elytron-security-properties-file</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-config-yaml</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-plugin.version}</version>
<executions>
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<phase>test</phase>
<configuration>
<dataFile>${project.build.directory}/jacoco-quarkus.exec</dataFile>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>1</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,20 @@
package ch.phoenix.oss.quarkus.commons.audit;
import jakarta.enterprise.inject.spi.CDI;
import org.hibernate.envers.RevisionListener;
public class AuditRevisionListener implements RevisionListener {
@Override
public void newRevision(Object revisionEntity) {
var provider = CDI.current().select(RevisionContextProvider.class).get();
var rev = (Revision) revisionEntity;
rev.actor = provider.getActor();
rev.traceId = provider.getTraceId();
rev.spanId = provider.getSpanId();
rev.requestId = provider.getRequestId();
rev.clientIp = provider.getClientIp();
rev.hostName = provider.getHostName();
}
}

View file

@ -0,0 +1,30 @@
package ch.phoenix.oss.quarkus.commons.audit;
import io.quarkus.hibernate.orm.panache.PanacheEntity;
import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import java.time.Instant;
import org.hibernate.envers.NotAudited;
/**
* The goal of this class is to have on the entity itself the exact same
* timestamps as the ones from revisions generated by envers. Because of that,
* we can't use @CreationTimestamp and @UpdateTimestamp, as those timestamp values
* are managed by different Hibernate classes, so the generated values will drift.
* <p>
* Manually setting these values to match envers revisions would be error-prone,
* verbose and tedious. So, the recommendation is to implement triggers on the
* audit tables which will update the main entity whenever a revision is created.
* An example of how to do that can be found in this module's integration tests.
*/
@MappedSuperclass
public abstract class AuditedPanacheEntity extends PanacheEntity {
@NotAudited
@Column(updatable = false)
public Instant createdAt;
@NotAudited
@Column(updatable = false)
public Instant lastUpdatedAt;
}

View file

@ -0,0 +1,30 @@
package ch.phoenix.oss.quarkus.commons.audit;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import java.time.Instant;
import org.hibernate.envers.NotAudited;
/**
* The goal of this class is to have on the entity itself the exact same
* timestamps as the ones from revisions generated by envers. Because of that,
* we can't use @CreationTimestamp and @UpdateTimestamp, as those timestamp values
* are managed by different Hibernate classes, so the generated values will drift.
* <p>
* Manually setting these values to match envers revisions would be error-prone,
* verbose and tedious. So, the recommendation is to implement triggers on the
* audit tables which will update the main entity whenever a revision is created.
* An example of how to do that can be found in this module's integration tests.
*/
@MappedSuperclass
public abstract class AuditedPanacheEntityBase extends PanacheEntityBase {
@NotAudited
@Column(updatable = false)
public Instant createdAt;
@NotAudited
@Column(updatable = false)
public Instant lastUpdatedAt;
}

View file

@ -0,0 +1,67 @@
package ch.phoenix.oss.quarkus.commons.audit;
import ch.phoenix.oss.quarkus.commons.tracing.TracingService;
import io.opentelemetry.instrumentation.annotations.WithSpan;
import io.quarkus.arc.DefaultBean;
import io.quarkus.arc.Unremovable;
import io.quarkus.logging.Log;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import java.net.InetAddress;
import java.net.UnknownHostException;
@Unremovable
@DefaultBean
@ApplicationScoped
class DefaultRevisionContextProvider implements RevisionContextProvider {
private static final String UNKNOWN = "unknown";
private final TracingService tracingService;
@Inject
DefaultRevisionContextProvider(TracingService tracingService) {
this.tracingService = tracingService;
}
@Override
@WithSpan
public String getActor() {
return tracingService.getActor();
}
@Override
@WithSpan
public String getTraceId() {
return tracingService.getTraceId();
}
@Override
@WithSpan
public String getSpanId() {
return tracingService.getSpanId();
}
@Override
@WithSpan
public String getRequestId() {
return tracingService.getRequestId();
}
@Override
@WithSpan
public String getClientIp() {
return tracingService.getClientIp();
}
@Override
@WithSpan
public String getHostName() {
try {
return InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
Log.error("Unable to determine host name", e);
return UNKNOWN;
}
}
}

View file

@ -0,0 +1,58 @@
package ch.phoenix.oss.quarkus.commons.audit;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import jakarta.persistence.*;
import java.time.Instant;
import java.util.Objects;
import org.hibernate.envers.RevisionEntity;
import org.hibernate.envers.RevisionNumber;
import org.hibernate.envers.RevisionTimestamp;
@Entity
@Table(name = "revinfo")
@RevisionEntity(AuditRevisionListener.class)
public class Revision extends PanacheEntityBase {
@Id
@GeneratedValue
@RevisionNumber
public long rev;
@RevisionTimestamp
@Column(nullable = false, updatable = false)
public Instant timestamp;
@Column(updatable = false)
public String actor;
@Column(updatable = false)
public String traceId;
@Column(updatable = false)
public String spanId;
@Column(updatable = false)
public String requestId;
@Column(updatable = false)
public String clientIp;
@Column(updatable = false)
public String hostName;
@Override
public boolean equals(Object o) {
if (!(o instanceof Revision that)) return false;
return rev == that.rev;
}
@Override
public int hashCode() {
return Objects.hashCode(rev);
}
@Override
public String toString() {
return "Revision{rev=" + rev + '}';
}
}

View file

@ -0,0 +1,16 @@
package ch.phoenix.oss.quarkus.commons.audit;
public interface RevisionContextProvider {
String getActor();
String getTraceId();
String getSpanId();
String getRequestId();
String getClientIp();
String getHostName();
}

View file

@ -0,0 +1,136 @@
package ch.phoenix.oss.quarkus.commons.audit;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.mockito.Mockito.when;
import ch.phoenix.oss.quarkus.commons.tracing.TracingService;
import io.quarkus.narayana.jta.QuarkusTransaction;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectSpy;
import jakarta.inject.Inject;
import jakarta.persistence.EntityManager;
import java.time.Instant;
import org.hibernate.envers.AuditReaderFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@QuarkusTest
class AuditedPanacheEntityBaseTest {
@Inject
EntityManager entityManager;
@InjectSpy
TracingService tracingService;
@SuppressWarnings("Convert2MethodRef")
@BeforeEach
void setup() {
QuarkusTransaction.requiringNew().run(() -> TestEntity2.deleteAll());
}
@Test
void persistAndUpdate() {
when(tracingService.getRequestId()).thenReturn("00000000-0000-0000-0000-000000000000");
when(tracingService.getSpanId()).thenReturn("0000000000000000");
when(tracingService.getTraceId()).thenReturn("00000000000000000000000000000000");
when(tracingService.getActor()).thenReturn("unknown");
when(tracingService.getClientIp()).thenReturn("unknown");
var now = Instant.now();
QuarkusTransaction.requiringNew().run(() -> {
var entity = new TestEntity2("something");
entity.persist();
});
QuarkusTransaction.requiringNew().run(() -> {
var entity = TestEntity2.findBySomething("something");
assertAll(
() -> assertThat(entity.createdAt)
.as("createdAt should be after or equal to expected value")
.isAfterOrEqualTo(now),
() -> assertThat(entity.lastUpdatedAt)
.as("lastUpdatedAt should be equal to createdAt")
.isEqualTo(entity.createdAt));
var auditReader = AuditReaderFactory.get(entityManager);
var revisions = auditReader.getRevisions(TestEntity2.class, entity.id);
assertThat(revisions).hasSize(1);
var revInfo = entityManager.find(Revision.class, revisions.getFirst());
assertThat(revInfo).isNotNull();
assertAll(
() -> assertThat(revInfo.timestamp)
.as("revision timestamp should be equal to entity's createdAt timestamp")
.isEqualTo(entity.createdAt),
() -> assertThat(revInfo.actor)
.as("actor should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.traceId)
.as("traceId should match expected value")
.isEqualTo("00000000000000000000000000000000"),
() -> assertThat(revInfo.spanId)
.as("spanId should match expected value")
.isEqualTo("0000000000000000"),
() -> assertThat(revInfo.requestId)
.as("requestId should match expected value")
.isEqualTo("00000000-0000-0000-0000-000000000000"),
() -> assertThat(revInfo.clientIp)
.as("clientIp should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.hostName)
.as("hostName should not be blank")
.isNotBlank());
});
QuarkusTransaction.requiringNew().run(() -> {
var entity = TestEntity2.findBySomething("something");
entity.something = "else";
});
QuarkusTransaction.requiringNew().run(() -> {
var entity = TestEntity2.findBySomething("else");
assertAll(() -> assertThat(entity.createdAt)
.as("createdAt should be before lastUpdatedAt")
.isBefore(entity.lastUpdatedAt));
var auditReader = AuditReaderFactory.get(entityManager);
var revisions = auditReader.getRevisions(TestEntity2.class, entity.id);
assertThat(revisions).hasSize(2);
Revision revInfo = Revision.findById(revisions.getLast());
assertThat(revInfo).isNotNull();
assertAll(
() -> assertThat(revInfo.timestamp)
.as("revision timestamp should not be equal to entity's createdAt")
.isNotEqualTo(entity.createdAt),
() -> assertThat(revInfo.timestamp)
.as("revision timestamp should be equal to entity's lastUpdatedAt")
.isEqualTo(entity.lastUpdatedAt),
() -> assertThat(revInfo.actor)
.as("actor should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.traceId)
.as("traceId should match expected value")
.isEqualTo("00000000000000000000000000000000"),
() -> assertThat(revInfo.spanId)
.as("spanId should match expected value")
.isEqualTo("0000000000000000"),
() -> assertThat(revInfo.requestId)
.as("requestId should match expected value")
.isEqualTo("00000000-0000-0000-0000-000000000000"),
() -> assertThat(revInfo.clientIp)
.as("clientIp should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.hostName)
.as("hostName should not be blank")
.isNotBlank());
});
}
}

View file

@ -0,0 +1,136 @@
package ch.phoenix.oss.quarkus.commons.audit;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.mockito.Mockito.when;
import ch.phoenix.oss.quarkus.commons.tracing.TracingService;
import io.quarkus.narayana.jta.QuarkusTransaction;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectSpy;
import jakarta.inject.Inject;
import jakarta.persistence.EntityManager;
import java.time.Instant;
import org.hibernate.envers.AuditReaderFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@QuarkusTest
class AuditedPanacheEntityTest {
@Inject
EntityManager entityManager;
@InjectSpy
TracingService tracingService;
@SuppressWarnings("Convert2MethodRef")
@BeforeEach
void setup() {
QuarkusTransaction.requiringNew().run(() -> TestEntity.deleteAll());
}
@Test
void persistAndUpdate() {
when(tracingService.getRequestId()).thenReturn("00000000-0000-0000-0000-000000000000");
when(tracingService.getSpanId()).thenReturn("0000000000000000");
when(tracingService.getTraceId()).thenReturn("00000000000000000000000000000000");
when(tracingService.getActor()).thenReturn("unknown");
when(tracingService.getClientIp()).thenReturn("unknown");
var now = Instant.now();
QuarkusTransaction.requiringNew().run(() -> {
var entity = new TestEntity("something");
entity.persist();
});
QuarkusTransaction.requiringNew().run(() -> {
var entity = TestEntity.findBySomething("something");
assertAll(
() -> assertThat(entity.createdAt)
.as("createdAt should be after or equal to expected value")
.isAfterOrEqualTo(now),
() -> assertThat(entity.lastUpdatedAt)
.as("lastUpdatedAt should be equal to createdAt")
.isEqualTo(entity.createdAt));
var auditReader = AuditReaderFactory.get(entityManager);
var revisions = auditReader.getRevisions(TestEntity.class, entity.id);
assertThat(revisions).hasSize(1);
var revInfo = entityManager.find(Revision.class, revisions.getFirst());
assertThat(revInfo).isNotNull();
assertAll(
() -> assertThat(revInfo.timestamp)
.as("revision timestamp should be equal to entity's createdAt timestamp")
.isEqualTo(entity.createdAt),
() -> assertThat(revInfo.actor)
.as("actor should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.traceId)
.as("traceId should match expected value")
.isEqualTo("00000000000000000000000000000000"),
() -> assertThat(revInfo.spanId)
.as("spanId should match expected value")
.isEqualTo("0000000000000000"),
() -> assertThat(revInfo.requestId)
.as("requestId should match expected value")
.isEqualTo("00000000-0000-0000-0000-000000000000"),
() -> assertThat(revInfo.clientIp)
.as("clientIp should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.hostName)
.as("hostName should not be blank")
.isNotBlank());
});
QuarkusTransaction.requiringNew().run(() -> {
var entity = TestEntity.findBySomething("something");
entity.something = "else";
});
QuarkusTransaction.requiringNew().run(() -> {
var entity = TestEntity.findBySomething("else");
assertAll(() -> assertThat(entity.createdAt)
.as("createdAt should be before lastUpdatedAt")
.isBefore(entity.lastUpdatedAt));
var auditReader = AuditReaderFactory.get(entityManager);
var revisions = auditReader.getRevisions(TestEntity.class, entity.id);
assertThat(revisions).hasSize(2);
Revision revInfo = Revision.findById(revisions.getLast());
assertThat(revInfo).isNotNull();
assertAll(
() -> assertThat(revInfo.timestamp)
.as("revision timestamp should not be equal to entity's createdAt")
.isNotEqualTo(entity.createdAt),
() -> assertThat(revInfo.timestamp)
.as("revision timestamp should be equal to entity's lastUpdatedAt")
.isEqualTo(entity.lastUpdatedAt),
() -> assertThat(revInfo.actor)
.as("actor should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.traceId)
.as("traceId should match expected value")
.isEqualTo("00000000000000000000000000000000"),
() -> assertThat(revInfo.spanId)
.as("spanId should match expected value")
.isEqualTo("0000000000000000"),
() -> assertThat(revInfo.requestId)
.as("requestId should match expected value")
.isEqualTo("00000000-0000-0000-0000-000000000000"),
() -> assertThat(revInfo.clientIp)
.as("clientIp should match expected value")
.isEqualTo("unknown"),
() -> assertThat(revInfo.hostName)
.as("hostName should not be blank")
.isNotBlank());
});
}
}

View file

@ -0,0 +1,31 @@
package ch.phoenix.oss.quarkus.commons.audit;
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
import static org.mockito.Mockito.mockStatic;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.junit.jupiter.api.Test;
@QuarkusTest
class DefaultRevisionContextProviderTest {
@Inject
DefaultRevisionContextProvider underTest;
@Test
void getHostName() {
assertThat(underTest.getHostName()).isNotBlank();
}
@Test
void getHostNameWhenUnknown() {
try (var inetMock = mockStatic(InetAddress.class)) {
inetMock.when(InetAddress::getLocalHost).thenThrow(new UnknownHostException("simulated failure"));
assertThat(underTest.getHostName()).isEqualTo("unknown");
}
}
}

View file

@ -0,0 +1,51 @@
package ch.phoenix.oss.quarkus.commons.audit;
import static org.assertj.core.api.Assertions.assertThat;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
@QuarkusTest
class RevisionTest {
@Test
void testEquals() {
var r1 = new Revision();
r1.rev = 1;
var r2 = new Revision();
r2.rev = 1;
var r3 = new Revision();
r3.rev = 2;
assertThat(r1)
.as("Revisions equality should should match expected value")
.isEqualTo(r1)
.isEqualTo(r2)
.isNotEqualTo(r3)
.isNotEqualTo(new Object());
}
@Test
void testHashCode() {
var r1 = new Revision();
r1.rev = 123;
var r2 = new Revision();
r2.rev = 123;
var r3 = new Revision();
r3.rev = 2;
assertThat(r1.hashCode()).isEqualTo(123).isEqualTo(r2.hashCode()).isNotEqualTo(r3.hashCode());
}
@Test
void testToString() {
var rev = new Revision();
rev.rev = 1;
assertThat(rev).as("Revision's toString should match expected value").hasToString("Revision{rev=1}");
}
}

View file

@ -0,0 +1,23 @@
package ch.phoenix.oss.quarkus.commons.audit;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import org.hibernate.envers.Audited;
@Entity
@Audited
@Table(name = "test_entity")
public class TestEntity extends AuditedPanacheEntity {
public String something;
public TestEntity() {}
public TestEntity(String something) {
this.something = something;
}
public static TestEntity findBySomething(String something) {
return find("something", something).singleResult();
}
}

View file

@ -0,0 +1,29 @@
package ch.phoenix.oss.quarkus.commons.audit;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.hibernate.envers.Audited;
@Entity
@Audited
@Table(name = "test_entity")
public class TestEntity2 extends AuditedPanacheEntityBase {
@Id
@GeneratedValue
public Long id;
public String something;
public TestEntity2() {}
public TestEntity2(String something) {
this.something = something;
}
public static TestEntity2 findBySomething(String something) {
return find("something", something).singleResult();
}
}

View file

@ -0,0 +1,22 @@
quarkus:
flyway:
migrate-at-start: true
datasource:
db-kind: postgresql
hibernate-orm:
sql-load-script: no-file
schema-management:
strategy: none
log:
sql: true
bind-parameters: true
hibernate-envers:
audit-strategy: org.hibernate.envers.strategy.internal.ValidityAuditStrategy
revision-listener: ch.phoenix.oss.quarkus.commons.audit.AuditRevisionListener
security:
users:
embedded:
enabled: true
plain-text: true
users:
jon: doe

View file

@ -0,0 +1,46 @@
create sequence revinfo_seq start with 1 increment by 50;
create sequence test_entity_seq start with 1 increment by 50;
create table revinfo
(
rev bigint not null,
timestamp timestamp(6) with time zone not null,
actor varchar(255),
spanId varchar(255),
traceId varchar(255),
requestId varchar(255),
clientIp varchar(255),
hostName varchar(255),
primary key (rev)
);
create table test_entity
(
id bigint primary key not null,
something varchar(255),
createdAt timestamp(6) with time zone,
lastUpdatedAt timestamp(6) with time zone
);
create table test_entity_aud
(
revtype smallint,
rev bigint not null,
revend bigint,
id bigint not null,
something varchar(255),
primary key (rev, id)
);
alter table if exists test_entity_aud
add constraint fk_rev__revinfo_rev
foreign key (rev)
references revinfo;
alter table if exists test_entity_aud
add constraint fk_revend__revinfo_rev
foreign key (revend)
references revinfo;

View file

@ -0,0 +1,35 @@
CREATE OR REPLACE FUNCTION trg_test_entity_aud_apply_rev()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $func$
DECLARE
ts TIMESTAMP;
BEGIN
-- fetch the exact revision timestamp from revinfo
SELECT r.timestamp
INTO ts
FROM revinfo r
WHERE r.rev = NEW.rev;
-- only set created_at once, when still NULL
UPDATE test_entity
SET createdAt = ts
WHERE id = NEW.id
AND createdAt IS NULL;
-- always bump last_updated_at
UPDATE test_entity
SET lastUpdatedAt = ts
WHERE id = NEW.id;
RETURN NULL;
END;
$func$;
DROP TRIGGER IF EXISTS trg_test_entity_aud_after_insert
ON test_entity_aud;
CREATE TRIGGER trg_test_entity_aud_after_insert
AFTER INSERT ON test_entity_aud
FOR EACH ROW
EXECUTE FUNCTION trg_test_entity_aud_apply_rev();

View file

@ -0,0 +1,37 @@
-- 1) Create or replace the trigger function
CREATE OR REPLACE FUNCTION trg_test_entity_aud_apply_rev()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $func$
DECLARE
ts TIMESTAMP;
BEGIN
-- fetch the exact revision timestamp from revinfo
SELECT r.timestamp
INTO ts
FROM revinfo r
WHERE r.rev = NEW.rev;
-- only set created_at once, when still NULL
UPDATE test_entity
SET created_at = ts
WHERE id = NEW.id
AND created_at IS NULL;
-- always bump last_updated_at
UPDATE test_entity
SET last_updated_at = ts
WHERE id = NEW.id;
RETURN NULL; -- AFTER trigger ignores return value
END;
$func$;
-- 2) Drop any existing trigger, then attach the new one
DROP TRIGGER IF EXISTS trg_test_entity_aud_after_insert
ON test_entity_aud;
CREATE TRIGGER trg_test_entity_aud_after_insert
AFTER INSERT ON test_entity_aud
FOR EACH ROW
EXECUTE FUNCTION trg_test_entity_aud_apply_rev();

View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-client-logger</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-config-yaml</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-jackson</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-plugin.version}</version>
<executions>
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<phase>test</phase>
<configuration>
<dataFile>${project.build.directory}/jacoco-quarkus.exec</dataFile>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.92</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,10 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import org.eclipse.microprofile.config.spi.Converter;
public class LowerCaseStringConverter implements Converter<String> {
@Override
public String convert(String value) throws IllegalArgumentException, NullPointerException {
return value.toLowerCase();
}
}

View file

@ -0,0 +1,119 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import io.vertx.core.Handler;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
import jakarta.enterprise.context.Dependent;
import jakarta.inject.Inject;
import java.util.Map;
import java.util.Set;
import org.jboss.logging.Logger;
import org.jboss.resteasy.reactive.client.api.ClientLogger;
/**
* This is based on org.jboss.resteasy.reactive.client.logging.DefaultClientLogger,
* with the only change being that headers are redacted based on the Set provided
* by the configuration.
*/
@Dependent
public class RedactingClientLogger implements ClientLogger {
private static final Logger log = Logger.getLogger(RedactingClientLogger.class);
private static final String REDACTED_VALUE = "*****";
private final Set<String> redactedHeaders;
private int bodySize;
@Inject
public RedactingClientLogger(RedactingClientLoggerConfiguration configuration) {
this.redactedHeaders = configuration
.headers()
.redact()
.orElse(RedactingClientLoggerConfiguration.Headers.DEFAULT_REDACTED_HEADERS);
}
@Override
public void setBodySize(int bodySize) {
this.bodySize = bodySize;
}
@Override
public void logResponse(HttpClientResponse response, boolean redirect) {
if (!log.isDebugEnabled()) {
return;
}
//noinspection Convert2Lambda
response.bodyHandler(new Handler<>() {
@Override
public void handle(Buffer body) {
log.debugf(
"%s: %s %s, Status[%d %s], Headers[%s], Body:\n%s",
redirect ? "Redirect" : "Response",
response.request().getMethod(),
response.request().absoluteURI(),
response.statusCode(),
response.statusMessage(),
asString(response.headers()),
bodyToString(body));
}
});
}
@Override
public void logRequest(HttpClientRequest request, Buffer body, boolean omitBody) {
if (!log.isDebugEnabled()) {
return;
}
if (omitBody) {
log.debugf(
"Request: %s %s Headers[%s], Body omitted",
request.getMethod(), request.absoluteURI(), asString(request.headers()));
} else if (body == null || body.length() == 0) {
log.debugf(
"Request: %s %s Headers[%s], Empty body",
request.getMethod(), request.absoluteURI(), asString(request.headers()));
} else {
log.debugf(
"Request: %s %s Headers[%s], Body:\n%s",
request.getMethod(), request.absoluteURI(), asString(request.headers()), bodyToString(body));
}
}
private String bodyToString(Buffer body) {
if (body == null) {
return "";
} else if (bodySize <= 0) {
return body.toString();
} else {
String bodyAsString = body.toString();
return bodyAsString.substring(0, Math.min(bodySize, bodyAsString.length()));
}
}
private String asString(MultiMap headers) {
if (headers.isEmpty()) {
return "";
}
StringBuilder sb = new StringBuilder((headers.size() * (6 + 1 + 6))
+ (headers.size() - 1)); // this is a very rough estimate of a result like 'key1=value1 key2=value2'
boolean isFirst = true;
for (Map.Entry<String, String> entry : headers) {
if (isFirst) {
isFirst = false;
} else {
sb.append(' ');
}
var key = entry.getKey();
var value = redactedHeaders.contains(key.toLowerCase()) ? REDACTED_VALUE : entry.getValue();
sb.append(key).append('=').append(value);
}
return sb.toString();
}
}

View file

@ -0,0 +1,20 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithConverter;
import jakarta.ws.rs.core.HttpHeaders;
import java.util.Optional;
import java.util.Set;
@ConfigMapping(prefix = "phoenix.client-logger")
public interface RedactingClientLoggerConfiguration {
Headers headers();
interface Headers {
Set<String> DEFAULT_REDACTED_HEADERS = Set.of(HttpHeaders.AUTHORIZATION.toLowerCase());
Optional<Set<@WithConverter(LowerCaseStringConverter.class) String>> redact();
}
}

View file

@ -0,0 +1,12 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import io.quarkus.test.junit.QuarkusTestProfile;
import java.util.Map;
public class InfoLevelProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("quarkus.log.category.\"ch.phoenix.oss.quarkus.commons.client.logger\".level", "INFO");
}
}

View file

@ -0,0 +1,44 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import java.net.URI;
import java.util.Optional;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.junit.jupiter.api.Test;
@QuarkusTest
@TestProfile(InfoLevelProfile.class)
class InfoLevelTest {
@Inject
@RestClient
TestClient injectedClient;
TestClient builtClient = QuarkusRestClientBuilder.newBuilder()
.clientLogger(new RedactingClientLogger(() -> Optional::empty))
.baseUri(URI.create("http://localhost:8087"))
.build(TestClient.class);
@Test
void getWithInjectedClient() {
injectedClient.get("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "also redacted");
}
@Test
void getWithBuiltClientAndEmptyConfig() {
builtClient.get("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "not redacted");
}
@Test
void postWithInjectedClient() {
injectedClient.post("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "also redacted", "body");
}
@Test
void postWithBuiltClientAndEmptyConfig() {
builtClient.post("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "not redacted", "");
}
}

View file

@ -0,0 +1,47 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import java.net.URI;
import java.util.Optional;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.junit.jupiter.api.Test;
@QuarkusTest
class RedactingClientLoggerTest {
@Inject
@RestClient
TestClient injectedClient;
TestClient builtClient = QuarkusRestClientBuilder.newBuilder()
.clientLogger(new RedactingClientLogger(() -> Optional::empty))
.baseUri(URI.create("http://localhost:8087"))
.build(TestClient.class);
@Test
void getWithInjectedClient() {
injectedClient.get("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "also redacted");
}
@Test
void getWithBuiltClientAndEmptyConfig() {
builtClient.get("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "not redacted");
}
@Test
void postWithInjectedClient() {
injectedClient.post("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "also redacted", "body");
}
@Test
void postWithInjectedClientAndNullBody() {
injectedClient.post("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "also redacted", null);
}
@Test
void postWithBuiltClientAndEmptyConfig() {
builtClient.post("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "not redacted", "");
}
}

View file

@ -0,0 +1,12 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import io.quarkus.test.junit.QuarkusTestProfile;
import java.util.Map;
public class ScopeNoneProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("quarkus.rest-client.logging.scope", "none");
}
}

View file

@ -0,0 +1,44 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import java.net.URI;
import java.util.Optional;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.junit.jupiter.api.Test;
@QuarkusTest
@TestProfile(ScopeNoneProfile.class)
class ScopeNoneTest {
@Inject
@RestClient
TestClient injectedClient;
TestClient builtClient = QuarkusRestClientBuilder.newBuilder()
.clientLogger(new RedactingClientLogger(() -> Optional::empty))
.baseUri(URI.create("http://localhost:8087"))
.build(TestClient.class);
@Test
void getWithInjectedClient() {
injectedClient.get("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "also redacted");
}
@Test
void getWithBuiltClientAndEmptyConfig() {
builtClient.get("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "not redacted");
}
@Test
void postWithInjectedClient() {
injectedClient.post("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "also redacted", "body");
}
@Test
void postWithBuiltClientAndEmptyConfig() {
builtClient.post("this will be redacted", "5c0d8e45-e402-4b71-8f84-24cc0cfd7eec", "not redacted", "");
}
}

View file

@ -0,0 +1,28 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
@SuppressWarnings("UastIncorrectHttpHeaderInspection")
@RegisterRestClient(configKey = "test")
public interface TestClient {
@GET
@Path("/")
@Produces(MediaType.TEXT_PLAIN)
String get(
@HeaderParam("Authorization") String authorization,
@HeaderParam("X-Request-ID") String requestId,
@HeaderParam("X-Something-Else") String somethingElse);
@POST
@Path("/")
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
String post(
@HeaderParam("Authorization") String authorization,
@HeaderParam("X-Request-ID") String requestId,
@HeaderParam("X-Something-Else") String somethingElse,
String body);
}

View file

@ -0,0 +1,21 @@
package ch.phoenix.oss.quarkus.commons.client.logger;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
@Path("/")
public class TestResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String get() {
return "get";
}
@POST
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
public String post(String body) {
return body;
}
}

View file

@ -0,0 +1,20 @@
quarkus:
http:
test-port: 8087
rest-client:
logging:
scope: request-response
body-limit: 10000
test:
url: http://localhost:${quarkus.http.test-port}
log:
category:
"ch.phoenix.oss.quarkus.commons.client.logger":
level: DEBUG
phoenix:
client-logger:
headers:
redact:
- AUTHORIZATION
- X-SOMETHING-ELSE

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenixtechnologies.quarkus</groupId>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-clock-service</artifactId>

View file

@ -1,9 +1,8 @@
package ch.phoenixtechnologies.quarkus.commons.clock;
package ch.phoenix.oss.quarkus.commons.clock;
import io.quarkus.arc.DefaultBean;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import java.time.Clock;
class ClockProducer {
@ -14,5 +13,4 @@ class ClockProducer {
Clock produceClock() {
return Clock.systemDefaultZone();
}
}

View file

@ -0,0 +1,19 @@
package ch.phoenix.oss.quarkus.commons.clock;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
public interface ClockService {
Instant instant();
long currentTimeMillis();
LocalDate localDate();
LocalDateTime localDateTime();
ZonedDateTime zonedDateTime();
}

View file

@ -1,10 +1,8 @@
package ch.phoenixtechnologies.quarkus.commons.clock;
package ch.phoenix.oss.quarkus.commons.clock;
import io.quarkus.arc.DefaultBean;
import jakarta.enterprise.context.ApplicationScoped;
import java.time.Clock;
import java.time.Instant;
import java.time.*;
@DefaultBean
@ApplicationScoped
@ -25,4 +23,19 @@ class ClockServiceImpl implements ClockService {
public long currentTimeMillis() {
return clock.millis();
}
@Override
public LocalDate localDate() {
return LocalDate.now(clock);
}
@Override
public LocalDateTime localDateTime() {
return LocalDateTime.now(clock);
}
@Override
public ZonedDateTime zonedDateTime() {
return ZonedDateTime.now(clock);
}
}

View file

@ -1,10 +0,0 @@
package ch.phoenixtechnologies.quarkus.commons.clock;
import java.time.Instant;
public interface ClockService {
Instant instant();
long currentTimeMillis();
}

View file

@ -1,13 +1,11 @@
package ch.phoenixtechnologies.quarkus.commons.clock;
package ch.phoenix.oss.quarkus.commons.clock;
import static org.assertj.core.api.Assertions.assertThat;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import java.time.Clock;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
@QuarkusTest
class ClockProducerTest {
@ -21,4 +19,4 @@ class ClockProducerTest {
.as("Produced clock's zone should match expected value")
.isEqualTo(Clock.systemDefaultZone().getZone());
}
}
}

View file

@ -0,0 +1,70 @@
package ch.phoenix.oss.quarkus.commons.clock;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import io.quarkus.test.InjectMock;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import java.time.*;
import org.junit.jupiter.api.Test;
@QuarkusTest
class ClockServiceImplTest {
@Inject
ClockService clockService;
@InjectMock
Clock clock;
@Test
void instant() {
var expected = Instant.ofEpochMilli(1729280640915L);
when(clock.instant()).thenReturn(expected);
assertThat(clockService.instant())
.as("Instant should match expected value")
.isEqualTo(expected);
}
@Test
void currentTimeMillis() {
var expected = 1729280640915L;
when(clock.millis()).thenReturn(expected);
assertThat(clockService.currentTimeMillis())
.as("Instant should match expected value")
.isEqualTo(expected);
}
@Test
void localDate() {
var instant = Instant.ofEpochMilli(1729280640915L);
when(clock.instant()).thenReturn(instant);
when(clock.getZone()).thenReturn(ZoneId.of("UTC"));
assertThat(clockService.localDate())
.as("LocalDate should match expected value")
.isEqualTo(LocalDate.parse("2024-10-18"));
}
@Test
void localDateTime() {
var instant = Instant.ofEpochMilli(1729280640915L);
when(clock.instant()).thenReturn(instant);
when(clock.getZone()).thenReturn(ZoneId.of("UTC"));
assertThat(clockService.localDateTime())
.as("LocalDateTime should match expected value")
.isEqualTo(LocalDateTime.parse("2024-10-18T19:44:00.915"));
}
@Test
void zonedDateTime() {
var instant = Instant.ofEpochMilli(1729280640915L);
when(clock.instant()).thenReturn(instant);
when(clock.getZone()).thenReturn(ZoneId.of("UTC"));
assertThat(clockService.zonedDateTime())
.as("ZonedDateTime should match expected value")
.isEqualTo(ZonedDateTime.parse("2024-10-18T19:44:00.915Z[UTC]"));
}
}

View file

@ -1,43 +0,0 @@
package ch.phoenixtechnologies.quarkus.commons.clock;
import io.quarkus.test.InjectMock;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectSpy;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import java.time.Clock;
import java.time.Instant;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
@QuarkusTest
class ClockServiceImplTest {
@Inject
ClockService clockService;
@InjectMock
Clock clock;
@Test
void instant() {
var expected = Instant.ofEpochMilli(1729280640915L);
when(clock.instant()).thenReturn(expected);
assertThat(clockService.instant())
.as("Instant should match expected value")
.isEqualTo(expected);
}
@Test
void currentTimeMillis() {
var expected = 1729280640915L;
when(clock.millis()).thenReturn(expected);
assertThat(clockService.currentTimeMillis())
.as("Instant should match expected value")
.isEqualTo(expected);
}
}

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenixtechnologies.quarkus</groupId>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-json-service</artifactId>
@ -42,7 +40,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.83</minimum>
<minimum>1</minimum>
</limit>
</limits>
</rule>

View file

@ -1,4 +1,4 @@
package ch.phoenixtechnologies.quarkus.commons.json;
package ch.phoenix.oss.quarkus.commons.json;
import com.fasterxml.jackson.core.type.TypeReference;
@ -9,5 +9,4 @@ public interface JsonService {
<T> T fromJson(String json, Class<T> clazz);
<T> T fromJson(String json, TypeReference<T> typeReference);
}

View file

@ -1,4 +1,4 @@
package ch.phoenixtechnologies.quarkus.commons.json;
package ch.phoenix.oss.quarkus.commons.json;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
@ -30,10 +30,9 @@ class JsonServiceImpl implements JsonService {
try {
return objectMapper.readValue(json, clazz);
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Unable to read object of class [" + clazz.getName()
+ "] from json String: " + json, e);
throw new IllegalArgumentException(
"Unable to read object of class [" + clazz.getName() + "] from json String: " + json, e);
}
}
@Override
@ -41,8 +40,10 @@ class JsonServiceImpl implements JsonService {
try {
return objectMapper.readValue(json, typeReference);
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Unable to read object of type [" + typeReference.getType().getTypeName()
+ "] from json String: " + json, e);
throw new IllegalArgumentException(
"Unable to read object of type [" + typeReference.getType().getTypeName() + "] from json String: "
+ json,
e);
}
}
}

View file

@ -1,23 +1,29 @@
package ch.phoenixtechnologies.quarkus.commons.json;
import com.fasterxml.jackson.core.type.TypeReference;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
package ch.phoenix.oss.quarkus.commons.json;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import com.fasterxml.jackson.core.type.TypeReference;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import java.util.List;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
@QuarkusTest
class JsonServiceImplTest {
public static final TypeReference<List<TestRecord>> TYPE_REFERENCE = new TypeReference<>() {
};
public static final TypeReference<List<TestRecord>> TYPE_REFERENCE = new TypeReference<>() {};
record TestRecord(String name, int age) {
record TestRecord(String name, int age) {}
static class CircularReference {
CircularReference reference;
@Override
public String toString() {
return "CircularReference";
}
}
@Inject
@ -29,9 +35,18 @@ class JsonServiceImplTest {
var actual = jsonService.toJson(new TestRecord("John Doe", 30));
assertThat(actual)
.as("Json should match expected value")
.isEqualTo(expected);
assertThat(actual).as("Json should match expected value").isEqualTo(expected);
}
@Test
void toJsonWithCircularReference() {
var circularReference = new CircularReference();
circularReference.reference = circularReference;
assertThatThrownBy(() -> jsonService.toJson(circularReference))
.as("Should throw IllegalArgumentException when input is invalid")
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Unable to write object as json String: CircularReference");
}
@Test
@ -41,9 +56,7 @@ class JsonServiceImplTest {
var actual = jsonService.fromJson(json, TestRecord.class);
assertThat(actual)
.as("Deserialized object should match expected value")
.isEqualTo(expected);
assertThat(actual).as("Deserialized object should match expected value").isEqualTo(expected);
}
@Test
@ -53,7 +66,8 @@ class JsonServiceImplTest {
assertThatThrownBy(() -> jsonService.fromJson(json, TestRecord.class))
.as("Should throw IllegalArgumentException when input is invalid")
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Unable to read object of class [ch.phoenixtechnologies.quarkus.commons.json.JsonServiceImplTest$TestRecord] from json String: {\"name\":\"John Doe\",\"age\":\"30\"");
.hasMessage(
"Unable to read object of class [ch.phoenix.oss.quarkus.commons.json.JsonServiceImplTest$TestRecord] from json String: {\"name\":\"John Doe\",\"age\":\"30\"");
}
@Test
@ -75,6 +89,7 @@ class JsonServiceImplTest {
assertThatThrownBy(() -> jsonService.fromJson(json, TYPE_REFERENCE))
.as("Should throw IllegalArgumentException when input is invalid")
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Unable to read object of type [java.util.List<ch.phoenixtechnologies.quarkus.commons.json.JsonServiceImplTest$TestRecord>] from json String: {\"name\":\"John Doe\",\"age\":30},{\"name\":\"Jane Doe\",\"age\":\"25\"}");
.hasMessage(
"Unable to read object of type [java.util.List<ch.phoenix.oss.quarkus.commons.json.JsonServiceImplTest$TestRecord>] from json String: {\"name\":\"John Doe\",\"age\":30},{\"name\":\"Jane Doe\",\"age\":\"25\"}");
}
}
}

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenixtechnologies.quarkus</groupId>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-message-digest-service</artifactId>

View file

@ -1,4 +1,4 @@
package ch.phoenixtechnologies.quarkus.commons.digest;
package ch.phoenix.oss.quarkus.commons.digest;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
@ -8,5 +8,4 @@ public interface MessageDigestConfiguration {
@WithDefault("SHA-256")
String defaultAlgorithm();
}

View file

@ -1,4 +1,4 @@
package ch.phoenixtechnologies.quarkus.commons.digest;
package ch.phoenix.oss.quarkus.commons.digest;
import java.nio.charset.Charset;
import java.security.MessageDigest;

View file

@ -1,8 +1,7 @@
package ch.phoenixtechnologies.quarkus.commons.digest;
package ch.phoenix.oss.quarkus.commons.digest;
import io.quarkus.arc.DefaultBean;
import jakarta.enterprise.context.ApplicationScoped;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;

View file

@ -1,37 +1,37 @@
package ch.phoenixtechnologies.quarkus.commons.digest;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
package ch.phoenix.oss.quarkus.commons.digest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@QuarkusTest
class MessageDigestServiceImplTest {
public static final String INPUT = "test";
public static final byte[] EXPECTED_SHA256_DIGEST = {-97, -122, -48, -127, -120, 76, 125, 101, -102, 47, -22, -96, -59, 90, -48, 21, -93, -65, 79, 27, 43, 11, -126, 44, -47, 93, 108, 21, -80, -16, 10, 8};
public static final byte[] EXPECTED_SHA256_DIGEST = {
-97, -122, -48, -127, -120, 76, 125, 101, -102, 47, -22, -96, -59, 90, -48, 21, -93, -65, 79, 27, 43, 11, -126,
44, -47, 93, 108, 21, -80, -16, 10, 8
};
@Inject
MessageDigestServiceImpl service;
@Test
void getInstance() {
assertThat(service.getInstance())
.isInstanceOf(MessageDigest.class);
assertThat(service.getInstance()).isInstanceOf(MessageDigest.class);
}
@ParameterizedTest
@ValueSource(strings = {"SHA-256", "SHA-512", "MD5"})
void getInstanceWithAlgorithm(String algorithm) {
assertThat(service.getInstance(algorithm))
.isInstanceOf(MessageDigest.class);
assertThat(service.getInstance(algorithm)).isInstanceOf(MessageDigest.class);
}
@ParameterizedTest
@ -61,7 +61,6 @@ class MessageDigestServiceImplTest {
assertThat(service.digest(INPUT, StandardCharsets.UTF_8))
.as("Digest should match expected value")
.isEqualTo(EXPECTED_SHA256_DIGEST);
}
@Test
@ -78,4 +77,4 @@ class MessageDigestServiceImplTest {
.as("Digest should match expected value")
.isEqualTo(EXPECTED_SHA256_DIGEST);
}
}
}

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenixtechnologies.quarkus</groupId>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-random-number-generator</artifactId>

View file

@ -1,4 +1,4 @@
package ch.phoenixtechnologies.quarkus.commons.random;
package ch.phoenix.oss.quarkus.commons.random;
import java.math.BigInteger;
import java.util.Random;

View file

@ -1,8 +1,7 @@
package ch.phoenixtechnologies.quarkus.commons.random;
package ch.phoenix.oss.quarkus.commons.random;
import io.quarkus.arc.DefaultBean;
import jakarta.enterprise.context.ApplicationScoped;
import java.math.BigInteger;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package ch.phoenixtechnologies.quarkus.commons.random;
package ch.phoenix.oss.quarkus.commons.random;
import java.util.Random;

View file

@ -1,8 +1,7 @@
package ch.phoenixtechnologies.quarkus.commons.random;
package ch.phoenix.oss.quarkus.commons.random;
import io.quarkus.arc.DefaultBean;
import jakarta.enterprise.context.ApplicationScoped;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Random;
@ -19,6 +18,4 @@ class RandomProviderImpl implements RandomProvider {
throw new IllegalStateException("Unable to obtain strong SecureRandom instance", e);
}
}
}

View file

@ -1,15 +1,14 @@
package ch.phoenixtechnologies.quarkus.commons.random;
package ch.phoenix.oss.quarkus.commons.random;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectSpy;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import java.math.BigInteger;
import java.util.Random;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import org.junit.jupiter.api.Test;
@QuarkusTest
class RandomNumberGeneratorImplTest {
@ -26,9 +25,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateInt();
assertThat(actual)
.as("Generated int should match expected value")
.isEqualTo(-1305521323);
assertThat(actual).as("Generated int should match expected value").isEqualTo(-1305521323);
}
@Test
@ -37,9 +34,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateInt(40);
assertThat(actual)
.as("Generated int should match expected value")
.isEqualTo(26);
assertThat(actual).as("Generated int should match expected value").isEqualTo(26);
}
@Test
@ -48,21 +43,16 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateInt(1, 40);
assertThat(actual)
.as("Generated int should match expected value")
.isEqualTo(17);
assertThat(actual).as("Generated int should match expected value").isEqualTo(17);
}
@Test
void generateLong() {
when(provider.get()).thenReturn(getRandom());
var actual = generator.generateLong();
assertThat(actual)
.as("Generated long should match expected value")
.isEqualTo(-5607171386684657918L);
assertThat(actual).as("Generated long should match expected value").isEqualTo(-5607171386684657918L);
}
@Test
@ -71,9 +61,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateLong(40L);
assertThat(actual)
.as("Generated long should match expected value")
.isEqualTo(9L);
assertThat(actual).as("Generated long should match expected value").isEqualTo(9L);
}
@Test
@ -82,9 +70,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateLong(1L, 40L);
assertThat(actual)
.as("Generated long should match expected value")
.isEqualTo(23L);
assertThat(actual).as("Generated long should match expected value").isEqualTo(23L);
}
@Test
@ -93,9 +79,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateFloat();
assertThat(actual)
.as("Generated float should match expected value")
.isEqualTo(0.6960346f);
assertThat(actual).as("Generated float should match expected value").isEqualTo(0.6960346f);
}
@Test
@ -104,9 +88,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateFloat(0.99f);
assertThat(actual)
.as("Generated float should match expected value")
.isEqualTo(0.6890743f);
assertThat(actual).as("Generated float should match expected value").isEqualTo(0.6890743f);
}
@Test
@ -115,9 +97,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateFloat(0.01f, 0.99f);
assertThat(actual)
.as("Generated float should match expected value")
.isEqualTo(0.69211394f);
assertThat(actual).as("Generated float should match expected value").isEqualTo(0.69211394f);
}
@Test
@ -126,9 +106,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateDouble();
assertThat(actual)
.as("Generated double should match expected value")
.isEqualTo(0.6960346394874213d);
assertThat(actual).as("Generated double should match expected value").isEqualTo(0.6960346394874213d);
}
@Test
@ -137,9 +115,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateDouble(0.99d);
assertThat(actual)
.as("Generated double should match expected value")
.isEqualTo(0.6890742930925471d);
assertThat(actual).as("Generated double should match expected value").isEqualTo(0.6890742930925471d);
}
@Test
@ -148,9 +124,7 @@ class RandomNumberGeneratorImplTest {
var actual = generator.generateDouble(0.01d, 0.99d);
assertThat(actual)
.as("Generated double should match expected value")
.isEqualTo(0.6921139466976729d);
assertThat(actual).as("Generated double should match expected value").isEqualTo(0.6921139466976729d);
}
@Test
@ -176,5 +150,4 @@ class RandomNumberGeneratorImplTest {
private static Random getRandom() {
return new Random(24353L);
}
}
}

View file

@ -1,16 +1,15 @@
package ch.phoenixtechnologies.quarkus.commons.random;
package ch.phoenix.oss.quarkus.commons.random;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.SecureRandom;
import java.security.Security;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.junit.jupiter.api.Test;
@QuarkusTest
@SuppressWarnings("removal")
@ -47,16 +46,13 @@ class RandomProviderImplTest {
private static String getSecurityProperty() {
return AccessController.doPrivileged(
(PrivilegedAction<String>) () -> Security.getProperty(
SECURE_RANDOM_STRONG_ALGORITHMS));
(PrivilegedAction<String>) () -> Security.getProperty(SECURE_RANDOM_STRONG_ALGORITHMS));
}
private static void setSecurityProperty(String datum) {
AccessController.doPrivileged(
(PrivilegedAction<Void>) () -> {
Security.setProperty(
SECURE_RANDOM_STRONG_ALGORITHMS, datum);
return (Void) null;
});
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
Security.setProperty(SECURE_RANDOM_STRONG_ALGORITHMS, datum);
return (Void) null;
});
}
}
}

View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-tracing-service</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-security</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-elytron-security-properties-file</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-config-yaml</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-plugin.version}</version>
<executions>
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<phase>test</phase>
<configuration>
<dataFile>${project.build.directory}/jacoco-quarkus.exec</dataFile>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.95</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,10 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import org.eclipse.microprofile.config.spi.Converter;
public class LowerCaseStringConverter implements Converter<String> {
@Override
public String convert(String value) throws IllegalArgumentException, NullPointerException {
return value.toLowerCase();
}
}

View file

@ -0,0 +1,58 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithConverter;
import io.smallrye.config.WithDefault;
import jakarta.ws.rs.core.HttpHeaders;
import java.util.Optional;
import java.util.Set;
@ConfigMapping(prefix = "phoenix.commons.tracing")
public interface TracingConfiguration {
RequestFilterConfiguration requestFilter();
interface RequestFilterConfiguration {
Headers headers();
interface Headers {
Set<String> DEFAULT_REDACTED = Set.of(HttpHeaders.AUTHORIZATION.toLowerCase());
/**
* Optional set of headers to redact when tracing. By default, redacts
* the 'Authorization' header.
*
* @return the set of headers to be redacted
*/
Optional<Set<@WithConverter(LowerCaseStringConverter.class) String>> redact();
}
Path path();
interface Path {
@WithDefault("false")
boolean includeRaw();
}
Query query();
interface Query {
Set<String> DEFAULT_REDACTED = Set.of("access_token", "refresh_token", "apikey");
@WithDefault("false")
boolean includeRaw();
/**
* Optional set of query params to redact when tracing. By default, redacts
* the following params: 'access_token', 'refresh_token' and 'apikey'.
*
* @return the set of query params to be redacted
*/
Optional<Set<@WithConverter(LowerCaseStringConverter.class) String>> redact();
}
}
}

View file

@ -0,0 +1,18 @@
package ch.phoenix.oss.quarkus.commons.tracing;
public class TracingConstants {
public static final String ACTOR = "actor";
public static final String ANONYMOUS = "anonymous";
public static final String REQUEST_ROUTE = "request.route";
public static final String REQUEST_METHOD = "request.method";
public static final String REQUEST_PATH_RAW = "request.path.raw";
public static final String REQUEST_PATH_PARAMS = "request.path.params";
public static final String REQUEST_QUERY_RAW = "request.query.raw";
public static final String REQUEST_QUERY_PARAMS = "request.query.params";
public static final String REQUEST_HEADERS = "request.headers";
public static final String REQUEST_CLIENT_IP = "request.client.ip";
public static final String SCHEDULER_JOB_NAME = "scheduler.job.name";
private TracingConstants() {}
}

View file

@ -0,0 +1,151 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import io.quarkus.arc.Unremovable;
import io.quarkus.logging.Log;
import io.quarkus.security.identity.SecurityIdentity;
import io.vertx.ext.web.RoutingContext;
import jakarta.inject.Inject;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ResourceInfo;
import java.util.List;
import org.jboss.resteasy.reactive.server.ServerRequestFilter;
@Unremovable
public class TracingRequestFilter {
private static final String REDACTED_VALUE = "********";
private final RoutingContext routingContext;
private final TracingService tracingService;
private final SecurityIdentity securityIdentity;
private final TracingConfiguration configuration;
@Inject
public TracingRequestFilter(
RoutingContext routingContext,
TracingService tracingService,
SecurityIdentity securityIdentity,
TracingConfiguration configuration) {
this.routingContext = routingContext;
this.tracingService = tracingService;
this.securityIdentity = securityIdentity;
this.configuration = configuration;
}
@ServerRequestFilter
public void filter(ContainerRequestContext requestContext, ResourceInfo resourceInfo) {
if (securityIdentity.isAnonymous()) {
tracingService.trace(TracingConstants.ACTOR, TracingConstants.ANONYMOUS);
} else {
tracingService.trace(
TracingConstants.ACTOR, securityIdentity.getPrincipal().getName());
}
var method = requestContext.getMethod();
tracingService.trace(TracingConstants.REQUEST_METHOD, method);
var routePattern = getRoutePattern(resourceInfo);
tracingService.trace(TracingConstants.REQUEST_ROUTE, routePattern);
var uriInfo = requestContext.getUriInfo();
uriInfo.getPathParameters()
.forEach((key, value) ->
tracingService.trace(TracingConstants.REQUEST_PATH_PARAMS + '.' + key, joinStrings(value)));
if (configuration.requestFilter().path().includeRaw()) {
tracingService.trace(
TracingConstants.REQUEST_PATH_RAW, uriInfo.getAbsolutePath().getRawPath());
}
var redactedHeaders = configuration
.requestFilter()
.headers()
.redact()
.orElse(TracingConfiguration.RequestFilterConfiguration.Headers.DEFAULT_REDACTED);
requestContext.getHeaders().forEach((key, value) -> {
var lowerCaseKey = key.toLowerCase();
var property = TracingConstants.REQUEST_HEADERS + '.' + lowerCaseKey;
if (redactedHeaders.contains(lowerCaseKey)) {
tracingService.trace(property, REDACTED_VALUE);
} else {
tracingService.trace(property, joinStrings(value));
}
});
var redactedQueryParams = configuration
.requestFilter()
.query()
.redact()
.orElse(TracingConfiguration.RequestFilterConfiguration.Query.DEFAULT_REDACTED);
uriInfo.getQueryParameters().forEach((key, value) -> {
var lowerCaseKey = key.toLowerCase();
var property = TracingConstants.REQUEST_QUERY_PARAMS + '.' + lowerCaseKey;
if (redactedQueryParams.contains(lowerCaseKey)) {
tracingService.trace(property, REDACTED_VALUE);
} else {
tracingService.trace(property, joinStrings(value));
}
});
if (configuration.requestFilter().query().includeRaw()) {
var rawQuery = uriInfo.getRequestUri().getRawQuery();
if (rawQuery != null && !rawQuery.isBlank()) {
tracingService.trace(TracingConstants.REQUEST_QUERY_RAW, rawQuery);
}
}
tracingService.trace(
TracingConstants.REQUEST_CLIENT_IP,
routingContext.request().connection().remoteAddress(true).hostAddress());
Log.debugf("Incoming request: %s %s", method, uriInfo.getAbsolutePath().getRawPath());
}
private static String joinStrings(List<String> value) {
return String.join(", ", value);
}
private String getRoutePattern(ResourceInfo resourceInfo) {
String classPath = getPathValue(resourceInfo.getResourceClass().getAnnotation(Path.class));
String methodPath = getPathValue(resourceInfo.getResourceMethod().getAnnotation(Path.class));
if (!classPath.isEmpty()) {
if (methodPath.isEmpty()) {
return "/" + classPath;
} else {
return "/" + classPath + "/" + methodPath;
}
} else {
if (methodPath.isEmpty()) {
return "/";
} else {
return "/" + methodPath;
}
}
}
private static String getPathValue(Path path) {
if (path == null) {
return "";
}
return trimSlashes(path.value());
}
private static String trimSlashes(String segment) {
if (segment.isEmpty() || "/".equals(segment)) {
return "";
}
// Assuming that it's not possible for a segment to contain //,
// thus it's possible to avoid extra ifs and whiles, as well
// as the use of regexes
int start = (segment.charAt(0) == '/') ? 1 : 0;
int end = (segment.charAt(segment.length() - 1) == '/') ? segment.length() - 1 : segment.length();
return segment.substring(start, end);
}
}

View file

@ -0,0 +1,24 @@
package ch.phoenix.oss.quarkus.commons.tracing;
public interface TracingService {
void clearAll();
void trace(String key, Object value);
String getActor();
String getRequestPathRaw();
String getRequestMethod();
String getRequestId();
String getTraceId();
String getSpanId();
String getClientIp();
String getSchedulerJob();
}

View file

@ -0,0 +1,69 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import io.opentelemetry.api.trace.Span;
import io.quarkus.arc.DefaultBean;
import io.quarkus.logging.Log;
import jakarta.enterprise.context.ApplicationScoped;
import org.jboss.logging.MDC;
@DefaultBean
@ApplicationScoped
class TracingServiceImpl implements TracingService {
private final Span span;
TracingServiceImpl(Span span) {
this.span = span;
}
@Override
public void clearAll() {
MDC.clear();
}
@Override
public void trace(final String key, final Object value) {
Log.tracef("tracing key=%s value=%s", key, value);
MDC.put(key, value);
}
@Override
public String getActor() {
return (String) MDC.get(TracingConstants.ACTOR);
}
@Override
public String getRequestPathRaw() {
return (String) MDC.get(TracingConstants.REQUEST_PATH_RAW);
}
@Override
public String getRequestMethod() {
return (String) MDC.get(TracingConstants.REQUEST_METHOD);
}
@Override
public String getRequestId() {
return (String) MDC.get(TracingConstants.REQUEST_HEADERS + ".x-request-id");
}
@Override
public String getTraceId() {
return span.getSpanContext().getTraceId();
}
@Override
public String getSpanId() {
return span.getSpanContext().getSpanId();
}
@Override
public String getClientIp() {
return (String) MDC.get(TracingConstants.REQUEST_CLIENT_IP);
}
@Override
public String getSchedulerJob() {
return (String) MDC.get(TracingConstants.SCHEDULER_JOB_NAME);
}
}

View file

@ -0,0 +1,44 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.startsWith;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectSpy;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;
@QuarkusTest
class ActorTest {
@InjectSpy
TracingService tracingService;
@Test
void getAuthenticated() {
var route = "/authenticated";
RestAssured.given()
.auth()
.basic("jon", "doe")
.accept(ContentType.TEXT)
.when()
.get(route)
.then()
.statusCode(200);
verify(tracingService).trace("actor", "jon");
verify(tracingService).trace("request.method", "GET");
verify(tracingService).trace("request.route", route);
verify(tracingService).trace("request.headers.accept", "text/plain");
verify(tracingService).trace("request.headers.accept-encoding", "gzip,deflate");
verify(tracingService).trace("request.headers.authorization", "********");
verify(tracingService).trace("request.headers.connection", "Keep-Alive");
verify(tracingService).trace(eq("request.headers.host"), startsWith("localhost:"));
verify(tracingService).trace(eq("request.headers.user-agent"), startsWith("Apache-HttpClient"));
verify(tracingService).trace("request.client.ip", "127.0.0.1");
verifyNoMoreInteractions(tracingService);
}
}

View file

@ -0,0 +1,54 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.startsWith;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectSpy;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;
@QuarkusTest
class QueryParamTest {
@InjectSpy
TracingService tracingService;
@Test
void traceQueryParams() {
var route = "/authenticated";
RestAssured.given()
.auth()
.basic("jon", "doe")
.accept(ContentType.TEXT)
.header("X-SOMETHING-ELSE", "whatever")
.queryParam("access_token", "api123")
.queryParam("refresh_token", "refresh123")
.queryParam("apikey", "apikey123")
.queryParam("grant_type", "authorization_code")
.when()
.get(route)
.then()
.statusCode(200);
verify(tracingService).trace("actor", "jon");
verify(tracingService).trace("request.method", "GET");
verify(tracingService).trace("request.route", route);
verify(tracingService).trace("request.headers.accept", "text/plain");
verify(tracingService).trace("request.headers.accept-encoding", "gzip,deflate");
verify(tracingService).trace("request.headers.authorization", "********");
verify(tracingService).trace("request.headers.connection", "Keep-Alive");
verify(tracingService).trace(eq("request.headers.host"), startsWith("localhost:"));
verify(tracingService).trace(eq("request.headers.user-agent"), startsWith("Apache-HttpClient"));
verify(tracingService).trace("request.headers.x-something-else", "whatever");
verify(tracingService).trace("request.query.params.access_token", "********");
verify(tracingService).trace("request.query.params.refresh_token", "********");
verify(tracingService).trace("request.query.params.apikey", "********");
verify(tracingService).trace("request.query.params.grant_type", "authorization_code");
verify(tracingService).trace("request.client.ip", "127.0.0.1");
verifyNoMoreInteractions(tracingService);
}
}

View file

@ -0,0 +1,46 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.startsWith;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import io.quarkus.test.junit.mockito.InjectSpy;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;
@QuarkusTest
@TestProfile(Test2Profile.class)
class RawPathTest {
@InjectSpy
TracingService tracingService;
@Test
void getWithRawPath() {
var route = "/no-leading-and-trailing/{param}/{param2}";
RestAssured.given()
.accept(ContentType.TEXT)
.when()
.get(route, 1, 2)
.then()
.statusCode(200);
verify(tracingService).trace("actor", "anonymous");
verify(tracingService).trace("request.method", "GET");
verify(tracingService).trace("request.route", route);
verify(tracingService).trace("request.path.params.param", "1");
verify(tracingService).trace("request.path.params.param2", "2");
verify(tracingService).trace("request.path.raw", "/no-leading-and-trailing/1/2");
verify(tracingService).trace("request.headers.accept", "text/plain");
verify(tracingService).trace("request.headers.accept-encoding", "gzip,deflate");
verify(tracingService).trace("request.headers.connection", "Keep-Alive");
verify(tracingService).trace(eq("request.headers.host"), startsWith("localhost:"));
verify(tracingService).trace(eq("request.headers.user-agent"), startsWith("Apache-HttpClient"));
verify(tracingService).trace("request.client.ip", "127.0.0.1");
verifyNoMoreInteractions(tracingService);
}
}

View file

@ -0,0 +1,61 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.startsWith;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import io.quarkus.test.junit.mockito.InjectSpy;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;
@QuarkusTest
@TestProfile(Test2Profile.class)
class RedactedTest {
@InjectSpy
TracingService tracingService;
@Test
void traceRedactedValues() {
var route = "/authenticated";
RestAssured.given()
.auth()
.basic("jon", "doe")
.accept(ContentType.TEXT)
.header("X-SOMETHING-ELSE", "whatever")
.queryParam("access_token", "api123")
.queryParam("refresh_token", "refresh123")
.queryParam("apikey", "apikey123")
.queryParam("grant_type", "authorization_code")
.when()
.get(route)
.then()
.statusCode(200);
verify(tracingService).trace("actor", "jon");
verify(tracingService).trace("request.method", "GET");
verify(tracingService).trace("request.route", route);
verify(tracingService).trace("request.path.raw", route);
verify(tracingService).trace("request.headers.accept", "text/plain");
verify(tracingService).trace("request.headers.accept-encoding", "gzip,deflate");
verify(tracingService).trace("request.headers.authorization", "********");
verify(tracingService).trace("request.headers.connection", "Keep-Alive");
verify(tracingService).trace(eq("request.headers.host"), startsWith("localhost:"));
verify(tracingService).trace(eq("request.headers.user-agent"), startsWith("Apache-HttpClient"));
verify(tracingService).trace("request.headers.x-something-else", "********");
verify(tracingService).trace("request.query.params.access_token", "********");
verify(tracingService).trace("request.query.params.refresh_token", "refresh123");
verify(tracingService).trace("request.query.params.apikey", "apikey123");
verify(tracingService).trace("request.query.params.grant_type", "authorization_code");
verify(tracingService)
.trace(
"request.query.raw",
"access_token=api123&refresh_token=refresh123&apikey=apikey123&grant_type=authorization_code");
verify(tracingService).trace("request.client.ip", "127.0.0.1");
verifyNoMoreInteractions(tracingService);
}
}

View file

@ -0,0 +1,87 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import static org.junit.jupiter.params.provider.Arguments.arguments;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.startsWith;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectSpy;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import java.util.Map;
import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@QuarkusTest
class RoutePatternTest {
@InjectSpy
TracingService tracingService;
static Stream<Arguments> get() {
return Stream.of(
arguments("/", Map.of()),
arguments("/leading-and-no-trailing", Map.of()),
arguments("/leading/{param}/{param2}", Map.of("param", "1", "param2", "2")),
arguments("/{param}/{param2}/trailing", Map.of("param", "1", "param2", "2")),
arguments("/leading-and-no-trailing/{param}", Map.of("param", "1")),
arguments("/leading-and-no-trailing/{param}/{param2}", Map.of("param", "1", "param2", "2")),
arguments("/leading-and-trailing", Map.of()),
arguments("/leading-and-trailing/{param}", Map.of("param", "1")),
arguments("/leading-and-trailing/{param}/{param2}", Map.of("param", "1", "param2", "2")),
arguments("/no-leading-and-no-trailing", Map.of()),
arguments("/no-leading-and-no-trailing/{param}", Map.of("param", "1")),
arguments("/no-leading-and-no-trailing/{param}/{param2}", Map.of("param", "1", "param2", "2")),
arguments("/no-leading-and-trailing", Map.of()),
arguments("/no-leading-and-trailing/{param}", Map.of("param", "1")),
arguments("/no-leading-and-trailing/{param}/{param2}", Map.of("param", "1", "param2", "2")));
}
@MethodSource
@ParameterizedTest
void get(String route, Map<String, String> pathParams) {
RestAssured.given()
.accept(ContentType.TEXT)
.when()
.get(route, pathParams)
.then()
.statusCode(200);
verify(tracingService).trace("actor", "anonymous");
verify(tracingService).trace("request.method", "GET");
verify(tracingService).trace("request.route", route);
pathParams.forEach((key, value) -> verify(tracingService).trace("request.path.params." + key, value));
verify(tracingService).trace("request.headers.accept", "text/plain");
verify(tracingService).trace("request.headers.accept-encoding", "gzip,deflate");
verify(tracingService).trace("request.headers.connection", "Keep-Alive");
verify(tracingService).trace(eq("request.headers.host"), startsWith("localhost:"));
verify(tracingService).trace(eq("request.headers.user-agent"), startsWith("Apache-HttpClient"));
verify(tracingService).trace("request.client.ip", "127.0.0.1");
verifyNoMoreInteractions(tracingService);
}
@Test
void postBlankResource() {
var route = "/";
RestAssured.given().accept(ContentType.TEXT).when().post(route).then().statusCode(200);
verify(tracingService).trace("actor", "anonymous");
verify(tracingService).trace("request.method", "POST");
verify(tracingService).trace("request.route", route);
verify(tracingService).trace("request.headers.accept", "text/plain");
verify(tracingService).trace("request.headers.accept-encoding", "gzip,deflate");
verify(tracingService).trace("request.headers.connection", "Keep-Alive");
verify(tracingService).trace("request.headers.content-length", "0");
verify(tracingService)
.trace("request.headers.content-type", "application/x-www-form-urlencoded; charset=ISO-8859-1");
verify(tracingService).trace(eq("request.headers.host"), startsWith("localhost:"));
verify(tracingService).trace(eq("request.headers.user-agent"), startsWith("Apache-HttpClient"));
verify(tracingService).trace("request.client.ip", "127.0.0.1");
verifyNoMoreInteractions(tracingService);
}
}

View file

@ -0,0 +1,11 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import io.quarkus.test.junit.QuarkusTestProfile;
public class Test2Profile implements QuarkusTestProfile {
@Override
public String getConfigProfile() {
return "test2";
}
}

View file

@ -0,0 +1,98 @@
package ch.phoenix.oss.quarkus.commons.tracing;
import static org.assertj.core.api.Assertions.assertThat;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.instrumentation.annotations.WithSpan;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import org.jboss.logging.MDC;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@QuarkusTest
class TracingServiceImplTest {
@Inject
TracingService tracingService;
@Inject
Span span;
@BeforeEach
void setUp() {
MDC.clear();
}
@Test
void getActor() {
tracingService.trace("actor", "abc");
assertThat(tracingService.getActor())
.as("Actor should match expected value")
.isEqualTo("abc");
}
@Test
void getRequestPathRaw() {
tracingService.trace("request.path.raw", "/foo/bar");
assertThat(tracingService.getRequestPathRaw())
.as("Request Path Raw should match expected value")
.isEqualTo("/foo/bar");
}
@Test
void getRequestMethod() {
tracingService.trace("request.method", "GET");
assertThat(tracingService.getRequestMethod())
.as("Request Method should match expected value")
.isEqualTo("GET");
}
@Test
void getRequestId() {
tracingService.trace("request.headers.x-request-id", "ba458367-bfeb-46ba-87da-50b9343be8f9");
assertThat(tracingService.getRequestId())
.as("Request Id should match expected value")
.isEqualTo("ba458367-bfeb-46ba-87da-50b9343be8f9");
}
@Test
@WithSpan
void getTraceId() {
assertThat(tracingService.getTraceId())
.as("Request Trace Id should match expected value")
.isEqualTo(span.getSpanContext().getTraceId());
}
@Test
@WithSpan
void getSpanId() {
assertThat(tracingService.getSpanId())
.as("Request Span Id should match expected value")
.isEqualTo(span.getSpanContext().getSpanId());
}
@Test
void getClientIp() {
tracingService.trace("request.client.ip", "127.0.0.1");
assertThat(tracingService.getClientIp())
.as("Request Client Iü should match expected value")
.isEqualTo("127.0.0.1");
}
@Test
void getSchedulerJob() {
tracingService.trace("scheduler.job.name", "scheduler/abc");
assertThat(tracingService.getSchedulerJob())
.as("Scheduler Job Name should match expected value")
.isEqualTo("scheduler/abc");
}
@Test
void clearAll() {
tracingService.trace("aaa", "bbb");
assertThat(MDC.get("aaa")).isEqualTo("bbb");
tracingService.clearAll();
assertThat(MDC.get("aaa")).isNull();
}
}

View file

@ -0,0 +1,15 @@
package ch.phoenix.oss.quarkus.commons.tracing.resource;
import io.quarkus.security.Authenticated;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
@Authenticated
@Path("authenticated")
public class AuthenticatedResource {
@GET
public String get() {
return "Hello user";
}
}

View file

@ -0,0 +1,25 @@
package ch.phoenix.oss.quarkus.commons.tracing.resource;
import jakarta.annotation.security.PermitAll;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("")
@Produces(MediaType.TEXT_PLAIN)
public class BlankResource {
@GET
@PermitAll
public String get() {
return "get";
}
@POST
@Path("")
public String post() {
return "post";
}
}

View file

@ -0,0 +1,29 @@
package ch.phoenix.oss.quarkus.commons.tracing.resource;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("/leading-and-no-trailing")
@Produces(MediaType.TEXT_PLAIN)
public class LeadingAndNoTrailingResource {
@GET
@Path("")
public String root() {
return "root";
}
@GET
@Path("/{param}")
public String singleParam(String param) {
return param;
}
@GET
@Path("/{param}/{param2}")
public String multiParam(String param, String param2) {
return param + "/" + param2;
}
}

View file

@ -0,0 +1,29 @@
package ch.phoenix.oss.quarkus.commons.tracing.resource;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("/leading-and-trailing/")
@Produces(MediaType.TEXT_PLAIN)
public class LeadingAndTrailingResource {
@GET
@Path("/")
public String root() {
return "root";
}
@GET
@Path("/{param}/")
public String singleParam(String param) {
return param;
}
@GET
@Path("/{param}/{param2}/")
public String multiParam(String param, String param2) {
return param + "/" + param2;
}
}

View file

@ -0,0 +1,29 @@
package ch.phoenix.oss.quarkus.commons.tracing.resource;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("no-leading-and-no-trailing")
@Produces(MediaType.TEXT_PLAIN)
public class NoLeadingAndNoTrailingResource {
@GET
@Path("")
public String root() {
return "root";
}
@GET
@Path("{param}")
public String singleParam(String param) {
return param;
}
@GET
@Path("{param}/{param2}")
public String multiParam(String param, String param2) {
return param + "/" + param2;
}
}

View file

@ -0,0 +1,29 @@
package ch.phoenix.oss.quarkus.commons.tracing.resource;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("no-leading-and-trailing/")
@Produces(MediaType.TEXT_PLAIN)
public class NoLeadingAndTrailingResource {
@GET
@Path("/")
public String root() {
return "root";
}
@GET
@Path("{param}/")
public String singleParam(String param) {
return param;
}
@GET
@Path("{param}/{param2}/")
public String multiParam(String param, String param2) {
return param + "/" + param2;
}
}

View file

@ -0,0 +1,23 @@
package ch.phoenix.oss.quarkus.commons.tracing.resource;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("/")
@Produces(MediaType.TEXT_PLAIN)
public class SlashResource {
@GET
@Path("/leading/{param}/{param2}")
public String doubleLeading(int param, int param2) {
return "leading/" + param + "/" + param2;
}
@GET
@Path("{param}/{param2}/trailing/")
public String doubleTrailing(int param, int param2) {
return param + "/" + param2 + "/trailing";
}
}

View file

@ -0,0 +1,39 @@
quarkus:
http:
test-port: 0
log:
category:
"org.apache.http.wire":
level: DEBUG # set to DEBUG when RestAssured logs are necessary to understand test failures
otel:
traces:
exporter: none
security:
users:
embedded:
enabled: true
plain-text: true
users:
jon: doe
"%test2":
quarkus:
log:
min-level: TRACE
category:
"ch.phoenix.oss.quarkus.commons.tracing":
level: TRACE
phoenix:
commons:
tracing:
request-filter:
path:
include-raw: true
headers:
redact:
- AUTHORIZATION
- X-SOMETHING-ELSE
query:
include-raw: true
redact:
- ACCESS_TOKEN

View file

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.phoenixtechnologies.quarkus</groupId>
<groupId>ch.phoenix.oss</groupId>
<artifactId>quarkus-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.9-SNAPSHOT</version>
</parent>
<artifactId>quarkus-uuid-generator</artifactId>

View file

@ -1,4 +1,4 @@
package ch.phoenixtechnologies.quarkus.commons.uuid;
package ch.phoenix.oss.quarkus.commons.uuid;
import java.util.Random;
import java.util.UUID;
@ -33,5 +33,4 @@ public interface UUIDGenerator {
default UUID generateV5WithX500Namespace(String name) {
return generateV5(NAMESPACE_X500, name);
}
}

View file

@ -1,9 +1,8 @@
package ch.phoenixtechnologies.quarkus.commons.uuid;
package ch.phoenix.oss.quarkus.commons.uuid;
import com.fasterxml.uuid.Generators;
import io.quarkus.arc.DefaultBean;
import jakarta.enterprise.context.ApplicationScoped;
import java.util.Random;
import java.util.UUID;
@ -30,5 +29,4 @@ class UUIDGeneratorImpl implements UUIDGenerator {
public UUID generateV5(UUID namespace, String name) {
return Generators.nameBasedGenerator(namespace).generate(name);
}
}

View file

@ -1,19 +1,17 @@
package ch.phoenixtechnologies.quarkus.commons.uuid;
package ch.phoenix.oss.quarkus.commons.uuid;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import ch.phoenixtechnologies.quarkus.commons.uuid.UUIDGeneratorImpl;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import java.util.Random;
import java.util.UUID;
import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.Random;
import java.util.UUID;
import java.util.stream.Stream;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
@QuarkusTest
class UUIDGeneratorImplTest {
@ -44,9 +42,7 @@ class UUIDGeneratorImplTest {
var actual = generator.generateV4(getRandom());
assertThat(actual)
.as("Generated UUID should match expected value")
.isEqualTo(expected);
assertThat(actual).as("Generated UUID should match expected value").isEqualTo(expected);
}
@Test
@ -55,9 +51,7 @@ class UUIDGeneratorImplTest {
var actual = generator.generateV5("test");
assertThat(actual)
.as("Generated UUID should match expected value")
.isEqualTo(expected);
assertThat(actual).as("Generated UUID should match expected value").isEqualTo(expected);
}
public static Stream<Arguments> generateV5WithNamespace() {
@ -65,8 +59,7 @@ class UUIDGeneratorImplTest {
Arguments.of(NAMESPACE_DNS, V5_NAME, EXPECTED_V5_DNS),
Arguments.of(NAMESPACE_URL, V5_NAME, EXPECTED_V5_URL),
Arguments.of(NAMESPACE_OID, V5_NAME, EXPECTED_V5_OID),
Arguments.of(NAMESPACE_X500, V5_NAME, EXPECTED_V5_X500)
);
Arguments.of(NAMESPACE_X500, V5_NAME, EXPECTED_V5_X500));
}
@MethodSource
@ -74,27 +67,21 @@ class UUIDGeneratorImplTest {
void generateV5WithNamespace(UUID namespace, String name, UUID expected) {
var actual = generator.generateV5(namespace, name);
assertThat(actual)
.as("Generated UUID should match expected value")
.isEqualTo(expected);
assertThat(actual).as("Generated UUID should match expected value").isEqualTo(expected);
}
@Test
void generateV5WithDNSNamespace() {
var actual = generator.generateV5WithDNSNamespace(V5_NAME);
assertThat(actual)
.as("Generated UUID should match expected value")
.isEqualTo(EXPECTED_V5_DNS);
assertThat(actual).as("Generated UUID should match expected value").isEqualTo(EXPECTED_V5_DNS);
}
@Test
void generateV5WithURLNamespace() {
var actual = generator.generateV5WithURLNamespace(V5_NAME);
assertThat(actual)
.as("Generated UUID should match expected value")
.isEqualTo(EXPECTED_V5_URL);
assertThat(actual).as("Generated UUID should match expected value").isEqualTo(EXPECTED_V5_URL);
}
@Test
@ -114,5 +101,4 @@ class UUIDGeneratorImplTest {
private static Random getRandom() {
return new Random(24353L);
}
}
}