@mcp-abap-adt/connection 17.0.0 → 17.1.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.
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [17.1.0] - 2026-10-13
|
|
11
|
+
|
|
12
|
+
What this package answers for is listed in [docs/SCOPE.md](./docs/SCOPE.md).
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **`disconnect()` without `connect()` on an instance built on a session.**
|
|
16
|
+
An instance built with `session` (`createConnection({ …, session })`, or the
|
|
17
|
+
connectors' sixth argument) may be disconnected without connecting:
|
|
18
|
+
`disconnect()` sends the ICF logoff (`/sap/public/bc/icf/logoff`, on cloud
|
|
19
|
+
too) with the handed cookies — no `sap-contextid`, no credential, no CSRF
|
|
20
|
+
fetch or any other request before it, the credential's `prepare()` never
|
|
21
|
+
called — resolves when the logoff is written, and spends the instance;
|
|
22
|
+
`flushGoodbye()` waits for SAP's answer. A session string naming no
|
|
23
|
+
`SAP_SESSIONID` sends nothing. Still once: a second `disconnect()` rejects,
|
|
24
|
+
and `connect()` after it is refused as on any spent instance. For logging
|
|
25
|
+
off a leftover session of a process that is gone. No new API; an instance
|
|
26
|
+
built without `session` behaves as in 17.0.0.
|
|
27
|
+
|
|
10
28
|
## [17.0.0] - 2026-10-13
|
|
11
29
|
|
|
12
30
|
What this package answers for is listed in [docs/SCOPE.md](./docs/SCOPE.md).
|
|
@@ -2630,7 +2648,8 @@ const connection = createAbapConnection(config, logger);
|
|
|
2630
2648
|
- JWT token refresh now properly handles connection errors (401/403 during initial connect)
|
|
2631
2649
|
- Permission errors (403 with "ExceptionResourceNoAccess") no longer trigger JWT refresh loops
|
|
2632
2650
|
- Proper separation: base class handles HTTP/session, concrete classes handle auth-specific errors
|
|
2633
|
-
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v17.
|
|
2651
|
+
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v17.1.0...HEAD
|
|
2652
|
+
[17.1.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v17.0.0...v17.1.0
|
|
2634
2653
|
[17.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v16.0.0...v17.0.0
|
|
2635
2654
|
[16.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v15.1.0...v16.0.0
|
|
2636
2655
|
[15.1.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v15.0.1...v15.1.0
|
|
@@ -284,6 +284,12 @@ declare abstract class AbstractAbapConnection implements AbapConnection, ISessio
|
|
|
284
284
|
* `connect()` rejects, so a caller's `disconnect()` in its `finally` is the
|
|
285
285
|
* first of that life and has nothing of it to wait for.
|
|
286
286
|
*
|
|
287
|
+
* **On an instance built on an existing session, without `connect()`**, this
|
|
288
|
+
* logs that session off: the handed cookies go to the wire, and the logoff
|
|
289
|
+
* is sent with them as for any instance — no request before it, no
|
|
290
|
+
* credential, the provider's `prepare()` never called. A string naming no
|
|
291
|
+
* `SAP_SESSIONID` sends nothing. The instance is spent either way.
|
|
292
|
+
*
|
|
287
293
|
* **Requests already in flight are not waited for, and the logoff ends the
|
|
288
294
|
* session they are running on** — so they will start failing against a
|
|
289
295
|
* session that no longer exists. That is the caller having asked to
|
|
@@ -300,6 +306,16 @@ declare abstract class AbstractAbapConnection implements AbapConnection, ISessio
|
|
|
300
306
|
* answer.
|
|
301
307
|
*/
|
|
302
308
|
disconnect(): Promise<void>;
|
|
309
|
+
/**
|
|
310
|
+
* Puts the cookies of a handed session into the wire, as `resume()` seeds
|
|
311
|
+
* its jar, and sends nothing: what the wire held goes first, and the
|
|
312
|
+
* session's cookies arrive as a `Set-Cookie` the wire folds in through its
|
|
313
|
+
* own `ingest()`. A wire whose session no cookie names (RFC) keeps nothing
|
|
314
|
+
* of it, and its close then has nothing to end. Never throws — it is
|
|
315
|
+
* reached from `disconnect()`: a custom wire that throws here is logged in
|
|
316
|
+
* fixed words (the cookies are never echoed) and its close decides alone.
|
|
317
|
+
*/
|
|
318
|
+
private seedHandedSession;
|
|
303
319
|
/**
|
|
304
320
|
* Wait for SAP's answer to the last dispatched goodbye.
|
|
305
321
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractAbapConnection.d.ts","sourceRoot":"","sources":["../../src/connection/AbstractAbapConnection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,KAAK,YAAY,EACjB,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAEL,KAAK,aAAa,EAInB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAGnB,MAAM,oBAAoB,CAAC;AAwD5B,uBAAe,sBACb,YACE,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB;IAmIjB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa;IACjC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IA9I3C;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,mBAA0B;IAEtD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,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,IAAI,MAAM,GAAG,IAAI;IAI7B,SAAS,IAAI,SAAS;IAItB;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEpD;;;;;;;OAOG;cACa,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAElD;;;;;;;;OAQG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAkE9B
|
|
1
|
+
{"version":3,"file":"AbstractAbapConnection.d.ts","sourceRoot":"","sources":["../../src/connection/AbstractAbapConnection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,KAAK,YAAY,EACjB,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAEL,KAAK,aAAa,EAInB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAGnB,MAAM,oBAAoB,CAAC;AAwD5B,uBAAe,sBACb,YACE,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB;IAmIjB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa;IACjC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IA9I3C;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,mBAA0B;IAEtD,OAAO,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0I3B;;;;;;;;;;;OAWG;YACW,uBAAuB;IA6DrC;;;;;;;;;OASG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAQpB,+EAA+E;IAC/E,OAAO,CAAC,OAAO;IAOf;;;;;;;OAOG;YACW,eAAe;IAsB7B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;OAOG;YACW,gBAAgB;IAqC9B;;;;;;;;OAQG;cACa,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,MAAgC,EAC5C,UAAU,GAAE,MAAgC;IAC5C;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAChD,OAAO,CAAC,MAAM,CAAC;IAkBlB,SAAS,CAAC,YAAY,IAAI,MAAM,GAAG,IAAI;IAIvC;;OAEG;IACH,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAMlD;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,MAAM,GAAG,IAAI;IAIrC;;;;;;OAMG;IACH,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMlD;;;;;;;;OAQG;YACW,eAAe;IAU7B;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,aAAa;IAiCrB;;;;OAIG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAIlD;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,eAAe;CA6BxB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -427,6 +427,12 @@ class AbstractAbapConnection {
|
|
|
427
427
|
* `connect()` rejects, so a caller's `disconnect()` in its `finally` is the
|
|
428
428
|
* first of that life and has nothing of it to wait for.
|
|
429
429
|
*
|
|
430
|
+
* **On an instance built on an existing session, without `connect()`**, this
|
|
431
|
+
* logs that session off: the handed cookies go to the wire, and the logoff
|
|
432
|
+
* is sent with them as for any instance — no request before it, no
|
|
433
|
+
* credential, the provider's `prepare()` never called. A string naming no
|
|
434
|
+
* `SAP_SESSIONID` sends nothing. The instance is spent either way.
|
|
435
|
+
*
|
|
430
436
|
* **Requests already in flight are not waited for, and the logoff ends the
|
|
431
437
|
* session they are running on** — so they will start failing against a
|
|
432
438
|
* session that no longer exists. That is the caller having asked to
|
|
@@ -467,6 +473,18 @@ class AbstractAbapConnection {
|
|
|
467
473
|
// The context is taken now, while the session is still true: the clear
|
|
468
474
|
// below runs while the close is suspended on its first await.
|
|
469
475
|
const context = this.sessionContext();
|
|
476
|
+
// An instance built on an existing session whose `connect()` never took
|
|
477
|
+
// it over: the session is still the caller's handed string, held by
|
|
478
|
+
// nothing. The wire is given its cookies — no request, no credential,
|
|
479
|
+
// nothing asked of the provider — so the logoff below ends it as for any
|
|
480
|
+
// instance: sent only when they name a live `SAP_SESSIONID`, without
|
|
481
|
+
// `sap-contextid`. A caller ending a leftover session of a process that
|
|
482
|
+
// is gone wants neither a probe nor a logon for it.
|
|
483
|
+
if (this.resumeFrom !== null) {
|
|
484
|
+
const session = this.resumeFrom;
|
|
485
|
+
this.resumeFrom = null;
|
|
486
|
+
this.seedHandedSession(session);
|
|
487
|
+
}
|
|
470
488
|
// Kept, not dropped: `flushGoodbye()` is how a caller who is about to
|
|
471
489
|
// open a new connection waits for it. Rejections are absorbed here so that holding
|
|
472
490
|
// the promise never turns a failed goodbye into an unhandled rejection —
|
|
@@ -484,6 +502,29 @@ class AbstractAbapConnection {
|
|
|
484
502
|
// by the write.
|
|
485
503
|
await written;
|
|
486
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* Puts the cookies of a handed session into the wire, as `resume()` seeds
|
|
507
|
+
* its jar, and sends nothing: what the wire held goes first, and the
|
|
508
|
+
* session's cookies arrive as a `Set-Cookie` the wire folds in through its
|
|
509
|
+
* own `ingest()`. A wire whose session no cookie names (RFC) keeps nothing
|
|
510
|
+
* of it, and its close then has nothing to end. Never throws — it is
|
|
511
|
+
* reached from `disconnect()`: a custom wire that throws here is logged in
|
|
512
|
+
* fixed words (the cookies are never echoed) and its close decides alone.
|
|
513
|
+
*/
|
|
514
|
+
seedHandedSession(session) {
|
|
515
|
+
try {
|
|
516
|
+
this.transport.forgetSession();
|
|
517
|
+
this.transport.ingest({
|
|
518
|
+
'set-cookie': session
|
|
519
|
+
.split(';')
|
|
520
|
+
.map((entry) => entry.trim())
|
|
521
|
+
.filter((entry) => entry !== ''),
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
catch {
|
|
525
|
+
this.logger?.debug('Could not hand the session to the wire for its logoff');
|
|
526
|
+
}
|
|
527
|
+
}
|
|
487
528
|
/**
|
|
488
529
|
* Wait for SAP's answer to the last dispatched goodbye.
|
|
489
530
|
*
|
package/docs/USAGE.md
CHANGED
|
@@ -228,6 +228,34 @@ What `connect()` does then:
|
|
|
228
228
|
The credential's logon moment (`establish`, which brings TLS material) is
|
|
229
229
|
offered only after the session answered, so it never rides on that request.
|
|
230
230
|
|
|
231
|
+
**Logging a kept session off without `connect()`** (since 17.1.0). An instance
|
|
232
|
+
built with `session` may be disconnected without ever connecting — for a
|
|
233
|
+
leftover session of a process that is gone:
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
const leftover = createConnection({
|
|
237
|
+
system: 'onprem',
|
|
238
|
+
transport: 'http',
|
|
239
|
+
config,
|
|
240
|
+
credential: new BasicAuthProvider(config.username, config.password),
|
|
241
|
+
session: keptCookies,
|
|
242
|
+
});
|
|
243
|
+
await leftover.disconnect(); // the logoff has left; no connect() needed
|
|
244
|
+
await leftover.flushGoodbye(); // only if you need SAP's answer too
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`disconnect()` then sends **the logoff and nothing else**: the ICF logoff
|
|
248
|
+
(`/sap/public/bc/icf/logoff`, on cloud too — measured to end a cloud security
|
|
249
|
+
session) with the handed cookies, without `sap-contextid`, without the
|
|
250
|
+
credential and with no CSRF fetch or other request before it; the credential's
|
|
251
|
+
`prepare()` is never called. It resolves when the logoff is written, as always,
|
|
252
|
+
and `flushGoodbye()` waits for SAP's answer. A string that names no
|
|
253
|
+
`SAP_SESSIONID` sends nothing. The instance is spent either way: a second
|
|
254
|
+
`disconnect()` rejects, and so does a `connect()` after it. An instance built
|
|
255
|
+
without `session` sends nothing at a `disconnect()` before `connect()`, as
|
|
256
|
+
before. Whether the session was still alive is SAP's to know; the logoff's
|
|
257
|
+
answer is not read.
|
|
258
|
+
|
|
231
259
|
Wrapping the connection with your own HTTP request logging stays with the
|
|
232
260
|
consumer. That is a policy of yours, typically read from your environment, not
|
|
233
261
|
a property of the wire. The factory passes `wireLogger` to the transport,
|
|
@@ -583,6 +611,9 @@ the logoff is the backstop, not the way to finish your work.
|
|
|
583
611
|
retried.
|
|
584
612
|
3. A successful `connect()` (200) sends no logoff; the session lives until
|
|
585
613
|
`disconnect()`.
|
|
614
|
+
An instance built on a kept session (`session`) and never connected sends
|
|
615
|
+
it at `disconnect()` with the handed cookies when they name a
|
|
616
|
+
`SAP_SESSIONID_*` (see "Logging a kept session off without `connect()`").
|
|
586
617
|
4. Where it goes: on-premise, the platform's ICF logoff
|
|
587
618
|
(`/sap/public/bc/icf/logoff`). On cloud, the logoff resource the session
|
|
588
619
|
document links to; when it links none, the same ICF logoff, sent exactly as
|