@mcp-abap-adt/connection 15.1.0 → 16.0.0

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +144 -1
  2. package/README.md +68 -20
  3. package/dist/connection/AbstractAbapConnection.d.ts +89 -39
  4. package/dist/connection/AbstractAbapConnection.d.ts.map +1 -1
  5. package/dist/connection/AbstractAbapConnection.js +249 -223
  6. package/dist/connection/CloudHttpTransport.d.ts +8 -1
  7. package/dist/connection/CloudHttpTransport.d.ts.map +1 -1
  8. package/dist/connection/CloudHttpTransport.js +28 -15
  9. package/dist/connection/HttpTransport.d.ts +61 -6
  10. package/dist/connection/HttpTransport.d.ts.map +1 -1
  11. package/dist/connection/HttpTransport.js +144 -21
  12. package/dist/connection/IAdtTransport.d.ts +12 -19
  13. package/dist/connection/IAdtTransport.d.ts.map +1 -1
  14. package/dist/connection/OnPremHttpTransport.d.ts +2 -13
  15. package/dist/connection/OnPremHttpTransport.d.ts.map +1 -1
  16. package/dist/connection/OnPremHttpTransport.js +16 -32
  17. package/dist/connection/RfcTransport.d.ts +0 -6
  18. package/dist/connection/RfcTransport.d.ts.map +1 -1
  19. package/dist/connection/RfcTransport.js +13 -46
  20. package/dist/connection/createConnection.d.ts +77 -0
  21. package/dist/connection/createConnection.d.ts.map +1 -0
  22. package/dist/connection/createConnection.js +39 -0
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +5 -1
  26. package/docs/INDEX.md +4 -2
  27. package/docs/MIGRATION-16.0.md +123 -0
  28. package/docs/SCOPE.md +17 -45
  29. package/docs/STATEFUL_SESSION_GUIDE.md +37 -38
  30. package/docs/USAGE.md +156 -84
  31. package/package.json +2 -2
  32. package/dist/connection/requestAbort.d.ts +0 -32
  33. package/dist/connection/requestAbort.d.ts.map +0 -1
  34. package/dist/connection/requestAbort.js +0 -69
@@ -22,6 +22,13 @@
22
22
  * back to the platform logoff — an inference, and the only one left in this
23
23
  * layer. A consumer that reaches an on-prem system with this transport has
24
24
  * taken the wrong one, and finds out rather than being silently downgraded.
25
+ *
26
+ * **The platform logoff when no link was published.** Not an inference about
27
+ * the system: `/sap/public/bc/icf/logoff` ends a cloud security session too
28
+ * (measured on a BTP trial with bare HTTP, 2026-10-13: a preflight answered
29
+ * without a logoff link yet set a live `SAP_SESSIONID`; after that logoff the
30
+ * same cookies got `401`, before it `200`). So a held session with no link is
31
+ * logged off there, as the on-prem wire does.
25
32
  */
26
33
  import { HttpTransport } from './HttpTransport.js';
27
34
  import type { IAdtSessionContext, ICloudTransport } from './IAdtTransport.js';
@@ -51,7 +58,7 @@ export declare class CloudHttpTransport extends HttpTransport implements ICloudT
51
58
  /** The logoff resource this server linked to beside our session, resolved — the close target. */
52
59
  private logoff;
53
60
  open(context: IAdtSessionContext): Promise<void>;
54
- close(context: IAdtSessionContext): Promise<void>;
61
+ close(context: IAdtSessionContext, written?: () => void): Promise<void>;
55
62
  /**
56
63
  * An href resolved against the document that published it, as a link in an
57
64
  * Atom document is. Resolved at open, so the close has nothing left that can
@@ -1 +1 @@
1
- {"version":3,"file":"CloudHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/CloudHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgB9E,qBAAa,kBACX,SAAQ,aACR,YAAW,eAAe;IAE1B,SAAkB,IAAI,gBAAgB;IAEtC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAU;IAEnC;;;;;;;;;;;;;;;;;OAiBG;cACgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI3D,iGAAiG;IACjG,OAAO,CAAC,MAAM,CAAuB;IAEtB,IAAI,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiEhD,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmChE;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAenB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CAWjB"}
1
+ {"version":3,"file":"CloudHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/CloudHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgB9E,qBAAa,kBACX,SAAQ,aACR,YAAW,eAAe;IAE1B,SAAkB,IAAI,gBAAgB;IAEtC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAU;IAEnC;;;;;;;;;;;;;;;;;OAiBG;cACgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI3D,iGAAiG;IACjG,OAAO,CAAC,MAAM,CAAuB;IAEtB,IAAI,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiEhD,KAAK,CAClB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,IAAI,CAAC;IA8ChB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAenB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CAWjB"}
@@ -23,6 +23,13 @@
23
23
  * back to the platform logoff — an inference, and the only one left in this
24
24
  * layer. A consumer that reaches an on-prem system with this transport has
25
25
  * taken the wrong one, and finds out rather than being silently downgraded.
26
+ *
27
+ * **The platform logoff when no link was published.** Not an inference about
28
+ * the system: `/sap/public/bc/icf/logoff` ends a cloud security session too
29
+ * (measured on a BTP trial with bare HTTP, 2026-10-13: a preflight answered
30
+ * without a logoff link yet set a live `SAP_SESSIONID`; after that logoff the
31
+ * same cookies got `401`, before it `200`). So a held session with no link is
32
+ * logged off there, as the on-prem wire does.
26
33
  */
27
34
  Object.defineProperty(exports, "__esModule", { value: true });
28
35
  exports.CloudHttpTransport = void 0;
@@ -104,8 +111,8 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
104
111
  this.logger?.debug(`Session resource answered ${response.status} but published no securitysession link`);
105
112
  return;
106
113
  }
107
- // Published only while its ICF service is active; without it there is
108
- // nothing that ends this session, and the close says so.
114
+ // Published only while its ICF service is active; without it the close
115
+ // sends the platform's own logoff instead.
109
116
  this.logoff = this.resolveLink(this.linkHref(response.data, LOGOFF_REL), `${context.baseUrl}${SESSIONS_PATH}`);
110
117
  this.logger?.debug(`Security session opened: ${resource}`);
111
118
  }
@@ -120,27 +127,33 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
120
127
  this.logger?.debug(`Could not open a security session: ${error instanceof Error ? error.message : String(error)}`);
121
128
  }
122
129
  }
123
- async close(context) {
130
+ async close(context, written) {
124
131
  const logoff = this.logoff;
125
132
  this.logoff = null;
126
- // Read SYNCHRONOUSLY, before the first await. A close is dispatched
127
- // without being awaited, so the teardown's `forgetSession()` runs while
128
- // this is suspended — and a goodbye assembled afterwards would carry no
129
- // cookie, which is the one thing that proves the session is ours to end.
130
- const cookies = this.cookies();
133
+ // Read SYNCHRONOUSLY, before the first await. The teardown's
134
+ // `forgetSession()` runs as soon as the close is dispatched — the
135
+ // connection waits for its write only after the transition — so a
136
+ // goodbye assembled after an await would carry no cookie, which is the
137
+ // one thing that proves the session is ours to end.
138
+ // Without `sap-contextid`: see `logoffCookies()`.
139
+ const cookies = this.logoffCookies();
131
140
  // Snapshotted for the same reason: the logoff must reach the server holding
132
141
  // this session, not whichever one the wire is pinned to when it goes out.
133
142
  const affinity = this.affinityHeaders();
134
143
  const session = this.sessionHeaders();
135
- if (!cookies) {
136
- // No cookie to prove the session is ours — holding the cookie is the
137
- // whole permission to end one.
144
+ if (!cookies || !this.holdsSessionCookie()) {
145
+ // The same rule as on-prem: a logoff only for a non-empty
146
+ // `SAP_SESSIONID_*` this wire received — here the security session the
147
+ // preflight created. Holding that cookie is the whole permission to end
148
+ // one, and without it the ICF logoff ends nothing.
138
149
  return;
139
150
  }
140
151
  if (!logoff) {
141
- // A session was opened, but the server linked no logoff resource: it
142
- // stays until the server's own timeout.
143
- this.logger?.debug('The server published no logoff resource; the security session is left to its timeout');
152
+ // A session is held, but the server linked no logoff resource (a
153
+ // preflight that published none, or failed): the platform's own logoff
154
+ // ends it, sent exactly as the on-prem wire sends it.
155
+ this.logger?.debug('The server published no logoff resource; sending the platform logoff');
156
+ await this.sendIcfLogoff(context, { cookies, affinity }, written);
144
157
  return;
145
158
  }
146
159
  await this.sendLogoff(context, logoff, {
@@ -149,7 +162,7 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
149
162
  // `x-sap-security-session: use`, as Eclipse sends it on the logoff: it
150
163
  // names the session the logoff ends, like every other request here.
151
164
  session,
152
- });
165
+ }, written);
153
166
  }
154
167
  /**
155
168
  * An href resolved against the document that published it, as a link in an
@@ -18,6 +18,7 @@
18
18
  * not the credential). Material that changes between logons drops the client;
19
19
  * the cookie jar and the CSRF token are the session's and stay.
20
20
  */
21
+ import { type ClientRequest, type IncomingMessage, type RequestOptions } from 'node:http';
21
22
  import { type AgentOptions } from 'node:https';
22
23
  import type { ILogonTarget } from '@mcp-abap-adt/interfaces-auth';
23
24
  import type { ILogger } from '../logger.js';
@@ -93,6 +94,34 @@ export declare class HttpTransport implements IAdtTransport {
93
94
  * replacement every time the client was re-asserted.
94
95
  */
95
96
  sessionFingerprint(): Map<string, string>;
97
+ /**
98
+ * The cookies a logoff carries: the jar without `sap-contextid`.
99
+ *
100
+ * The logoff ends the HTTP security session `SAP_SESSIONID` names, and with
101
+ * it every ABAP context of that session. Measured on an on-premise system with bare HTTP
102
+ * (2026-10-13): a LOCK held in a stateful context, then a logoff carrying
103
+ * `SAP_SESSIONID_ABC_001` and `sap-usercontext` but no `sap-contextid` →
104
+ * 200, `SAP_SESSIONID` deleted, and an independent session then got the
105
+ * LOCK: the context ended and the lock was released. A logoff that carried a
106
+ * stale (deleted) `sap-contextid` got 400 and closed nothing. So the
107
+ * context cookie never rides on a logoff.
108
+ */
109
+ protected logoffCookies(): string | null;
110
+ /**
111
+ * Whether this wire holds a non-empty `SAP_SESSIONID_*` cookie it received —
112
+ * the one condition under which a logoff is sent.
113
+ *
114
+ * Read from the jar, never from `sessionEstablished()`, which a wire may
115
+ * answer otherwise (BASIS 7.40 says yes with no such cookie). The evidence,
116
+ * on an on-premise system (ABAP code and measurement): `CL_HTTP_SERVER_NET->send_response`
117
+ * sets `SAP_SESSIONID_<SID>_<CLIENT>` only when that request created a
118
+ * security session (`m_security_session_created`), whatever the status — a
119
+ * 404 or 403 after logon carried it and the session was alive; and the ICF
120
+ * logoff ends a session only when that cookie is present. So a logoff
121
+ * without it ends nothing, and one with it is owed whatever the status that
122
+ * brought it.
123
+ */
124
+ protected holdsSessionCookie(): boolean;
96
125
  /**
97
126
  * A session exists when the server named one.
98
127
  *
@@ -223,7 +252,20 @@ export declare class HttpTransport implements IAdtTransport {
223
252
  * session document links to, the on-prem one the platform logoff. A bare HTTP wire has
224
253
  * neither, and says so by doing nothing.
225
254
  */
226
- close(_context: IAdtSessionContext): Promise<void>;
255
+ close(_context: IAdtSessionContext, _written?: () => void): Promise<void>;
256
+ /**
257
+ * The platform's own logoff, `/sap/public/bc/icf/logoff`: the session's
258
+ * cookies (taken by the caller before its first await, without
259
+ * `sap-contextid`), no session headers, its write reported through
260
+ * `written`. On-prem it is the only goodbye; on cloud it is the goodbye when
261
+ * the server linked no logoff resource of its own — it ends a cloud security
262
+ * session too (measured on a BTP trial with bare HTTP, 2026-10-13: the same
263
+ * cookies were refused with 401 right after it, accepted before).
264
+ */
265
+ protected sendIcfLogoff(context: IAdtSessionContext, snapshot: {
266
+ cookies: string;
267
+ affinity: Record<string, string>;
268
+ }, written?: () => void): Promise<void>;
227
269
  /**
228
270
  * The logoff, sent as Eclipse ADT 3.60.3 sends it when a project is closed.
229
271
  *
@@ -243,7 +285,9 @@ export declare class HttpTransport implements IAdtTransport {
243
285
  cookies: string;
244
286
  affinity: Record<string, string>;
245
287
  session: Record<string, string>;
246
- }): Promise<void>;
288
+ },
289
+ /** Called once the logoff's bytes are on the socket; see `close()`. */
290
+ written?: () => void): Promise<void>;
247
291
  /**
248
292
  * Throws for a status the request does not admit — by doing nothing, because
249
293
  * that is already what axios does, and `AxiosError` already carries
@@ -262,9 +306,10 @@ export declare class HttpTransport implements IAdtTransport {
262
306
  /**
263
307
  * Send EXACTLY these headers, with nothing of the wire's live state mixed in.
264
308
  *
265
- * For a goodbye, and only for a goodbye. `disconnect()` dispatches the logoff
266
- * without awaiting it, so the request is still being assembled while the
267
- * connection is already free to `connect()` again — and by the time it goes
309
+ * For a goodbye, and only for a goodbye. `disconnect()` releases the
310
+ * transition queue before the logoff is even written, so the request is
311
+ * still being assembled while the connection is already free to `connect()`
312
+ * again — and by the time it goes
268
313
  * out, the jar can hold a different session. Dressing it then merges the LIVE
269
314
  * `SAP_SESSIONID` over the snapshot, and `mergeCookieHeaders` lets the later
270
315
  * value win on a repeated name, so the goodbye for the old session arrives
@@ -273,7 +318,17 @@ export declare class HttpTransport implements IAdtTransport {
273
318
  * Reading the cookies synchronously is necessary and was not sufficient: the
274
319
  * snapshot survived only until the send path put the jar back on top of it.
275
320
  */
276
- protected sendDetached(request: IAdtTransportRequest): Promise<IAdtTransportResponse>;
321
+ protected sendDetached(request: IAdtTransportRequest,
322
+ /** Called once the request's bytes are on the socket. */
323
+ written?: () => void): Promise<IAdtTransportResponse>;
324
+ /**
325
+ * The node request a logoff goes out on — the seam where its write is seen.
326
+ *
327
+ * A test replaces it to hold a request's socket shut; the wire uses node's
328
+ * own `http` / `https`, as axios would with redirects off. The logoff's
329
+ * answer is not read, so not following a redirect changes nothing.
330
+ */
331
+ protected logoffRequest(options: RequestOptions, onResponse: (response: IncomingMessage) => void): ClientRequest;
277
332
  private dispatch;
278
333
  }
279
334
  //# sourceMappingURL=HttpTransport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/HttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,KAAK,EAGV,YAAY,EACb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAE3B,MAAM,oBAAoB,CAAC;AAwC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA6DzD,qBAAa,aAAc,YAAW,aAAa;IAsC/C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IACzC;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO;IA7C1B;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAU;IAE/B,OAAO,CAAC,QAAQ,CAA8B;IAE9C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAqC;IAErD,iFAAiF;IACjF,OAAO,CAAC,cAAc,CAAS;IAE/B;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IACjD,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,KAAK,CAAuB;gBAGjB,YAAY,GAAE,MAAM,YAA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cACa,aAAa,CAC3B,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,EAC/D,OAAO,CAAC,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,IAAI,CAAC;IAShB;;;;;;;;;;;;;;OAcG;cACa,UAAU,CACxB,OAAO,EAAE,kBAAkB,EAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjC;IACD,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,IAAI,CAAC;IAyChB;;;;;OAKG;IACG,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAKzE;;;;;;OAMG;IACH,OAAO,CAAC,GAAG;IAmBX;;;;;;;;;;;;;;OAcG;cACa,YAAY,CAC1B,OAAO,EAAE,oBAAoB;IAC7B,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,qBAAqB,CAAC;IAIjC;;;;;;OAMG;IACH,SAAS,CAAC,aAAa,CACrB,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,GAC9C,aAAa;YAMF,QAAQ;CA2DvB"}
@@ -25,6 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.HttpTransport = exports.isStatefulRequest = void 0;
27
27
  const node_crypto_1 = require("node:crypto");
28
+ const node_http_1 = require("node:http");
28
29
  const node_https_1 = require("node:https");
29
30
  const auth_errors_1 = require("@mcp-abap-adt/auth-errors");
30
31
  const axios_1 = __importDefault(require("axios"));
@@ -32,10 +33,35 @@ const cookies_js_1 = require("../utils/cookies.js");
32
33
  const authErrors_js_1 = require("./authErrors.js");
33
34
  const csrfConfig_js_1 = require("./csrfConfig.js");
34
35
  const IAdtTransport_js_1 = require("./IAdtTransport.js");
35
- const requestAbort_js_1 = require("./requestAbort.js");
36
36
  const statefulRequest_js_1 = require("./statefulRequest.js");
37
+ /**
38
+ * Whether a `Set-Cookie`'s attributes delete it: `Max-Age` of zero or less, or
39
+ * an `Expires` already in the past — SAP's own deletions are the latter
40
+ * (`expires=Tue, 01-Jan-1980 00:00:01 GMT`, a one-character value). Read by
41
+ * splitting, not by pattern; `Date.parse` reads the date.
42
+ */
43
+ function deletesCookie(attributes) {
44
+ for (const attribute of attributes) {
45
+ const [rawName, ...rawValue] = attribute.split('=');
46
+ const name = rawName?.trim().toLowerCase();
47
+ const value = rawValue.join('=').trim();
48
+ if (name === 'max-age') {
49
+ const seconds = Number(value);
50
+ if (value !== '' && Number.isFinite(seconds) && seconds <= 0)
51
+ return true;
52
+ }
53
+ if (name === 'expires') {
54
+ const at = Date.parse(value);
55
+ if (Number.isFinite(at) && at <= Date.now())
56
+ return true;
57
+ }
58
+ }
59
+ return false;
60
+ }
37
61
  /** The cookie that names a stateful ABAP context. */
38
62
  const CONTEXT_COOKIE = 'sap-contextid';
63
+ /** The platform's logoff, which answers `200` while expiring the session cookie. */
64
+ const ICF_LOGOFF_PATH = '/sap/public/bc/icf/logoff';
39
65
  /**
40
66
  * A `Cookie` header without `sap-contextid`, for a request that is not stateful.
41
67
  *
@@ -193,13 +219,22 @@ class HttpTransport {
193
219
  for (const entry of Array.isArray(setCookie) ? setCookie : [setCookie]) {
194
220
  if (typeof entry !== 'string')
195
221
  continue;
196
- const [nameValue] = entry.split(';');
222
+ const [nameValue, ...attributes] = entry.split(';');
197
223
  if (!nameValue)
198
224
  continue;
199
225
  const [name, ...rest] = nameValue.split('=');
200
226
  const trimmed = name?.trim();
201
227
  if (!trimmed)
202
228
  continue;
229
+ // A deletion removes the cookie, and is told by its expiry, not its
230
+ // value: SAP's logoff deletes every cookie with a one-character value
231
+ // and `expires=Tue, 01-Jan-1980 00:00:01 GMT` (on-premise, 2026-10-13). Kept,
232
+ // a deleted `SAP_SESSIONID` would read as a session the server has
233
+ // just ended.
234
+ if (deletesCookie(attributes)) {
235
+ this.jar.delete(trimmed);
236
+ continue;
237
+ }
203
238
  this.jar.set(trimmed, rest.join('=').trim());
204
239
  }
205
240
  // SAP answers `sap-usercontext` with the system default rather than the
@@ -209,13 +244,11 @@ class HttpTransport {
209
244
  if (this.options.client) {
210
245
  this.jar.set('sap-usercontext', `sap-client=${this.options.client}`);
211
246
  }
212
- if (this.jar.size === 0)
213
- return;
247
+ // Recomputed from what the jar holds now, deletions included.
214
248
  const combined = Array.from(this.jar.entries())
215
249
  .map(([name, value]) => (value ? `${name}=${value}` : name))
216
250
  .join('; ');
217
- if (combined)
218
- this.combined = combined;
251
+ this.combined = combined || null;
219
252
  }
220
253
  /** What to put on the `Cookie` header, or nothing if the jar is empty. */
221
254
  cookies() {
@@ -231,11 +264,48 @@ class HttpTransport {
231
264
  sessionFingerprint() {
232
265
  const fingerprint = new Map();
233
266
  for (const [name, value] of this.jar) {
234
- if (name.startsWith('SAP_SESSIONID'))
267
+ // Non-empty only: an empty value names no session.
268
+ if (name.startsWith('SAP_SESSIONID') && value !== '') {
235
269
  fingerprint.set(name, value);
270
+ }
236
271
  }
237
272
  return fingerprint;
238
273
  }
274
+ /**
275
+ * The cookies a logoff carries: the jar without `sap-contextid`.
276
+ *
277
+ * The logoff ends the HTTP security session `SAP_SESSIONID` names, and with
278
+ * it every ABAP context of that session. Measured on an on-premise system with bare HTTP
279
+ * (2026-10-13): a LOCK held in a stateful context, then a logoff carrying
280
+ * `SAP_SESSIONID_ABC_001` and `sap-usercontext` but no `sap-contextid` →
281
+ * 200, `SAP_SESSIONID` deleted, and an independent session then got the
282
+ * LOCK: the context ended and the lock was released. A logoff that carried a
283
+ * stale (deleted) `sap-contextid` got 400 and closed nothing. So the
284
+ * context cookie never rides on a logoff.
285
+ */
286
+ logoffCookies() {
287
+ const pairs = Array.from(this.jar.entries())
288
+ .filter(([name]) => name !== CONTEXT_COOKIE)
289
+ .map(([name, value]) => (value ? `${name}=${value}` : name));
290
+ return pairs.length > 0 ? pairs.join('; ') : null;
291
+ }
292
+ /**
293
+ * Whether this wire holds a non-empty `SAP_SESSIONID_*` cookie it received —
294
+ * the one condition under which a logoff is sent.
295
+ *
296
+ * Read from the jar, never from `sessionEstablished()`, which a wire may
297
+ * answer otherwise (BASIS 7.40 says yes with no such cookie). The evidence,
298
+ * on an on-premise system (ABAP code and measurement): `CL_HTTP_SERVER_NET->send_response`
299
+ * sets `SAP_SESSIONID_<SID>_<CLIENT>` only when that request created a
300
+ * security session (`m_security_session_created`), whatever the status — a
301
+ * 404 or 403 after logon carried it and the session was alive; and the ICF
302
+ * logoff ends a session only when that cookie is present. So a logoff
303
+ * without it ends nothing, and one with it is owed whatever the status that
304
+ * brought it.
305
+ */
306
+ holdsSessionCookie() {
307
+ return this.sessionFingerprint().size > 0;
308
+ }
239
309
  /**
240
310
  * A session exists when the server named one.
241
311
  *
@@ -344,11 +414,6 @@ class HttpTransport {
344
414
  // Authorized per attempt: a provider may renew behind the call.
345
415
  const auth = {};
346
416
  await context.authorize(auth);
347
- // The last point before the wire: the exchange's request was
348
- // aborted in a turn since its authorize answered. Fatal to the
349
- // exchange through `isFatal`, like the abort `authorize` raises.
350
- if (context.signal?.aborted)
351
- throw (0, requestAbort_js_1.requestAborted)();
352
417
  const response = await this.send({
353
418
  method: 'GET',
354
419
  url,
@@ -667,7 +732,19 @@ class HttpTransport {
667
732
  * session document links to, the on-prem one the platform logoff. A bare HTTP wire has
668
733
  * neither, and says so by doing nothing.
669
734
  */
670
- async close(_context) { }
735
+ async close(_context, _written) { }
736
+ /**
737
+ * The platform's own logoff, `/sap/public/bc/icf/logoff`: the session's
738
+ * cookies (taken by the caller before its first await, without
739
+ * `sap-contextid`), no session headers, its write reported through
740
+ * `written`. On-prem it is the only goodbye; on cloud it is the goodbye when
741
+ * the server linked no logoff resource of its own — it ends a cloud security
742
+ * session too (measured on a BTP trial with bare HTTP, 2026-10-13: the same
743
+ * cookies were refused with 401 right after it, accepted before).
744
+ */
745
+ async sendIcfLogoff(context, snapshot, written) {
746
+ await this.sendLogoff(context, `${context.baseUrl}${ICF_LOGOFF_PATH}`, { ...snapshot, session: {} }, written);
747
+ }
671
748
  /**
672
749
  * The logoff, sent as Eclipse ADT 3.60.3 sends it when a project is closed.
673
750
  *
@@ -683,13 +760,20 @@ class HttpTransport {
683
760
  * about THIS session; and when the logoff cannot end one, the reason is an
684
761
  * error message whose status the ICF kernel picks, which no ABAP source shows.
685
762
  */
686
- async sendLogoff(context, url, snapshot) {
763
+ async sendLogoff(context, url, snapshot,
764
+ /** Called once the logoff's bytes are on the socket; see `close()`. */
765
+ written) {
687
766
  // Nothing that logs on, whoever put it in the context: the goodbye carries
688
767
  // the session's cookie and no credential.
689
768
  const extra = Object.fromEntries(Object.entries(context.extraHeaders ?? {}).filter(([name]) => name.trim().toLowerCase() !== 'authorization'));
690
769
  try {
691
770
  await this.sendDetached({
692
771
  method: 'GET',
772
+ // A redirect is an answer like any other: the logoff has arrived,
773
+ // and its answer is not read. Not followed — that would send the
774
+ // session's cookie on to wherever the server points — and not
775
+ // reported as a failure to say goodbye.
776
+ validateStatus: (status) => status >= 200 && status < 400,
693
777
  url,
694
778
  headers: {
695
779
  ...snapshot.affinity,
@@ -703,7 +787,7 @@ class HttpTransport {
703
787
  'sap-cancel-on-close': 'true',
704
788
  Cookie: snapshot.cookies,
705
789
  },
706
- });
790
+ }, written);
707
791
  this.logger?.debug('Told the server the session is finished');
708
792
  }
709
793
  catch (error) {
@@ -748,9 +832,10 @@ class HttpTransport {
748
832
  /**
749
833
  * Send EXACTLY these headers, with nothing of the wire's live state mixed in.
750
834
  *
751
- * For a goodbye, and only for a goodbye. `disconnect()` dispatches the logoff
752
- * without awaiting it, so the request is still being assembled while the
753
- * connection is already free to `connect()` again — and by the time it goes
835
+ * For a goodbye, and only for a goodbye. `disconnect()` releases the
836
+ * transition queue before the logoff is even written, so the request is
837
+ * still being assembled while the connection is already free to `connect()`
838
+ * again — and by the time it goes
754
839
  * out, the jar can hold a different session. Dressing it then merges the LIVE
755
840
  * `SAP_SESSIONID` over the snapshot, and `mergeCookieHeaders` lets the later
756
841
  * value win on a repeated name, so the goodbye for the old session arrives
@@ -759,11 +844,49 @@ class HttpTransport {
759
844
  * Reading the cookies synchronously is necessary and was not sufficient: the
760
845
  * snapshot survived only until the send path put the jar back on top of it.
761
846
  */
762
- async sendDetached(request) {
763
- return this.dispatch(request, { ...request.headers });
847
+ async sendDetached(request,
848
+ /** Called once the request's bytes are on the socket. */
849
+ written) {
850
+ return this.dispatch(request, { ...request.headers }, written);
764
851
  }
765
- async dispatch(request, headers) {
852
+ /**
853
+ * The node request a logoff goes out on — the seam where its write is seen.
854
+ *
855
+ * A test replaces it to hold a request's socket shut; the wire uses node's
856
+ * own `http` / `https`, as axios would with redirects off. The logoff's
857
+ * answer is not read, so not following a redirect changes nothing.
858
+ */
859
+ logoffRequest(options, onResponse) {
860
+ return options.protocol === 'https:'
861
+ ? (0, node_https_1.request)(options, onResponse)
862
+ : (0, node_http_1.request)(options, onResponse);
863
+ }
864
+ async dispatch(request, headers, written) {
766
865
  const response = await this.client()({
866
+ // The write is the point `disconnect()` resolves at: the request's
867
+ // `finish`, emitted once its bytes are handed to the socket — not when
868
+ // the server answers, which it may do minutes later or never.
869
+ ...(written !== undefined
870
+ ? {
871
+ transport: {
872
+ request: (options, onResponse) => {
873
+ // A socket of its own: with no agent of the wire's (plain
874
+ // `http:` — the TLS material's agent and a proxy's are kept),
875
+ // node would take a pooled keep-alive socket, whose write can
876
+ // succeed after the server closed it, losing the logoff after
877
+ // `finish`. `agent: false` opens a fresh connection, and node
878
+ // sends `Connection: close` on it. Over `https:` the wire's
879
+ // own agent keeps no socket alive unless the caller's
880
+ // `agentOptions` say `keepAlive: true`.
881
+ const outgoing = this.logoffRequest(options.agent === undefined
882
+ ? { ...options, agent: false }
883
+ : options, onResponse);
884
+ outgoing.once('finish', written);
885
+ return outgoing;
886
+ },
887
+ },
888
+ }
889
+ : {}),
767
890
  method: request.method,
768
891
  // The connection hands over a PATH; putting a server in front of it is
769
892
  // this wire's job. RFC's is to write the same path into the request line
@@ -50,14 +50,6 @@ export interface IAdtTransportRequest {
50
50
  * `HttpTransport.dress`.
51
51
  */
52
52
  stateful?: boolean;
53
- /**
54
- * The caller's signal, for the waits a wire makes on this request's behalf
55
- * before it sends — over RFC, the logon and the open of a conversation of
56
- * its own. An abort ends such a wait for this request only; whatever it
57
- * opened for this request alone is given back. Not a cancel: a request
58
- * already sent is not recalled, so no wire hands it to its client.
59
- */
60
- signal?: AbortSignal | undefined;
61
53
  }
62
54
  /** What came back, in the terms every transport can produce. */
63
55
  export interface IAdtTransportResponse {
@@ -129,16 +121,6 @@ export interface IAdtEstablishContext extends IAdtSessionContext {
129
121
  * apart, so it asks.
130
122
  */
131
123
  isFatal?: (error: unknown) => boolean;
132
- /**
133
- * The signal of the one request this exchange is made for — its upfront
134
- * token fetch, its CSRF recovery. Absent for `connect()`'s establishment,
135
- * which is nobody's single request. A wire checks it immediately before
136
- * each send of the exchange, in the same turn, and sends nothing once it
137
- * has fired: the answer to an earlier `authorize` leaves turns in between.
138
- * The exchange is that request's alone — no other request waits on it —
139
- * so stopping it takes nothing from another caller.
140
- */
141
- signal?: AbortSignal | undefined;
142
124
  }
143
125
  export interface IAdtTransport {
144
126
  /** For logs, so which transport ran is never inferred from behaviour. */
@@ -168,8 +150,19 @@ export interface IAdtTransport {
168
150
  * `disconnect()`, which promises to settle. What it does is the wire's: a
169
151
  * the logoff the cloud session document links to, the platform's logoff, or
170
152
  * closing the conversation.
153
+ *
154
+ * **Two points, told apart.** `written` is called once the goodbye has left
155
+ * — its bytes handed to the socket, not answered — and the returned promise
156
+ * settles when the close is over, answer included. `disconnect()` resolves
157
+ * at the first: SAP queues a logoff behind a request still running in the
158
+ * same stateful ABAP session and answers it only after, yet the ENQUEUE
159
+ * locks go once it arrives (measured on an on-premise system, 2026-10-12 and 2026-10-13), so
160
+ * a caller about to
161
+ * exit needs it sent, not answered. A wire that sends nothing, or whose
162
+ * close is over at once (RFC: when the close call has returned), need not
163
+ * call it: a settled close is past the write.
171
164
  */
172
- close(context: IAdtSessionContext): Promise<void>;
165
+ close(context: IAdtSessionContext, written?: () => void): Promise<void>;
173
166
  /**
174
167
  * Issue one request.
175
168
  *
@@ -1 +1 @@
1
- {"version":3,"file":"IAdtTransport.d.ts","sourceRoot":"","sources":["../../src/connection/IAdtTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,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AO,CAAC,IAAI,CAAC,CAAC;IAExD,0EAA0E;IAC1E,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;IAE3B;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAE3C,oDAAoD;IACpD,aAAa,IAAI,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,GAAG,IAAI,CAQtE"}
@@ -16,22 +16,11 @@
16
16
  * first to see whether it answers.
17
17
  */
18
18
  import { HttpTransport } from './HttpTransport.js';
19
- import type { IAdtEstablishContext, IAdtSessionContext, IOnPremTransport } from './IAdtTransport.js';
19
+ import type { IAdtSessionContext, IOnPremTransport } from './IAdtTransport.js';
20
20
  export declare class OnPremHttpTransport extends HttpTransport implements IOnPremTransport {
21
21
  readonly kind: string;
22
22
  /** Which system this wire is for. Read by the compiler, never at runtime. */
23
23
  readonly system: "onprem";
24
- /**
25
- * Whether an establishment actually succeeded.
26
- *
27
- * Cookies alone cannot answer it: a 401 that refuses us can carry a
28
- * `Set-Cookie`, and that is debris, not a session. Telling the server we are
29
- * finished with something we never had sends a request nobody asked for —
30
- * into the middle of an authentication exchange, in the case that found this.
31
- */
32
- private established;
33
- establish(context: IAdtEstablishContext): Promise<void>;
34
- forgetSession(): void;
35
24
  /**
36
25
  * Nothing to ask for: the session comes with the establishing request.
37
26
  *
@@ -40,6 +29,6 @@ export declare class OnPremHttpTransport extends HttpTransport implements IOnPre
40
29
  * only ever read by the connection to decide whether to send a close — a
41
30
  * decision that is now this class's, below.
42
31
  */
43
- close(context: IAdtSessionContext): Promise<void>;
32
+ close(context: IAdtSessionContext, written?: () => void): Promise<void>;
44
33
  }
45
34
  //# sourceMappingURL=OnPremHttpTransport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnPremHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/OnPremHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAI5B,qBAAa,mBACX,SAAQ,aACR,YAAW,gBAAgB;IAE3B,SAAkB,IAAI,EAAE,MAAM,CAAiB;IAE/C,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAG,QAAQ,CAAU;IAEpC;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW,CAAS;IAEb,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D,aAAa,IAAI,IAAI;IAK9B;;;;;;;OAOG;IAEY,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAwBjE"}
1
+ {"version":3,"file":"OnPremHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/OnPremHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,qBAAa,mBACX,SAAQ,aACR,YAAW,gBAAgB;IAE3B,SAAkB,IAAI,EAAE,MAAM,CAAiB;IAE/C,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAG,QAAQ,CAAU;IAEpC;;;;;;;OAOG;IAEY,KAAK,CAClB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,IAAI,CAAC;CA0BjB"}