Compare commits

...

58 Commits

Author SHA1 Message Date
yhampe
dc6b685079 Merge remote-tracking branch 'origin/feature/RED-9472' into feature/RED-9472
# Conflicts:
#	persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/roles/ApplicationRoles.java
2024-12-18 11:21:38 +01:00
yhampe
47727a4b35 RED-9472
working on bug with redaction service response
2024-12-18 11:21:14 +01:00
yhampe
2081588075 RED-9472
fixing 500 bug when calling upload endpoint
2024-12-18 11:21:12 +01:00
yhampe
aad7d15ee1 RED-9472:
solving merge conflicts
2024-12-18 11:20:46 +01:00
yhampe
f3fab58e89 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:20:31 +01:00
yhampe
3623a11584 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:20:28 +01:00
yhampe
d80380f997 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:20:25 +01:00
yhampe
ef5f2d32a0 RED-9472:
solving merge conflicts
2024-12-18 11:20:20 +01:00
yhampe
f17e471617 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:20:20 +01:00
yhampe
570ca42058 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:20:20 +01:00
yhampe
daa4ef0a0f RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:20:18 +01:00
yhampe
1a7421a225 RED-9472
fixing 500 bug when calling upload endpoint
2024-12-18 11:19:49 +01:00
yhampe
d406b0a207 RED-9393 user stats controller
added authority check
2024-12-18 11:19:49 +01:00
yhampe
6c2d357dca RED-9472:
solving merge conflicts
2024-12-18 11:19:49 +01:00
yhampe
92f8dcd961 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:19:49 +01:00
yhampe
8c8eae14da RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:19:49 +01:00
yhampe
1b6d67dba7 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:19:49 +01:00
yhampe
9f62910ce1 RED-9472:
solving merge conflicts
2024-12-18 11:19:49 +01:00
yhampe
2694441964 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:19:49 +01:00
yhampe
deab1b238e RED-9472:
solving merge conflicts
2024-12-18 11:19:49 +01:00
yhampe
bea2d0662e RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:19:49 +01:00
yhampe
53ae0b0648 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-18 11:19:48 +01:00
yhampe
e1d592516f RED-9472
working on bug with redaction service response
2024-12-18 10:09:55 +01:00
yhampe
3c2326e3f5 RED-9472
fixing 500 bug when calling upload endpoint
2024-12-13 13:16:48 +01:00
yhampe
dbf85761bd RED-9472
fixing 500 bug when calling upload endpoint
2024-12-13 09:55:45 +01:00
yhampe
cf9ca768c0 Merge remote-tracking branch 'origin/feature/RED-9472' into feature/RED-9472
# Conflicts:
#	persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/roles/ApplicationRoles.java
2024-12-13 09:54:37 +01:00
yhampe
577158ea5d RED-9472
fixing 500 bug when calling upload endpoint
2024-12-13 09:52:36 +01:00
yhampe
b5dbf360a3 RED-9393 user stats controller
added authority check
2024-12-13 09:52:28 +01:00
yhampe
3abd9909c6 RED-9472:
solving merge conflicts
2024-12-13 09:52:28 +01:00
yhampe
3484644ea6 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-13 09:52:17 +01:00
yhampe
179d688897 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-13 09:52:04 +01:00
yhampe
269ff270d7 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-13 09:52:01 +01:00
yhampe
09cba5eff2 RED-9472:
solving merge conflicts
2024-12-13 09:51:29 +01:00
yhampe
49e780da02 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-13 09:51:29 +01:00
yhampe
4f7cfe0b95 RED-9472:
solving merge conflicts
2024-12-13 09:51:29 +01:00
yhampe
cd8d7f97ae RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-13 09:51:29 +01:00
yhampe
2c6fd33d40 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-12-13 09:51:24 +01:00
yhampe
5b1a3bf56a RED-9472
fixing 500 bug when calling upload endpoint
2024-12-12 08:43:46 +01:00
yhampe
83b163a93b RED-9472
adjusted permissions/action roles
2024-12-04 09:05:37 +01:00
yhampe
0e6455da10 RED-9472
adjusted permissions/action roles
2024-12-03 10:29:46 +01:00
yhampe
650a325450 RED-9393 user stats controller
added authority check
2024-11-25 09:31:36 +01:00
yhampe
daf393d003 Merge remote-tracking branch 'origin/feature/RED-9472' into feature/RED-9472 2024-11-25 09:25:48 +01:00
Yannik Hampe
730ac8653d Update com.iqser.red.service.java-conventions.gradle.kts 2024-11-22 10:24:39 +01:00
Yannik Hampe
b3c4e670a8 Merge branch 'master' into 'feature/RED-9472'
# Conflicts:
#   buildSrc/src/main/kotlin/com.iqser.red.service.java-conventions.gradle.kts
2024-11-22 10:12:38 +01:00
yhampe
d26a0189fe RED-9472:
solving merge conflicts
2024-11-22 10:11:46 +01:00
yhampe
11b799f8f4 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-11-22 10:11:12 +01:00
yhampe
a02e48c17a RED-9472:
solving merge conflicts
2024-11-22 10:10:42 +01:00
yhampe
1991cfb8e5 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-11-22 10:10:42 +01:00
yhampe
7153681eb6 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-11-22 10:10:37 +01:00
yhampe
d8274d8dd7 Merge remote-tracking branch 'origin/feature/RED-9472' into feature/RED-9472
# Conflicts:
#	persistence-service-v1/persistence-service-external-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/external/resource/RulesResource.java
2024-11-19 08:28:35 +01:00
yhampe
482cad2a46 RED-9472:
solving merge conflicts
2024-11-19 08:28:05 +01:00
yhampe
f31d9170f8 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-11-19 08:28:02 +01:00
yhampe
e5dd3e7abc RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-11-19 08:26:02 +01:00
yhampe
65d72a60ac RED-9472:
solving merge conflicts
2024-11-18 11:05:31 +01:00
yhampe
94f288fc0f RED-9472:
solving merge conflicts
2024-11-18 09:45:26 +01:00
yhampe
7e8e081553 Merge remote-tracking branch 'origin/feature/RED-9472' into feature/RED-9472
# Conflicts:
#	buildSrc/src/main/kotlin/com.iqser.red.service.java-conventions.gradle.kts
#	persistence-service-v1/persistence-service-external-api-impl-v1/src/main/java/com/iqser/red/persistence/service/v1/external/api/impl/controller/RulesController.java
#	persistence-service-v1/persistence-service-external-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/external/resource/RulesResource.java
#	persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/FileTest.java
#	persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/utils/AbstractPersistenceServerServiceTest.java
2024-11-18 09:38:11 +01:00
yhampe
d2380d47b2 RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-11-18 09:37:00 +01:00
yhampe
0c1670461b RED-9472: seperation of system rules
now calling respected endpoints in rules controller

RED-9472: seperation of system rules

now calling respected endpoints in rules controller

RED-9472: seperation of system rules

removed rulesbuilder to fix failing pipeline and break circular dependency

RED-9472: seperation of system rules

added removal of system rules on download

added partial merge of user updated rules on upload

RED-9472: seperation of system rules

upgdatet redaction version

RED-9472: seperation of system rules

added endpoints for full rule files (including system rules)

added roles

RED-9472: seperation of system rules

changed path of full file paths

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests by mocking rulebuilder service

RED-9472: seperation of system rules

fixed failing tests

added validatioresponse to rulesresponse

RED-9472: seperation of system rules

added a new model for rule upload

RED-9472: seperation of system rules
disabled tests for getting tag

RED-9472: seperation of system rules

RED-9472: seperation of system rules

changed tests for new response of rulebuilderclient
2024-10-23 09:20:21 +02:00
23 changed files with 317 additions and 101 deletions

View File

@ -6,7 +6,7 @@ plugins {
jacoco
}
val redactionServiceVersion by rootProject.extra { "4.290.0" }
val redactionServiceVersion by rootProject.extra { "4.436.0-RED9472.9" }
val pdftronRedactionServiceVersion by rootProject.extra { "4.90.0-RED10115.0" }
val redactionReportServiceVersion by rootProject.extra { "4.81.0" }
val searchServiceVersion by rootProject.extra { "2.90.0" }

View File

@ -1,7 +1,9 @@
package com.iqser.red.persistence.service.v1.external.api.impl.controller;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.READ_RULES;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.READ_SYSTEM_RULES;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.WRITE_RULES;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.WRITE_SYSTEM_RULES;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionservice.RuleBuilderClient;
import com.iqser.red.service.persistence.management.v1.processor.exception.BadRequestException;
import com.iqser.red.service.persistence.management.v1.processor.exception.FileUploadException;
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
@ -35,8 +38,11 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.RuleFileTyp
import com.iqser.red.service.persistence.service.v1.api.shared.model.audit.AuditRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.DroolsValidationResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUpdateRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUploadRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUploadRequestModel;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUploadResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.SystemRulesSeperationRequest;
import com.knecon.fforesight.keycloakcommons.security.KeycloakSecurity;
import feign.FeignException;
@ -50,6 +56,7 @@ public class RulesController implements RulesResource {
private static final String DOWNLOAD_FILE_NAME = "rules.drl";
private final RuleBuilderClient ruleBuilderClient;
private final RulesPersistenceService rulesPersistenceService;
private final RulesValidationService rulesValidationService;
private final AuditPersistenceService auditPersistenceService;
@ -62,21 +69,38 @@ public class RulesController implements RulesResource {
RulesUploadRequest rulesUploadRequest = RulesUploadRequest.fromModel(rules);
DroolsValidationResponse droolsValidationResponse = new DroolsValidationResponse();
String mergedRulesString = "";
try {
var droolsValidation = rulesValidationService.validateRules(rulesUploadRequest.getRuleFileType(), rulesUploadRequest.getRules());
droolsValidationResponse = RulesValidationMapper.createFromDroolsValidation(droolsValidation);
if (!droolsValidation.isCompiled()) {
var ruleEntityOptional = rulesPersistenceService.getRules(rulesUploadRequest.getDossierTemplateId(), rulesUploadRequest.getRuleFileType());
if (ruleEntityOptional.isPresent()) {
RulesUpdateRequest rulesUpdateRequest = new RulesUpdateRequest(ruleEntityOptional.get().getValue(), rules.getRules());
try {
ResponseEntity<RulesUploadResponse> mergedRules = ruleBuilderClient.mergeUserUpdateRules(rulesUpdateRequest);
return new ResponseEntity<>(droolsValidationResponse, !rules.isDryRun() ? HttpStatus.UNPROCESSABLE_ENTITY : HttpStatus.OK);
}
} catch (FeignException e) {
if (e.status() == HttpStatus.BAD_REQUEST.value()) {
throw new BadRequestException("The provided rule string is not a valid drools rule file!");
log.info("response: " + mergedRules);
if (mergedRules == null || mergedRules.getBody() == null) {
throw new BadRequestException("Failed to merge rules - received null response from service");
}
if (mergedRules.getStatusCode().equals(HttpStatus.UNPROCESSABLE_ENTITY)) {
DroolsValidationResponse mergedRulesValidationResponse = mergedRules.getBody().getDroolsValidationResponse();
return new ResponseEntity<>(mergedRulesValidationResponse, !rules.isDryRun() ? HttpStatus.UNPROCESSABLE_ENTITY : HttpStatus.OK);
}
mergedRulesString = mergedRules.getBody().getRules();
if (mergedRulesString == null) {
throw new BadRequestException("Failed to merge rules - merged result is null");
}
} catch (FeignException e) {
if (e.status() == HttpStatus.BAD_REQUEST.value()) {
throw new BadRequestException("The provided rule file is not a valid drools rule file!");
}
throw new BadRequestException("Failed to merge rules: " + e.getMessage());
}
}
if (!rules.isDryRun()) {
rulesPersistenceService.setRules(rulesUploadRequest.getRules(), rulesUploadRequest.getDossierTemplateId(), rulesUploadRequest.getRuleFileType());
rulesPersistenceService.setRules(mergedRulesString, rulesUploadRequest.getDossierTemplateId(), rulesUploadRequest.getRuleFileType());
fileStatusPersistenceService.resetErrorCounter(rules.getDossierTemplateId());
}
@ -99,6 +123,47 @@ public class RulesController implements RulesResource {
}
@Override
@PreAuthorize("hasAuthority('" + WRITE_SYSTEM_RULES + "')")
public ResponseEntity<DroolsValidationResponse> uploadFullFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
@PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType,
@RequestParam(value = DRY_RUN_PARAMETER) boolean dryRun,
@RequestPart(name = "file") MultipartFile file) {
try {
String rules = new String(file.getBytes(), StandardCharsets.UTF_8);
DroolsValidationResponse droolsValidationResponse = new DroolsValidationResponse();
try {
var droolsValidation = rulesValidationService.validateRules(ruleFileType, rules);
droolsValidationResponse = RulesValidationMapper.createFromDroolsValidation(droolsValidation);
if (!droolsValidation.isCompiled()) {
return new ResponseEntity<>(droolsValidationResponse, !dryRun ? HttpStatus.UNPROCESSABLE_ENTITY : HttpStatus.OK);
}
} catch (FeignException e) {
if (e.status() == HttpStatus.BAD_REQUEST.value()) {
throw new BadRequestException("The provided rule string is not a valid drools rule file!");
}
}
if (!dryRun) {
rulesPersistenceService.setRules(rules, dossierTemplateId, ruleFileType);
}
auditPersistenceService.audit(AuditRequest.builder()
.userId(KeycloakSecurity.getUserId())
.objectId(dossierTemplateId)
.category(AuditCategory.DOSSIER_TEMPLATE.name())
.message(String.format("%s Rules have been updated", ruleFileType))
.build());
return new ResponseEntity<>(droolsValidationResponse, HttpStatus.OK);
} catch (IOException e) {
throw new FileUploadException("Could not upload file.", e);
}
}
@Override
@PreAuthorize("hasAuthority('" + READ_RULES + "')")
public RulesResponse download(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType) {
@ -107,6 +172,9 @@ public class RulesController implements RulesResource {
if (ruleEntityOptional.isEmpty()) {
throw new NotFoundException(String.format("No rule file of type %s found for dossierTemplateId %s", ruleFileType, dossierTemplateId));
}
SystemRulesSeperationRequest systemRulesSeperationRequest = new SystemRulesSeperationRequest(ruleEntityOptional.get().getValue());
String cleanedRules = ruleBuilderClient.getRuleFileWithoutSystemRules(systemRulesSeperationRequest).getRules();
ruleEntityOptional.get().setValue(cleanedRules);
return new RulesResponse(ruleEntityOptional.get().getValue(), dossierTemplateId, ruleEntityOptional.get().isTimeoutDetected());
}
@ -137,6 +205,28 @@ public class RulesController implements RulesResource {
}
@Override
@PreAuthorize("hasAuthority('" + READ_SYSTEM_RULES + "')")
public ResponseEntity<?> downloadFullFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
@PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType) {
var ruleEntityOptional = rulesPersistenceService.getRules(dossierTemplateId, ruleFileType);
if (ruleEntityOptional.isEmpty()) {
throw new NotFoundException(String.format("No rule file of type %s found for dossierTemplateId %s", ruleFileType, dossierTemplateId));
}
RulesResponse rulesResponse = new RulesResponse(ruleEntityOptional.get().getValue(), dossierTemplateId, ruleEntityOptional.get().isTimeoutDetected());
byte[] data = rulesResponse.getRules().getBytes(StandardCharsets.UTF_8);
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.TEXT_PLAIN);
httpHeaders.add("Content-Disposition", "attachment; filename*=utf-8''" + ruleFileType.name() + "_" + DOWNLOAD_FILE_NAME);
InputStream is = new ByteArrayInputStream(data);
return new ResponseEntity<>(new InputStreamResource(is), httpHeaders, HttpStatus.OK);
}
@Override
@PreAuthorize("hasAuthority('" + READ_RULES + "')")
public ResponseEntity<?> downloadFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId) {

View File

@ -28,7 +28,9 @@ public interface RulesResource {
String RULES_PATH = ExternalApi.BASE_PATH + "/rules";
String UPLOAD_PATH = "/upload";
String UPLOAD_FULL_PATH = "/uploadFull";
String DOWNLOAD_PATH = "/download";
String DOWNLOAD_FULL_PATH = "/downloadFull";
String RESET_PATH = "/reset";
String DOSSIER_TEMPLATE_PARAMETER_NAME = "dossierTemplateId";
@ -92,6 +94,16 @@ public interface RulesResource {
@Schema(type = "string", format = "binary", name = "file") @RequestPart(name = "file") MultipartFile file);
@ResponseStatus(value = HttpStatus.NO_CONTENT)
@PostMapping(value = RULES_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE + RULE_FILE_TYPE_PATH_VARIABLE + UPLOAD_FULL_PATH, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@Operation(summary = "Takes object containing string or rules as argument, which will be used by the redaction service.")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Rules upload successful or rules validation done"), @ApiResponse(responseCode = "400", description = "Uploaded rules could not be verified."), @ApiResponse(responseCode = "422", description = "Uploaded rules could not be compiled.")})
ResponseEntity<DroolsValidationResponse> uploadFullFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
@PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType,
@RequestParam(value = DRY_RUN_PARAMETER) boolean dryRun,
@Schema(type = "string", format = "binary", name = "file") @RequestPart(name = "file") MultipartFile file);
@ResponseBody
@ResponseStatus(value = HttpStatus.OK)
@Operation(summary = "Returns file containing the currently used Drools rules.")
@ -113,4 +125,13 @@ public interface RulesResource {
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "No content")})
@PutMapping(value = RULES_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE + RULE_FILE_TYPE_PATH_VARIABLE + RESET_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
void unlockRules(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType);
@ResponseBody
@ResponseStatus(value = HttpStatus.OK)
@Operation(summary = "Returns file containing the currently used Drools rules.")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
@GetMapping(value = RULES_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE + RULE_FILE_TYPE_PATH_VARIABLE + DOWNLOAD_FULL_PATH)
ResponseEntity<?> downloadFullFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
@PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType);
}

View File

@ -20,6 +20,7 @@ import org.springframework.retry.support.RetryTemplate;
import com.iqser.red.service.persistence.management.v1.processor.client.pdftronredactionservice.PDFTronClient;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionreportservice.StatusReportClient;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionservice.RedactionClient;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionservice.RuleBuilderClient;
import com.iqser.red.service.persistence.management.v1.processor.client.searchservice.SearchClient;
import com.iqser.red.service.persistence.management.v1.processor.client.tenantusermanagementservice.UsersClient;
import com.iqser.red.service.persistence.management.v1.processor.settings.FileManagementServiceSettings;
@ -30,7 +31,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@Configuration
@ComponentScan
@EnableFeignClients(basePackageClasses = {PDFTronClient.class, StatusReportClient.class, SearchClient.class, RedactionClient.class, UsersClient.class})
@EnableFeignClients(basePackageClasses = {PDFTronClient.class, StatusReportClient.class, SearchClient.class, RedactionClient.class, UsersClient.class, RuleBuilderClient.class})
@ImportAutoConfiguration(SharedMongoAutoConfiguration.class)
public class PersistenceServiceProcessorConfiguration {

View File

@ -0,0 +1,10 @@
package com.iqser.red.service.persistence.management.v1.processor.client.redactionservice;
import org.springframework.cloud.openfeign.FeignClient;
import com.iqser.red.service.redaction.v1.resources.RuleBuilderResource;
@FeignClient(name = "RuleBuilderClient", url = "${redaction-service.url}")
public interface RuleBuilderClient extends RuleBuilderResource {
}

View File

@ -49,7 +49,9 @@ public final class ActionRoles {
// Rules
public static final String READ_RULES = "red-read-rules";
public static final String READ_SYSTEM_RULES = "red-read-system-rules";
public static final String WRITE_RULES = "red-write-rules";
public static final String WRITE_SYSTEM_RULES = "red-write-system-rules";
// Data formats
public static final String READ_DATA_FORMATS = "red-read-data-formats";

View File

@ -25,7 +25,11 @@ public final class ApplicationRoles {
UPDATE_LICENSE,
GET_TENANTS,
CREATE_TENANT,
READ_USERS, READ_ALL_USERS, READ_USER_STATS,
READ_USER_STATS,
READ_USERS,
READ_ALL_USERS,
READ_SYSTEM_RULES,
WRITE_SYSTEM_RULES,
WRITE_USERS,
READ_SMTP_CONFIGURATION,
WRITE_SMTP_CONFIGURATION,
@ -59,9 +63,7 @@ public final class ApplicationRoles {
MANAGE_VIEWED_PAGES,
PROCESS_DOWNLOAD,
PROCESS_MANUAL_REDACTION_REQUEST,
READ_COLORS,
READ_DICTIONARY_TYPES,
READ_DIGITAL_SIGNATURE, READ_DOSSIER,
READ_COLORS, READ_DICTIONARY_TYPES, READ_DIGITAL_SIGNATURE, READ_DOSSIER,
READ_DOSSIER_ATTRIBUTES,
READ_DOSSIER_ATTRIBUTES_CONFIG,
READ_DOSSIER_TEMPLATES,
@ -71,13 +73,9 @@ public final class ApplicationRoles {
READ_GENERAL_CONFIGURATION,
READ_LEGAL_BASIS,
READ_MANUAL_REDACTIONS,
READ_NOTIFICATIONS,
READ_REDACTION_LOG,
READ_RULES,
READ_NOTIFICATIONS, READ_REDACTION_LOG, READ_SYSTEM_RULES, READ_SYSTEM_RULES,
READ_DATA_FORMATS,
READ_USERS,
READ_VERSIONS,
READ_WATERMARK,
READ_USERS, READ_VERSIONS, READ_WATERMARK, READ_RULES,
REANALYZE_DOSSIER,
REANALYZE_FILE,
REQUEST_MANUAL_REDACTION,
@ -117,7 +115,7 @@ public final class ApplicationRoles {
READ_FILE_ATTRIBUTES_CONFIG,
READ_LEGAL_BASIS,
READ_LICENSE_REPORT, READ_NOTIFICATIONS, READ_USER_STATS,
READ_RULES,
READ_RULES, READ_SYSTEM_RULES,
READ_DATA_FORMATS,
READ_SMTP_CONFIGURATION,
READ_VERSIONS,
@ -133,7 +131,7 @@ public final class ApplicationRoles {
WRITE_FILE_ATTRIBUTES_CONFIG,
WRITE_GENERAL_CONFIGURATION,
WRITE_LEGAL_BASIS,
WRITE_RULES,
WRITE_RULES, WRITE_SYSTEM_RULES,
WRITE_DATA_FORMATS,
WRITE_SMTP_CONFIGURATION,
WRITE_WATERMARK,
@ -150,8 +148,10 @@ public final class ApplicationRoles {
READ_APP_CONFIG,
READ_GENERAL_CONFIGURATION,
READ_GENERAL_CONFIGURATION,
GET_SIMILAR_IMAGES, READ_NOTIFICATIONS,
READ_USERS, READ_USER_STATS,
GET_SIMILAR_IMAGES,
READ_NOTIFICATIONS,
READ_USERS,
READ_USER_STATS,
UPDATE_MY_PROFILE,
UPDATE_NOTIFICATIONS,
WRITE_USERS,

View File

@ -19,6 +19,7 @@ public class RulesValidationService {
public DroolsValidation validateRules(RuleFileType ruleFileType, String rules) {
return redactionServiceClient.testRules(new RuleValidationModel(ruleFileType.name(), rules));
}
}

View File

@ -6,7 +6,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.management.v1.processor.entity.configuration.RuleSetEntity;
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.repository.RuleSetRepository;
import com.iqser.red.service.persistence.service.v1.api.shared.model.RuleFileType;
@ -106,7 +105,6 @@ public class RulesPersistenceService {
private final RuleSetRepository ruleSetRepository;
@Transactional
public Optional<RuleSetEntity> getRules(String dossierTemplateId, RuleFileType ruleFileType) {

View File

@ -49,7 +49,6 @@ public class ApprovalTest extends AbstractPersistenceServerServiceTest {
@Autowired
private FileClient fileClient;
@SpyBean
private LegalBasisMappingPersistenceService legalBasisMappingPersistenceService;

View File

@ -155,6 +155,7 @@ public class ComponentDefinitionTests extends AbstractPersistenceServerServiceTe
assertTrue(unknownDossierError.getMessage().contains("DossierTemplate with Id 123 not found."));
}
@Test
public void testAddComponentDefinitionAfterSoftDeletion() {
@ -269,7 +270,8 @@ public class ComponentDefinitionTests extends AbstractPersistenceServerServiceTe
assertEquals(newOrder.get(2).getId(), firstComponentId);
assertEquals(newOrder.get(2).getRank(), 3);
var unknownDossierError = assertThrows(FeignException.class, () -> dossierTemplateExternalClient.reorderComponents("123", List.of(secondComponentId, thirdComponentId, firstComponentId)));
var unknownDossierError = assertThrows(FeignException.class,
() -> dossierTemplateExternalClient.reorderComponents("123", List.of(secondComponentId, thirdComponentId, firstComponentId)));
assertTrue(unknownDossierError.getMessage().contains("DossierTemplate with Id 123 not found."));
}

View File

@ -417,7 +417,6 @@ public class ComponentLogStorageToMongoDBTest extends AbstractPersistenceServerS
}
@Test
@SneakyThrows
@Disabled

View File

@ -543,5 +543,4 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
assertTrue(result.getMessage().contains("Dossier name can not be longer than 254 characters"));
}
}

View File

@ -6,18 +6,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.iqser.red.service.pdftron.redaction.v1.api.model.RedactionResultDetail;
import com.iqser.red.service.pdftron.redaction.v1.api.model.RedactionType;
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.repository.DownloadRedactionFileStatusRepository;
import com.iqser.red.service.persistence.service.v1.api.shared.model.download.DownloadStatus;
import com.knecon.fforesight.tenantcommons.EncryptionDecryptionService;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.iqser.red.service.pdftron.redaction.v1.api.model.RedactionResultDetail;
import com.iqser.red.service.pdftron.redaction.v1.api.model.RedactionResultMessage;
import com.iqser.red.service.pdftron.redaction.v1.api.model.RedactionType;
import com.iqser.red.service.peristence.v1.server.integration.client.DownloadClient;
import com.iqser.red.service.peristence.v1.server.integration.client.FileClient;
import com.iqser.red.service.peristence.v1.server.integration.service.DossierTesterAndProvider;
@ -27,12 +23,13 @@ import com.iqser.red.service.peristence.v1.server.integration.utils.AbstractPers
import com.iqser.red.service.persistence.management.v1.processor.model.DownloadJob;
import com.iqser.red.service.persistence.management.v1.processor.service.download.DownloadMessageReceiver;
import com.iqser.red.service.persistence.management.v1.processor.service.download.DownloadPreparationService;
import com.iqser.red.service.persistence.service.v1.api.shared.model.PrepareDownloadRequest;
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.repository.DownloadRedactionFileStatusRepository;
import com.iqser.red.service.persistence.service.v1.api.shared.model.PrepareDownloadWithOptionRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.RemoveDownloadRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.DownloadFileType;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.WorkflowStatus;
import com.iqser.red.service.redaction.report.v1.api.model.ReportResultMessage;
import com.knecon.fforesight.tenantcommons.EncryptionDecryptionService;
import com.knecon.fforesight.tenantcommons.TenantContext;
import feign.FeignException;
@ -99,10 +96,7 @@ public class DownloadTest extends AbstractPersistenceServerServiceTest {
.fileIds(List.of(file2.getId()))
.build());
downloadMessageReceiver.receive(DownloadJob.builder()
.userId(userProvider.getUserId())
.storageId(downloads.getStorageId())
.build());
downloadMessageReceiver.receive(DownloadJob.builder().userId(userProvider.getUserId()).storageId(downloads.getStorageId()).build());
var reportInfoId = downloads.getStorageId().substring(0, downloads.getStorageId().length() - 3) + "/REPORT_INFO.json";
storageService.storeJSONObject(TenantContext.getTenantId(), reportInfoId, new ArrayList<>());

View File

@ -374,18 +374,17 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
fileAttributeConfigClient.addOrUpdateFileAttribute(dossier.getDossierTemplateId(), majorVersion);
var missingComma = new MockMultipartFile("file.csv",
"fileattributes_missing_comma.csv",
"application/csv",
IOUtils.toByteArray(new ClassPathResource("files/csv/fileattributes_missing_comma.csv").getInputStream()));
"fileattributes_missing_comma.csv",
"application/csv",
IOUtils.toByteArray(new ClassPathResource("files/csv/fileattributes_missing_comma.csv").getInputStream()));
var result = assertThrows(FeignException.class, () -> uploadClient.upload(missingComma, dossier.getId(), false, false));
assertTrue(result.getMessage().contains("Invalid CSV file format: Invalid CSV file format at line 2: Expected 5 columns but found 4"));
var missingQuotation = new MockMultipartFile("file.csv",
"fileattributes_missing_quotation_mark.csv",
"application/csv",
IOUtils.toByteArray(new ClassPathResource("files/csv/fileattributes_missing_quotation_mark.csv").getInputStream()));
"fileattributes_missing_quotation_mark.csv",
"application/csv",
IOUtils.toByteArray(new ClassPathResource("files/csv/fileattributes_missing_quotation_mark.csv").getInputStream()));
result = assertThrows(FeignException.class, () -> uploadClient.upload(missingQuotation, dossier.getId(), false, false));
assertTrue(result.getMessage().contains("Invalid CSV file format: Unterminated quoted field at end of CSV line. Beginning of lost text: [4.636.0,4.363.0,4.363.0\\n]") || result.getMessage().contains("Invalid CSV file format: Unterminiertes Anführungszeichen am Ende einer CSV-Zeile. Anfang des verlorenen Textes: [4.636.0,4.363.0,4.363.0\\n]"));

View File

@ -1,11 +1,9 @@
package com.iqser.red.service.peristence.v1.server.integration.tests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doNothing;
import java.util.List;
import java.util.Set;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -21,7 +19,6 @@ import com.iqser.red.service.peristence.v1.server.integration.service.ReportTemp
import com.iqser.red.service.peristence.v1.server.integration.utils.AbstractPersistenceServerServiceTest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.PrepareDownloadWithOptionRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.ReportTemplateUpdateRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.DownloadFileType;
import feign.FeignException;
@ -365,6 +362,7 @@ public class ReportTemplateTest extends AbstractPersistenceServerServiceTest {
}
@Test
public void testDownloadDossierAndDeleteReportTemplate() {
// Arrange
@ -390,10 +388,10 @@ public class ReportTemplateTest extends AbstractPersistenceServerServiceTest {
assertThat(firstTemplate.getFileName()).isEqualTo(fileName);
downloadClient.prepareDownload(PrepareDownloadWithOptionRequest.builder()
.reportTemplateIds(List.of(firstTemplate.getTemplateId()))
.dossierId(dossier.getId())
.fileIds(List.of(file.getId()))
.build());
.reportTemplateIds(List.of(firstTemplate.getTemplateId()))
.dossierId(dossier.getId())
.fileIds(List.of(file.getId()))
.build());
reportTemplateClient.deleteTemplate(firstTemplate.getDossierTemplateId(), firstTemplate.getTemplateId());

View File

@ -1,6 +1,7 @@
package com.iqser.red.service.peristence.v1.server.integration.tests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
@ -9,6 +10,7 @@ import java.util.List;
import java.util.Objects;
import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
@ -19,11 +21,14 @@ import com.iqser.red.service.peristence.v1.server.integration.service.DossierTem
import com.iqser.red.service.peristence.v1.server.integration.utils.AbstractPersistenceServerServiceTest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.RuleFileType;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.DroolsValidationResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RuleSyntaxErrorMessage;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RuleSyntaxWarningMessage;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUpdateRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUploadRequestModel;
import com.iqser.red.service.redaction.v1.model.DroolsSyntaxDeprecatedWarnings;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUploadResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.SystemRulesSeperationRequest;
import com.iqser.red.service.redaction.v1.model.DroolsSyntaxErrorMessage;
import com.iqser.red.service.redaction.v1.model.DroolsValidation;
import com.iqser.red.service.redaction.v1.model.RuleValidationModel;
import feign.FeignException;
@ -43,6 +48,12 @@ public class RulesTest extends AbstractPersistenceServerServiceTest {
public void testRules() {
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
when(ruleBuilderClient.getRuleFileWithoutSystemRules(any(SystemRulesSeperationRequest.class))).thenReturn(new RulesResponse("lorem ipsum", dossierTemplate.getId(), false));
when(ruleBuilderClient.mergeUserUpdateRules(any(RulesUpdateRequest.class))).thenReturn(new ResponseEntity(new RulesUploadResponse("lorem ipsum dolor sit amet",
dossierTemplate.getId(),
false,
new DroolsValidationResponse()),
org.springframework.http.HttpStatus.OK));
var response = rulesClient.upload(new RulesUploadRequestModel("lorem ipsum", dossierTemplate.getId(), RuleFileType.ENTITY, false));
assertThat(response.getStatusCode().value()).isEqualTo(HttpStatus.SC_OK);
@ -51,6 +62,9 @@ public class RulesTest extends AbstractPersistenceServerServiceTest {
assertThat(rulesClient.download(dossierTemplate.getId()).getRules()).isEqualTo("lorem ipsum");
response = rulesClient.upload(new RulesUploadRequestModel("lorem ipsum dolor sit amet", dossierTemplate.getId(), RuleFileType.ENTITY, false));
when(ruleBuilderClient.getRuleFileWithoutSystemRules(any(SystemRulesSeperationRequest.class))).thenReturn(new RulesResponse("lorem ipsum dolor sit amet",
dossierTemplate.getId(),
false));
assertThat(response.getStatusCode().value()).isEqualTo(HttpStatus.SC_OK);
assertThat(versionClient.getVersions(List.of(dossierTemplate.getId()))
.get(dossierTemplate.getId()).getRulesVersion()).isEqualTo(4);
@ -60,21 +74,26 @@ public class RulesTest extends AbstractPersistenceServerServiceTest {
@Test
@Disabled
public void testRulesWithRunDrySetTrue() {
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
List<DroolsSyntaxDeprecatedWarnings> warningMessages = new ArrayList<>();
warningMessages.add(DroolsSyntaxDeprecatedWarnings.builder().line(1).column(0).message("this function is deprecated").build());
List<RuleSyntaxWarningMessage> warningMessages = new ArrayList<>();
warningMessages.add(RuleSyntaxWarningMessage.builder().line(1).column(0).message("this function is deprecated").build());
List<DroolsSyntaxErrorMessage> errorMessages = new ArrayList<>();
errorMessages.add(DroolsSyntaxErrorMessage.builder().line(1).column(0).message("error message").build());
when(ruleBuilderClient.mergeUserUpdateRules(any(RulesUpdateRequest.class))).thenReturn(new ResponseEntity(new RulesUploadResponse("lorem ipsum dolor sit amet",
dossierTemplate.getId(),
false,
DroolsValidationResponse.builder()
.syntaxErrorMessages(Collections.emptyList())
.deprecatedWarnings(
warningMessages)
.build()),
org.springframework.http.HttpStatus.OK));
var request = new RulesUploadRequestModel("lorem ipsum", dossierTemplate.getId(), RuleFileType.ENTITY, true);
// case 1: dry-run true, no error messages just warning messages
when(redactionClient.testRules(new RuleValidationModel(request.getRuleFileType().name(), request.getRules()))).thenReturn(DroolsValidation.builder()
.syntaxErrorMessages(Collections.emptyList())
.deprecatedWarnings(
warningMessages)
.build());
ResponseEntity<DroolsValidationResponse> response = rulesClient.upload(request);
assertThat(response.getStatusCode().value()).isEqualTo(HttpStatus.SC_OK);
@ -83,14 +102,10 @@ public class RulesTest extends AbstractPersistenceServerServiceTest {
assertThat(response.getBody().getDeprecatedWarnings()).isNotEmpty();
assertThat(versionClient.getVersions(List.of(dossierTemplate.getId()))
.get(dossierTemplate.getId()).getRulesVersion()).isEqualTo(2); //1. beim Anlegen des DossierTemplates; 2. bei provideTestTemplate()
.get(dossierTemplate.getId())
.getRulesVersion()).isEqualTo(3); //1. beim Anlegen des DossierTemplates; 2. bei provideTestTemplate(), 3. beim rules mergen on upload
// case 2: dry-run true, error messages and warning messages
when(redactionClient.testRules(new RuleValidationModel(request.getRuleFileType().name(), request.getRules()))).thenReturn(DroolsValidation.builder()
.syntaxErrorMessages(errorMessages)
.deprecatedWarnings(
warningMessages)
.build());
response = rulesClient.upload(request);
assertThat(response.getStatusCode().value()).isEqualTo(HttpStatus.SC_OK);
@ -105,21 +120,24 @@ public class RulesTest extends AbstractPersistenceServerServiceTest {
@Test
@Disabled
public void testRulesWithRunDrySetFalse() {
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
DroolsValidationResponse droolsValidationResponse = new DroolsValidationResponse();
List<DroolsSyntaxDeprecatedWarnings> warningMessages = new ArrayList<>();
warningMessages.add(DroolsSyntaxDeprecatedWarnings.builder().line(1).column(0).message("this function is deprecated").build());
List<DroolsSyntaxErrorMessage> errorMessages = new ArrayList<>();
errorMessages.add(DroolsSyntaxErrorMessage.builder().line(1).column(0).message("error message").build());
List<RuleSyntaxWarningMessage> warningMessages = new ArrayList<>();
warningMessages.add(RuleSyntaxWarningMessage.builder().line(1).column(0).message("this function is deprecated").build());
List<RuleSyntaxErrorMessage> errorMessages = new ArrayList<>();
droolsValidationResponse.setSyntaxErrorMessages(new ArrayList<>());
errorMessages.add(RuleSyntaxErrorMessage.builder().line(1).column(0).message("error message").build());
when(ruleBuilderClient.mergeUserUpdateRules(any(RulesUpdateRequest.class))).thenReturn(new ResponseEntity(new RulesUploadResponse("lorem ipsum dolor sit amet",
dossierTemplate.getId(),
false,
droolsValidationResponse),
org.springframework.http.HttpStatus.OK));
var request = new RulesUploadRequestModel("lorem ipsum", dossierTemplate.getId(), RuleFileType.ENTITY, false);
// case 1: dry-run false, error messages and warning messages
when(redactionClient.testRules(new RuleValidationModel(request.getRuleFileType().name(), request.getRules()))).thenReturn(DroolsValidation.builder()
.syntaxErrorMessages(errorMessages)
.deprecatedWarnings(
warningMessages)
.build());
try {
rulesClient.upload(request);
} catch (FeignException e) {
@ -127,14 +145,8 @@ public class RulesTest extends AbstractPersistenceServerServiceTest {
}
assertThat(versionClient.getVersions(List.of(dossierTemplate.getId()))
.get(dossierTemplate.getId()).getRulesVersion()).isEqualTo(2); //1. beim Anlegen des DossierTemplates; 2. bei provideTestTemplate()
// case 2: dry-run false, no error messages just warning messages
when(redactionClient.testRules(new RuleValidationModel(request.getRuleFileType().name(), request.getRules()))).thenReturn(DroolsValidation.builder()
.syntaxErrorMessages(Collections.emptyList())
.deprecatedWarnings(
warningMessages)
.build());
.get(dossierTemplate.getId())
.getRulesVersion()).isEqualTo(3); //1. beim Anlegen des DossierTemplates; 2. bei provideTestTemplate(), 3. beim merge von user rules
ResponseEntity<DroolsValidationResponse> response = rulesClient.upload(request);
assertThat(response.getStatusCode().value()).isEqualTo(HttpStatus.SC_OK);

View File

@ -13,7 +13,6 @@ import com.iqser.red.service.peristence.v1.server.integration.service.UserProvid
import com.iqser.red.service.peristence.v1.server.integration.utils.AbstractPersistenceServerServiceTest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.ViewedPagesRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ViewedPage;
import com.iqser.red.service.persistence.service.v1.api.shared.model.common.JSONPrimitive;
public class ViewedPagesTest extends AbstractPersistenceServerServiceTest {

View File

@ -1,5 +1,8 @@
package com.iqser.red.service.peristence.v1.server.integration.tests.performance;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import java.io.FileInputStream;
import java.util.LinkedList;
import java.util.concurrent.CompletableFuture;
@ -8,19 +11,27 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import com.iqser.red.service.peristence.v1.server.integration.service.DossierTesterAndProvider;
import com.iqser.red.service.peristence.v1.server.integration.service.FileTesterAndProvider;
import com.iqser.red.service.peristence.v1.server.integration.utils.AbstractPersistenceServerServiceTest;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionservice.RuleBuilderClient;
import com.iqser.red.service.persistence.management.v1.processor.migration.StorageToMongoCopyService;
import com.iqser.red.service.persistence.management.v1.processor.utils.StorageIdUtils;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.Dossier;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileType;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUpdateRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.SystemRulesSeperationRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.mongo.service.EntityLogMongoService;
import com.iqser.red.storage.commons.service.StorageService;
import com.knecon.fforesight.tenantcommons.TenantContext;
import lombok.SneakyThrows;
@Disabled
public class StorageToMongoDBPerformanceTest extends AbstractPersistenceServerServiceTest {
@ -36,11 +47,17 @@ public class StorageToMongoDBPerformanceTest extends AbstractPersistenceServerSe
@Autowired
private EntityLogMongoService entityLogMongoService;
@MockBean
private RuleBuilderClient ruleBuilderClient;
@BeforeEach
@SneakyThrows
public void setUp() {
RulesResponse rulesResponse = new RulesResponse("some rules", "Template 1", false);
when(ruleBuilderClient.mergeUserUpdateRules(any(RulesUpdateRequest.class))).thenReturn(new ResponseEntity(rulesResponse, HttpStatus.OK));
when(ruleBuilderClient.getRuleFileWithoutSystemRules(any(SystemRulesSeperationRequest.class))).thenReturn(rulesResponse);
}

View File

@ -15,6 +15,15 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import org.assertj.core.util.Lists;
import org.bson.BsonArray;
import org.bson.BsonDocument;
import org.bson.BsonString;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.quartz.Scheduler;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.listener.MessageListenerContainer;
@ -34,6 +43,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.StatementCallback;
import org.springframework.jdbc.datasource.SingleConnectionDataSource;
@ -58,6 +69,7 @@ import com.iqser.red.service.peristence.v1.server.utils.MetricsPrinterService;
import com.iqser.red.service.persistence.management.v1.processor.client.pdftronredactionservice.PDFTronClient;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionreportservice.ReportTemplatePlaceholderClient;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionservice.RedactionClient;
import com.iqser.red.service.persistence.management.v1.processor.client.redactionservice.RuleBuilderClient;
import com.iqser.red.service.persistence.management.v1.processor.client.searchservice.SearchClient;
import com.iqser.red.service.persistence.management.v1.processor.client.tenantusermanagementservice.UsersClient;
import com.iqser.red.service.persistence.management.v1.processor.dataexchange.service.SystemManagedTypesImport;
@ -103,6 +115,11 @@ import com.iqser.red.service.persistence.management.v1.processor.service.persist
import com.iqser.red.service.persistence.management.v1.processor.service.users.UserService;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.configuration.ApplicationConfig;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.DroolsValidationResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUpdateRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.RulesUploadResponse;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules.SystemRulesSeperationRequest;
import com.iqser.red.service.persistence.service.v1.api.shared.mongo.repository.ComponentLogDocumentRepository;
import com.iqser.red.service.persistence.service.v1.api.shared.mongo.repository.ComponentLogEntryDocumentRepository;
import com.iqser.red.service.persistence.service.v1.api.shared.mongo.repository.EntityLogDocumentRepository;
@ -135,16 +152,6 @@ import com.mongodb.client.MongoDatabase;
import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Lists;
import org.bson.BsonArray;
import org.bson.BsonDocument;
import org.bson.BsonString;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.quartz.Scheduler;
@Slf4j
@ExtendWith(SpringExtension.class)
@EnableFeignClients(basePackageClasses = FileClient.class)
@ -165,6 +172,8 @@ public abstract class AbstractPersistenceServerServiceTest {
@MockBean
protected EntityLogService entityLogService;
@MockBean
protected RuleBuilderClient ruleBuilderClient;
@MockBean
protected PDFTronClient pdfTronRedactionClient;
@Autowired
protected ApplicationConfigClient appConfigClient;
@ -381,6 +390,11 @@ public abstract class AbstractPersistenceServerServiceTest {
.syntaxErrorMessages(Collections.emptyList())
.deprecatedWarnings(Collections.emptyList())
.build());
RulesResponse rulesResponse = new RulesResponse("lorem ipsum", "Template 1", false);
RulesUploadResponse rulesUploadResponse = new RulesUploadResponse("lorem ipsum", "Template 1", false, new DroolsValidationResponse());
when(ruleBuilderClient.mergeUserUpdateRules(any(RulesUpdateRequest.class))).thenReturn(new ResponseEntity(rulesUploadResponse, HttpStatus.OK));
when(ruleBuilderClient.getRuleFileWithoutSystemRules(any(SystemRulesSeperationRequest.class))).thenReturn(rulesResponse);
}

View File

@ -0,0 +1,19 @@
package com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Object containing a string of Drools rules.")
public class RulesUpdateRequest {
@Schema(description = "The actual string of rules.")
private String existingRules;
@Schema(description = "The actual string of rules.")
private String updatedRules;
}

View File

@ -0,0 +1,25 @@
package com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Object containing a string of Drools rules.")
public class RulesUploadResponse {
@Schema(description = "The actual string of rules.")
private String rules;
@Schema(description = "The DossierTemplate Id for these rules")
private String dossierTemplateId;
@Schema(description = "Bad written rules can lead to timeouts or endless processing. This will be detected by the system and all analyse request for the rules will be rejected. This flag indicates that a timeout was detected and you need to fix the rules")
private boolean timeoutDetected;
@Schema(description = "validation result, only set when uploading rules")
private DroolsValidationResponse droolsValidationResponse;
}

View File

@ -0,0 +1,17 @@
package com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Object containing a string of Drools rules.")
public class SystemRulesSeperationRequest {
@Schema(description = "The string of rules that should be cleaned of sytem rules.")
private String rules;
}