@mcp-abap-adt/connection 14.0.1 → 15.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.
- package/CHANGELOG.md +45 -1
- package/README.md +11 -7
- package/dist/connection/AbstractAbapConnection.d.ts +1 -1
- package/dist/connection/AbstractAbapConnection.d.ts.map +1 -1
- package/dist/connection/AbstractAbapConnection.js +3 -4
- package/dist/connection/AdtCloudConnector.d.ts +2 -2
- package/dist/connection/AdtCloudConnector.js +2 -2
- package/dist/connection/CloudHttpTransport.d.ts +23 -10
- package/dist/connection/CloudHttpTransport.d.ts.map +1 -1
- package/dist/connection/CloudHttpTransport.js +56 -44
- package/dist/connection/HttpTransport.d.ts +22 -2
- package/dist/connection/HttpTransport.d.ts.map +1 -1
- package/dist/connection/HttpTransport.js +45 -2
- package/dist/connection/IAdtTransport.d.ts +3 -2
- package/dist/connection/IAdtTransport.d.ts.map +1 -1
- package/dist/connection/OnPremHttpTransport.d.ts.map +1 -1
- package/dist/connection/OnPremHttpTransport.js +5 -24
- package/docs/INDEX.md +2 -0
- package/docs/MIGRATION-10.0.md +5 -0
- package/docs/MIGRATION-15.0.md +46 -0
- package/docs/MIGRATION-6.0.md +3 -1
- package/docs/USAGE.md +14 -9
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [15.0.0] - 2026-10-12
|
|
11
|
+
|
|
12
|
+
### Breaking
|
|
13
|
+
- **On `@mcp-abap-adt/interfaces-adt-connection` 2.0.0** (was `^1.0.0`).
|
|
14
|
+
`makeAdtRequest` mirrors the contract's `IAbapConnection.makeAdtRequest`,
|
|
15
|
+
whose defaults 2.0.0 made `unknown`: `makeAdtRequest<T = unknown, D =
|
|
16
|
+
unknown>`. An answer whose type is not named is `unknown`, so reading a field
|
|
17
|
+
off it no longer compiles until the type is named or checked. Nothing changes
|
|
18
|
+
at run time. 14.x declared the contract's 1.x while it was at 2.0.0, so a
|
|
19
|
+
consumer on 2.x installed two copies; 15.0 holds one. See
|
|
20
|
+
[MIGRATION-15.0.md](./docs/MIGRATION-15.0.md).
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- README and USAGE: the contract's `makeAdtRequest` is shown as it is
|
|
24
|
+
(`IAdtWireResponse<T, D>` with `unknown` defaults), not as an
|
|
25
|
+
`AxiosResponse`; the GET example names its XML body's type.
|
|
26
|
+
|
|
27
|
+
## [14.1.0] - 2026-10-12
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- **A cloud connection's `disconnect()` now ends its security session.** The
|
|
31
|
+
close sent `DELETE` on the session's own address, and the server ends a
|
|
32
|
+
session that way only when the request runs in a DIFFERENT one; from inside
|
|
33
|
+
it the answer is `200` and nothing is ended, so every closed connection left
|
|
34
|
+
its session until the server's timeout. The close now sends the logoff the
|
|
35
|
+
session document links to (`rel=…/sessions/logoff`). Measured on a BTP trial
|
|
36
|
+
(2026-10-12): after the `DELETE` the session's cookie alone was still
|
|
37
|
+
accepted 30 s later; after the logoff it is refused with `401` at once. When
|
|
38
|
+
the server links no logoff resource, nothing is sent and the debug log says
|
|
39
|
+
so.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
- **The logoff is sent as Eclipse ADT 3.60.3 sends it, on both wires**: the
|
|
43
|
+
session's cookie and no credential, with `Accept: */*`,
|
|
44
|
+
`sap-adt-request-id` and `sap-cancel-on-close: true`, and on the cloud
|
|
45
|
+
`x-sap-security-session: use`. The service answers `sap-authenticated: not
|
|
46
|
+
required`, so the credential the goodbye carried was handed to a public
|
|
47
|
+
endpoint that ignored it; the provider is no longer asked, and a provider
|
|
48
|
+
that refuses no longer keeps the session open. Measured 2026-10-12 on a BTP
|
|
49
|
+
trial and on premise (BASIS 816): after `disconnect()` the session's cookie
|
|
50
|
+
alone is refused with `401` at once and 10 s later.
|
|
51
|
+
|
|
10
52
|
## [14.0.1] - 2026-10-09
|
|
11
53
|
|
|
12
54
|
Documentation and development only; the code is the same as 14.0.0.
|
|
@@ -2348,7 +2390,9 @@ const connection = createAbapConnection(config, logger);
|
|
|
2348
2390
|
- JWT token refresh now properly handles connection errors (401/403 during initial connect)
|
|
2349
2391
|
- Permission errors (403 with "ExceptionResourceNoAccess") no longer trigger JWT refresh loops
|
|
2350
2392
|
- Proper separation: base class handles HTTP/session, concrete classes handle auth-specific errors
|
|
2351
|
-
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/
|
|
2393
|
+
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v15.0.0...HEAD
|
|
2394
|
+
[15.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.1.0...v15.0.0
|
|
2395
|
+
[14.1.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.0.1...v14.1.0
|
|
2352
2396
|
[14.0.1]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.0.0...v14.0.1
|
|
2353
2397
|
[14.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v13.0.0...v14.0.0
|
|
2354
2398
|
[13.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v12.0.0...v13.0.0
|
package/README.md
CHANGED
|
@@ -47,13 +47,13 @@ The package uses a clean separation of concerns:
|
|
|
47
47
|
|
|
48
48
|
- **`AdtCloudConnector`** (concrete, exported):
|
|
49
49
|
- An ABAP Cloud system: a session is a resource, opened at
|
|
50
|
-
`/sap/bc/adt/core/http/sessions` and given back
|
|
50
|
+
`/sap/bc/adt/core/http/sessions` and given back through the logoff resource its answer
|
|
51
|
+
links to (a `DELETE` on the session's own address answers `200` and ends nothing)
|
|
51
52
|
- Takes an auth provider, same as above
|
|
52
53
|
|
|
53
54
|
**Which one you take is how you say where you are dialling.** Nothing is probed:
|
|
54
|
-
the session resource answers on on-prem too,
|
|
55
|
-
|
|
56
|
-
mechanism that releases nothing.
|
|
55
|
+
the session resource answers on on-prem too, so its answer says nothing about which
|
|
56
|
+
system this is.
|
|
57
57
|
|
|
58
58
|
- **Auth providers** (an `IAuthProvider` from `@mcp-abap-adt/interfaces-auth`; the
|
|
59
59
|
ready-made ones — `BasicAuthProvider`, `TokenAuthProvider`, `SamlAuthProvider`,
|
|
@@ -160,6 +160,7 @@ the packages above. See [Migration to 9.0.0](./docs/MIGRATION-9.0.md).
|
|
|
160
160
|
|
|
161
161
|
- 📦 **[Installation Guide](./docs/INSTALLATION.md)** - Setup and installation instructions
|
|
162
162
|
- 📚 **[Usage Guide](./docs/USAGE.md)** - Detailed usage examples and API documentation
|
|
163
|
+
- 🚚 **[Migration to 15.0.0](./docs/MIGRATION-15.0.md)** - on `@mcp-abap-adt/interfaces-adt-connection` 2: `makeAdtRequest`'s answer is `unknown` unless its type is named; nothing changes at run time
|
|
163
164
|
- 🚚 **[Migration to 14.0.0](./docs/MIGRATION-14.0.md)** - the `sap-abap-auth` CLI is removed, with its `open` and `commander` dependencies; use `@mcp-abap-adt/auth-broker-cli`; the library's API is unchanged
|
|
164
165
|
- 🚚 **[Migration to 13.0.0](./docs/MIGRATION-13.0.md)** - interfaces-auth 7 and auth-errors 2, and the providers from auth-providers 6.0.0; no behaviour change, one interfaces-auth major per process
|
|
165
166
|
- 🚚 **[Migration to 12.0.0](./docs/MIGRATION-12.0.md)** - refusals follow the auth error contract (interfaces-auth 6, auth-errors): `AuthRefusedError.refusal` is an `IAuthProviderError` — read its `kind`; a custom `ILogonTarget` mints its refusal; no auth-providers release fits 12.x — take 13.0.0 with auth-providers 6.0.0
|
|
@@ -639,12 +640,15 @@ type SapConfig = {
|
|
|
639
640
|
Main interface for ABAP connections.
|
|
640
641
|
|
|
641
642
|
```typescript
|
|
642
|
-
import { AbapRequestOptions } from '@mcp-abap-adt/connection';
|
|
643
|
-
import type {
|
|
643
|
+
import type { AbapRequestOptions } from '@mcp-abap-adt/connection';
|
|
644
|
+
import type { IAdtWireResponse } from '@mcp-abap-adt/interfaces-adt-connection';
|
|
644
645
|
// The shared contract (IAbapConnection), what every connection provides:
|
|
645
646
|
interface AbapConnection {
|
|
646
647
|
connect(): Promise<void>; // REQUIRED before any request; rejects on failure
|
|
647
|
-
|
|
648
|
+
// An answer whose type is not named is `unknown` (interfaces-adt-connection 2).
|
|
649
|
+
makeAdtRequest<T = unknown, D = unknown>(
|
|
650
|
+
options: AbapRequestOptions,
|
|
651
|
+
): Promise<IAdtWireResponse<T, D>>;
|
|
648
652
|
getBaseUrl(): Promise<string>;
|
|
649
653
|
setSessionType(type: "stateless" | "stateful"): void; // Switch session type
|
|
650
654
|
getSessionId(): string | null; // Client-side conversation id
|
|
@@ -453,7 +453,7 @@ declare abstract class AbstractAbapConnection implements AbapConnection, ISessio
|
|
|
453
453
|
* nothing to renew.
|
|
454
454
|
*/
|
|
455
455
|
protected credentialRejected(_rejection: IAuthRejection): Promise<GuardedAnswer>;
|
|
456
|
-
makeAdtRequest<T =
|
|
456
|
+
makeAdtRequest<T = unknown, D = unknown>(options: AbapRequestOptions): Promise<IAdtWireResponse<T, D>>;
|
|
457
457
|
private performRequest;
|
|
458
458
|
/**
|
|
459
459
|
* One attempt: sent, and its response folded into the session.
|
|
@@ -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,gCAAg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Ae,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAIlD;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,eAAe;CA6BxB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -837,10 +837,9 @@ class AbstractAbapConnection {
|
|
|
837
837
|
async credentialRejected(_rejection) {
|
|
838
838
|
return { outcome: { ok: false, refusal: authErrors_js_1.NO_CREDENTIAL_TO_RENEW } };
|
|
839
839
|
}
|
|
840
|
-
// The defaults are IAbapConnection's (interfaces-adt-connection),
|
|
841
|
-
// implements: changing them here alone would type every caller's
|
|
842
|
-
// differently from the contract it codes against.
|
|
843
|
-
// biome-ignore lint/suspicious/noExplicitAny: mirrors IAbapConnection.makeAdtRequest
|
|
840
|
+
// The defaults are IAbapConnection's (interfaces-adt-connection 2: `unknown`),
|
|
841
|
+
// which this implements: changing them here alone would type every caller's
|
|
842
|
+
// response differently from the contract it codes against.
|
|
844
843
|
async makeAdtRequest(options) {
|
|
845
844
|
// Admission first, synchronously, before any await: the check and the
|
|
846
845
|
// count must happen in one step, or a request could be admitted and still
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A session there is a **resource**: asked for at
|
|
5
5
|
* `/sap/bc/adt/core/http/sessions` with `x-sap-security-session: create` and
|
|
6
|
-
* `sap-adt-purpose: preflight_logon`, and given back
|
|
7
|
-
* the
|
|
6
|
+
* `sap-adt-purpose: preflight_logon`, and given back through the logoff resource
|
|
7
|
+
* the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
8
8
|
* measured against a BTP trial: without that request the same connection gets
|
|
9
9
|
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
10
10
|
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* A session there is a **resource**: asked for at
|
|
6
6
|
* `/sap/bc/adt/core/http/sessions` with `x-sap-security-session: create` and
|
|
7
|
-
* `sap-adt-purpose: preflight_logon`, and given back
|
|
8
|
-
* the
|
|
7
|
+
* `sap-adt-purpose: preflight_logon`, and given back through the logoff resource
|
|
8
|
+
* the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
9
9
|
* measured against a BTP trial: without that request the same connection gets
|
|
10
10
|
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
11
11
|
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
* ABAP Cloud over HTTP: the wire where a session is a resource with an address.
|
|
3
3
|
*
|
|
4
4
|
* Asked for at `/sap/bc/adt/core/http/sessions` with `x-sap-security-session:
|
|
5
|
-
* create` and `sap-adt-purpose: preflight_logon`, and given back
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* create` and `sap-adt-purpose: preflight_logon`, and given back through the
|
|
6
|
+
* logoff resource the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
7
|
+
* measured against a BTP trial: without that request the same connection gets
|
|
8
|
+
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
9
|
+
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
10
|
+
*
|
|
11
|
+
* **Not by `DELETE` on the session's own address.** The resource ends a session
|
|
12
|
+
* only when the address names a DIFFERENT one than the request runs in — a new
|
|
13
|
+
* session ending an old one — and otherwise answers `200` having done nothing.
|
|
14
|
+
* Measured on a BTP trial (2026-10-12): after that `DELETE` the session's cookie
|
|
15
|
+
* alone was still accepted, at once and 30 s later; after the logoff it was
|
|
16
|
+
* refused with `401` at once, and so was a session whose address another
|
|
17
|
+
* session sent the `DELETE` for.
|
|
11
18
|
*
|
|
12
19
|
* **Taking this transport is the consumer saying which system it is dialling.**
|
|
13
20
|
* Nothing here asks the server what it is. The strategy this replaces treated a
|
|
@@ -41,16 +48,22 @@ export declare class CloudHttpTransport extends HttpTransport implements ICloudT
|
|
|
41
48
|
* guess wearing a measurement's clothes.
|
|
42
49
|
*/
|
|
43
50
|
protected sessionHeaders(): Record<string, string>;
|
|
44
|
-
/** The
|
|
45
|
-
private
|
|
51
|
+
/** The logoff resource this server linked to beside our session, resolved — the close target. */
|
|
52
|
+
private logoff;
|
|
46
53
|
open(context: IAdtSessionContext): Promise<void>;
|
|
47
54
|
close(context: IAdtSessionContext): Promise<void>;
|
|
48
55
|
/**
|
|
49
|
-
*
|
|
56
|
+
* An href resolved against the document that published it, as a link in an
|
|
57
|
+
* Atom document is. Resolved at open, so the close has nothing left that can
|
|
58
|
+
* throw: an href that is no URL is said once and leaves nothing to send.
|
|
59
|
+
*/
|
|
60
|
+
private resolveLink;
|
|
61
|
+
/**
|
|
62
|
+
* A link's href, by its `rel` rather than by position.
|
|
50
63
|
*
|
|
51
64
|
* The document carries three links — the session, the logoff resource and
|
|
52
65
|
* system information — and their order is not a contract.
|
|
53
66
|
*/
|
|
54
|
-
private
|
|
67
|
+
private linkHref;
|
|
55
68
|
}
|
|
56
69
|
//# sourceMappingURL=CloudHttpTransport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/CloudHttpTransport.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
* ABAP Cloud over HTTP: the wire where a session is a resource with an address.
|
|
4
4
|
*
|
|
5
5
|
* Asked for at `/sap/bc/adt/core/http/sessions` with `x-sap-security-session:
|
|
6
|
-
* create` and `sap-adt-purpose: preflight_logon`, and given back
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* create` and `sap-adt-purpose: preflight_logon`, and given back through the
|
|
7
|
+
* logoff resource the same answer links to. Reproduced from Eclipse ADT 3.60 and
|
|
8
|
+
* measured against a BTP trial: without that request the same connection gets
|
|
9
|
+
* `sap-usercontext` and `sap-XSRF_*` and no session for a lock to be bound to,
|
|
10
|
+
* which is how "cloud issues no SAP_SESSIONID" came to be believed.
|
|
11
|
+
*
|
|
12
|
+
* **Not by `DELETE` on the session's own address.** The resource ends a session
|
|
13
|
+
* only when the address names a DIFFERENT one than the request runs in — a new
|
|
14
|
+
* session ending an old one — and otherwise answers `200` having done nothing.
|
|
15
|
+
* Measured on a BTP trial (2026-10-12): after that `DELETE` the session's cookie
|
|
16
|
+
* alone was still accepted, at once and 30 s later; after the logoff it was
|
|
17
|
+
* refused with `401` at once, and so was a session whose address another
|
|
18
|
+
* session sent the `DELETE` for.
|
|
12
19
|
*
|
|
13
20
|
* **Taking this transport is the consumer saying which system it is dialling.**
|
|
14
21
|
* Nothing here asks the server what it is. The strategy this replaces treated a
|
|
@@ -29,6 +36,7 @@ const SESSION_ACCEPT = 'application/vnd.sap.adt.core.http.session.v3+xml, ' +
|
|
|
29
36
|
'application/vnd.sap.adt.core.http.session.v2+xml, ' +
|
|
30
37
|
'application/vnd.sap.adt.core.http.session.v1+xml';
|
|
31
38
|
const SECURITY_SESSION_REL = 'http://www.sap.com/adt/categories/core/http/sessions/securitysession';
|
|
39
|
+
const LOGOFF_REL = 'http://www.sap.com/adt/categories/core/http/sessions/logoff';
|
|
32
40
|
class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
33
41
|
kind = 'cloud-http';
|
|
34
42
|
/** Which system this wire is for. Read by the compiler, never at runtime. */
|
|
@@ -54,8 +62,8 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
54
62
|
sessionHeaders() {
|
|
55
63
|
return this.sessionEstablished() ? { 'x-sap-security-session': 'use' } : {};
|
|
56
64
|
}
|
|
57
|
-
/** The
|
|
58
|
-
|
|
65
|
+
/** The logoff resource this server linked to beside our session, resolved — the close target. */
|
|
66
|
+
logoff = null;
|
|
59
67
|
async open(context) {
|
|
60
68
|
// The logon, outside the swallowing `try`: a credential that refuses it
|
|
61
69
|
// (`AuthRefusedError`) is the caller's to hear, not a preflight to shrug at.
|
|
@@ -87,7 +95,7 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
87
95
|
// anything is read out of it.
|
|
88
96
|
context.observe(response.headers);
|
|
89
97
|
this.ingest(response.headers);
|
|
90
|
-
const resource = this.
|
|
98
|
+
const resource = this.linkHref(response.data, SECURITY_SESSION_REL);
|
|
91
99
|
if (!resource) {
|
|
92
100
|
// Answered, but published no session of its own — so there is no
|
|
93
101
|
// address to give one back by. Said out loud rather than worked
|
|
@@ -96,7 +104,9 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
96
104
|
this.logger?.debug(`Session resource answered ${response.status} but published no securitysession link`);
|
|
97
105
|
return;
|
|
98
106
|
}
|
|
99
|
-
|
|
107
|
+
// Published only while its ICF service is active; without it there is
|
|
108
|
+
// nothing that ends this session, and the close says so.
|
|
109
|
+
this.logoff = this.resolveLink(this.linkHref(response.data, LOGOFF_REL), `${context.baseUrl}${SESSIONS_PATH}`);
|
|
100
110
|
this.logger?.debug(`Security session opened: ${resource}`);
|
|
101
111
|
}
|
|
102
112
|
catch (error) {
|
|
@@ -111,63 +121,65 @@ class CloudHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
111
121
|
}
|
|
112
122
|
}
|
|
113
123
|
async close(context) {
|
|
114
|
-
const
|
|
115
|
-
this.
|
|
124
|
+
const logoff = this.logoff;
|
|
125
|
+
this.logoff = null;
|
|
116
126
|
// Read SYNCHRONOUSLY, before the first await. A close is dispatched
|
|
117
127
|
// without being awaited, so the teardown's `forgetSession()` runs while
|
|
118
128
|
// this is suspended — and a goodbye assembled afterwards would carry no
|
|
119
129
|
// cookie, which is the one thing that proves the session is ours to end.
|
|
120
130
|
const cookies = this.cookies();
|
|
121
|
-
|
|
122
|
-
// Snapshotted for the same reason: the DELETE must reach the server holding
|
|
131
|
+
// Snapshotted for the same reason: the logoff must reach the server holding
|
|
123
132
|
// this session, not whichever one the wire is pinned to when it goes out.
|
|
124
133
|
const affinity = this.affinityHeaders();
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
//
|
|
134
|
+
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.
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
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');
|
|
128
144
|
return;
|
|
129
145
|
}
|
|
146
|
+
await this.sendLogoff(context, logoff, {
|
|
147
|
+
cookies,
|
|
148
|
+
affinity,
|
|
149
|
+
// `x-sap-security-session: use`, as Eclipse sends it on the logoff: it
|
|
150
|
+
// names the session the logoff ends, like every other request here.
|
|
151
|
+
session,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* An href resolved against the document that published it, as a link in an
|
|
156
|
+
* Atom document is. Resolved at open, so the close has nothing left that can
|
|
157
|
+
* throw: an href that is no URL is said once and leaves nothing to send.
|
|
158
|
+
*/
|
|
159
|
+
resolveLink(href, documentUrl) {
|
|
160
|
+
if (!href)
|
|
161
|
+
return null;
|
|
130
162
|
try {
|
|
131
|
-
|
|
132
|
-
await context.authorize(auth);
|
|
133
|
-
await this.sendDetached({
|
|
134
|
-
method: 'DELETE',
|
|
135
|
-
url: new URL(resource, context.baseUrl).toString(),
|
|
136
|
-
headers: {
|
|
137
|
-
...affinity,
|
|
138
|
-
// Detached, so not dressed: the client is said here in so many
|
|
139
|
-
// words, as on every other request of this wire.
|
|
140
|
-
...this.clientHeaders(),
|
|
141
|
-
...auth,
|
|
142
|
-
...context.extraHeaders,
|
|
143
|
-
Cookie: (0, cookies_js_1.mergeCookieHeaders)(auth.Cookie, cookies),
|
|
144
|
-
'x-sap-security-session': 'use',
|
|
145
|
-
// A state change, so the server wants the token. Without one the
|
|
146
|
-
// request is refused with 403 — which is still just a message the
|
|
147
|
-
// server did not accept, and still not something to raise from a
|
|
148
|
-
// teardown.
|
|
149
|
-
...(csrf ? { 'x-csrf-token': csrf } : {}),
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
this.logger?.debug('Told the server the security session is finished');
|
|
163
|
+
return new URL(href, documentUrl).toString();
|
|
153
164
|
}
|
|
154
|
-
catch
|
|
155
|
-
this.logger?.debug(`
|
|
165
|
+
catch {
|
|
166
|
+
this.logger?.debug(`The server published a logoff link that is no URL: ${href}`);
|
|
167
|
+
return null;
|
|
156
168
|
}
|
|
157
169
|
}
|
|
158
170
|
/**
|
|
159
|
-
*
|
|
171
|
+
* A link's href, by its `rel` rather than by position.
|
|
160
172
|
*
|
|
161
173
|
* The document carries three links — the session, the logoff resource and
|
|
162
174
|
* system information — and their order is not a contract.
|
|
163
175
|
*/
|
|
164
|
-
|
|
176
|
+
linkHref(body, wanted) {
|
|
165
177
|
if (typeof body !== 'string')
|
|
166
178
|
return undefined;
|
|
167
179
|
for (const link of body.matchAll(/<[^>]*link\b([^>]*)>/g)) {
|
|
168
180
|
const attrs = link[1];
|
|
169
181
|
const rel = attrs.match(/\brel="([^"]*)"/)?.[1];
|
|
170
|
-
if (rel !==
|
|
182
|
+
if (rel !== wanted)
|
|
171
183
|
continue;
|
|
172
184
|
const href = attrs.match(/\bhref="([^"]*)"/)?.[1];
|
|
173
185
|
if (href)
|
|
@@ -219,11 +219,31 @@ export declare class HttpTransport implements IAdtTransport {
|
|
|
219
219
|
/**
|
|
220
220
|
* Nothing to give back at this level.
|
|
221
221
|
*
|
|
222
|
-
* The two concrete wires override it — the cloud one
|
|
223
|
-
*
|
|
222
|
+
* The two concrete wires override it — the cloud one sends the logoff its
|
|
223
|
+
* session document links to, the on-prem one the platform logoff. A bare HTTP wire has
|
|
224
224
|
* neither, and says so by doing nothing.
|
|
225
225
|
*/
|
|
226
226
|
close(_context: IAdtSessionContext): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* The logoff, sent as Eclipse ADT 3.60.3 sends it when a project is closed.
|
|
229
|
+
*
|
|
230
|
+
* The session's cookie and nothing that logs on: the service answers
|
|
231
|
+
* `sap-authenticated: not required`, so a credential would only be handed to
|
|
232
|
+
* a public endpoint that ignores it (measured on a BTP trial, 2026-10-12).
|
|
233
|
+
* What is snapshotted — the cookie, the affinity, the session headers — is
|
|
234
|
+
* taken by the caller before its first await, because the teardown clears it
|
|
235
|
+
* while the close is suspended.
|
|
236
|
+
*
|
|
237
|
+
* Its answer is not read: it is the same `200` and the same goodbye page for
|
|
238
|
+
* a live session, one already ended and no cookie at all, so it says nothing
|
|
239
|
+
* about THIS session; and when the logoff cannot end one, the reason is an
|
|
240
|
+
* error message whose status the ICF kernel picks, which no ABAP source shows.
|
|
241
|
+
*/
|
|
242
|
+
protected sendLogoff(context: IAdtSessionContext, url: string, snapshot: {
|
|
243
|
+
cookies: string;
|
|
244
|
+
affinity: Record<string, string>;
|
|
245
|
+
session: Record<string, string>;
|
|
246
|
+
}): Promise<void>;
|
|
227
247
|
/**
|
|
228
248
|
* Throws for a status the request does not admit — by doing nothing, because
|
|
229
249
|
* that is already what axios does, and `AxiosError` already carries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/HttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
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;AAuC5B,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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Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.HttpTransport = exports.isStatefulRequest = void 0;
|
|
27
|
+
const node_crypto_1 = require("node:crypto");
|
|
27
28
|
const node_https_1 = require("node:https");
|
|
28
29
|
const auth_errors_1 = require("@mcp-abap-adt/auth-errors");
|
|
29
30
|
const axios_1 = __importDefault(require("axios"));
|
|
@@ -656,11 +657,53 @@ class HttpTransport {
|
|
|
656
657
|
/**
|
|
657
658
|
* Nothing to give back at this level.
|
|
658
659
|
*
|
|
659
|
-
* The two concrete wires override it — the cloud one
|
|
660
|
-
*
|
|
660
|
+
* The two concrete wires override it — the cloud one sends the logoff its
|
|
661
|
+
* session document links to, the on-prem one the platform logoff. A bare HTTP wire has
|
|
661
662
|
* neither, and says so by doing nothing.
|
|
662
663
|
*/
|
|
663
664
|
async close(_context) { }
|
|
665
|
+
/**
|
|
666
|
+
* The logoff, sent as Eclipse ADT 3.60.3 sends it when a project is closed.
|
|
667
|
+
*
|
|
668
|
+
* The session's cookie and nothing that logs on: the service answers
|
|
669
|
+
* `sap-authenticated: not required`, so a credential would only be handed to
|
|
670
|
+
* a public endpoint that ignores it (measured on a BTP trial, 2026-10-12).
|
|
671
|
+
* What is snapshotted — the cookie, the affinity, the session headers — is
|
|
672
|
+
* taken by the caller before its first await, because the teardown clears it
|
|
673
|
+
* while the close is suspended.
|
|
674
|
+
*
|
|
675
|
+
* Its answer is not read: it is the same `200` and the same goodbye page for
|
|
676
|
+
* a live session, one already ended and no cookie at all, so it says nothing
|
|
677
|
+
* about THIS session; and when the logoff cannot end one, the reason is an
|
|
678
|
+
* error message whose status the ICF kernel picks, which no ABAP source shows.
|
|
679
|
+
*/
|
|
680
|
+
async sendLogoff(context, url, snapshot) {
|
|
681
|
+
// Nothing that logs on, whoever put it in the context: the goodbye carries
|
|
682
|
+
// the session's cookie and no credential.
|
|
683
|
+
const extra = Object.fromEntries(Object.entries(context.extraHeaders ?? {}).filter(([name]) => name.trim().toLowerCase() !== 'authorization'));
|
|
684
|
+
try {
|
|
685
|
+
await this.sendDetached({
|
|
686
|
+
method: 'GET',
|
|
687
|
+
url,
|
|
688
|
+
headers: {
|
|
689
|
+
...snapshot.affinity,
|
|
690
|
+
// Detached, so not dressed: the client is said here in so many
|
|
691
|
+
// words, as on every other request of this wire.
|
|
692
|
+
...this.clientHeaders(),
|
|
693
|
+
...extra,
|
|
694
|
+
...snapshot.session,
|
|
695
|
+
Accept: '*/*',
|
|
696
|
+
'sap-adt-request-id': (0, node_crypto_1.randomUUID)().replace(/-/g, ''),
|
|
697
|
+
'sap-cancel-on-close': 'true',
|
|
698
|
+
Cookie: snapshot.cookies,
|
|
699
|
+
},
|
|
700
|
+
});
|
|
701
|
+
this.logger?.debug('Told the server the session is finished');
|
|
702
|
+
}
|
|
703
|
+
catch (error) {
|
|
704
|
+
this.logger?.debug(`Could not tell the server the session is finished: ${error instanceof Error ? error.message : String(error)}`);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
664
707
|
/**
|
|
665
708
|
* Throws for a status the request does not admit — by doing nothing, because
|
|
666
709
|
* that is already what axios does, and `AxiosError` already carries
|
|
@@ -77,7 +77,8 @@ export interface IAdtSessionContext {
|
|
|
77
77
|
baseUrl: string;
|
|
78
78
|
/**
|
|
79
79
|
* Fill the credential into a request the wire itself originates — the CSRF
|
|
80
|
-
* fetch, the cloud preflight
|
|
80
|
+
* fetch, the cloud preflight. Not the logoff: it carries the session's cookie
|
|
81
|
+
* and no credential, as Eclipse sends it. Asked per request, never held: a
|
|
81
82
|
* provider may renew behind the call. Throws `AuthRefusedError` when the
|
|
82
83
|
* credential will not authorize it; the request is then not sent.
|
|
83
84
|
*/
|
|
@@ -147,7 +148,7 @@ export interface IAdtTransport {
|
|
|
147
148
|
*
|
|
148
149
|
* Never throws, and a repeat call finds nothing owed — this is reached from
|
|
149
150
|
* `disconnect()`, which promises to settle. What it does is the wire's: a
|
|
150
|
-
*
|
|
151
|
+
* the logoff the cloud session document links to, the platform's logoff, or
|
|
151
152
|
* closing the conversation.
|
|
152
153
|
*/
|
|
153
154
|
close(context: IAdtSessionContext): Promise<void>;
|
|
@@ -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;CACpB;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,6DAA6D;AAC7D;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB
|
|
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;AAEl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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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnPremHttpTransport.d.ts","sourceRoot":"","sources":["../../src/connection/OnPremHttpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
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"}
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.OnPremHttpTransport = void 0;
|
|
21
|
-
const cookies_js_1 = require("../utils/cookies.js");
|
|
22
21
|
const HttpTransport_js_1 = require("./HttpTransport.js");
|
|
23
22
|
const ICF_LOGOFF_PATH = '/sap/public/bc/icf/logoff';
|
|
24
23
|
class OnPremHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
@@ -67,29 +66,11 @@ class OnPremHttpTransport extends HttpTransport_js_1.HttpTransport {
|
|
|
67
66
|
// eventually close somebody's GUI.
|
|
68
67
|
return;
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
await this.sendDetached({
|
|
76
|
-
method: 'GET',
|
|
77
|
-
url: `${context.baseUrl}${ICF_LOGOFF_PATH}`,
|
|
78
|
-
headers: {
|
|
79
|
-
...affinity,
|
|
80
|
-
// Detached, so not dressed: the client is said here in so many
|
|
81
|
-
// words, as on every other request of this wire.
|
|
82
|
-
...this.clientHeaders(),
|
|
83
|
-
...auth,
|
|
84
|
-
...context.extraHeaders,
|
|
85
|
-
Cookie: (0, cookies_js_1.mergeCookieHeaders)(auth.Cookie, cookies),
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
this.logger?.debug('Told the server the session is finished');
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
this.logger?.debug(`Could not tell the server the session is finished: ${error instanceof Error ? error.message : String(error)}`);
|
|
92
|
-
}
|
|
69
|
+
await this.sendLogoff(context, `${context.baseUrl}${ICF_LOGOFF_PATH}`, {
|
|
70
|
+
cookies,
|
|
71
|
+
affinity,
|
|
72
|
+
session: {},
|
|
73
|
+
});
|
|
93
74
|
}
|
|
94
75
|
}
|
|
95
76
|
exports.OnPremHttpTransport = OnPremHttpTransport;
|
package/docs/INDEX.md
CHANGED
|
@@ -15,6 +15,7 @@ mcp-abap-connection/
|
|
|
15
15
|
│ ├── INSTALLATION.md # Setup and installation guide
|
|
16
16
|
│ ├── USAGE.md # API documentation and examples
|
|
17
17
|
│ ├── MIGRATION-2.0.md # Moving to the explicit session lifecycle
|
|
18
|
+
│ ├── MIGRATION-15.0.md # interfaces-adt-connection 2: makeAdtRequest answers unknown
|
|
18
19
|
│ ├── MIGRATION-14.0.md # the sap-abap-auth CLI, open and commander are removed
|
|
19
20
|
│ ├── MIGRATION-13.0.md # interfaces-auth 7, auth-errors 2, auth-providers 6.0.0; no behaviour change
|
|
20
21
|
│ ├── MIGRATION-12.0.md # refusals follow the auth error contract (interfaces-auth 6, auth-errors)
|
|
@@ -45,6 +46,7 @@ mcp-abap-connection/
|
|
|
45
46
|
- 🧭 [Scope and Boundaries](./SCOPE.md) - What this package does (and does not), sibling packages, and why there is no RFC to cloud
|
|
46
47
|
|
|
47
48
|
### Upgrading
|
|
49
|
+
- 🚚 [Migrating to 15.0.0](./MIGRATION-15.0.md) - on `@mcp-abap-adt/interfaces-adt-connection` 2: `makeAdtRequest`'s answer is `unknown` unless its type is named
|
|
48
50
|
- 🚚 [Migrating to 14.0.0](./MIGRATION-14.0.md) - the `sap-abap-auth` CLI is removed; use `@mcp-abap-adt/auth-broker-cli`
|
|
49
51
|
- 🚚 [Migrating to 13.0.0](./MIGRATION-13.0.md) - interfaces-auth 7 and auth-errors 2; the connection's behaviour is unchanged, a consumer holds one interfaces-auth major and takes the providers from auth-providers 6.0.0
|
|
50
52
|
- 🚚 [Migrating to 12.0.0](./MIGRATION-12.0.md) - refusals follow the auth error contract: `AuthRefusedError.refusal` is an `IAuthProviderError` (read its `kind`), a custom `ILogonTarget` mints its refusal through `@mcp-abap-adt/auth-errors`, and no auth-providers release fits 12.x — auth-providers 6.0.0 goes with 13.0.0
|
package/docs/MIGRATION-10.0.md
CHANGED
|
@@ -221,6 +221,11 @@ gone. Two methods replace it:
|
|
|
221
221
|
provider refuses, so a goodbye that authorizes catches it; the connection absorbs
|
|
222
222
|
a rejected close it dispatched, but a close that never throws is the contract.
|
|
223
223
|
|
|
224
|
+
(Later releases send the logoff of the shipped wires without a credential, as
|
|
225
|
+
Eclipse does: the service answers `sap-authenticated: not required`, and a goodbye
|
|
226
|
+
that waits on the provider leaves the session open when the provider refuses. A
|
|
227
|
+
custom wire is better off doing the same — see the CHANGELOG.)
|
|
228
|
+
|
|
224
229
|
```ts
|
|
225
230
|
import { authError } from '@mcp-abap-adt/auth-errors';
|
|
226
231
|
import type {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Migration to 15.0
|
|
2
|
+
|
|
3
|
+
15.0.0 moves the connection onto `@mcp-abap-adt/interfaces-adt-connection`
|
|
4
|
+
**2.0.0**, the contract it implements. Nothing changes at run time: the
|
|
5
|
+
lifecycle, the requests, the logoff and every answer are as in 14.1.0. What
|
|
6
|
+
changes is a type.
|
|
7
|
+
|
|
8
|
+
## What changed
|
|
9
|
+
|
|
10
|
+
`makeAdtRequest` mirrors `IAbapConnection.makeAdtRequest`, and the contract's
|
|
11
|
+
2.0.0 made its defaults `unknown` instead of `any`:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// 14.x
|
|
15
|
+
makeAdtRequest<T = any, D = any>(options): Promise<IAdtWireResponse<T, D>>;
|
|
16
|
+
// 15.0
|
|
17
|
+
makeAdtRequest<T = unknown, D = unknown>(options): Promise<IAdtWireResponse<T, D>>;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
So an answer whose type the caller does not name is `unknown`. Reading a field
|
|
21
|
+
off it — `response.data.items`, a typo included — compiled against `any` and
|
|
22
|
+
no longer compiles.
|
|
23
|
+
|
|
24
|
+
14.x declared `interfaces-adt-connection` `^1.0.0` while the contract was at
|
|
25
|
+
2.0.0, so a consumer on the 2.x contract installed two copies of it. 15.0 holds
|
|
26
|
+
one.
|
|
27
|
+
|
|
28
|
+
## What a consumer must do
|
|
29
|
+
|
|
30
|
+
Where the compiler now reports an error:
|
|
31
|
+
|
|
32
|
+
- **Name the type** the request answers, when it is known:
|
|
33
|
+
`connection.makeAdtRequest<string>(options)` for an XML or text body.
|
|
34
|
+
- **Narrow `unknown`** where the shape is checked at run time anyway:
|
|
35
|
+
`typeof response.data === 'string'`, or a type guard for an object, before
|
|
36
|
+
reading a field.
|
|
37
|
+
- **A stub or mock of `makeAdtRequest`** that returns a fixed shape is no
|
|
38
|
+
longer assignable to the generic signature: declare it generic,
|
|
39
|
+
`async <T = unknown, D = unknown>(options) => ({ … data: body as T … })`,
|
|
40
|
+
or annotate its return as `Promise<IAdtWireResponse<any, any>>` in the test.
|
|
41
|
+
- **Be on `@mcp-abap-adt/interfaces-adt-connection` 2** wherever you depend on
|
|
42
|
+
it yourself, so that one copy of the contract is installed
|
|
43
|
+
(`npm ls @mcp-abap-adt/interfaces-adt-connection`).
|
|
44
|
+
|
|
45
|
+
Code that never reads `response.data` as a typed object, or names its type
|
|
46
|
+
already, changes nothing.
|
package/docs/MIGRATION-6.0.md
CHANGED
|
@@ -87,7 +87,9 @@ The cloud wire is not the on-prem one with a different name. It asks for a
|
|
|
87
87
|
session at `/sap/bc/adt/core/http/sessions` and gives it back by `DELETE` on the
|
|
88
88
|
address the server publishes; the on-prem wire has neither, and says goodbye
|
|
89
89
|
through the platform logoff. Handing the wrong one to a connector does not
|
|
90
|
-
compile.
|
|
90
|
+
compile. (Later releases give the cloud session back through the logoff its
|
|
91
|
+
session document links to: the `DELETE`, sent from inside the session, ended
|
|
92
|
+
nothing — see the CHANGELOG.)
|
|
91
93
|
|
|
92
94
|
The `ITokenRefresher` that used to be a constructor slot **is** the credential
|
|
93
95
|
now. Hand `TokenAuthProvider` a bare string instead and you get a token with
|
package/docs/USAGE.md
CHANGED
|
@@ -80,8 +80,7 @@ on-prem system are both ordinary, and a design where the credential picked the
|
|
|
80
80
|
system's session mechanism got one of them wrong whichever way it guessed.
|
|
81
81
|
|
|
82
82
|
Nothing is detected. `/sap/bc/adt/core/http/sessions` answers on on-prem too,
|
|
83
|
-
|
|
84
|
-
it — so asking the server would choose the mechanism that releases nothing.
|
|
83
|
+
so its answer says nothing about which system this is.
|
|
85
84
|
|
|
86
85
|
### Basic Authentication (On-Premise)
|
|
87
86
|
|
|
@@ -167,7 +166,8 @@ them is refused with `ADT_NOT_CONNECTED`.
|
|
|
167
166
|
|
|
168
167
|
```typescript
|
|
169
168
|
import { getTimeout } from '@mcp-abap-adt/connection';
|
|
170
|
-
|
|
169
|
+
// The body is XML: name its type, or the answer's `data` is `unknown`.
|
|
170
|
+
const packages = await connection.makeAdtRequest<string>({
|
|
171
171
|
method: 'GET',
|
|
172
172
|
url: '/sap/bc/adt/repository/nodestructure',
|
|
173
173
|
params: {
|
|
@@ -717,11 +717,14 @@ try {
|
|
|
717
717
|
connection satisfies, including RFC:
|
|
718
718
|
|
|
719
719
|
```typescript
|
|
720
|
-
import { AbapRequestOptions } from '@mcp-abap-adt/connection';
|
|
721
|
-
import type {
|
|
720
|
+
import type { AbapRequestOptions } from '@mcp-abap-adt/connection';
|
|
721
|
+
import type { IAdtWireResponse } from '@mcp-abap-adt/interfaces-adt-connection';
|
|
722
722
|
interface AbapConnection {
|
|
723
723
|
connect(): Promise<void>; // REQUIRED before any request
|
|
724
|
-
|
|
724
|
+
// An answer whose type is not named is `unknown` (interfaces-adt-connection 2).
|
|
725
|
+
makeAdtRequest<T = unknown, D = unknown>(
|
|
726
|
+
options: AbapRequestOptions,
|
|
727
|
+
): Promise<IAdtWireResponse<T, D>>;
|
|
725
728
|
getBaseUrl(): Promise<string>;
|
|
726
729
|
setSessionType(type: "stateless" | "stateful"): void;
|
|
727
730
|
getSessionId(): string | null; // client-side conversation id
|
|
@@ -768,8 +771,10 @@ class AdtCloudConnector<
|
|
|
768
771
|
|
|
769
772
|
The difference is what each does with the session: on-prem takes it from the
|
|
770
773
|
establishing call and gives it back with the platform's ICF logoff; cloud opens
|
|
771
|
-
one at `/sap/bc/adt/core/http/sessions` and gives it back
|
|
772
|
-
|
|
774
|
+
one at `/sap/bc/adt/core/http/sessions` and gives it back through the logoff
|
|
775
|
+
resource the server links to in the same answer. Not by `DELETE` on the
|
|
776
|
+
session's own address: from inside that session it answers `200` and ends
|
|
777
|
+
nothing (measured on a BTP trial, 2026-10-12).
|
|
773
778
|
|
|
774
779
|
**Both take a transport, and neither defaults one.** What differs is the CHOICE,
|
|
775
780
|
and the type parameter is where that is said: `TTransport` is bound to
|
|
@@ -951,7 +956,7 @@ never asks what kind it is:
|
|
|
951
956
|
|---|---|
|
|
952
957
|
| `prepare()` | once, in `connect()`, before the wire opens |
|
|
953
958
|
| `establish(logon)` | at each logon the wire performs |
|
|
954
|
-
| `authorize(request)` | before every attempt of every request — including the CSRF fetch, the cloud preflight
|
|
959
|
+
| `authorize(request)` | before every attempt of every request — including the CSRF fetch, the cloud preflight and each resend; not the logoff, which carries only the session's cookie |
|
|
955
960
|
| `rejected(rejection)` | the system said no |
|
|
956
961
|
|
|
957
962
|
**Each request asks the provider.** Nothing is cached by the connection, so a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/connection",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "ABAP connection layer for MCP ABAP ADT server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@mcp-abap-adt/auth-errors": "^2.2.0",
|
|
54
|
-
"@mcp-abap-adt/interfaces-adt-connection": "^
|
|
54
|
+
"@mcp-abap-adt/interfaces-adt-connection": "^2.0.0",
|
|
55
55
|
"@mcp-abap-adt/interfaces-auth": "^7.5.0",
|
|
56
56
|
"@mcp-abap-adt/interfaces-auth-sap": "^3.3.0",
|
|
57
57
|
"@mcp-abap-adt/interfaces-network": "^2.0.0",
|