mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
165 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7e61befc21 | ||
|
be6dc14330 | ||
|
ab4bc1af9f | ||
|
eaec23ae7a | ||
|
8ff727c95d | ||
|
48475fdfaa | ||
|
812959be2e | ||
|
5b8c52db67 | ||
|
20c42b6561 | ||
|
52dfea9b21 | ||
|
d04dada44e | ||
|
2e85de7c81 | ||
|
42324368e5 | ||
|
8d885220d8 | ||
|
6367f5304d | ||
|
f17b309c27 | ||
|
bb2cc1765d | ||
|
d20e8ee158 | ||
|
254193f9aa | ||
|
4293f21618 | ||
|
e0eb43c479 | ||
|
f1bbb6cce7 | ||
|
e6e2a2d8ac | ||
|
c2cfcdc35a | ||
|
6b2ac86b1d | ||
|
8b212dc4cf | ||
|
e2c357c1e0 | ||
|
4a024e510d | ||
|
3f75c9b15f | ||
|
96f94a98be | ||
|
bfc0445aeb | ||
|
977f6f12d4 | ||
|
626640ddc7 | ||
|
2b00e550a9 | ||
|
f3dca482ff | ||
|
94e957cb73 | ||
|
8868e64a6a | ||
|
f4af65943f | ||
|
6fe1b50741 | ||
|
f300bd6b3a | ||
|
f7195ef16a | ||
|
ef228f0614 | ||
|
6c0f231316 | ||
|
33b521b421 | ||
|
eff4e0738c | ||
|
5685fc3b17 | ||
|
7c22a2598b | ||
|
efe053167d | ||
|
4aae383637 | ||
|
ca1774ffae | ||
|
6206f67bdd | ||
|
82897f449f | ||
|
e6d30cddac | ||
|
0e6b444a25 | ||
|
61dc54bb33 | ||
|
a6c7f044df | ||
|
18016df074 | ||
|
b021c1ebfe | ||
|
e3e42137d9 | ||
|
9327814266 | ||
|
d45fd10431 | ||
|
09242daaec | ||
|
491a41e8ba | ||
|
1dac1e5fdb | ||
|
2c9d8e63ea | ||
|
a3998de1ba | ||
|
582742bbd3 | ||
|
ebe29717fa | ||
|
c6a654cbcf | ||
|
cd947b5581 | ||
|
ef4dd74580 | ||
|
7edbdd72f2 | ||
|
b7978c2a62 | ||
|
c1d9142a9c | ||
|
03a5a3cd3a | ||
|
c1ac217c44 | ||
|
1b04fef8cd | ||
|
31bb692b16 | ||
|
3222f13efe | ||
|
d66ed689a0 | ||
|
f84a7035d7 | ||
|
56177b6790 | ||
|
3c32899f6e | ||
|
d3512dd8e4 | ||
|
d8273b19cf | ||
|
8abea08762 | ||
|
42e3ead101 | ||
|
b1c095b51e | ||
|
ab85ea8ffe | ||
|
9a794cfe97 | ||
|
8e3f610f8a | ||
|
8c9edde95f | ||
|
5652317a0a | ||
|
b8a9a9588c | ||
|
a48cf7eed3 | ||
|
73f6c7a8f7 | ||
|
37aaa0d147 | ||
|
5d5d1d8680 | ||
|
120d4acdb0 | ||
|
fa3acb47a9 | ||
|
716b039c07 | ||
|
abec95881e | ||
|
58164d59bf | ||
|
8e80b87439 | ||
|
4e3591cc72 | ||
|
6aa4c37825 | ||
|
68dae275a5 | ||
|
536f8c609c | ||
|
6686863352 | ||
|
3774a0e504 | ||
|
4bf569d297 | ||
|
13bcfe4125 | ||
|
982e0d24f5 | ||
|
c2fbf53b03 | ||
|
f8b5e9cb03 | ||
|
ea0b37022b | ||
|
f20a9b441d | ||
|
7c3a9113a0 | ||
|
66d9beef14 | ||
|
4a97305505 | ||
|
9b4593e4b3 | ||
|
01a2a23c4a | ||
|
2c2b51f47e | ||
|
1e37b3308d | ||
|
84a36d68d4 | ||
|
40d475abf9 | ||
|
5d3f1f2402 | ||
|
2cd29d87ec | ||
|
8f1631fb55 | ||
|
5f6dced886 | ||
|
25fdc9ccc7 | ||
|
b6456cde34 | ||
|
27b80d8adb | ||
|
536e12ff76 | ||
|
96ab699ea8 | ||
|
9630d4cb02 | ||
|
fe9175d959 | ||
|
277d10133d | ||
|
3fb964a460 | ||
|
d630dcb7af | ||
|
7a673966aa | ||
|
65d2863b9d | ||
|
56ef484ae0 | ||
|
d619d5365e | ||
|
7096276b02 | ||
|
c9a46e1a8a | ||
|
98f9175a13 | ||
|
4e89b0a033 | ||
|
c6c0779984 | ||
|
554b26e7e7 | ||
|
93d704d44c | ||
|
0916efad7c | ||
|
6169ec0095 | ||
|
75ace2a268 | ||
|
f489c4193b | ||
|
71c3addf2d | ||
|
cc43f9338e | ||
|
45ad5045b1 | ||
|
773f99453e | ||
|
538d269f66 | ||
|
1dbf1c1314 | ||
|
3969cd8f14 | ||
|
eaa11fcb34 | ||
|
cd5c2227e2 | ||
|
757b26b1b8 |
164
.github/workflows/ci.yml
vendored
164
.github/workflows/ci.yml
vendored
@@ -38,13 +38,13 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Prepare maven cache and check compilation"
|
||||
@@ -61,13 +61,13 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v8.24.1
|
||||
continue-on-error: true
|
||||
with:
|
||||
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
|
||||
@@ -84,11 +84,11 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v8.24.1
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
repository: "Alfresco/veracode-baseline-archive"
|
||||
@@ -141,9 +141,9 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- uses: Alfresco/ya-pmd-scan@v4.3.0
|
||||
with:
|
||||
classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\""
|
||||
@@ -173,10 +173,10 @@ jobs:
|
||||
testModule: mmt
|
||||
testAttributes: "-Dtest=AllMmtUnitTestSuite"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run tests"
|
||||
@@ -210,10 +210,10 @@ jobs:
|
||||
env:
|
||||
REQUIRES_INSTALLED_ARTIFACTS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -245,10 +245,10 @@ jobs:
|
||||
matrix:
|
||||
version: ['10.5', '10.6']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: Run MariaDB ${{ matrix.version }} database
|
||||
@@ -272,10 +272,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run MariaDB 10.11 database"
|
||||
@@ -299,10 +299,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run MySQL 8 database"
|
||||
@@ -325,10 +325,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run PostgreSQL 14.15 database"
|
||||
@@ -351,10 +351,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run PostgreSQL 15.10 database"
|
||||
@@ -377,10 +377,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run PostgreSQL 16.6 database"
|
||||
@@ -401,10 +401,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run ActiveMQ"
|
||||
@@ -457,10 +457,10 @@ jobs:
|
||||
disabledHostnameVerification: false
|
||||
mvn-options: '-Dencryption.ssl.keystore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.keystore -Dencryption.ssl.truststore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.truststore'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Set transformers tag"
|
||||
@@ -527,10 +527,10 @@ jobs:
|
||||
env:
|
||||
REQUIRES_LOCAL_IMAGES: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -566,10 +566,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- name: "Run Postgres 16.6 database"
|
||||
@@ -596,10 +596,10 @@ jobs:
|
||||
env:
|
||||
REQUIRES_INSTALLED_ARTIFACTS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -628,10 +628,10 @@ jobs:
|
||||
env:
|
||||
REQUIRES_INSTALLED_ARTIFACTS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -656,10 +656,10 @@ jobs:
|
||||
env:
|
||||
REQUIRES_LOCAL_IMAGES: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
@@ -702,10 +702,10 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[skip tests]') &&
|
||||
!contains(github.event.head_commit.message, '[force]')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: actions/checkout@v5
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Build"
|
||||
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
|
||||
run: |
|
||||
|
20
.github/workflows/master_release.yml
vendored
20
.github/workflows/master_release.yml
vendored
@@ -31,15 +31,15 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[no release]') &&
|
||||
github.event_name != 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.24.1
|
||||
with:
|
||||
username: ${{ env.GIT_USERNAME }}
|
||||
email: ${{ env.GIT_EMAIL }}
|
||||
@@ -60,15 +60,15 @@ jobs:
|
||||
!contains(github.event.head_commit.message, '[no downstream]') &&
|
||||
github.event_name != 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v8.24.1
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.24.1
|
||||
- name: "Init"
|
||||
run: bash ./scripts/ci/init.sh
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.24.1
|
||||
with:
|
||||
username: ${{ env.GIT_USERNAME }}
|
||||
email: ${{ env.GIT_EMAIL }}
|
||||
|
6
.github/workflows/precommit_formatter.yml
vendored
6
.github/workflows/precommit_formatter.yml
vendored
@@ -11,9 +11,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(github.event.head_commit.message, '[reformat code]')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Set up Python ${{ inputs.python-version }}
|
||||
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
extra_args: --all-files
|
||||
- name: Update secrets baseline
|
||||
run: pip install detect-secrets && detect-secrets scan --baseline .secrets.baseline
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.16.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.24.1
|
||||
with:
|
||||
username: ${{ secrets.BOT_GITHUB_USERNAME }}
|
||||
add-options: -u
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -83,7 +83,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.4</version>
|
||||
<version>4.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
|
@@ -43,7 +43,7 @@ import com.github.dockerjava.core.command.LogContainerResultCallback;
|
||||
import com.github.dockerjava.netty.NettyDockerCmdExecFactory;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@@ -37,7 +37,7 @@ import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPr
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.testng.annotations.Test;
|
||||
@@ -56,7 +56,7 @@ import org.alfresco.test.AlfrescoTest;
|
||||
|
||||
/**
|
||||
* Add Relationship tests
|
||||
*
|
||||
*
|
||||
* @author Kavit Shah
|
||||
*/
|
||||
public class AddRelationshipTests extends BaseRMRestTest
|
||||
|
@@ -45,7 +45,7 @@ import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.15
|
||||
SOLR6_TAG=2.0.16
|
||||
POSTGRES_TAG=16.6
|
||||
ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8
|
||||
|
@@ -119,6 +119,11 @@ rm.patch.v35.holdNewChildAssocPatch.batchSize=1000
|
||||
rm.haspermissionmap.read=Read
|
||||
rm.haspermissionmap.write=WriteProperties,AddChildren,ReadContent
|
||||
|
||||
# Extended Permissions
|
||||
# Enable matching the given username with the correct casing username when retrieving an IPR group.
|
||||
# Only needs to be used if there are owners that don't have the username in the correct casing.
|
||||
rm.extendedSecurity.enableUsernameNormalization=false
|
||||
|
||||
#
|
||||
# Extended auto-version behaviour. If true and other auto-version properties are satisfied, then
|
||||
# a document will be auto-versioned when its type is changed.
|
||||
|
@@ -611,6 +611,7 @@
|
||||
<property name="authorityService" ref="authorityService"/>
|
||||
<property name="permissionService" ref="permissionService"/>
|
||||
<property name="transactionService" ref="transactionService"/>
|
||||
<property name="enableUsernameNormalization" value="${rm.extendedSecurity.enableUsernameNormalization}" />
|
||||
</bean>
|
||||
|
||||
<bean id="ExtendedSecurityService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -38,6 +38,7 @@ import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.extensions.webscripts.ui.common.StringUtils;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.RenditionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
@@ -96,6 +97,8 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
/** transaction service */
|
||||
private TransactionService transactionService;
|
||||
|
||||
private boolean enableUsernameNormalization;
|
||||
|
||||
/**
|
||||
* @param filePlanService
|
||||
* file plan service
|
||||
@@ -141,6 +144,15 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
this.transactionService = transactionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param enableUsernameNormalization
|
||||
* enable username normalization to ensure correct casing
|
||||
*/
|
||||
public void setEnableUsernameNormalization(boolean enableUsernameNormalization)
|
||||
{
|
||||
this.enableUsernameNormalization = enableUsernameNormalization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Application context refresh event handler
|
||||
*/
|
||||
@@ -359,12 +371,18 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
{
|
||||
String group = null;
|
||||
|
||||
// If enabled, the authorities are forced to match the correct casing of the usernames in case they were set
|
||||
// with the incorrect casing.
|
||||
// If not, it will just use the authorities as they are.
|
||||
// In normal circumstances, the authorities are in the correct casing, so this is disabled by default.
|
||||
Set<String> authoritySet = normalizeAuthorities(authorities);
|
||||
|
||||
// find group or determine what the next index is if no group exists or there is a clash
|
||||
Pair<String, Integer> groupResult = findIPRGroup(groupPrefix, authorities);
|
||||
Pair<String, Integer> groupResult = findIPRGroup(groupPrefix, authoritySet);
|
||||
|
||||
if (groupResult.getFirst() == null)
|
||||
{
|
||||
group = createIPRGroup(groupPrefix, authorities, groupResult.getSecond());
|
||||
group = createIPRGroup(groupPrefix, authoritySet, groupResult.getSecond());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -399,7 +417,8 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
while (hasMoreItems == true)
|
||||
{
|
||||
// get matching authorities
|
||||
PagingResults<String> results = authorityService.getAuthorities(AuthorityType.GROUP,
|
||||
PagingResults<String> results = authorityService.getAuthorities(
|
||||
AuthorityType.GROUP,
|
||||
RMAuthority.ZONE_APP_RM,
|
||||
groupShortNamePrefix,
|
||||
false,
|
||||
@@ -427,6 +446,63 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
return new Pair<>(iprGroup, nextGroupIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a set of authorities, normalizes the authority names to ensure correct casing.
|
||||
*
|
||||
* @param authNames
|
||||
* @return
|
||||
*/
|
||||
private Set<String> normalizeAuthorities(Set<String> authNames)
|
||||
{
|
||||
// If disabled or no authorities, return as is
|
||||
if (!enableUsernameNormalization || authNames == null || authNames.isEmpty())
|
||||
{
|
||||
return authNames;
|
||||
}
|
||||
|
||||
Set<String> normalizedAuthorities = new HashSet<>();
|
||||
for (String authorityName : authNames)
|
||||
{
|
||||
normalizedAuthorities.add(normalizeAuthorityName(authorityName));
|
||||
}
|
||||
return normalizedAuthorities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usernames are case insensitive but affect the IPR group matching when set with different casing. For a given authority of type user, this method normalizes the authority name. If group, it returns the name as-is.
|
||||
*
|
||||
* @param authorityName
|
||||
* the authority name to normalize
|
||||
* @return the normalized authority name
|
||||
*/
|
||||
private String normalizeAuthorityName(String authorityName)
|
||||
{
|
||||
if (authorityName == null || authorityName.startsWith(GROUP_PREFIX))
|
||||
{
|
||||
return authorityName;
|
||||
}
|
||||
|
||||
// For users, attempt to get the correct casing from the username property of the user node
|
||||
if (authorityService.authorityExists(authorityName))
|
||||
{
|
||||
try
|
||||
{
|
||||
NodeRef authorityNodeRef = authorityService.getAuthorityNodeRef(authorityName);
|
||||
if (authorityNodeRef != null)
|
||||
{
|
||||
String username = (String) nodeService.getProperty(authorityNodeRef, ContentModel.PROP_USERNAME);
|
||||
return username != null ? username : authorityName;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// If anything goes wrong, fallback to the original name
|
||||
}
|
||||
}
|
||||
|
||||
return authorityName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a group exactly matches a list of authorities.
|
||||
*
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
# Version label
|
||||
version.major=25
|
||||
version.minor=2
|
||||
version.minor=3
|
||||
version.revision=0
|
||||
version.label=
|
||||
|
||||
|
@@ -52,6 +52,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.RenditionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
@@ -67,6 +68,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransacti
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.security.AccessPermission;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
@@ -522,6 +524,104 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
verify(mockedPermissionService).setPermission(nodeRef, writeGroup, RMPermissionModel.FILING, true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a node with no previous IPR groups assigned
|
||||
* And having pre-existing IPR groups matching the ones we need
|
||||
* When I add some read and write authorities but with a different casing
|
||||
* Then the existing IPR groups are used
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test public void addExtendedSecurityWithMixedCasingUsernames()
|
||||
{
|
||||
// Have the usernames in the node as the correct usernames but with incorrect casing
|
||||
String user1 = "UseR";
|
||||
String user2 = "UseR_w";
|
||||
|
||||
// Incorrect IPR Group names
|
||||
Set<String> diffCasingReaders = Stream.of(user1, GROUP).collect(Collectors.toSet());
|
||||
Set<String> diffCasingWriters = Stream.of(user2, GROUP_W).collect(Collectors.toSet());
|
||||
String wrongReadGroupPrefix = extendedSecurityService.getIPRGroupPrefixShortName(READER_GROUP_PREFIX, diffCasingReaders);
|
||||
String wrongWriteGroupPrefix = extendedSecurityService.getIPRGroupPrefixShortName(WRITER_GROUP_PREFIX, diffCasingWriters);
|
||||
String wrongReadGroup = wrongReadGroupPrefix + "0";
|
||||
String wrongWriteGroup = wrongWriteGroupPrefix + "0";
|
||||
|
||||
// Correct Group names
|
||||
String correctReadGroup = readGroupPrefix + "0";
|
||||
String correctWriteGroup = writeGroupPrefix + "0";
|
||||
|
||||
// If queried for the correct groups, return the results
|
||||
PagingResults<String> mockedCorrectReadPResults = mock(PagingResults.class);
|
||||
PagingResults<String> mockedCorrectWritePResults = mock(PagingResults.class);
|
||||
when(mockedCorrectReadPResults.getPage())
|
||||
.thenReturn(Stream.of(GROUP_PREFIX + correctReadGroup).collect(Collectors.toList()));
|
||||
when(mockedAuthorityService.getAuthorities(
|
||||
eq(AuthorityType.GROUP),
|
||||
eq(RMAuthority.ZONE_APP_RM),
|
||||
eq(readGroupPrefix),
|
||||
eq(false),
|
||||
eq(false),
|
||||
any(PagingRequest.class)))
|
||||
.thenReturn(mockedCorrectReadPResults);
|
||||
|
||||
when(mockedCorrectWritePResults.getPage())
|
||||
.thenReturn(Stream.of(GROUP_PREFIX + correctWriteGroup).collect(Collectors.toList()));
|
||||
when(mockedAuthorityService.getAuthorities(
|
||||
eq(AuthorityType.GROUP),
|
||||
eq(RMAuthority.ZONE_APP_RM),
|
||||
eq(writeGroupPrefix),
|
||||
eq(false),
|
||||
eq(false),
|
||||
any(PagingRequest.class)))
|
||||
.thenReturn(mockedCorrectWritePResults);
|
||||
|
||||
// Don't return results for the incorrect groups (lenient as these may not be called with normalization enabled)
|
||||
PagingResults<String> mockedWrongReadPResults = mock(PagingResults.class);
|
||||
PagingResults<String> mockedWrongWritePResults = mock(PagingResults.class);
|
||||
lenient().when(mockedWrongReadPResults.getPage())
|
||||
.thenReturn(Collections.emptyList());
|
||||
lenient().when(mockedAuthorityService.getAuthorities(
|
||||
eq(AuthorityType.GROUP),
|
||||
eq(RMAuthority.ZONE_APP_RM),
|
||||
eq(wrongReadGroupPrefix),
|
||||
eq(false),
|
||||
eq(false),
|
||||
any(PagingRequest.class)))
|
||||
.thenReturn(mockedWrongReadPResults);
|
||||
|
||||
lenient().when(mockedWrongWritePResults.getPage())
|
||||
.thenReturn(Collections.emptyList());
|
||||
lenient().when(mockedAuthorityService.getAuthorities(
|
||||
eq(AuthorityType.GROUP),
|
||||
eq(RMAuthority.ZONE_APP_RM),
|
||||
eq(wrongWriteGroupPrefix),
|
||||
eq(false),
|
||||
eq(false),
|
||||
any(PagingRequest.class)))
|
||||
.thenReturn(mockedWrongWritePResults);
|
||||
|
||||
// The users do exist, despite being in a different casing and are able to be retrieved
|
||||
NodeRef noderefUser1 = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, USER);
|
||||
when(mockedAuthorityService.authorityExists(user1)).thenReturn(true);
|
||||
when(mockedAuthorityService.getAuthorityNodeRef(user1)).thenReturn(noderefUser1);
|
||||
when(mockedNodeService.getProperty(noderefUser1, ContentModel.PROP_USERNAME)).thenReturn(USER);
|
||||
|
||||
NodeRef noderefUser2 = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, USER_W);
|
||||
when(mockedAuthorityService.authorityExists(user2)).thenReturn(true);
|
||||
when(mockedAuthorityService.getAuthorityNodeRef(user2)).thenReturn(noderefUser2);
|
||||
when(mockedNodeService.getProperty(noderefUser2, ContentModel.PROP_USERNAME)).thenReturn(USER_W);
|
||||
|
||||
// Set the extended security service to normalize usernames
|
||||
extendedSecurityService.setEnableUsernameNormalization(true);
|
||||
extendedSecurityService.set(nodeRef, diffCasingReaders, diffCasingWriters);
|
||||
|
||||
// Verify that the incorrect read group is not created
|
||||
verify(mockedAuthorityService, never()).createAuthority(AuthorityType.GROUP, wrongReadGroup, wrongReadGroup, Collections.singleton(RMAuthority.ZONE_APP_RM));
|
||||
|
||||
// Verify that the incorrect write group is not created
|
||||
verify(mockedAuthorityService, never()).createAuthority(AuthorityType.GROUP, wrongWriteGroup, wrongWriteGroup, Collections.singleton(RMAuthority.ZONE_APP_RM));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a node with no previous IPR groups assigned
|
||||
@@ -571,7 +671,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.thenReturn(Stream
|
||||
.of(USER_W, AlfMock.generateText())
|
||||
.collect(Collectors.toSet()));
|
||||
|
||||
|
||||
// add extended security
|
||||
extendedSecurityService.set(nodeRef, READERS, WRITERS);
|
||||
|
||||
@@ -895,7 +995,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
// group names
|
||||
String readGroup = extendedSecurityService.getIPRGroupShortName(READER_GROUP_FULL_PREFIX, READERS, 0);
|
||||
String writeGroup = extendedSecurityService.getIPRGroupShortName(WRITER_GROUP_FULL_PREFIX, WRITERS, 0);
|
||||
|
||||
|
||||
// setup renditions
|
||||
NodeRef renditionNodeRef = AlfMock.generateNodeRef(mockedNodeService);
|
||||
when(mockedNodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_RECORD))
|
||||
@@ -904,7 +1004,7 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.thenReturn(renditionNodeRef);
|
||||
when(mockedNodeService.getChildAssocs(nodeRef, RenditionModel.ASSOC_RENDITION, RegexQNamePattern.MATCH_ALL))
|
||||
.thenReturn(Collections.singletonList(mockedChildAssociationRef));
|
||||
|
||||
|
||||
// setup permissions
|
||||
Set<AccessPermission> permissions = Stream
|
||||
.of(new AccessPermissionImpl(AlfMock.generateText(), AccessStatus.ALLOWED, readGroup, 0),
|
||||
@@ -913,17 +1013,17 @@ public class ExtendedSecurityServiceImplUnitTest
|
||||
.collect(Collectors.toSet());
|
||||
when(mockedPermissionService.getAllSetPermissions(nodeRef))
|
||||
.thenReturn(permissions);
|
||||
|
||||
|
||||
// remove extended security
|
||||
extendedSecurityService.remove(nodeRef);
|
||||
|
||||
|
||||
// verify that the groups permissions have been removed
|
||||
verify(mockedPermissionService).clearPermission(nodeRef, readGroup);
|
||||
verify(mockedPermissionService).clearPermission(nodeRef, writeGroup);
|
||||
|
||||
|
||||
// verify that the groups permissions have been removed from the rendition
|
||||
verify(mockedPermissionService).clearPermission(renditionNodeRef, readGroup);
|
||||
verify(mockedPermissionService).clearPermission(renditionNodeRef, writeGroup);
|
||||
|
||||
|
||||
}
|
||||
}
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -51,8 +51,8 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@@ -28,7 +28,7 @@ import java.util.ResourceBundle;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
@@ -92,7 +92,7 @@ public class WikiPageGet extends AbstractWikiWebScript
|
||||
{
|
||||
links.add(link);
|
||||
// build the list of available pages
|
||||
WikiPageInfo wikiPage = wikiService.getWikiPage(site.getShortName(), StringEscapeUtils.unescapeHtml(link));
|
||||
WikiPageInfo wikiPage = wikiService.getWikiPage(site.getShortName(), StringEscapeUtils.unescapeHtml4(link));
|
||||
if (wikiPage != null)
|
||||
{
|
||||
pageTitles.add(wikiPage.getTitle());
|
||||
|
@@ -91,6 +91,15 @@ function doclist_getAllNodes(parsedArgs, filterParams, query, totalItemCount)
|
||||
};
|
||||
}
|
||||
|
||||
function sanitizeJunkFavouriteKeys(favourites){
|
||||
for (var key in favourites) {
|
||||
if (!key || key.trim() === "") {
|
||||
delete favourites[key];
|
||||
}
|
||||
}
|
||||
return favourites;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main entry point: Create collection of documents and folders in the given space
|
||||
*
|
||||
@@ -123,6 +132,28 @@ function doclist_main()
|
||||
|
||||
if (logger.isLoggingEnabled())
|
||||
logger.log("doclist.lib.js - NodeRef: " + parsedArgs.nodeRef + " Query: " + query);
|
||||
|
||||
favourites = sanitizeJunkFavouriteKeys(favourites);
|
||||
|
||||
if(Object.keys(favourites).length === 0 && query === null)
|
||||
{
|
||||
return {
|
||||
luceneQuery: "",
|
||||
paging: {
|
||||
totalRecords: 0,
|
||||
startIndex: 0
|
||||
},
|
||||
container: parsedArgs.rootNode,
|
||||
parent: null,
|
||||
onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"),
|
||||
itemCount: {
|
||||
folders: 0,
|
||||
documents: 0
|
||||
},
|
||||
items: [],
|
||||
customJSON: slingshotDocLib.getJSON()
|
||||
};
|
||||
}
|
||||
|
||||
var totalItemCount = filterParams.limitResults ? parseInt(filterParams.limitResults, 10) : -1;
|
||||
// For all sites documentLibrary query we pull in all available results and post filter
|
||||
|
@@ -182,11 +182,14 @@ var Filters =
|
||||
case "favourites":
|
||||
for (var favourite in favourites)
|
||||
{
|
||||
if (filterQuery)
|
||||
if (favourite && favourite.trim() !== "")
|
||||
{
|
||||
filterQuery += " OR ";
|
||||
if (filterQuery)
|
||||
{
|
||||
filterQuery += " OR ";
|
||||
}
|
||||
filterQuery += "ID:\"" + favourite + "\"";
|
||||
}
|
||||
filterQuery += "ID:\"" + favourite + "\"";
|
||||
}
|
||||
|
||||
if (filterQuery.length !== 0)
|
||||
@@ -201,7 +204,13 @@ var Filters =
|
||||
else
|
||||
{
|
||||
// empty favourites query
|
||||
filterQuery = "+ID:\"\"";
|
||||
logger.warn("No favourites found for user: " + person.properties.userName);
|
||||
return {
|
||||
query: null,
|
||||
limitResults: 0,
|
||||
sort: [],
|
||||
language: "lucene"
|
||||
};
|
||||
}
|
||||
|
||||
filterParams.query = filterQuery;
|
||||
|
@@ -25,7 +25,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import jakarta.transaction.UserTransaction;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONArray;
|
||||
@@ -958,7 +958,7 @@ public class WikiRestApiTest extends BaseWebScriptTest
|
||||
String link = m.group(1);
|
||||
link += "?title=<script>alert('xss');</script>";
|
||||
WikiPageInfo wikiPage2 = this.wikiService.getWikiPage(SITE_SHORT_NAME_WIKI, link);
|
||||
WikiPageInfo wikiPage1 = this.wikiService.getWikiPage(SITE_SHORT_NAME_WIKI, StringEscapeUtils.unescapeHtml(link));
|
||||
WikiPageInfo wikiPage1 = this.wikiService.getWikiPage(SITE_SHORT_NAME_WIKI, StringEscapeUtils.unescapeHtml4(link));
|
||||
assertEquals(wikiPage2, wikiPage1);
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -144,7 +144,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>7.0.0</version>
|
||||
<version>7.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- the cxf libs were updated, see dependencyManagement section -->
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -37,8 +37,7 @@ commons-fileupload http://jakarta.apache.org/commons/
|
||||
commons-httpclient http://jakarta.apache.org/commons/
|
||||
commons-io http://jakarta.apache.org/commons/
|
||||
commons-jxpath http://jakarta.apache.org/commons/
|
||||
commons-lang http://jakarta.apache.org/commons/
|
||||
commons-lang3 http://jakarta.apache.org/commons/
|
||||
commons-lang3 http://jakarta.apache.org/commons/
|
||||
commons-logging http://jakarta.apache.org/commons/
|
||||
commons-net http://jakarta.apache.org/commons/
|
||||
commons-pool http://jakarta.apache.org/commons/
|
||||
|
@@ -1,6 +1,5 @@
|
||||
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat
|
||||
FROM alfresco/alfresco-base-tomcat:tomcat10-jre17-rockylinux9@sha256:9622418e142fb4fe1c5320666ad61ea292bc5c98f3dd0b550b6add33d18f659f
|
||||
|
||||
FROM alfresco/alfresco-base-tomcat:tomcat10-jre17-rockylinux9@sha256:00d89fb84bda7bb37c17b0117adb2cfe4f7cbddcd6c1e42b0a67ea8dbb41a734
|
||||
# Set default docker_context.
|
||||
ARG resource_path=target
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
SOLR6_TAG=2.0.15
|
||||
SOLR6_TAG=2.0.16
|
||||
POSTGRES_TAG=16.6
|
||||
ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
|
@@ -5,7 +5,7 @@ import java.util.Date;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException;
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -17,7 +17,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<rest.api.explorer.branch>master</rest.api.explorer.branch>
|
||||
<httpclient-osgi-version>4.5.6</httpclient-osgi-version>
|
||||
<commons-lang3.version>3.17.0</commons-lang3.version>
|
||||
<commons-lang3.version>3.18.0</commons-lang3.version>
|
||||
<scribejava-apis.version>8.3.3</scribejava-apis.version>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
@@ -159,14 +159,14 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
<version>3.0.23</version>
|
||||
<version>3.0.25</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-json</artifactId>
|
||||
<version>3.0.22</version>
|
||||
<version>3.0.25</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2025 - 2025 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.rest.search;
|
||||
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestNodeModel;
|
||||
import org.alfresco.utility.RetryOperation;
|
||||
import org.alfresco.utility.Utility;
|
||||
import org.alfresco.utility.model.ContentModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
|
||||
public class NodeContentTest extends RestTest
|
||||
{
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API,
|
||||
TestGroup.SEARCH}, executionType = ExecutionType.SANITY, description = "Check basic functionality of GET queries/sites")
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.RATINGS, TestGroup.CORE})
|
||||
public void testNodeContent() throws Exception
|
||||
{
|
||||
|
||||
UserModel adminUser = dataContent.getAdminUser();
|
||||
final String fileName = "nodecontent.pdf";
|
||||
final String term = "babekyrtso";
|
||||
|
||||
FileModel fileModel = FileModel.getFileModelBasedOnTestDataFile(fileName);
|
||||
restClient.authenticateUser(adminUser)
|
||||
.configureRequestSpec()
|
||||
.addMultiPart("filedata", fileModel.toFile());
|
||||
RestNodeModel node = restClient.authenticateUser(adminUser).withCoreAPI().usingNode(ContentModel.my()).createNode();
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
SearchRequest query = new SearchRequest();
|
||||
RestRequestQueryModel queryModel = new RestRequestQueryModel();
|
||||
queryModel.setLanguage("afts");
|
||||
queryModel.setQuery(term);
|
||||
query.setQuery(queryModel);
|
||||
|
||||
RetryOperation op = () -> {
|
||||
List<SearchNodeModel> entries = restClient.authenticateUser(adminUser)
|
||||
.withSearchAPI()
|
||||
.search(query).getEntries();
|
||||
|
||||
assertFalse(CollectionUtils.isEmpty(entries), "Search results should not be empty");
|
||||
boolean fileFound = entries.stream()
|
||||
.map(SearchNodeModel::getModel)
|
||||
.anyMatch(e -> fileName.equals(e.getName()));
|
||||
assertTrue(fileFound, "Search results should contain the file: " + fileName);
|
||||
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
};
|
||||
Utility.sleep(300, 100000, op);
|
||||
|
||||
restClient.authenticateUser(adminUser)
|
||||
.withCoreAPI()
|
||||
.usingNode(ContentModel.my())
|
||||
.deleteNode(node);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
BIN
packaging/tests/tas-restapi/src/test/resources/shared-resources/testdata/nodecontent.pdf
vendored
Normal file
BIN
packaging/tests/tas-restapi/src/test/resources/shared-resources/testdata/nodecontent.pdf
vendored
Normal file
Binary file not shown.
@@ -15,6 +15,7 @@
|
||||
<package name="org.alfresco.rest.people.*"/>
|
||||
<package name="org.alfresco.rest.queries.*"/>
|
||||
<package name="org.alfresco.rest.ratings.*"/>
|
||||
<package name="org.alfresco.rest.search.*"/>
|
||||
</packages>
|
||||
</test>
|
||||
</suite>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
64
pom.xml
64
pom.xml
@@ -2,7 +2,7 @@
|
||||
<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>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<properties>
|
||||
<acs.version.major>25</acs.version.major>
|
||||
<acs.version.minor>2</acs.version.minor>
|
||||
<acs.version.minor>3</acs.version.minor>
|
||||
<acs.version.revision>0</acs.version.revision>
|
||||
<acs.version.label />
|
||||
<amp.min.version>${acs.version.major}.0.0</amp.min.version>
|
||||
@@ -51,26 +51,26 @@
|
||||
<dependency.alfresco-server-root.version>7.0.2</dependency.alfresco-server-root.version>
|
||||
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||
<dependency.alfresco-transform-core.version>5.1.8-A.2</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.1.8-A.2</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-transform-core.version>5.2.1</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.2.1</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-greenmail.version>7.1</dependency.alfresco-greenmail.version>
|
||||
<dependency.acs-event-model.version>1.0.2</dependency.acs-event-model.version>
|
||||
<dependency.acs-event-model.version>1.0.5</dependency.acs-event-model.version>
|
||||
|
||||
<dependency.aspectj.version>1.9.22.1</dependency.aspectj.version>
|
||||
<dependency.spring.version>6.2.2</dependency.spring.version>
|
||||
<dependency.spring.version>6.2.8</dependency.spring.version>
|
||||
<dependency.spring-security.version>6.3.9</dependency.spring-security.version>
|
||||
<dependency.antlr.version>3.5.3</dependency.antlr.version>
|
||||
<dependency.jackson.version>2.17.2</dependency.jackson.version>
|
||||
<dependency.cxf.version>4.1.0</dependency.cxf.version>
|
||||
<dependency.cxf.version>4.1.2</dependency.cxf.version>
|
||||
<dependency.opencmis.version>1.0.0-jakarta-1</dependency.opencmis.version>
|
||||
<dependency.webscripts.version>10.0</dependency.webscripts.version>
|
||||
<dependency.bouncycastle.version>1.79</dependency.bouncycastle.version>
|
||||
<dependency.mockito-core.version>5.14.1</dependency.mockito-core.version>
|
||||
<dependency.webscripts.version>10.2</dependency.webscripts.version>
|
||||
<dependency.bouncycastle.version>1.81</dependency.bouncycastle.version>
|
||||
<dependency.mockito-core.version>5.18.0</dependency.mockito-core.version>
|
||||
<dependency.assertj.version>3.27.3</dependency.assertj.version>
|
||||
<dependency.org-json.version>20240303</dependency.org-json.version>
|
||||
<dependency.org-json.version>20250517</dependency.org-json.version>
|
||||
<dependency.commons-dbcp.version>2.12.0</dependency.commons-dbcp.version>
|
||||
<dependency.commons-io.version>2.18.0</dependency.commons-io.version>
|
||||
<dependency.gson.version>2.12.1</dependency.gson.version>
|
||||
<dependency.commons-io.version>2.20.0</dependency.commons-io.version>
|
||||
<dependency.gson.version>2.13.1</dependency.gson.version>
|
||||
<dependency.guava.version>33.3.1-jre</dependency.guava.version>
|
||||
<dependency.httpclient.version>4.5.14</dependency.httpclient.version>
|
||||
<dependency.httpcore.version>4.4.16</dependency.httpcore.version>
|
||||
@@ -80,8 +80,8 @@
|
||||
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
|
||||
<dependency.xercesImpl.version>2.12.2</dependency.xercesImpl.version>
|
||||
<dependency.slf4j.version>2.0.16</dependency.slf4j.version>
|
||||
<dependency.log4j.version>2.24.3</dependency.log4j.version>
|
||||
<dependency.groovy.version>3.0.23</dependency.groovy.version>
|
||||
<dependency.log4j.version>2.25.1</dependency.log4j.version>
|
||||
<dependency.groovy.version>3.0.25</dependency.groovy.version>
|
||||
<dependency.tika.version>2.9.2</dependency.tika.version>
|
||||
<dependency.truezip.version>7.7.10</dependency.truezip.version>
|
||||
<dependency.poi.version>5.4.0</dependency.poi.version>
|
||||
@@ -115,19 +115,19 @@
|
||||
<dependency.jakarta-json-path.version>2.9.0</dependency.jakarta-json-path.version>
|
||||
<dependency.json-smart.version>2.5.2</dependency.json-smart.version>
|
||||
<alfresco.googledrive.version>4.1.0</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>3.3.0-A1</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>25.1.0</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
<alfresco.aos-module.version>3.3.0</alfresco.aos-module.version>
|
||||
<alfresco.api-explorer.version>25.2.0</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
|
||||
|
||||
<alfresco.maven-plugin.version>2.2.0</alfresco.maven-plugin.version>
|
||||
<license-maven-plugin.version>2.4.0</license-maven-plugin.version>
|
||||
<spotless-plugin.version>2.44.2</spotless-plugin.version>
|
||||
<spotless-plugin.version>2.45.0</spotless-plugin.version>
|
||||
|
||||
<dependency.postgresql.version>42.7.5</dependency.postgresql.version>
|
||||
<dependency.mysql.version>8.0.30</dependency.mysql.version>
|
||||
<dependency.mysql-image.version>8</dependency.mysql-image.version>
|
||||
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
|
||||
<dependency.tas-utility.version>5.0.2</dependency.tas-utility.version>
|
||||
<dependency.rest-assured.version>5.5.0</dependency.rest-assured.version>
|
||||
<dependency.rest-assured.version>5.5.5</dependency.rest-assured.version>
|
||||
<dependency.tas-email.version>2.0.0</dependency.tas-email.version>
|
||||
<dependency.tas-webdav.version>1.21</dependency.tas-webdav.version>
|
||||
<dependency.tas-ftp.version>1.19</dependency.tas-ftp.version>
|
||||
@@ -154,7 +154,7 @@
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||
<tag>25.2.0.52</tag>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -409,7 +409,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.3.3</version>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
@@ -422,9 +422,9 @@
|
||||
<version>1.18.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.18.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
@@ -444,8 +444,8 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-fileupload2-jakarta</artifactId>
|
||||
<version>2.0.0-M1</version>
|
||||
<artifactId>commons-fileupload2-jakarta-servlet6</artifactId>
|
||||
<version>2.0.0-M4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-net</groupId>
|
||||
@@ -708,13 +708,13 @@
|
||||
<dependency>
|
||||
<groupId>com.networknt</groupId>
|
||||
<artifactId>json-schema-validator</artifactId>
|
||||
<version>1.5.5</version>
|
||||
<version>1.5.8</version>
|
||||
</dependency>
|
||||
<!-- upgrade dependency from TIKA -->
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.18.1</version>
|
||||
<version>1.21.1</version>
|
||||
</dependency>
|
||||
<!-- upgrade dependency from TIKA -->
|
||||
<dependency>
|
||||
@@ -798,7 +798,7 @@
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.13.1</version>
|
||||
<version>2.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
@@ -943,7 +943,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
<version>1.18.38</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -1000,7 +1000,7 @@
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>0.45.0</version>
|
||||
<version>0.46.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
@@ -1081,7 +1081,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.cargo</groupId>
|
||||
<artifactId>cargo-maven3-plugin</artifactId>
|
||||
<version>1.10.16</version>
|
||||
<version>1.10.20</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -45,7 +45,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.santuario</groupId>
|
||||
<artifactId>xmlsec</artifactId>
|
||||
<version>4.0.3</version>
|
||||
<version>4.0.4</version>
|
||||
</dependency>
|
||||
<!-- newer version, see REPO-3133 -->
|
||||
<dependency>
|
||||
|
@@ -30,7 +30,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.fileupload2.core.FileItemInput;
|
||||
import org.apache.commons.fileupload2.core.FileItemInputIterator;
|
||||
import org.apache.commons.fileupload2.jakarta.JakartaServletFileUpload;
|
||||
import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
|
@@ -31,7 +31,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.fileupload2.core.FileItemInput;
|
||||
import org.apache.commons.fileupload2.core.FileItemInputIterator;
|
||||
import org.apache.commons.fileupload2.jakarta.JakartaServletFileUpload;
|
||||
import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
|
@@ -27,7 +27,6 @@ package org.alfresco.rest.framework.resource.parameters;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
|
||||
@@ -69,7 +68,7 @@ public interface Parameters
|
||||
* @return The Parameter value
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException;
|
||||
<T> T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Returns a representation of the Paging of collections of resources, with skip count and max items. See {@link Paging} Specified by the "skipCount" and "maxItems" request parameters.
|
||||
|
@@ -31,7 +31,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.beanutils.ConvertUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
@@ -231,7 +230,7 @@ public class Params implements Parameters
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException
|
||||
public <T> T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException
|
||||
{
|
||||
String param = getParameter(parameterName);
|
||||
if (param == null)
|
||||
@@ -239,7 +238,7 @@ public class Params implements Parameters
|
||||
Object obj = ConvertUtils.convert(param, clazz);
|
||||
if (obj != null && obj.getClass().equals(clazz))
|
||||
{
|
||||
return (T) obj;
|
||||
return clazz.cast(obj);
|
||||
}
|
||||
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[]{parameterName});
|
||||
}
|
||||
|
@@ -40,6 +40,7 @@
|
||||
"items":
|
||||
[
|
||||
<#list results as row>
|
||||
<#if row.item.hasPermission("Read")>
|
||||
{
|
||||
"type": "${row.item.typeShort}",
|
||||
"parentType": "${row.item.parentTypeShort!""}",
|
||||
@@ -75,6 +76,7 @@
|
||||
"nodeRef": "${row.item.nodeRef}"<#if row.selectable?exists>,
|
||||
"selectable" : ${row.selectable?string}</#if>
|
||||
}<#if row_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
]
|
||||
}
|
||||
|
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
package org.alfresco.rest.api.tests;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.alfresco.repo.web.util.JettyComponent;
|
||||
|
||||
public class EnterprisePublicApiTestFixture extends EnterpriseTestFixture
|
||||
@@ -40,32 +42,53 @@ public class EnterprisePublicApiTestFixture extends EnterpriseTestFixture
|
||||
public final static String[] CLASS_LOCATIONS = new String[]{"classpath*:/publicapi/lucene/"};
|
||||
|
||||
private static EnterprisePublicApiTestFixture instance;
|
||||
private String[] customConfigLocations;
|
||||
|
||||
/* Note: synchronized for multi-threaded test access */
|
||||
public synchronized static EnterprisePublicApiTestFixture getInstance(boolean createTestData) throws Exception
|
||||
public synchronized static EnterprisePublicApiTestFixture getInstance(boolean createTestData, String... customConfigLocations)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new EnterprisePublicApiTestFixture();
|
||||
instance.setup(createTestData);
|
||||
instance = new EnterprisePublicApiTestFixture(customConfigLocations);
|
||||
try
|
||||
{
|
||||
instance.setup(createTestData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
String errorMessage = "Exception was thrown during setup EnterprisePublicApiTestFixture: " + e.getClass() + " - " + e.getMessage();
|
||||
throw new RuntimeException(errorMessage, e);
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static EnterprisePublicApiTestFixture getInstance() throws Exception
|
||||
public static EnterprisePublicApiTestFixture getInstance(String... customConfigLocations)
|
||||
{
|
||||
return getInstance(true);
|
||||
return getInstance(true, customConfigLocations);
|
||||
}
|
||||
|
||||
private EnterprisePublicApiTestFixture()
|
||||
public static EnterprisePublicApiTestFixture getInstance()
|
||||
{
|
||||
return getInstance(true, null);
|
||||
}
|
||||
|
||||
public static EnterprisePublicApiTestFixture getInstance(boolean createTestData)
|
||||
{
|
||||
return getInstance(createTestData, null);
|
||||
}
|
||||
|
||||
private EnterprisePublicApiTestFixture(String... customConfigLocations)
|
||||
{
|
||||
super(CONFIG_LOCATIONS, CLASS_LOCATIONS, PORT, CONTEXT_PATH, PUBLIC_API_SERVLET_NAME, DEFAULT_NUM_MEMBERS_PER_SITE, false);
|
||||
this.customConfigLocations = customConfigLocations;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JettyComponent makeJettyComponent()
|
||||
{
|
||||
JettyComponent jettyComponent = new EnterpriseJettyComponent(getPort(), getContextPath(), getConfigLocations(), getClassLocations());
|
||||
String[] configLocations = mergeLocations(getConfigLocations(), this.customConfigLocations);
|
||||
JettyComponent jettyComponent = new EnterpriseJettyComponent(getPort(), getContextPath(), configLocations, getClassLocations());
|
||||
return jettyComponent;
|
||||
}
|
||||
|
||||
@@ -74,4 +97,19 @@ public class EnterprisePublicApiTestFixture extends EnterpriseTestFixture
|
||||
{
|
||||
return new RepoService(applicationContext);
|
||||
}
|
||||
|
||||
private String[] mergeLocations(String[]... locations)
|
||||
{
|
||||
String[] mergedLocations = new String[0];
|
||||
for (String[] location : locations)
|
||||
{
|
||||
if (location == null || location.length == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
mergedLocations = Arrays.copyOf(mergedLocations, mergedLocations.length + location.length);
|
||||
System.arraycopy(location, 0, mergedLocations, mergedLocations.length - location.length, location.length);
|
||||
}
|
||||
return mergedLocations;
|
||||
}
|
||||
}
|
||||
|
@@ -36,15 +36,21 @@ public class EnterpriseTestApi extends AbstractTestApi
|
||||
getTestFixture().getRandomNetwork();
|
||||
}
|
||||
|
||||
protected String[] getCustomConfigLocations()
|
||||
{
|
||||
return new String[]{};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestFixture getTestFixture() throws Exception
|
||||
{
|
||||
return EnterprisePublicApiTestFixture.getInstance();
|
||||
return EnterprisePublicApiTestFixture.getInstance(getCustomConfigLocations());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestFixture getTestFixture(boolean createTestData) throws Exception
|
||||
{
|
||||
return EnterprisePublicApiTestFixture.getInstance(createTestData);
|
||||
return EnterprisePublicApiTestFixture.getInstance(createTestData, getCustomConfigLocations());
|
||||
}
|
||||
|
||||
}
|
||||
|
BIN
remote-api/src/test/resources/publicapi/upload/babekyrtso.pdf
Normal file
BIN
remote-api/src/test/resources/publicapi/upload/babekyrtso.pdf
Normal file
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.2.0.52</version>
|
||||
<version>25.3.0.35-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -85,7 +85,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-fileupload2-jakarta</artifactId>
|
||||
<artifactId>commons-fileupload2-jakarta-servlet6</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -94,7 +94,6 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.17.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
@@ -120,7 +119,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-validator</groupId>
|
||||
<artifactId>commons-validator</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
@@ -358,7 +357,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>7.0.0</version>
|
||||
<version>7.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -402,7 +401,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>3.0.4</version>
|
||||
<version>3.0.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Activiti -->
|
||||
@@ -737,10 +736,6 @@
|
||||
<artifactId>reflections</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@@ -116,7 +116,7 @@ public class NodeDAOImpl extends AbstractNodeDAOImpl
|
||||
private static final String SELECT_NODE_MAX_ID = "alfresco.node.select_NodeMaxId";
|
||||
private static final String SELECT_NODE_INTERVAL_BY_TYPE = "alfresco.node.select_MinMaxNodeIdForNodeType";
|
||||
private static final String SELECT_NODES_WITH_ASPECT_IDS = "alfresco.node.select_NodesWithAspectIds";
|
||||
private static final String SELECT_NODES_WITH_ASPECT_IDS_LIMITED = "alfresco.node.select_NodesWithAspectIds_Limited";
|
||||
private static final String SELECT_NODES_WITH_ASPECT_IDS_LIMITED = "alfresco.node.select.select_NodesWithAspectIds_Limited";
|
||||
private static final String INSERT_NODE_ASSOC = "alfresco.node.insert.insert_NodeAssoc";
|
||||
private static final String UPDATE_NODE_ASSOC = "alfresco.node.update_NodeAssoc";
|
||||
private static final String DELETE_NODE_ASSOC = "alfresco.node.delete_NodeAssoc";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2025 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -124,6 +124,9 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
|
||||
/** Number of (bytecode) instructions that will trigger the observer */
|
||||
private int observerInstructionCount = 100;
|
||||
|
||||
/** Flag to enable or disable scope cleaning at the end of each script execution */
|
||||
private boolean cleanScope = true;
|
||||
|
||||
/** Custom context factory */
|
||||
public static AlfrescoContextFactory contextFactory;
|
||||
|
||||
@@ -210,6 +213,15 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
|
||||
this.observerInstructionCount = observerInstructionCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cleanScope
|
||||
* true to enable scope cleaning at the end of each script execution - set to false to disable this feature.
|
||||
*/
|
||||
public void setCleanScope(boolean cleanScope)
|
||||
{
|
||||
this.cleanScope = cleanScope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.repository.ScriptProcessor#reset()
|
||||
*/
|
||||
@@ -619,7 +631,7 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (!secure)
|
||||
if (!secure && cleanScope)
|
||||
{
|
||||
unsetScope(model, scope);
|
||||
}
|
||||
|
@@ -1130,7 +1130,10 @@ public class Search extends BaseScopableProcessorExtension implements Initializi
|
||||
// for example the key could be: {!afts}@{http://www.alfresco.org/model/content/1.0}created:[NOW/DAY-1DAY TO NOW/DAY+1DAY]
|
||||
// qName => @{http://www.alfresco.org/model/content/1.0}created
|
||||
// 7 => {!afts}
|
||||
key = key.substring(7);
|
||||
if (key.startsWith("{!afts}"))
|
||||
{
|
||||
key = key.substring(7);
|
||||
}
|
||||
String qName = key.substring(0, key.lastIndexOf(':'));
|
||||
|
||||
// Retrieve the previous facet queries
|
||||
|
@@ -862,9 +862,18 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
|
||||
if (aspectDef != null)
|
||||
{
|
||||
// Remove default properties
|
||||
Map<QName, Serializable> propsBefore = nodeDAO.getNodeProperties(nodeId);
|
||||
Map<QName, PropertyDefinition> propertyDefs = aspectDef.getProperties();
|
||||
Set<QName> propertyToRemoveQNames = propertyDefs.keySet();
|
||||
nodeDAO.removeNodeProperties(nodeId, propertyToRemoveQNames);
|
||||
boolean propertiesRemoved = nodeDAO.removeNodeProperties(nodeId, propertyToRemoveQNames);
|
||||
|
||||
if (propertiesRemoved)
|
||||
{
|
||||
invokeOnUpdateProperties(
|
||||
nodeRef,
|
||||
propsBefore, // before
|
||||
nodeDAO.getNodeProperties(nodeId)); // after
|
||||
}
|
||||
|
||||
// Remove child associations
|
||||
// We have to iterate over the associations and remove all those between the parent and child
|
||||
|
@@ -81,11 +81,19 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
|
||||
|
||||
public static final QName DEFAULT_RENDITION_CONTENT_PROP = ContentModel.PROP_CONTENT;
|
||||
public static final String DEFAULT_MIMETYPE = MimetypeMap.MIMETYPE_TEXT_PLAIN;
|
||||
public static final String MIMETYPE_METADATA_EXTRACT = "alfresco-metadata-extract";
|
||||
public static final String MIMETYPE_METADATA_EMBED = "alfresco-metadata-embed";
|
||||
public static final String DEFAULT_ENCODING = "UTF-8";
|
||||
|
||||
public static final int SOURCE_HAS_NO_CONTENT = -1;
|
||||
public static final int RENDITION2_DOES_NOT_EXIST = -2;
|
||||
|
||||
// Allowed mimetypes to support text or metadata extract transforms when thumbnails are disabled.
|
||||
private static final Set<String> ALLOWED_MIMETYPES = Set.of(
|
||||
MimetypeMap.MIMETYPE_TEXT_PLAIN,
|
||||
MIMETYPE_METADATA_EXTRACT,
|
||||
MIMETYPE_METADATA_EMBED);
|
||||
|
||||
private static Log logger = LogFactory.getLog(RenditionService2Impl.class);
|
||||
|
||||
// As Async transforms and renditions are so similar, this class provides a way to provide the code that is different.
|
||||
@@ -288,7 +296,7 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isEnabled())
|
||||
if (!isAsyncAllowed(renderOrTransform))
|
||||
{
|
||||
throw new RenditionService2Exception("Async transforms and renditions are disabled " +
|
||||
"(system.thumbnail.generate=false or renditionService2.enabled=false).");
|
||||
@@ -967,4 +975,24 @@ public class RenditionService2Impl implements RenditionService2, InitializingBea
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if the given transform callback is a text extract transform for content indexing or metadata extract/embed.
|
||||
private boolean isTextOrMetadataExtractTransform(RenderOrTransformCallBack renderOrTransform)
|
||||
{
|
||||
RenditionDefinition2 renditionDefinition = renderOrTransform.getRenditionDefinition();
|
||||
return renditionDefinition != null && ALLOWED_MIMETYPES.contains(renditionDefinition.getTargetMimetype());
|
||||
}
|
||||
|
||||
private boolean isAsyncAllowed(RenderOrTransformCallBack renderOrTransform)
|
||||
{
|
||||
// If enabled is false, all async transforms/renditions must be blocked
|
||||
if (!enabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// If thumbnails are disabled, allow only text extract or metadata extract/embed transforms
|
||||
return thumbnailsEnabled || isTextOrMetadataExtractTransform(renderOrTransform);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2025 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -115,15 +115,15 @@ public class NodePermissionAssessor
|
||||
Set<QName> nodeAspects = nodeService.getAspects(node.getNodeRef());
|
||||
|
||||
String userName = null;
|
||||
if (nodeAspects.contains(ContentModel.ASPECT_AUDITABLE))
|
||||
{
|
||||
userName = node.getAuditableProperties().getAuditCreator();
|
||||
}
|
||||
else if (nodeAspects.contains(ContentModel.ASPECT_OWNABLE))
|
||||
if (nodeAspects.contains(ContentModel.ASPECT_OWNABLE))
|
||||
{
|
||||
Serializable owner = nodeService.getProperty(node.getNodeRef(), ContentModel.PROP_OWNER);
|
||||
userName = DefaultTypeConverter.INSTANCE.convert(String.class, owner);
|
||||
}
|
||||
else if (nodeAspects.contains(ContentModel.ASPECT_AUDITABLE))
|
||||
{
|
||||
userName = node.getAuditableProperties().getAuditCreator();
|
||||
}
|
||||
|
||||
return userName;
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ import com.nimbusds.oauth2.sdk.id.Identifier;
|
||||
import com.nimbusds.oauth2.sdk.id.Issuer;
|
||||
import com.nimbusds.openid.connect.sdk.claims.PersonClaims;
|
||||
import com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.hc.client5.http.classic.HttpClient;
|
||||
|
@@ -42,7 +42,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import com.nimbusds.oauth2.sdk.Scope;
|
||||
import com.nimbusds.oauth2.sdk.id.Identifier;
|
||||
import com.nimbusds.oauth2.sdk.id.State;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.oauth2.client.registration.ClientRegistration;
|
||||
|
@@ -782,25 +782,6 @@
|
||||
<if test="ordered == true">order by node.id ASC</if>
|
||||
</select>
|
||||
|
||||
<select id="select_NodesWithAspectIds_Limited" parameterType="Ids" resultMap="result_NodeRef" >
|
||||
select
|
||||
node.id as id,
|
||||
store.protocol as protocol,
|
||||
store.identifier as identifier,
|
||||
node.uuid as uuid
|
||||
from
|
||||
alf_node_aspects na
|
||||
join alf_node node on (na.node_id = node.id)
|
||||
left join alf_store store on (store.id = node.store_id)
|
||||
where
|
||||
<![CDATA[na.node_id >= #{idOne}]]>
|
||||
<if test="idTwo != null"><![CDATA[and na.node_id < #{idTwo}]]></if>
|
||||
and na.qname_id in
|
||||
<foreach item="item" index="i" collection="ids" open="(" separator="," close=")">#{item}</foreach>
|
||||
<if test="ordered == true">order by node.id ASC</if>
|
||||
<if test="maxResults != null"><![CDATA[limit #{maxResults}]]></if>
|
||||
</select>
|
||||
|
||||
<!-- Common results for result_NodeAssoc -->
|
||||
<sql id="select_NodeAssoc_Results">
|
||||
select
|
||||
@@ -1566,4 +1547,4 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
@@ -30,4 +30,23 @@
|
||||
<![CDATA[and commit_time_ms <= #{maxCommitTime}]]>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<select id="select_NodesWithAspectIds_Limited" parameterType="Ids" resultMap="alfresco.node.result_NodeRef" >
|
||||
select
|
||||
node.id as id,
|
||||
store.protocol as protocol,
|
||||
store.identifier as identifier,
|
||||
node.uuid as uuid
|
||||
from
|
||||
alf_node_aspects na
|
||||
join alf_node node on (na.node_id = node.id)
|
||||
left join alf_store store on (store.id = node.store_id)
|
||||
where
|
||||
<![CDATA[na.node_id >= #{idOne}]]>
|
||||
<if test="idTwo != null"><![CDATA[and na.node_id < #{idTwo}]]></if>
|
||||
and na.qname_id in
|
||||
<foreach item="item" index="i" collection="ids" open="(" separator="," close=")">#{item}</foreach>
|
||||
<if test="ordered == true">order by node.id ASC</if>
|
||||
<if test="maxResults != null"><![CDATA[limit #{maxResults}]]></if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@@ -30,4 +30,23 @@
|
||||
<![CDATA[and commit_time_ms <= #{maxCommitTime}]]>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<select id="select_NodesWithAspectIds_Limited" parameterType="Ids" resultMap="alfresco.node.result_NodeRef" >
|
||||
select
|
||||
node.id as id,
|
||||
store.protocol as protocol,
|
||||
store.identifier as identifier,
|
||||
node.uuid as uuid
|
||||
from
|
||||
alf_node_aspects na
|
||||
join alf_node node on (na.node_id = node.id)
|
||||
left join alf_store store on (store.id = node.store_id)
|
||||
where
|
||||
<![CDATA[na.node_id >= #{idOne}]]>
|
||||
<if test="idTwo != null"><![CDATA[and na.node_id < #{idTwo}]]></if>
|
||||
and na.qname_id in
|
||||
<foreach item="item" index="i" collection="ids" open="(" separator="," close=")">#{item}</foreach>
|
||||
<if test="ordered == true">order by node.id ASC</if>
|
||||
<if test="maxResults != null"><![CDATA[limit #{maxResults}]]></if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
repository.name=Main Repository
|
||||
|
||||
# Schema number
|
||||
version.schema=20100
|
||||
version.schema=20200
|
||||
|
||||
# Directory configuration
|
||||
|
||||
@@ -1394,6 +1394,9 @@ scripts.execution.maxMemoryUsedInBytes=-1
|
||||
# Number of instructions that will trigger the observer
|
||||
scripts.execution.observerInstructionCount=5000
|
||||
|
||||
# Flag to control if the scope is cleaned at the end of script execution
|
||||
scripts.execution.clean.scope=true
|
||||
|
||||
# Default value being used in POST/size-details endpoint to partition a huge folder into smaller chunks
|
||||
# so that we can compute more efficiently and consolidate all sizes into a single unit.
|
||||
default.async.folder.items=1000
|
||||
|
@@ -60,6 +60,9 @@
|
||||
<property name="observerInstructionCount">
|
||||
<value>${scripts.execution.observerInstructionCount}</value>
|
||||
</property>
|
||||
<property name="cleanScope">
|
||||
<value>${scripts.execution.clean.scope}</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- base config implementation that script extension beans extend from - for auto registration
|
||||
|
@@ -26,6 +26,12 @@
|
||||
|
||||
package org.alfresco.repo.event2;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import static org.alfresco.model.ContentModel.PROP_DESCRIPTION;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -545,6 +551,49 @@ public class UpdateRepoEventIT extends AbstractContextAwareRepoEvent
|
||||
assertEquals(aspectsBeforeRemove, resourceBefore.getAspectNames());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemoveAspectPropertiesTest()
|
||||
{
|
||||
final NodeRef nodeRef = createNode(ContentModel.TYPE_CONTENT);
|
||||
NodeResource resource = getNodeResource(1);
|
||||
final Set<String> originalAspects = resource.getAspectNames();
|
||||
assertNotNull(originalAspects);
|
||||
|
||||
// Add cm:geographic aspect with properties
|
||||
retryingTransactionHelper.doInTransaction(() -> {
|
||||
Map<QName, Serializable> aspectProperties = new HashMap<>();
|
||||
aspectProperties.put(ContentModel.PROP_LATITUDE, "12.345678");
|
||||
aspectProperties.put(ContentModel.PROP_LONGITUDE, "12.345678");
|
||||
nodeService.addAspect(nodeRef, ContentModel.ASPECT_GEOGRAPHIC, aspectProperties);
|
||||
return null;
|
||||
});
|
||||
resource = getNodeResource(2);
|
||||
Set<String> aspectsBeforeRemove = resource.getAspectNames();
|
||||
assertNotNull(aspectsBeforeRemove);
|
||||
assertTrue(aspectsBeforeRemove.contains("cm:geographic"));
|
||||
|
||||
// Remove cm:geographic aspect - this automatically removes the properties from the node
|
||||
retryingTransactionHelper.doInTransaction(() -> {
|
||||
nodeService.removeAspect(nodeRef, ContentModel.ASPECT_GEOGRAPHIC);
|
||||
return null;
|
||||
});
|
||||
|
||||
resource = getNodeResource(3);
|
||||
assertEquals(originalAspects, resource.getAspectNames());
|
||||
|
||||
NodeResource resourceBefore = getNodeResourceBefore(3);
|
||||
assertNotNull(resourceBefore.getAspectNames());
|
||||
assertEquals(aspectsBeforeRemove, resourceBefore.getAspectNames());
|
||||
// Resource before should contain cm:latitude and cm:longitude properties
|
||||
assertNotNull(resourceBefore.getProperties());
|
||||
assertTrue(resourceBefore.getProperties().containsKey("cm:latitude"));
|
||||
assertTrue(resourceBefore.getProperties().containsKey("cm:longitude"));
|
||||
// Resource after should NOT contain cm:latitude and cm:longitude properties
|
||||
assertNotNull(resource.getProperties());
|
||||
assertFalse(resource.getProperties().containsKey("cm:latitude"));
|
||||
assertFalse(resource.getProperties().containsKey("cm:longitude"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateAndUpdateInTheSameTransaction()
|
||||
{
|
||||
|
@@ -39,6 +39,7 @@ import org.junit.Test;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.RenditionModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -776,4 +777,58 @@ public class RenditionService2IntegrationTest extends AbstractRenditionIntegrati
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTextExtractTransformAllowedWhenThumbnailDisabled()
|
||||
{
|
||||
// create a source node
|
||||
NodeRef sourceNodeRef = createSource(ADMIN, "quick.pdf");
|
||||
assertNotNull("Node not generated", sourceNodeRef);
|
||||
String replyQueue = "org.test.queue";
|
||||
String targetMimetype = MimetypeMap.MIMETYPE_TEXT_PLAIN;
|
||||
|
||||
TransformDefinition textExtractTransform = new TransformDefinition(
|
||||
targetMimetype,
|
||||
java.util.Collections.emptyMap(),
|
||||
"clientData",
|
||||
replyQueue,
|
||||
"requestId");
|
||||
|
||||
renditionService2.setThumbnailsEnabled(false);
|
||||
try
|
||||
{
|
||||
// Should NOT throw, as this is a text extract transform
|
||||
AuthenticationUtil.runAs(() -> {
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(() -> {
|
||||
renditionService2.transform(sourceNodeRef, textExtractTransform);
|
||||
return null;
|
||||
});
|
||||
return null;
|
||||
}, ADMIN);
|
||||
}
|
||||
finally
|
||||
{
|
||||
renditionService2.setThumbnailsEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetadataExtractTransformAllowedWhenThumbnailDisabled()
|
||||
{
|
||||
// create a source node
|
||||
NodeRef sourceNodeRef = createSource(ADMIN, "quick.pdf");
|
||||
assertNotNull("Node not generated", sourceNodeRef);
|
||||
renditionService2.setThumbnailsEnabled(false);
|
||||
try
|
||||
{
|
||||
// Should NOT throw, as this is a metadata extract transform
|
||||
extract(ADMIN, sourceNodeRef);
|
||||
waitForExtract(ADMIN, sourceNodeRef, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
renditionService2.setThumbnailsEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user