You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added support for the `@Validation.Maximum` annotation to define the maximum allowed file size for attachments:
18
+
```cds
19
+
annotate my.Books.attachments with {
20
+
content @Validation.Maximum: '2MB';
21
+
}
22
+
```
23
+
24
+
### Fixed
25
+
26
+
- Removed the previous hard limit of `400 MB` for file uploads. Files exceeding this size may still fail during malware scanning and will be marked with a `Failed` status.
27
+
- Resolved issues with generic handler registration, enabling services to intercept the attachments plugin using middleware.
28
+
29
+
## Version 3.3.0
30
+
31
+
### Added
32
+
33
+
- Added [`standard`](./README.md#supported-storage-provider) kind and set it as the default so that the configuration needs no adjustment when switching hyper-scalers.
34
+
- Added support for uploading and updating attachments via `srv.run(INSERT.into(Attachments).entries())` or `srv.run(UPDATE.entity(Attachments).set())`
35
+
36
+
### Fixed
37
+
38
+
- Fixed an issue that in multi-tenancy scenarios with separate object stores duplicate object stores per tenant were created when updating the tenant binding via the SaaS dependency service.
39
+
- Fixed a race-condition where tenant isolation in separate object store mode could be broken.
40
+
- Fixed a case where attachments were not correctly deleted.
41
+
- Fixed a server crash when using the `AttachmentsSrv.put` API to upload an attachment.
42
+
- Fixed a server crash when no object store would be bound to the application on BTP.
43
+
- Fixed a server crash when the filename would not be given when creating new attachment metadata.
44
+
- Fixed an issue where attachment handlers would be missing when all Attachments entity were behind feature toggles.
45
+
- Fixed an issue where with storage kind `db` attachments could not be uploaded as drafts.
46
+
- Fixed an issue where the content could be uploaded for a not existing attachments entity.
47
+
7
48
## Version 3.2.0
8
49
9
50
### Added
@@ -15,8 +56,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
15
56
- Added criticality status to the attachment scan status.
16
57
- Provided translations for all SAP-supported languages.
Copy file name to clipboardExpand all lines: README.md
+70-9Lines changed: 70 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ For a quick local development setup with in-memory storage:
56
56
// (...)
57
57
"[hybrid]": {
58
58
"attachments": {
59
-
"kind": "s3"
59
+
"kind": "standard"
60
60
// (...)
61
61
}
62
62
}
@@ -200,9 +200,11 @@ Scan status codes:
200
200
-`Failed`: Scanning failed.
201
201
202
202
> [!Note]
203
-
> The plugin currently supports file uploads up to 400 MB in size per attachment as this is a limitation of the [malware scanning service](https://help.sap.com/docs/malware-scanning-servce/sap-malware-scanning-service/what-is-sap-malware-scanning-service). Please note: this limitation remains even with the malware scanner disabled.
204
203
> The malware scanner supports mTLS authentication which requires an annual renewal of the certificate. Previously, basic authentication was used which has now been deprecated.
205
204
205
+
> [!Note]
206
+
> If the malware scanner reports a file size larger than the limit specified via [@Validation.Maximum](#specify-the-maximum-file-size) it removes the file and sets the status of the attachment metadata to failed.
207
+
206
208
207
209
### Visibility Control for Attachments UI Facet Generation
208
210
@@ -243,6 +245,56 @@ The typical sequence includes:
243
245
1.**POST** -> create attachment metadata, returns ID
244
246
2.**PUT** -> upload file content using the ID
245
247
248
+
### Specify the maximum file size
249
+
250
+
You can specify the maximum file size by annotating the attachments content property with `@Validation.Maximum`
251
+
252
+
```cds
253
+
entity Incidents {
254
+
...
255
+
attachments: Composition of many Attachments;
256
+
}
257
+
258
+
annotate Incidents.attachments with {
259
+
content @Validation.Maximum : '20MB';
260
+
}
261
+
```
262
+
263
+
The default is 400MB
264
+
265
+
### Restrict allowed MIME types
266
+
267
+
You can restrict which MIME types are allowed for attachments by annotating the content property with `@Core.AcceptableMediaTypes`. This validation is performed during file upload.
To allow all MIME types (default behavior), either omit the annotation or use:
289
+
290
+
```cds
291
+
annotate Incidents.attachments with {
292
+
content @Core.AcceptableMediaTypes : ['*/*'];
293
+
}
294
+
```
295
+
296
+
When a file with a disallowed MIME type is uploaded, the request will be rejected with a `400` error.
297
+
246
298
## Releases
247
299
248
300
- The plugin is released to [NPM Registry](https://www.npmjs.com/package/@cap-js/attachments).
@@ -258,12 +310,21 @@ The typical sequence includes:
258
310
## Architecture Overview
259
311
### Multitenancy
260
312
261
-
The plugin supports multitenancy scenarios, allowing both shared and tenant-specific object store instances.
313
+
The plugin supports multi-tenancy scenarios, allowing both shared and tenant-specific object store instances.
262
314
263
315
> [!Note]
264
-
> Starting from version 2.1.0, **separate mode** for object store instances is the default setting for multitenancy.
316
+
> Starting from version 2.1.0, **separate mode** for object store instances is the default setting for multi-tenancy.
265
317
266
-
For multitenant applications, `@cap-js/attachments` must be included in the dependencies of both the application-level and _mtx/sidecar/package.json_ files.
318
+
For multi-tenant applications, `@cap-js/attachments` must be included in the dependencies of both the application-level and _mtx/sidecar/package.json_ files.
319
+
320
+
#### Separate object store instances
321
+
322
+
By default the plugin creates for each tenant its own object store instance during the tenants subscription.
323
+
324
+
When the tenant unsubscribes the object store instance is deleted.
325
+
326
+
> [!WARNING]
327
+
> When you remove the plugin from an application after separate object stores already have been created, the object stores are not automatically removed!
267
328
268
329
#### Shared Object Store Instance
269
330
@@ -333,10 +394,10 @@ To set the binding, please see the section [Storage Targets](#storage-targets).
333
394
334
395
##### Supported Storage Provider
335
396
336
-
-**AWS S3** (`kind: "s3"`)
337
-
-**Azure Blob Storage** (`kind: "azure"`)
338
-
-**Google Cloud Platform** (`kind: "gcp"`)
339
-
397
+
-**Standard** (`kind: "standard"`) | Depending on the bound object store credentials, uses AWS S3, Azure Blob Storage or GCP Cloud Storage. You can manually specify the implementation by adjusting the type to:
0 commit comments