@mcp-abap-adt/connection 9.2.0 → 9.2.2
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 +34 -3
- package/dist/connection/AbstractAbapConnection.d.ts +0 -5
- package/dist/connection/AbstractAbapConnection.d.ts.map +1 -1
- package/dist/connection/AbstractAbapConnection.js +2 -7
- package/docs/USAGE.md +0 -7
- package/package.json +5 -6
- package/dist/auth/kerberosSpnego.d.ts +0 -3
- package/dist/auth/kerberosSpnego.d.ts.map +0 -1
- package/dist/auth/kerberosSpnego.js +0 -56
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to the `@mcp-abap-adt/connection` package will be documented
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [9.2.2] - 2026-09-26
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **`@mcp-abap-adt/interfaces-adt` `^10.0.0`, `-auth` `^2.0.1`, `-auth-sap`
|
|
15
|
+
`^1.0.1`.** Neither major touches a symbol this package takes: `interfaces-adt`
|
|
16
|
+
10 adds `analyse` to object contracts (the connection types are byte-identical
|
|
17
|
+
to 9), and `interfaces-auth` 2 makes `AssertionContext.expectedInResponseTo`
|
|
18
|
+
optional, which only an `IAssertionValidator` implementer sees. `-auth-sap`
|
|
19
|
+
1.0.1 is the one that accepts `-auth` 2 — with 1.0.0 an install carried a
|
|
20
|
+
second, private copy of `-auth` 1.x under it. No API changes.
|
|
21
|
+
|
|
22
|
+
## [9.2.1] - 2026-09-24
|
|
23
|
+
|
|
24
|
+
### Removed
|
|
25
|
+
|
|
26
|
+
- **The optional `kerberos` dependency, and the SPNEGO wrapper nothing called.**
|
|
27
|
+
`KerberosAbapConnection` went in 6.0 (see `docs/MIGRATION-6.0.md#kerberos`);
|
|
28
|
+
what it left behind — `src/auth/kerberosSpnego.ts` — was not exported and not
|
|
29
|
+
reached from anywhere in the library, yet `optionalDependencies` still made
|
|
30
|
+
every install build a native module, and pull the archived `prebuild-install`
|
|
31
|
+
with it, for no code path. No API changes: nothing public named it. A
|
|
32
|
+
consumer who imported `dist/auth/kerberosSpnego.js` by deep path was on a
|
|
33
|
+
private file; `kerberos` itself is still on npm to call directly. Kerberos
|
|
34
|
+
belongs on the credential axis as an `IAuthProvider`, added with a KDC to
|
|
35
|
+
test it against.
|
|
36
|
+
- `docs/USAGE.md` described the single-leg SPNEGO limitation of a connection
|
|
37
|
+
that no longer exists. It no longer does.
|
|
38
|
+
|
|
8
39
|
## [9.2.0] - 2026-09-24
|
|
9
40
|
|
|
10
41
|
### Changed
|
|
@@ -89,8 +120,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
89
120
|
through 6. The umbrella — `@mcp-abap-adt/interfaces` — was deleted in its
|
|
90
121
|
52.0.0, for exactly the cost that paragraph describes. It says so now.
|
|
91
122
|
|
|
92
|
-
## [Unreleased]
|
|
93
|
-
|
|
94
123
|
## [9.0.0] - 2026-09-23
|
|
95
124
|
|
|
96
125
|
**The contracts split, and this package follows them rather than the shim left
|
|
@@ -1733,7 +1762,9 @@ const connection = createAbapConnection(config, logger);
|
|
|
1733
1762
|
- JWT token refresh now properly handles connection errors (401/403 during initial connect)
|
|
1734
1763
|
- Permission errors (403 with "ExceptionResourceNoAccess") no longer trigger JWT refresh loops
|
|
1735
1764
|
- Proper separation: base class handles HTTP/session, concrete classes handle auth-specific errors
|
|
1736
|
-
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v9.2.
|
|
1765
|
+
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v9.2.2...HEAD
|
|
1766
|
+
[9.2.2]: https://github.com/fr0ster/mcp-abap-connection/compare/v9.2.1...v9.2.2
|
|
1767
|
+
[9.2.1]: https://github.com/fr0ster/mcp-abap-connection/compare/v9.2.0...v9.2.1
|
|
1737
1768
|
[9.2.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v9.1.0...v9.2.0
|
|
1738
1769
|
[9.1.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v9.0.0...v9.1.0
|
|
1739
1770
|
[9.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v8.1.0...v9.0.0
|
|
@@ -203,11 +203,6 @@ declare abstract class AbstractAbapConnection implements AbapConnection, ISessio
|
|
|
203
203
|
*
|
|
204
204
|
* Must be idempotent: `establishSession()` may prepare the same credential
|
|
205
205
|
* again, and does.
|
|
206
|
-
*
|
|
207
|
-
* Kerberos deliberately does NOT implement it. Minting the SPNEGO token this
|
|
208
|
-
* early changes when the exchange happens, and that connection is not
|
|
209
|
-
* production-tested — its preflight fails the way it already did, is caught
|
|
210
|
-
* inside the strategy, and the connection falls back to ICF as before.
|
|
211
206
|
*/
|
|
212
207
|
protected prepareCredential(): Promise<void>;
|
|
213
208
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractAbapConnection.d.ts","sourceRoot":"","sources":["../../src/connection/AbstractAbapConnection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAGnB,MAAM,oBAAoB,CAAC;AAqC5B,uBAAe,sBACb,Y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c,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EACnC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAcpB,cAAc;IAuY5B,SAAS,CAAC,QAAQ,CAAC,wBAAwB,IAAI,MAAM;IAErD;;;;;;;;OAQG;cACa,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,MAAgC,EAC5C,UAAU,GAAE,MAAgC;IAC5C,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC;IAqBlB,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;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,IAAI,OAAO,YAAY,EAAE,YAAY;IAInE;;;;;;;;OAQG;YACW,eAAe;IAW7B;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,eAAe;CA6BxB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -274,11 +274,6 @@ class AbstractAbapConnection {
|
|
|
274
274
|
*
|
|
275
275
|
* Must be idempotent: `establishSession()` may prepare the same credential
|
|
276
276
|
* again, and does.
|
|
277
|
-
*
|
|
278
|
-
* Kerberos deliberately does NOT implement it. Minting the SPNEGO token this
|
|
279
|
-
* early changes when the exchange happens, and that connection is not
|
|
280
|
-
* production-tested — its preflight fails the way it already did, is caught
|
|
281
|
-
* inside the strategy, and the connection falls back to ICF as before.
|
|
282
277
|
*/
|
|
283
278
|
async prepareCredential() { }
|
|
284
279
|
/**
|
|
@@ -496,8 +491,8 @@ class AbstractAbapConnection {
|
|
|
496
491
|
this.lifecycle.forgetIdentity();
|
|
497
492
|
try {
|
|
498
493
|
// First, because the preflight below has to be able to authenticate: the
|
|
499
|
-
// credential of a certificate
|
|
500
|
-
// it is loaded
|
|
494
|
+
// credential of a certificate connection is not in hand until
|
|
495
|
+
// it is loaded, and assembling a request without it throws.
|
|
501
496
|
await this.prepareCredential();
|
|
502
497
|
// Before the establishing call, because on a system that has one this is
|
|
503
498
|
// what creates the session the rest of the connection runs in — and the
|
package/docs/USAGE.md
CHANGED
|
@@ -290,13 +290,6 @@ connection.setSessionType('stateless');
|
|
|
290
290
|
The connection owns its session, and that ownership is explicit rather than
|
|
291
291
|
implied. Four things follow from it.
|
|
292
292
|
|
|
293
|
-
> **A Kerberos limitation worth knowing.** SPNEGO here is single-leg: one
|
|
294
|
-
> `step('')` produces the token and the GSS context is discarded. If the server
|
|
295
|
-
> continues the exchange — a 401 carrying a `Negotiate` token, which
|
|
296
|
-
> [RFC 4559](https://www.rfc-editor.org/rfc/rfc4559) defines as a continuation —
|
|
297
|
-
> this client cannot feed that token back, so `connect()` fails with an error
|
|
298
|
-
> saying exactly that. Multi-leg SPNEGO is not implemented.
|
|
299
|
-
|
|
300
293
|
> **Availability.** `connect()` is on the shared `IAbapConnection` contract and
|
|
301
294
|
> works on every connection. The rest of this section is on the contract too, but
|
|
302
295
|
> as a **capability atom** in `@mcp-abap-adt/interfaces-adt` rather than as methods on
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/connection",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"description": "ABAP connection layer for MCP ABAP ADT server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"node": ">=18.0.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@mcp-abap-adt/interfaces-adt": "^
|
|
57
|
-
"@mcp-abap-adt/interfaces-auth": "^
|
|
58
|
-
"@mcp-abap-adt/interfaces-auth-sap": "^1.0.
|
|
56
|
+
"@mcp-abap-adt/interfaces-adt": "^10.0.0",
|
|
57
|
+
"@mcp-abap-adt/interfaces-auth": "^2.0.1",
|
|
58
|
+
"@mcp-abap-adt/interfaces-auth-sap": "^1.0.1",
|
|
59
59
|
"@mcp-abap-adt/interfaces-network": "^2.0.0",
|
|
60
60
|
"@mcp-abap-adt/interfaces-utils": "^1.1.0",
|
|
61
61
|
"axios": "^1.16.0",
|
|
@@ -63,8 +63,7 @@
|
|
|
63
63
|
"open": "^11.0.0"
|
|
64
64
|
},
|
|
65
65
|
"optionalDependencies": {
|
|
66
|
-
"@mcp-abap-adt/sap-rfc-lite": "^0.1.0"
|
|
67
|
-
"kerberos": "^2.1.0"
|
|
66
|
+
"@mcp-abap-adt/sap-rfc-lite": "^0.1.0"
|
|
68
67
|
},
|
|
69
68
|
"devDependencies": {
|
|
70
69
|
"@biomejs/biome": "^2.3.14",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kerberosSpnego.d.ts","sourceRoot":"","sources":["../../src/auth/kerberosSpnego.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBtE"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.generateSpnegoToken = generateSpnegoToken;
|
|
37
|
-
/** Thin, lazily-loaded wrapper over the optional `kerberos` native package. */
|
|
38
|
-
async function generateSpnegoToken(spn) {
|
|
39
|
-
// optional peer dep; typed as any because the module/types may be absent
|
|
40
|
-
let kerberos;
|
|
41
|
-
try {
|
|
42
|
-
// @ts-expect-error optional peer dependency — module may be absent at build time (TS2307)
|
|
43
|
-
kerberos = await Promise.resolve().then(() => __importStar(require('kerberos')));
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
throw new Error('Kerberos authentication requires the optional "kerberos" package. ' +
|
|
47
|
-
'Install it (needs GSSAPI dev libs on Linux / build tools on Windows): npm i kerberos');
|
|
48
|
-
}
|
|
49
|
-
const client = await kerberos.initializeClient(spn, {});
|
|
50
|
-
await client.step('');
|
|
51
|
-
const token = client.response;
|
|
52
|
-
if (!token) {
|
|
53
|
-
throw new Error('Kerberos: no SPNEGO token produced (no TGT? run kinit, or check SPN).');
|
|
54
|
-
}
|
|
55
|
-
return token;
|
|
56
|
-
}
|