Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
3402e55
Started with implementation of Azure blob storage
KoblerS Sep 23, 2025
5f9f2dc
Merge branch 'main' into multi-cloud-provider-support
KoblerS Oct 10, 2025
30b9efc
Refactor Azure Blob Storage service to improve logging and error hand…
KoblerS Oct 10, 2025
0c9b1e7
Add Azure Blob Storage settings and refactor tenant ID retrieval in A…
KoblerS Oct 10, 2025
5e6939a
Refactor AzureAttachmentsService to improve content handling in the p…
KoblerS Oct 10, 2025
d902358
Update error message for missing Azure Blob Storage credentials in Az…
KoblerS Oct 10, 2025
5b810b3
Add retry logic for Cloud Foundry login in deployment action (#262)
KoblerS Oct 10, 2025
6dfa7c4
258 chore remove cross dependency from tests (#259)
Schmarvinius Oct 10, 2025
7668ca5
Enhance AWS Attachments Service with detailed JSDoc comments and impr…
KoblerS Oct 16, 2025
822f2f6
Update translation_v2.json (#265)
schiwekM Oct 13, 2025
668c4e5
Added missing descr column (#267)
schiwekM Oct 13, 2025
fbcd591
Prepare release notes (#266)
KoblerS Oct 14, 2025
c0a71f6
Enhance memory management and error handling in attachment processing…
KoblerS Oct 16, 2025
daf9fc5
Refactor Azure Blob Storage and malware scanner integration for impro…
KoblerS Oct 16, 2025
80ea57e
Merge branch 'main' into 69-support-for-azure-blob-storage
KoblerS Oct 16, 2025
c06c518
Improve error handling for credential validation in AWS S3 and Azure …
KoblerS Oct 17, 2025
261e78c
Add placeholder for deleteInfectedAttachment method in AWS and Azure …
KoblerS Oct 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.tabSize": 2,
"editor.indentSize": 2
}
22 changes: 12 additions & 10 deletions lib/aws-s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ module.exports = class AWSAttachmentsService extends require("./basic") {
const missingFields = requiredFields.filter(field => !creds[field])

if (missingFields.length > 0) {
logConfig.configValidation('objectStore.credentials', creds, false,
`Object Store credentials missing: ${missingFields.join(', ')}`)
if (Object.keys(creds).includes('container_name')) {
throw new Error('Azure Blob Storage credentials found where AWS S3 credentials expected, please check your service bindings.')
}
throw new Error(`Missing Object Store credentials: ${missingFields.join(', ')}`)
}

Expand Down Expand Up @@ -429,21 +430,21 @@ module.exports = class AWSAttachmentsService extends require("./basic") {
* @param {import('express').NextFunction} next - The next middleware function
*/
async updateContentHandler(req, next) {
logConfig.debug(`[S3 Upload] Uploading file using updateContentHandler for ${req.target.name}`)
logConfig.debug(`[AWS S3] Uploading file using updateContentHandler for ${req.target.name}`)

// Check separate object store instances
if (separateObjectStore) {
const tenantID = cds.context.tenant
await this.createClientS3(tenantID)
}

const targetID = req.data.ID || req.params[1]?.ID || req.params[1];
const targetID = req.data.ID || req.params[1]?.ID || req.params[1]
if (!targetID) {
req.reject(400, "Missing ID in request");
req.reject(400, "Missing ID in request")
}

if (req?.data?.content) {
const response = await SELECT.from(req.target, { ID: targetID }).columns("url");
const response = await SELECT.from(req.target, { ID: targetID }).columns("url")
if (response?.url) {
const Key = response.url
const input = {
Expand All @@ -460,7 +461,7 @@ module.exports = class AWSAttachmentsService extends require("./basic") {
const keys = { ID: targetID }

const scanRequestJob = cds.spawn(async () => {
await scanRequest(req.target, keys, req)
await scanRequest(req.target, keys)
})

scanRequestJob.on('error', async (err) => {
Expand All @@ -470,12 +471,12 @@ module.exports = class AWSAttachmentsService extends require("./basic") {
{ keys, errorMessage: err.message })
})

logConfig.debug(`[S3 Upload] Uploaded file using updateContentHandler for ${req.target.name}`)
logConfig.debug(`[AWS S3] Uploaded file using updateContentHandler for ${req.target.name}`)
}
} else if (req?.data?.note) {
const key = { ID: targetID }
await super.update(req.target, key, { note: req.data.note })
logConfig.debug(`[S3 Upload] Updated file upload with note for ${req.target.name}`)
logConfig.debug(`[AWS S3] Updated file upload with note for ${req.target.name}`)
} else {
next()
}
Expand Down Expand Up @@ -603,7 +604,7 @@ module.exports = class AWSAttachmentsService extends require("./basic") {
*/
async delete(Key) {
const tenantID = cds.context.tenant
logConfig.debug(`[S3 Upload] Executing delete for file ${Key} in bucket ${this.bucket}`)
logConfig.debug(`[AWS S3] Executing delete for file ${Key} in bucket ${this.bucket}`)

// Check separate object store instances
if (separateObjectStore) {
Expand All @@ -620,6 +621,7 @@ module.exports = class AWSAttachmentsService extends require("./basic") {
}

/**
* Requires implementation as delete of infected attachment is specific to storage service
* @inheritdoc
*/
async deleteInfectedAttachment(Attachments, key) {
Expand Down
Loading
Loading