Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/deploy_and_Integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ jobs:
--arg cmisUrl "${{ env.CMIS_URL }}" \
--arg cmisClientID "${{ env.CMIS_CLIENT_ID }}" \
--arg cmisClientSecret "${{ env.CMIS_CLIENT_SECRET }}" \
--arg defaultRepositoryID "${{ secrets.DEFAULTREPOSITORYID }}" \
--arg virusScanRepositoryID "${{ secrets.VIRUSSCANREPOSITORYID }}" \
'
.appUrl = $appUrl
| .authUrl = $authUrl
Expand All @@ -217,6 +219,8 @@ jobs:
| .CMIS_URL = $cmisUrl
| .cmisClientID = $cmisClientID
| .cmisClientSecret = $cmisClientSecret
| .defaultRepositoryID = $defaultRepositoryID
| .virusScanRepositoryID = $virusScanRepositoryID
' "$JSON_FILE" > "temp.json"
)
mv "temp.json" "$JSON_FILE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ jobs:
--arg cmisUrl "${{ env.CMIS_URL }}" \
--arg cmisClientIDMT "${{ env.CMIS_CLIENT_ID_MT }}" \
--arg cmisClientSecretMT "${{ env.CMIS_CLIENT_SECRET_MT }}" \
--arg defaultRepositoryIDMT "${{ secrets.DEFAULTREPOSITORYIDMT }}" \
--arg defaultRepositoryID "${{ secrets.DEFAULTREPOSITORYID }}" \
--arg virusScanRepositoryID "${{ secrets.VIRUSSCANREPOSITORYID }}" \
'
.username = $username
| .password = $password
Expand All @@ -224,6 +227,9 @@ jobs:
| .CMIS_URL = $cmisUrl
| .cmisClientIDMT = $cmisClientIDMT
| .cmisClientSecretMT = $cmisClientSecretMT
| .defaultRepositoryIDMT = $defaultRepositoryIDMT
| .defaultRepositoryID = $defaultRepositoryID
| .virusScanRepositoryID = $virusScanRepositoryID
' "$JSON_FILE" > "temp.json"
)
mv "temp.json" "$JSON_FILE"
Expand Down
16 changes: 13 additions & 3 deletions test/integration/attachments-sdm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1822,9 +1822,13 @@ const config = {
}
expect(response.data.createdBy).toBeTruthy();
expect(response.data.modifiedBy).toBeTruthy();
// When using named user token, createdBy should match the authenticated username
if (credentials.username) {
// When using named user token, createdBy should match the authenticated username.
// For technicalUser flow, the principal is the client_credentials clientid (not a named user),
// so createdBy must NOT equal the named user.
if (tokenFlow === 'namedUser' && credentials.username) {
expect(response.data.createdBy).toBe(credentials.username);
} else if (tokenFlow === 'technicalUser' && credentials.username) {
expect(response.data.createdBy).not.toBe(credentials.username);
}

// Cleanup
Expand Down Expand Up @@ -2032,7 +2036,13 @@ describe.only('Attachments Integration Tests --CMIS METADATA', () => {
const { getCmisProperty } = require('./utills/cmis-document-helper');
const createdBy = await getCmisProperty(metadataEntityID, "metadata-test.pdf", "cmis:createdBy");
expect(createdBy).toBeTruthy();
expect(createdBy).toBe(credentials.username);
// For namedUser flow, SDM's cmis:createdBy is the authenticated user.
// For technicalUser flow, it's the client_credentials clientid — must NOT match the named user.
if (tokenFlow === 'namedUser') {
expect(createdBy).toBe(credentials.username);
} else if (tokenFlow === 'technicalUser') {
expect(createdBy).not.toBe(credentials.username);
}
console.log(`SDM createdBy field verified: ${createdBy}`);

// Cleanup
Expand Down
Loading