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
Copy file name to clipboardExpand all lines: advanced/fiori.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -490,8 +490,8 @@ For this feature to work correctly, CAP adds additional elements to your draft-e
490
490
This feature initiates a database schema update, as it adds an additional element to `DraftAdministrativeData`.
491
491
:::
492
492
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.
495
495
:::
496
496
To disable this feature, set <Config>cds.fiori.draft_messages:false</Config>.
Copy file name to clipboardExpand all lines: cds/cdl.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -979,7 +979,7 @@ Essentially, Compositions are the same as _[associations](#associations)_, just
979
979
:::
980
980
981
981
::: 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:
983
983
- Very limited Draft support. Fiori elements does not support compositions of one unless you take care of their creation in a custom handler.
984
984
- No extensive support for modifications over paths if compositions of one are involved. You must fill in foreign keys manually in a custom handler.
Copy file name to clipboardExpand all lines: guides/data-privacy/annotations.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,9 +141,10 @@ annotate my.Customers with @PersonalData: {
141
141
142
142
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.
143
143
144
-
- Each `@PersonalData` entity needs to identify a the `DataSubjectID` element.
144
+
- Each `@PersonalData` entity needs to identify a `DataSubjectID` element.
145
145
- For entities with `DataSubject` semantics, this is typically the primary key.
146
146
- 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.
Copy file name to clipboardExpand all lines: guides/multitenancy/index.md
+8-34Lines changed: 8 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -292,12 +292,6 @@ This is a known issue in CDS 9.
292
292
293
293
## Test-Drive Locally {#test-locally}
294
294
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
-
301
295
<divclass="impl java">
302
296
303
297
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`:
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
-
357
332
</div>
358
333
359
334
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
410
385
<divclass="impl node">
411
386
412
387
```sh
413
-
cds watch --profile local-multitenancy
388
+
cds watch --with-mtx
414
389
```
415
390
416
391
::: details Persistent database
@@ -445,16 +420,15 @@ In the following steps, we start two servers, the main app and MTX sidecar, and
Copy file name to clipboardExpand all lines: guides/multitenancy/mtxs.md
+138Lines changed: 138 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -810,6 +810,8 @@ See the [list of possible `kind` values](../../cds/csn#def-properties).{.learn-m
810
810
-`fields` lists the fields that are allowed to be extended. If the list is omitted, all fields can be extended.
811
811
-`new-entities` specifies the maximum number of entities that can be added to a service.
812
812
813
+
[Check Extension Restrictions for more details.](#extension-restrictions){.learn-more}
814
+
813
815
### GET `Extensions/<ID>`_→ [{ ID, csn, timestamp }]_ {#get-extensions}
814
816
815
817
Returns a list of all tenant-specific extensions.
@@ -1044,6 +1046,142 @@ The response is similar to the following:
1044
1046
1045
1047
The job and task status can take on the values `QUEUED`, `RUNNING`, `FINISHED` and `FAILED`.
1046
1048
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
+
1047
1185
## DeploymentService
1048
1186
1049
1187
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