sap-ai-dev-toolkit 0.6.2 → 0.6.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/README.md +1 -1
- package/package.json +1 -1
- package/src/mcp-proxy.mjs +15 -1
package/README.md
CHANGED
|
@@ -763,7 +763,7 @@ The relay between the VSP child and each BAS destination recovers from the failu
|
|
|
763
763
|
2. **Session refresh** — when SAP explicitly rejects a CSRF token, the cached session is dropped, a fresh token+cookie pair is fetched, and the request is retried within the configured bound. Generic authorization 401/403 responses are returned without being mislabeled or retried as CSRF failures.
|
|
764
764
|
3. **Proxy tunnel fallback** — when the BAS proxy refuses absolute-form requests (502/504 or transport errors), the relay switches to a CONNECT tunnel through the same proxy and keeps going.
|
|
765
765
|
4. **Child crash recovery** — a crashed VSP child is restarted transparently, re-initialized, tools re-registered, and the interrupted `tools/call` retried once before any error reaches the client.
|
|
766
|
-
5. **Configured destination authentication** —
|
|
766
|
+
5. **Configured destination authentication** — BAS destination children use the selected BAS destination as their only SAP identity. The toolkit clears VSP local authentication environment values so a project `.env` cannot override or conflict with destination authentication. Setup does not prompt for or store SAP usernames/passwords, and the relay does not connect directly to a backend host as a credential fallback. Cloud Foundry destinations use only credentials returned by their configured Destination service record.
|
|
767
767
|
Existing installs that still set the previous `BAS_VSP_*` environment variables remain supported. The setup wizard writes new MCP entries with the `SAP_AI_DEV_TOOLKIT_*` names.
|
|
768
768
|
|
|
769
769
|
#### Server logging
|
package/package.json
CHANGED
package/src/mcp-proxy.mjs
CHANGED
|
@@ -174,8 +174,22 @@ function useBasDestinationRelay(destination, env = process.env) {
|
|
|
174
174
|
return Boolean(destination.url && String(destination.url).includes('.dest'));
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
function useProxyAuthentication(destination) {
|
|
178
|
+
return destination.source !== 'cloud-foundry' || destination.authentication === 'PrincipalPropagation';
|
|
179
|
+
}
|
|
180
|
+
|
|
177
181
|
function childEnvironment(destination, env) {
|
|
178
182
|
const childEnv = { ...sanitizeChildEnv(env), ...(destination.childEnv || {}) };
|
|
183
|
+
if (useProxyAuthentication(destination)) {
|
|
184
|
+
// VSP loads SAP_* values from local .env files. Set every supported local
|
|
185
|
+
// auth variable explicitly empty so dotenv cannot supply a fallback
|
|
186
|
+
// identity or session instead of the selected BAS destination identity.
|
|
187
|
+
for (const key of [
|
|
188
|
+
'SAP_USER', 'SAP_USERNAME', 'SAP_PASSWORD', 'SAP_PASS',
|
|
189
|
+
'SAP_COOKIE_FILE', 'SAP_COOKIE_STRING', 'SAP_BROWSER_AUTH', 'SAP_SSO',
|
|
190
|
+
'SAP_SAML_AUTH', 'SAP_SAML_USER', 'SAP_SAML_PASSWORD', 'SAP_CREDENTIAL_CMD'
|
|
191
|
+
]) childEnv[key] = '';
|
|
192
|
+
}
|
|
179
193
|
// The VSP child must reach the local BAS relay directly, never through the
|
|
180
194
|
// BAS .dest proxy. Without a loopback exception every child request would
|
|
181
195
|
// be double-proxied and the relay's session pairing could never apply.
|
|
@@ -196,7 +210,7 @@ export function childArguments(destination, env = process.env) {
|
|
|
196
210
|
// controlled by SAP_ALLOW_TRANSPORTABLE_EDITS and SAP authorizations.
|
|
197
211
|
const mode = brandedEnvValue(env, 'MODE') || 'expert';
|
|
198
212
|
const args = ['--url', destination.url, '--client', destination.client || '001', '--mode', mode];
|
|
199
|
-
if (destination
|
|
213
|
+
if (useProxyAuthentication(destination)) args.push('--proxy-auth');
|
|
200
214
|
args.push('--enable-transports');
|
|
201
215
|
return args;
|
|
202
216
|
}
|