Skip to content

Commit 6f42a05

Browse files
renejeglinskyPDT42sjvanschgeoeugene-andreev
authored
Release 2025-24-10 (#2172)
Co-authored-by: Paul <paul.erlenwein@gmail.com> Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com> Co-authored-by: Christian Georgi <christian.georgi@sap.com> Co-authored-by: Evgeny Andreev <eugene.andreev@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Steffen Waldmann <steffen.waldmann@sap.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: chgeo <7470719+chgeo@users.noreply.github.com> Co-authored-by: ecklie <52252271+ecklie@users.noreply.github.com> Co-authored-by: Marc Becker <marc.becker@sap.com> Co-authored-by: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Co-authored-by: Dr. David A. Kunz <david.kunz@sap.com> Co-authored-by: Johannes Vogt <j.vogt@sap.com> Co-authored-by: Jakob Marius Kjaer <jakob.m.kjaer@gmail.com> Co-authored-by: vincentatsap <152401717+vincentatsap@users.noreply.github.com>
2 parents 19ef554 + bab30f8 commit 6f42a05

33 files changed

Lines changed: 658 additions & 340 deletions

.vitepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ config.rewrites = rewrites
106106
// Add custom capire info to the theme config
107107
config.themeConfig.capire = {
108108
versions: {
109-
java_services: '4.4.0',
109+
java_services: '4.4.1',
110110
java_cds4j: '4.4.1'
111111
},
112112
gotoLinks: []

advanced/fiori.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ For this feature to work correctly, CAP adds additional elements to your draft-e
490490
This feature initiates a database schema update, as it adds an additional element to `DraftAdministrativeData`.
491491
:::
492492

493-
::: warning Requires OData V4 and UI5 version >=1.135.0
494-
State messages require UI5 to use _document URLs_. CAP sets the `@Common.AddressViaNavigationPath` annotation to enable this. You need OData V4 and UI5 version >= 1.135.0. OData V2 does not support this annotation.
493+
::: warning Requires OData V4 and UI5 version >=1.136.0
494+
State messages require UI5 to use _document URLs_. CAP sets the `@Common.AddressViaNavigationPath` annotation to enable this. You need OData V4 and UI5 version >= 1.136.0. OData V2 does not support this annotation.
495495
:::
496496
To disable this feature, set <Config>cds.fiori.draft_messages:false</Config>.
497497

cds/cdl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ Essentially, Compositions are the same as _[associations](#associations)_, just
979979
:::
980980

981981
::: warning Limitations of Compositions of one
982-
Using of compositions of one for entities is discouraged. There is often no added value of using them as the information can be placed in the root entity. Compositions of one have limitations as follow:
982+
Using compositions of one for entities is discouraged. There is often no added value of using them as the information can be placed in the root entity. Compositions of one have limitations as follow:
983983
- Very limited Draft support. Fiori elements does not support compositions of one unless you take care of their creation in a custom handler.
984984
- No extensive support for modifications over paths if compositions of one are involved. You must fill in foreign keys manually in a custom handler.
985985
:::

cds/types.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ These types are used to define the structure of entities and services, and are m
3939
| `Time` | e.g. `24:59:59` | _TIME_ |
4040
| `DateTime` | _sec_ precision | _TIMESTAMP_ |
4141
| `Timestamp` | _µs_ precision, with up to 7 fractional digits | _TIMESTAMP_ |
42-
| `String` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(4)</sup> | _NVARCHAR_ |
43-
| `Binary` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(5)</sup> | _VARBINARY_ |
42+
| `String` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(4)(5)</sup> | _NVARCHAR_ |
43+
| `Binary` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(4)(6)</sup> | _VARBINARY_ |
4444
| `LargeBinary` | Unlimited data, usually streamed at runtime | _BLOB_ |
4545
| `LargeString` | Unlimited data, usually streamed at runtime | _NCLOB_ |
4646
| `Map` | Mapped to *NCLOB* for HANA. | *JSON* type |
@@ -54,9 +54,11 @@ These types are used to define the structure of entities and services, and are m
5454
>
5555
> <sup>(3)</sup> Not available on PostgreSQL and H2.
5656
>
57-
> <sup>(4)</sup> Configurable through `cds.cdsc.defaultStringLength`.
57+
> <sup>(4)</sup> Productive apps should always use an explicit length. Use the default only for rapid prototyping.
5858
>
59-
> <sup>(5)</sup> Configurable through `cds.cdsc.defaultBinaryLength`.
59+
> <sup>(5)</sup> Configurable through `cds.cdsc.defaultStringLength`.
60+
>
61+
> <sup>(6)</sup> Configurable through `cds.cdsc.defaultBinaryLength`.
6062
6163
#### See also...
6264

guides/data-privacy/annotations.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ annotate my.Customers with @PersonalData: {
141141

142142
Use this annotation to identify data subject's unique key, or a reference to it. References are commonly associations or foreign keys in subject details entities, or related ones, referring to a subject entity.
143143

144-
- Each `@PersonalData` entity needs to identify a the `DataSubjectID` element.
144+
- Each `@PersonalData` entity needs to identify a `DataSubjectID` element.
145145
- For entities with `DataSubject` semantics, this is typically the primary key.
146146
- For entities with `DataSubjectDetails` or `Other` semantics, this is usually an association to the data subject.
147+
- Fields marked as `DataSubjectID` should use [`not null`](../databases#not-null) to guarantee a value is present at all times.
147148

148149
Hence, we annotate our model as follows:
149150

guides/deployment/to-cf.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,14 @@ cf target
236236
```
237237
[Learn more about `cf login`](https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/7a37d66c2e7d401db4980db0cd74aa6b.html){.learn-more}
238238

239-
::: tip Prevent outdated lock file issues
240-
If your project already includes a _package-lock.json_, run `npm update` to make sure it’s in sync with your _package.json_ before proceeding.
241-
:::
242239

243-
You can now freeze dependencies, build, and deploy the application:
240+
If your project already includes a _package-lock.json_, freeze your updated dependencies:
241+
242+
```sh
243+
npm install --package-lock-only
244+
```
245+
246+
You can now build and deploy the application:
244247

245248
```sh
246249
cds up

guides/extensibility/customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ This enforces the following restrictions:
139139
- Only entities in namespace `sap.capire.orders` can be extended, with a maximum 2 new fields allowed.
140140
- Only the `OrdersService` can be extended, with a maximum of 2 new entities allowed.
141141

142-
[Learn more about extension restrictions.](../multitenancy/mtxs#extensibility-config){.learn-more}
142+
[Learn more about extension restrictions.](../multitenancy/mtxs#extension-restrictions){.learn-more}
143143

144144
### 3. Provide Template Projects {#templates}
145145

guides/messaging/event-broker.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ Your SAP Cloud Application Event Hub configuration must include your system name
120120
resources:
121121
- name: incidents-event-broker
122122
type: org.cloudfoundry.managed-service
123+
requires:
124+
- name: incidents-srv-api
123125
parameters:
124126
service: event-broker
125127
service-plan: event-connectivity
@@ -128,8 +130,7 @@ resources:
128130
# should start with own namespace (i.e., "foo.bar") and may not be longer than 15 characters
129131
systemNamespace: cap.incidents
130132
webhookUrl: ~{incidents-srv-api/url}/-/cds/event-broker/webhook
131-
requires:
132-
- name: incidents-srv-api
133+
133134
```
134135

135136
```yaml [mta.yaml in Java]

guides/multitenancy/index.md

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,6 @@ This is a known issue in CDS 9.
292292

293293
## Test-Drive Locally {#test-locally}
294294

295-
For local testing, create a new profile that contains the multitenancy configuration:
296-
297-
```sh
298-
cds add multitenancy --for local-multitenancy
299-
```
300-
301295
<div class="impl java">
302296

303297
For multitenancy you need additional dependencies in the _pom.xml_ of the `srv` directory. To support mock users in the local test scenario add `cds-starter-cloudfoundry`:
@@ -316,44 +310,25 @@ cds add multitenancy --for local-multitenancy
316310
```yaml [application.yaml]
317311
---
318312
spring:
319-
config.activate.on-profile: local-multitenancy
313+
config.activate.on-profile: with-mtx
320314
#...
321315
cds:
322316
multi-tenancy:
323317
mtxs.enabled: true
324-
security.mock.users: // [!code focus]
325-
- name: alice // [!code focus]
318+
security.mock.users: # [!code focus]
319+
alice: # [!code focus]
326320
tenant: t1
327321
roles: [ admin ]
328-
- name: bob // [!code focus]
322+
bob: # [!code focus]
329323
tenant: t1
330324
roles: [ cds.ExtensionDeveloper ]
331-
- name: erin // [!code focus]
325+
erin: # [!code focus]
332326
tenant: t2
333327
roles: [ admin, cds.ExtensionDeveloper ]
334328
```
335329
336330
:::
337331
338-
Configure the sidecar to use dummy authentication.
339-
340-
::: code-group
341-
342-
```json [mtx/sidecar/package.json]
343-
{
344-
"cds": {
345-
"profile": "mtx-sidecar",
346-
"[development]": {
347-
"requires": {
348-
"auth": "dummy"
349-
}
350-
}
351-
}
352-
}
353-
```
354-
355-
:::
356-
357332
</div>
358333
359334
Before deploying to the cloud, you can test-drive common SaaS operations with your app locally, including SaaS startup, subscribing tenants, and upgrading tenants.
@@ -410,7 +385,7 @@ In the following steps, we start two servers, the main app and MTX sidecar, and
410385
<div class="impl node">
411386

412387
```sh
413-
cds watch --profile local-multitenancy
388+
cds watch --with-mtx
414389
```
415390

416391
::: details Persistent database
@@ -445,16 +420,15 @@ In the following steps, we start two servers, the main app and MTX sidecar, and
445420
<div class="impl java">
446421

447422
```sh
448-
cd srv
449-
mvn cds:watch -Dspring-boot.run.profiles=local-multitenancy
423+
mvn cds:watch -Dspring-boot.run.profiles=with-mtx
450424
```
451425

452426
::: details Persistent database
453427

454428
The server starts as usual, with the difference that a persistent database is used automatically instead of an in-memory one:
455429

456430
```log
457-
2023-03-31 14:19:23.987 INFO 68528 --- [ restartedMain] c.s.c.bookshop.Application : The following 1 profile is active: "local-mtxs"
431+
2023-03-31 14:19:23.987 INFO 68528 --- [ restartedMain] c.s.c.bookshop.Application : The following 1 profile is active: "with-mtx"
458432
...
459433
2023-03-31 14:19:23.987 INFO 68528 --- [ restartedMain] c.s.c.services.impl.ServiceCatalogImpl : Registered service ExtensibilityService$Default
460434
2023-03-31 14:19:23.999 INFO 68528 --- [ restartedMain] c.s.c.services.impl.ServiceCatalogImpl : Registered service CatalogService

guides/multitenancy/mtxs.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,8 @@ See the [list of possible `kind` values](../../cds/csn#def-properties).{.learn-m
810810
- `fields` lists the fields that are allowed to be extended. If the list is omitted, all fields can be extended.
811811
- `new-entities` specifies the maximum number of entities that can be added to a service.
812812

813+
[Check Extension Restrictions for more details.](#extension-restrictions){.learn-more}
814+
813815
### GET `Extensions/<ID>` _[{ ID, csn, timestamp }]_ {#get-extensions}
814816

815817
Returns a list of all tenant-specific extensions.
@@ -1044,6 +1046,142 @@ The response is similar to the following:
10441046

10451047
The job and task status can take on the values `QUEUED`, `RUNNING`, `FINISHED` and `FAILED`.
10461048

1049+
### Extension Restrictions
1050+
1051+
You can restrict what parts of the application model can be extended by the SaaS customer.
1052+
This section lists the restrictions that you can define via the `extension-allowlist`.
1053+
1054+
> If an `extension-allowlist` is defined, only extensions in that list are allowed.
1055+
1056+
Using `"for": ["*"]` allows to apply rules to all entities and services.
1057+
1058+
:::info Most checks happen at design time
1059+
`cds push` automatically builds the extension project, checking most restrictions locally.
1060+
Some checks can only be performed at runtime, for example extension limit violations across multiple projects.
1061+
:::
1062+
1063+
#### Restrict Service Extensions
1064+
1065+
By adding services to the `extension-allowlist`, services are enabled for extensions by Saas customers.
1066+
In addition, you can restrict the number of bound entities by setting a limit for "new-entites".
1067+
1068+
```jsonc
1069+
"cds.xt.ExtensibilityService": {
1070+
"extension-allowlist": [
1071+
{
1072+
// at most 2 new entities in CatalogService
1073+
"for": ["CatalogService"],
1074+
"new-entities": 2
1075+
}
1076+
]
1077+
```
1078+
1079+
#### Restrict Entities and Fields
1080+
1081+
Entities can be extended with additional fields and also modifications of existing fields. Both kinds of extensions
1082+
can be restricted.
1083+
- `new-fields` specifies the maximum number of fields that can be added.
1084+
- `fields` lists existing fields that are allowed to be extended. If the list is omitted, all fields can be extended.
1085+
1086+
```jsonc
1087+
"cds.xt.ExtensibilityService": {
1088+
"extension-allowlist": [
1089+
{
1090+
// at most 2 new fields in entities from the my.bookshop namespace
1091+
"for": ["my.bookshop"],
1092+
"new-fields": 2,
1093+
// allow extensions for field "description" only
1094+
"fields": ["description"]
1095+
},
1096+
{
1097+
// at most 1 new fields in my.bookshop.Authors
1098+
"for": ["my.bookshop.Authors"],
1099+
"new-fields": 1
1100+
}
1101+
]
1102+
}
1103+
```
1104+
This restriction allows two new fields for all entities in namespace `my.bookshop` but only one new field
1105+
in entity `my.bookshop.Authors`.
1106+
1107+
The `field` restriction allows
1108+
```cds
1109+
extend my.bookshop.Books:description with (length: 2000);
1110+
```
1111+
but not, for example
1112+
```cds
1113+
extend my.bookshop.Books:title with (length: 200);
1114+
```
1115+
1116+
#### Restrict / Enable Annotations
1117+
1118+
The following annotations are blocked by default because they affect the persistence or security.
1119+
```txt
1120+
@restrict
1121+
@requires
1122+
@readonly
1123+
@mandatory
1124+
@assert.*
1125+
@cds.persistence.*
1126+
@sql.append
1127+
@sql.prepend
1128+
@path
1129+
@impl
1130+
@cds.autoexpose
1131+
@cds.api.ignore
1132+
@odata.etag
1133+
@cds.query.limit
1134+
@cds.localized
1135+
@cds.valid.*
1136+
@cds.search
1137+
```
1138+
1139+
You can, at your own risk, add exceptions for annotations.
1140+
```jsonc
1141+
"cds.xt.ExtensibilityService": {
1142+
"extension-allowlist": [
1143+
{
1144+
"for": ["my.bookshop.Books"],
1145+
"annotations": ["@mandatory", "@cds.api.ignore"]
1146+
},
1147+
{
1148+
"for": ["my.bookshop.Authors:placeOfBirth"],
1149+
"annotations": ["@mandatory"]
1150+
}
1151+
]
1152+
}
1153+
```
1154+
> Exception: `@cds.persistence.journal` cannot be applied as an extension to base entities.
1155+
1156+
#### Restrict Unbound Entities
1157+
1158+
You can also restrict unbound entities via their namespace.
1159+
1160+
For example
1161+
```jsonc
1162+
"cds.xt.ExtensibilityService": {
1163+
"extension-allowlist": [
1164+
{
1165+
// at most 1 new entities for namepace my.new
1166+
"for": ["my.new"],
1167+
"new-entities": 1
1168+
}
1169+
]
1170+
```
1171+
only allows one unbound entity with namespace `my.new`.
1172+
1173+
As a special case, you can also block any unbound entities:
1174+
```jsonc
1175+
"cds.xt.ExtensibilityService": {
1176+
"extension-allowlist": [
1177+
{
1178+
// no new entities for all namespaces
1179+
"for": ["*"],
1180+
"new-entities": 0
1181+
}
1182+
]
1183+
```
1184+
10471185
## DeploymentService
10481186
10491187
The _DeploymentService_ handles `subscribe`, `unsubscribe`, and `upgrade` events for single tenants and single apps or micro services. Actual implementation is provided through internal plugins, for example, for SAP HANA and SQLite.

0 commit comments

Comments
 (0)