@sap/cds-dk 9.9.3 → 9.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/lib/init/constants.js +1 -1
- package/lib/mtx/auth_manager.js +30 -17
- package/lib/mtx/settings_manager.js +7 -4
- package/npm-shrinkwrap.json +41 -32
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,19 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
8
8
|
|
|
9
|
+
## Version 9.9.5 - 2026-08-24
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- `cds login` now uses the renamed login endpoints `/-/cds/login/grant` and `/-/cds/login/grant-metadata` with a legacy fallback, and updates saved legacy token URLs.
|
|
14
|
+
|
|
15
|
+
## Version 9.9.4 - 2026-07-31
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- `cds init` uses Maven Java archetype version 4.9.1 for creating Java projects.
|
|
20
|
+
- Other dependency updates
|
|
21
|
+
|
|
9
22
|
## Version 9.9.3 - 2026-06-29
|
|
10
23
|
|
|
11
24
|
### Fixed
|
package/lib/init/constants.js
CHANGED
package/lib/mtx/auth_manager.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const cds = require('../cds');
|
|
2
|
-
const { SettingsManager } = require('./settings_manager');
|
|
2
|
+
const { SettingsManager, OAUTH_PATH, OAUTH_PATH_LEGACY_TOKEN } = require('./settings_manager');
|
|
3
3
|
const { ParamCollection } = require('./params');
|
|
4
4
|
const { getMessage } = require('./util/logging');
|
|
5
5
|
const { buildResponseError, buildNetworkError, parseResponseBody } = require('./util/request');
|
|
@@ -63,6 +63,32 @@ function reqParams(method, params) {
|
|
|
63
63
|
: { url: `${url}?${data}`, data: undefined, ignored };
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
async function postTokenTo(url, data, method, params) {
|
|
67
|
+
DEBUG?.(`Getting authentication token from ${method.toUpperCase()} ${params.obfuscateQueryParams(url)}`);
|
|
68
|
+
const response = await fetch(url, {
|
|
69
|
+
method: method.toUpperCase(),
|
|
70
|
+
body: data,
|
|
71
|
+
headers: { 'content-type': 'application/x-www-form-urlencoded' }
|
|
72
|
+
});
|
|
73
|
+
if (!response.ok) {
|
|
74
|
+
throw await buildResponseError(method, url, response);
|
|
75
|
+
}
|
|
76
|
+
return parseResponseBody(response);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function postToken(params, url, data, method) {
|
|
80
|
+
try {
|
|
81
|
+
return await postTokenTo(url, data, method, params);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
if (e.status !== 404 || !url.includes(OAUTH_PATH)) {
|
|
84
|
+
throw e;
|
|
85
|
+
}
|
|
86
|
+
const legacyUrl = url.replace(OAUTH_PATH, OAUTH_PATH_LEGACY_TOKEN);
|
|
87
|
+
DEBUG?.(`Token endpoint not found, retrying against legacy path ${params.obfuscateQueryParams(legacyUrl)}`);
|
|
88
|
+
return postTokenTo(legacyUrl, data, method, params);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
66
92
|
async function fetchToken(params) {
|
|
67
93
|
if (params.has('token') || !(params.has('refreshToken') || params.has('passcode') || params.has('clientid') || !params.has('passcodeUrl'))) {
|
|
68
94
|
return;
|
|
@@ -75,25 +101,12 @@ async function fetchToken(params) {
|
|
|
75
101
|
if (Object.keys(ignored).length) {
|
|
76
102
|
console.log(`Ignoring parameters for fetching token: ${Object.entries(ignored).map(([param, reason]) => `${param} (${reason})`).join(', ')}.`);
|
|
77
103
|
}
|
|
78
|
-
DEBUG?.(`Getting authentication token from ${method.toUpperCase()} ${params.obfuscateQueryParams(url)}`);
|
|
79
104
|
error = undefined;
|
|
80
105
|
try {
|
|
81
|
-
|
|
82
|
-
method: method.toUpperCase(),
|
|
83
|
-
body: data,
|
|
84
|
-
headers: { 'content-type': 'application/x-www-form-urlencoded' }
|
|
85
|
-
});
|
|
86
|
-
if (!response.ok) {
|
|
87
|
-
throw await buildResponseError(method, url, response);
|
|
88
|
-
}
|
|
89
|
-
responseData = await parseResponseBody(response);
|
|
106
|
+
responseData = await postToken(params, url, data, method);
|
|
90
107
|
break;
|
|
91
108
|
} catch (e) {
|
|
92
|
-
|
|
93
|
-
error = e;
|
|
94
|
-
} else {
|
|
95
|
-
error = buildNetworkError(method, url, e);
|
|
96
|
-
}
|
|
109
|
+
error = e.status ? e : buildNetworkError(method, url, e);
|
|
97
110
|
DEBUG?.(`HTTP status ${error.status}`);
|
|
98
111
|
if (params.has('refreshToken')) {
|
|
99
112
|
DEBUG?.('Discarding invalid refresh token');
|
|
@@ -122,7 +135,7 @@ async function fetchToken(params) {
|
|
|
122
135
|
message += `. Ensure the client credentials are correct`;
|
|
123
136
|
}
|
|
124
137
|
} else {
|
|
125
|
-
message = '
|
|
138
|
+
message = 'token request failed';
|
|
126
139
|
}
|
|
127
140
|
throw new Error(message + '.', { cause: error });
|
|
128
141
|
}
|
|
@@ -35,8 +35,9 @@ const KEYRING_DESC = {
|
|
|
35
35
|
|
|
36
36
|
const MTX_FULLY_QUALIFIED = 'com.sap.cds.mtx';
|
|
37
37
|
const OAUTH_PATH_LEGACY = '/mtx/v1/oauth/token';
|
|
38
|
-
const
|
|
39
|
-
const
|
|
38
|
+
const OAUTH_PATH_LEGACY_TOKEN = '/-/cds/login/token';
|
|
39
|
+
const OAUTH_PATH = '/-/cds/login/grant';
|
|
40
|
+
const OAUTH_META_PATH = '/-/cds/login/grant-metadata';
|
|
40
41
|
|
|
41
42
|
const SETTINGS_DIR = path.join(os.homedir(), CONFIG_SUBDIRS[os.platform()] || '', MTX_FULLY_QUALIFIED);
|
|
42
43
|
const SETTINGS_FILE = 'projects.json';
|
|
@@ -295,7 +296,7 @@ class SettingsManager {
|
|
|
295
296
|
async function updateTokenUrl() {
|
|
296
297
|
const tokenUrl = secure(params.get('tokenUrl'), 'token URL');
|
|
297
298
|
const renewUrl = !logout && !params.get('skipToken')
|
|
298
|
-
&& (!tokenUrl || tokenUrl.includes('//-/cds') || tokenUrl.includes(OAUTH_PATH_LEGACY)
|
|
299
|
+
&& (!tokenUrl || tokenUrl.includes('//-/cds') || tokenUrl.includes(OAUTH_PATH_LEGACY) || tokenUrl.includes(OAUTH_PATH_LEGACY_TOKEN)
|
|
299
300
|
|| params.get('appUrl') !== loadedSettings.get('appUrl')
|
|
300
301
|
|| params.get('subdomain') !== loadedSettings.get('subdomain'));
|
|
301
302
|
if (renewUrl) {
|
|
@@ -719,5 +720,7 @@ class SettingsManager {
|
|
|
719
720
|
module.exports = {
|
|
720
721
|
SettingsManager,
|
|
721
722
|
other,
|
|
722
|
-
notifyLogin
|
|
723
|
+
notifyLogin,
|
|
724
|
+
OAUTH_PATH,
|
|
725
|
+
OAUTH_PATH_LEGACY_TOKEN
|
|
723
726
|
};
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cds-dk",
|
|
3
|
-
"version": "9.9.
|
|
3
|
+
"version": "9.9.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@sap/cds-dk",
|
|
9
|
-
"version": "9.9.
|
|
9
|
+
"version": "9.9.5",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@cap-js/asyncapi": "^1.0.0",
|
|
13
13
|
"@cap-js/openapi": "^1.0.0",
|
|
14
14
|
"@sap/cds": "^9",
|
|
15
|
+
"@sap/cds-compiler": "^6",
|
|
15
16
|
"@sap/cds-mtxs": "^3",
|
|
16
17
|
"@sap/hdi-deploy": "^5",
|
|
17
18
|
"express": "^4.22.1 || ^5",
|
|
@@ -52,8 +53,8 @@
|
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
55
|
"node_modules/@cap-js/openapi": {
|
|
55
|
-
"version": "1.
|
|
56
|
-
"integrity": "sha512-
|
|
56
|
+
"version": "1.6.0",
|
|
57
|
+
"integrity": "sha512-1Knrn9dU3CBAlKRlhTzZTlzbg1IULbUV39mvhcuDZrgMhSWhJ3OuJVcNWtMClq+VkUeYTkMYpysbPqrMRoeEdw==",
|
|
57
58
|
"license": "Apache-2.0",
|
|
58
59
|
"dependencies": {
|
|
59
60
|
"pluralize": "^8.0.0"
|
|
@@ -102,8 +103,8 @@
|
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
105
|
"node_modules/@sap/cds": {
|
|
105
|
-
"version": "9.9.
|
|
106
|
-
"integrity": "sha512-
|
|
106
|
+
"version": "9.9.3",
|
|
107
|
+
"integrity": "sha512-uSbggU5fycRhipYDUsfYwgeahx3E+B3ILq2bomm6rW22gzi/dO6OJNPyVnWDI6XDU/Q5Sd1v/9DT5fRI79p5tQ==",
|
|
107
108
|
"license": "SEE LICENSE IN LICENSE",
|
|
108
109
|
"dependencies": {
|
|
109
110
|
"@sap/cds-compiler": "^6.4",
|
|
@@ -129,8 +130,8 @@
|
|
|
129
130
|
}
|
|
130
131
|
},
|
|
131
132
|
"node_modules/@sap/cds-compiler": {
|
|
132
|
-
"version": "6.9.
|
|
133
|
-
"integrity": "sha512-
|
|
133
|
+
"version": "6.9.4",
|
|
134
|
+
"integrity": "sha512-gz7PeE3vjl0OdnK+XWH/aslQ6WNsqA1EDwqKOXho0tTDwqXSgpe3BT85PKy49ozytRkUGh/YU1/3ztO+dWeUvQ==",
|
|
134
135
|
"license": "SEE LICENSE IN LICENSE",
|
|
135
136
|
"bin": {
|
|
136
137
|
"cdsc": "bin/cdsc.js",
|
|
@@ -150,8 +151,8 @@
|
|
|
150
151
|
}
|
|
151
152
|
},
|
|
152
153
|
"node_modules/@sap/cds-mtxs": {
|
|
153
|
-
"version": "3.9.
|
|
154
|
-
"integrity": "sha512
|
|
154
|
+
"version": "3.9.6",
|
|
155
|
+
"integrity": "sha512-/eTldcrM9nc5orKJxqdrAiWvO5WcFoZWb1WH0DczWxX3abPJvD+0otHDeA9Uc5XP4ecFQ51bc4ZjR01lfXW1ew==",
|
|
155
156
|
"license": "SEE LICENSE IN LICENSE",
|
|
156
157
|
"dependencies": {
|
|
157
158
|
"@sap/hdi-deploy": "^5"
|
|
@@ -216,8 +217,8 @@
|
|
|
216
217
|
}
|
|
217
218
|
},
|
|
218
219
|
"node_modules/@sap/xsenv": {
|
|
219
|
-
"version": "6.2.
|
|
220
|
-
"integrity": "sha512-
|
|
220
|
+
"version": "6.2.2",
|
|
221
|
+
"integrity": "sha512-SGn+yaVKeXND/rQaQhqTZC+M6g5ASW1YnqAdQiZqNL74E1T1kUsDHttgOjQNkLObMZ0fsxgQxRPMnuVcAgIODg==",
|
|
221
222
|
"license": "SEE LICENSE IN LICENSE",
|
|
222
223
|
"dependencies": {
|
|
223
224
|
"debug": "4.4.3",
|
|
@@ -331,8 +332,8 @@
|
|
|
331
332
|
}
|
|
332
333
|
},
|
|
333
334
|
"node_modules/body-parser/node_modules/content-type": {
|
|
334
|
-
"version": "2.
|
|
335
|
-
"integrity": "sha512-
|
|
335
|
+
"version": "2.1.0",
|
|
336
|
+
"integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
|
|
336
337
|
"license": "MIT",
|
|
337
338
|
"engines": {
|
|
338
339
|
"node": ">=18"
|
|
@@ -840,8 +841,8 @@
|
|
|
840
841
|
}
|
|
841
842
|
},
|
|
842
843
|
"node_modules/hdb": {
|
|
843
|
-
"version": "2.29.
|
|
844
|
-
"integrity": "sha512-
|
|
844
|
+
"version": "2.29.6",
|
|
845
|
+
"integrity": "sha512-I9AQxpTn6OKm66rzzNWbJeKnxn1ylJinzSsq0J1O0HOwxv3VNuwQttKem2/DG/Sv/yRIU20dBiqZTqXjqs6Eog==",
|
|
845
846
|
"license": "Apache-2.0",
|
|
846
847
|
"dependencies": {
|
|
847
848
|
"iconv-lite": "0.7.0"
|
|
@@ -888,8 +889,8 @@
|
|
|
888
889
|
}
|
|
889
890
|
},
|
|
890
891
|
"node_modules/iconv-lite": {
|
|
891
|
-
"version": "0.7.
|
|
892
|
-
"integrity": "sha512-
|
|
892
|
+
"version": "0.7.3",
|
|
893
|
+
"integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
|
|
893
894
|
"license": "MIT",
|
|
894
895
|
"dependencies": {
|
|
895
896
|
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
|
@@ -974,11 +975,15 @@
|
|
|
974
975
|
}
|
|
975
976
|
},
|
|
976
977
|
"node_modules/media-typer": {
|
|
977
|
-
"version": "1.1.
|
|
978
|
-
"integrity": "sha512-
|
|
978
|
+
"version": "1.1.1",
|
|
979
|
+
"integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==",
|
|
979
980
|
"license": "MIT",
|
|
980
981
|
"engines": {
|
|
981
982
|
"node": ">= 0.8"
|
|
983
|
+
},
|
|
984
|
+
"funding": {
|
|
985
|
+
"type": "opencollective",
|
|
986
|
+
"url": "https://opencollective.com/express"
|
|
982
987
|
}
|
|
983
988
|
},
|
|
984
989
|
"node_modules/merge-descriptors": {
|
|
@@ -1097,8 +1102,8 @@
|
|
|
1097
1102
|
"license": "MIT"
|
|
1098
1103
|
},
|
|
1099
1104
|
"node_modules/node-abi": {
|
|
1100
|
-
"version": "3.
|
|
1101
|
-
"integrity": "sha512-
|
|
1105
|
+
"version": "3.94.0",
|
|
1106
|
+
"integrity": "sha512-W5ZNO5KRPB5TkYmGVD9F6YqhsglXJzE6etpbmT+f6EQElhiX/UTG551cnsRGvLG3fyZEg9HwaDmNmj5nwJ4z9g==",
|
|
1102
1107
|
"license": "MIT",
|
|
1103
1108
|
"optional": true,
|
|
1104
1109
|
"dependencies": {
|
|
@@ -1239,11 +1244,15 @@
|
|
|
1239
1244
|
}
|
|
1240
1245
|
},
|
|
1241
1246
|
"node_modules/range-parser": {
|
|
1242
|
-
"version": "1.
|
|
1243
|
-
"integrity": "sha512-
|
|
1247
|
+
"version": "1.3.0",
|
|
1248
|
+
"integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
|
|
1244
1249
|
"license": "MIT",
|
|
1245
1250
|
"engines": {
|
|
1246
1251
|
"node": ">= 0.6"
|
|
1252
|
+
},
|
|
1253
|
+
"funding": {
|
|
1254
|
+
"type": "opencollective",
|
|
1255
|
+
"url": "https://opencollective.com/express"
|
|
1247
1256
|
}
|
|
1248
1257
|
},
|
|
1249
1258
|
"node_modules/raw-body": {
|
|
@@ -1330,8 +1339,8 @@
|
|
|
1330
1339
|
"license": "MIT"
|
|
1331
1340
|
},
|
|
1332
1341
|
"node_modules/sax": {
|
|
1333
|
-
"version": "1.6.
|
|
1334
|
-
"integrity": "sha512-
|
|
1342
|
+
"version": "1.6.1",
|
|
1343
|
+
"integrity": "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==",
|
|
1335
1344
|
"license": "BlueOak-1.0.0",
|
|
1336
1345
|
"engines": {
|
|
1337
1346
|
"node": ">=11.0.0"
|
|
@@ -1545,8 +1554,8 @@
|
|
|
1545
1554
|
}
|
|
1546
1555
|
},
|
|
1547
1556
|
"node_modules/tar-fs": {
|
|
1548
|
-
"version": "2.1.
|
|
1549
|
-
"integrity": "sha512-
|
|
1557
|
+
"version": "2.1.5",
|
|
1558
|
+
"integrity": "sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw==",
|
|
1550
1559
|
"license": "MIT",
|
|
1551
1560
|
"optional": true,
|
|
1552
1561
|
"dependencies": {
|
|
@@ -1621,8 +1630,8 @@
|
|
|
1621
1630
|
}
|
|
1622
1631
|
},
|
|
1623
1632
|
"node_modules/type-is/node_modules/content-type": {
|
|
1624
|
-
"version": "2.
|
|
1625
|
-
"integrity": "sha512-
|
|
1633
|
+
"version": "2.1.0",
|
|
1634
|
+
"integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
|
|
1626
1635
|
"license": "MIT",
|
|
1627
1636
|
"engines": {
|
|
1628
1637
|
"node": ">=18"
|
|
@@ -1690,8 +1699,8 @@
|
|
|
1690
1699
|
"license": "ISC"
|
|
1691
1700
|
},
|
|
1692
1701
|
"node_modules/ws": {
|
|
1693
|
-
"version": "8.21.
|
|
1694
|
-
"integrity": "sha512-
|
|
1702
|
+
"version": "8.21.3",
|
|
1703
|
+
"integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==",
|
|
1695
1704
|
"license": "MIT",
|
|
1696
1705
|
"engines": {
|
|
1697
1706
|
"node": ">=10.0.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cds-dk",
|
|
3
|
-
"version": "9.9.
|
|
3
|
+
"version": "9.9.5",
|
|
4
4
|
"description": "Command line client and development toolkit for the SAP Cloud Application Programming Model",
|
|
5
5
|
"homepage": "https://cap.cloud.sap/",
|
|
6
6
|
"keywords": [
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@cap-js/asyncapi": "^1.0.0",
|
|
21
21
|
"@cap-js/openapi": "^1.0.0",
|
|
22
22
|
"@sap/cds": "^9",
|
|
23
|
+
"@sap/cds-compiler": "^6",
|
|
23
24
|
"@sap/cds-mtxs": "^3",
|
|
24
25
|
"@sap/hdi-deploy": "^5",
|
|
25
26
|
"express": "^4.22.1 || ^5",
|