@mcp-abap-adt/connection 12.0.0 → 14.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 +80 -1
- package/README.md +11 -67
- package/docs/INDEX.md +8 -10
- package/docs/INSTALLATION.md +9 -43
- package/docs/MIGRATION-12.0.md +4 -3
- package/docs/MIGRATION-13.0.md +66 -0
- package/docs/MIGRATION-14.0.md +17 -0
- package/docs/USAGE.md +1 -2
- package/examples/README.md +1 -1
- package/package.json +6 -12
- package/bin/sap-abap-auth.js +0 -761
- package/docs/JWT_AUTH_TOOLS.md +0 -158
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,83 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [14.0.0] - 2026-10-08
|
|
11
|
+
|
|
12
|
+
### Breaking
|
|
13
|
+
|
|
14
|
+
- **The `sap-abap-auth` CLI is removed** (`bin/sap-abap-auth.js`, the `bin`
|
|
15
|
+
field and its `files` entry). It duplicated `@mcp-abap-adt/auth-broker-cli`
|
|
16
|
+
and was authentication logic in a package that does not authenticate. The
|
|
17
|
+
library's API is unchanged. See [MIGRATION-14.0.md](./docs/MIGRATION-14.0.md).
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
|
|
21
|
+
- The CLI, and `docs/JWT_AUTH_TOOLS.md` with it.
|
|
22
|
+
- The runtime dependencies only the CLI used: `open` and `commander`. The
|
|
23
|
+
remaining runtime dependencies are `axios` and the `@mcp-abap-adt` contract
|
|
24
|
+
packages.
|
|
25
|
+
|
|
26
|
+
## [13.0.0] - 2026-10-08
|
|
27
|
+
|
|
28
|
+
12.0.0 was published only on the `next` dist-tag; 13.0.0 is the release that
|
|
29
|
+
reaches `latest`.
|
|
30
|
+
|
|
31
|
+
### Breaking
|
|
32
|
+
|
|
33
|
+
- **connection moves to `@mcp-abap-adt/interfaces-auth` `^7.5.0`** (from
|
|
34
|
+
`^6.0.0`), `@mcp-abap-adt/auth-errors` `^2.1.1` (from `^1.0.0`) and
|
|
35
|
+
`@mcp-abap-adt/interfaces-auth-sap` `^3.3.0` (from `^3.2.0`). A process holds
|
|
36
|
+
one interfaces-auth major, so a consumer on interfaces-auth 6 must move with
|
|
37
|
+
it. See [MIGRATION-13.0.md](./docs/MIGRATION-13.0.md).
|
|
38
|
+
- interfaces-auth 7 adds the error kind `renewal-declined` and the
|
|
39
|
+
configuration case `invalid-value`, adds the operation `renewal-strategy`,
|
|
40
|
+
renames the operation `on-tokens-hook` to `persisting-tokens`, and removes the
|
|
41
|
+
interactive outcome `browser-launch-failed`,
|
|
42
|
+
`ITokenResult.refreshTokenDisposition` and `RefreshTokenDisposition`. A
|
|
43
|
+
consumer that switches on kinds or operations, or reads the removed members,
|
|
44
|
+
must follow. 7.1–7.5 add only members of code lists and new types
|
|
45
|
+
(`IBrowser`, the authorization parts).
|
|
46
|
+
- **The providers come from `@mcp-abap-adt/auth-providers` 6.0.0.** It is the
|
|
47
|
+
release built on interfaces-auth 7 and auth-errors 2, and the one this
|
|
48
|
+
release is tested with. 5.x does not fit (unbranded refusals), and no
|
|
49
|
+
auth-providers release fits connection 12.x.
|
|
50
|
+
|
|
51
|
+
### Unchanged
|
|
52
|
+
|
|
53
|
+
- Behaviour. connection mints and relays refusals of kinds `connection` and
|
|
54
|
+
`logon-target` exactly as in 12.0.0; no code in `src` switches on the
|
|
55
|
+
members that changed, reads `refreshTokenDisposition` or names the renamed
|
|
56
|
+
operation, so only the dependency ranges and the lockfile moved.
|
|
57
|
+
- The lifecycle, the one credential retry per request, `WireLogonError`, and
|
|
58
|
+
the guard against a request naming another SAP client.
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- `tools/check-provider-shape.mjs` is the byte-identical copy `auth-errors`
|
|
63
|
+
publishes (2.0.0 through 2.1.1 ship the same file; the shape check's R1 test
|
|
64
|
+
compares them).
|
|
65
|
+
|
|
66
|
+
### Development
|
|
67
|
+
|
|
68
|
+
- The devDependency `@mcp-abap-adt/auth-providers` is `^6.0.0` (from
|
|
69
|
+
`^5.2.0`), and every suite runs the real 6.0.0 providers. The test-only 5.x
|
|
70
|
+
adapter (`src/__tests__/helpers/legacyProvider.ts`, its table and its
|
|
71
|
+
`afterEach`) is deleted, and so is its suite.
|
|
72
|
+
- The hand-run live probes in `scripts/` (`pr41-onprem-verify`,
|
|
73
|
+
`pr41-rfc-headers-probe`, `pr41-rfc-lock`, `pr41-rfc-transport-probe`,
|
|
74
|
+
`onprem-session-hold`) are removed: only Jest suites stay in the
|
|
75
|
+
repository; the probes remain in the git history.
|
|
76
|
+
The dev tree now holds one `@mcp-abap-adt/interfaces-auth` (7.5.0) and one
|
|
77
|
+
`@mcp-abap-adt/auth-errors` (2.1.1).
|
|
78
|
+
- Two tests met 6.0.0 for real; neither is a change in connection's code:
|
|
79
|
+
- `CertificateAuthProvider` 6.0.0 proves its material usable in `prepare()`,
|
|
80
|
+
so the placeholder strings the certificate cases loaded were refused there.
|
|
81
|
+
They load the throwaway `fixtures/tls` pair now.
|
|
82
|
+
- A teardown test replaced `getAuthHeaders`, which the logoff never calls,
|
|
83
|
+
and passed only because the adapter's extra awaits kept the logoff in
|
|
84
|
+
flight past the assertion. It now breaks the logoff's own path
|
|
85
|
+
(`credentialHeaders`) and waits for the dispatch.
|
|
86
|
+
|
|
10
87
|
## [12.0.0] - 2026-10-06
|
|
11
88
|
|
|
12
89
|
### Breaking
|
|
@@ -2260,7 +2337,9 @@ const connection = createAbapConnection(config, logger);
|
|
|
2260
2337
|
- JWT token refresh now properly handles connection errors (401/403 during initial connect)
|
|
2261
2338
|
- Permission errors (403 with "ExceptionResourceNoAccess") no longer trigger JWT refresh loops
|
|
2262
2339
|
- Proper separation: base class handles HTTP/session, concrete classes handle auth-specific errors
|
|
2263
|
-
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/
|
|
2340
|
+
[Unreleased]: https://github.com/fr0ster/mcp-abap-connection/compare/v14.0.0...HEAD
|
|
2341
|
+
[14.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v13.0.0...v14.0.0
|
|
2342
|
+
[13.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v12.0.0...v13.0.0
|
|
2264
2343
|
[12.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v11.0.1...v12.0.0
|
|
2265
2344
|
[11.0.1]: https://github.com/fr0ster/mcp-abap-connection/compare/v11.0.0...v11.0.1
|
|
2266
2345
|
[11.0.0]: https://github.com/fr0ster/mcp-abap-connection/compare/v10.0.3...v11.0.0
|
package/README.md
CHANGED
|
@@ -24,7 +24,6 @@ ABAP connection layer for MCP ABAP ADT server. Provides a unified interface for
|
|
|
24
24
|
- Generic `GenericWebSocketTransport` with pluggable WS factory
|
|
25
25
|
- Reusable for debugger/traces and other event-driven flows
|
|
26
26
|
- 📝 **Custom Logging**: Pluggable logger interface for integration with any logging system
|
|
27
|
-
- 🛠️ **CLI Tool**: See [JWT Auth Tools](./docs/JWT_AUTH_TOOLS.md) for obtaining SAP BTP tokens
|
|
28
27
|
- 📦 **TypeScript**: Full TypeScript support with type definitions included
|
|
29
28
|
- ⚡ **Timeout Management**: Configurable timeouts for different operation types
|
|
30
29
|
|
|
@@ -58,7 +57,7 @@ The package uses a clean separation of concerns:
|
|
|
58
57
|
|
|
59
58
|
- **Auth providers** (an `IAuthProvider` from `@mcp-abap-adt/interfaces-auth`; the
|
|
60
59
|
ready-made ones — `BasicAuthProvider`, `TokenAuthProvider`, `SamlAuthProvider`,
|
|
61
|
-
`CertificateAuthProvider` — are in `@mcp-abap-adt/auth-providers
|
|
60
|
+
`CertificateAuthProvider` — are in `@mcp-abap-adt/auth-providers` 6.0.0, not here):
|
|
62
61
|
- What a connection authenticates with, passed in. The connection never asks
|
|
63
62
|
what kind of provider it was given; it calls the same four methods on all of
|
|
64
63
|
them: `prepare` once before the wire opens, `establish` at each logon,
|
|
@@ -140,12 +139,12 @@ This package interacts with external packages **ONLY through interfaces**:
|
|
|
140
139
|
|
|
141
140
|
The contracts themselves come from five packages, and with `@mcp-abap-adt/auth-errors`
|
|
142
141
|
— the runtime that mints and classifies the auth errors — are the only runtime
|
|
143
|
-
dependencies of this one besides `axios
|
|
142
|
+
dependencies of this one besides `axios`:
|
|
144
143
|
|
|
145
144
|
| Package | What this package takes from it |
|
|
146
145
|
|---|---|
|
|
147
146
|
| `@mcp-abap-adt/interfaces-adt-connection` | `IAbapConnection`, `IAbapRequestOptions`, `IAdtWireResponse`, `ITimeoutConfig`, the capability atoms, `ADT_SESSION_ERROR` |
|
|
148
|
-
| `@mcp-abap-adt/interfaces-auth` (
|
|
147
|
+
| `@mcp-abap-adt/interfaces-auth` (7.x) | `IAuthProvider`, `AuthOutcome`, `IAuthRefusal` (= `IAuthProviderError`), `IAuthRejection`, `ILogonTarget`, `IRequestTarget`, `ICertificateMaterial`, `ITokenRefresher`, `ITokenRefreshResult` |
|
|
149
148
|
| `@mcp-abap-adt/interfaces-auth-sap` | `ISapConfig`, `SapAuthType`, `SapConnectionType`, `ICertificateMaterialLoader` |
|
|
150
149
|
| `@mcp-abap-adt/interfaces-network` | `NETWORK_ERROR_CODES`, the WebSocket contracts |
|
|
151
150
|
| `@mcp-abap-adt/interfaces-utils` | `ILogger` |
|
|
@@ -161,7 +160,9 @@ the packages above. See [Migration to 9.0.0](./docs/MIGRATION-9.0.md).
|
|
|
161
160
|
|
|
162
161
|
- 📦 **[Installation Guide](./docs/INSTALLATION.md)** - Setup and installation instructions
|
|
163
162
|
- 📚 **[Usage Guide](./docs/USAGE.md)** - Detailed usage examples and API documentation
|
|
164
|
-
- 🚚 **[Migration to
|
|
163
|
+
- 🚚 **[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
|
+
- 🚚 **[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
|
+
- 🚚 **[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
|
|
165
166
|
- 🚚 **[Migration to 11.0.0](./docs/MIGRATION-11.0.md)** - the server certificate is verified by default; trust a self-signed system with `agentOptions.ca`, or opt out explicitly
|
|
166
167
|
- 🚚 **[Migration to 10.0.0](./docs/MIGRATION-10.0.md)** - the credential providers moved to `@mcp-abap-adt/auth-providers`; the connection speaks `IAuthProvider` 3.0; `AuthRefusedError`; the RFC factory takes the logon parameters
|
|
167
168
|
- 🚚 **[Migration to 9.0.0](./docs/MIGRATION-9.0.md)** - the contracts split out of `@mcp-abap-adt/interfaces`; which package each one moved to
|
|
@@ -205,11 +206,13 @@ The credential providers (`BasicAuthProvider`, `TokenAuthProvider`,
|
|
|
205
206
|
since 10.0.0. Install them from where they live:
|
|
206
207
|
|
|
207
208
|
```bash
|
|
208
|
-
npm install @mcp-abap-adt/auth-providers
|
|
209
|
+
npm install @mcp-abap-adt/auth-providers@^6
|
|
209
210
|
```
|
|
210
211
|
|
|
211
|
-
connection
|
|
212
|
-
|
|
212
|
+
connection 13.x works with **auth-providers 6.0.0** (`^6.0.0`), the release
|
|
213
|
+
built on interfaces-auth 7 and auth-errors 2, and is tested with it: the 5.x
|
|
214
|
+
providers answer unbranded refusals and do not fit. See
|
|
215
|
+
[Migration to 13.0.0](./docs/MIGRATION-13.0.md) and
|
|
213
216
|
[Migration to 12.0.0](./docs/MIGRATION-12.0.md).
|
|
214
217
|
|
|
215
218
|
For detailed installation instructions, see [Installation Guide](./docs/INSTALLATION.md).
|
|
@@ -608,65 +611,6 @@ const connection = new AdtOnPremConnector(
|
|
|
608
611
|
);
|
|
609
612
|
```
|
|
610
613
|
|
|
611
|
-
## CLI Tool
|
|
612
|
-
|
|
613
|
-
The package includes a CLI tool for authenticating with SAP BTP using service keys:
|
|
614
|
-
|
|
615
|
-
### Installation Options
|
|
616
|
-
|
|
617
|
-
- **Local project install**
|
|
618
|
-
```bash
|
|
619
|
-
npm install @mcp-abap-adt/connection --save-dev
|
|
620
|
-
npx sap-abap-auth auth -k path/to/service-key.json
|
|
621
|
-
```
|
|
622
|
-
- **Global install**
|
|
623
|
-
```bash
|
|
624
|
-
npm install -g @mcp-abap-adt/connection
|
|
625
|
-
sap-abap-auth auth -k path/to/service-key.json
|
|
626
|
-
```
|
|
627
|
-
- **On-demand (npx)**
|
|
628
|
-
```bash
|
|
629
|
-
npx @mcp-abap-adt/connection sap-abap-auth auth -k path/to/service-key.json
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
### Usage
|
|
633
|
-
|
|
634
|
-
```bash
|
|
635
|
-
# Show help
|
|
636
|
-
sap-abap-auth --help
|
|
637
|
-
|
|
638
|
-
# Authenticate with service key
|
|
639
|
-
sap-abap-auth auth -k service-key.json
|
|
640
|
-
|
|
641
|
-
# Specify browser
|
|
642
|
-
sap-abap-auth auth -k service-key.json --browser chrome
|
|
643
|
-
|
|
644
|
-
# Custom output file
|
|
645
|
-
sap-abap-auth auth -k service-key.json --output .env.production
|
|
646
|
-
```
|
|
647
|
-
|
|
648
|
-
### Options
|
|
649
|
-
|
|
650
|
-
- `-k, --key <path>` - Path to service key JSON file (required)
|
|
651
|
-
- `-b, --browser <name>` - Browser to open (chrome, edge, firefox, system, none)
|
|
652
|
-
- `-o, --output <path>` - Path to output .env file (default: .env)
|
|
653
|
-
- `-h, --help` - Show help message
|
|
654
|
-
|
|
655
|
-
### Using via `npx` (without global install)
|
|
656
|
-
|
|
657
|
-
If `@mcp-abap-adt/connection` is listed as a dependency in your project, you can invoke the CLI directly:
|
|
658
|
-
|
|
659
|
-
```bash
|
|
660
|
-
npx sap-abap-auth auth -k service-key.json
|
|
661
|
-
```
|
|
662
|
-
|
|
663
|
-
This works even when you do not install the package globally. For one-off usage, you can also run:
|
|
664
|
-
|
|
665
|
-
```bash
|
|
666
|
-
npx @mcp-abap-adt/connection sap-abap-auth auth -k service-key.json
|
|
667
|
-
```
|
|
668
|
-
|
|
669
|
-
This will download the package on demand and execute the CLI.
|
|
670
614
|
## API Reference
|
|
671
615
|
|
|
672
616
|
### Types
|
package/docs/INDEX.md
CHANGED
|
@@ -15,6 +15,8 @@ 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-14.0.md # the sap-abap-auth CLI, open and commander are removed
|
|
19
|
+
│ ├── MIGRATION-13.0.md # interfaces-auth 7, auth-errors 2, auth-providers 6.0.0; no behaviour change
|
|
18
20
|
│ ├── MIGRATION-12.0.md # refusals follow the auth error contract (interfaces-auth 6, auth-errors)
|
|
19
21
|
│ ├── MIGRATION-11.0.md # the server certificate is verified by default
|
|
20
22
|
│ ├── MIGRATION-10.0.md # providers move to auth-providers; IAuthProvider 3.0; AuthRefusedError
|
|
@@ -23,13 +25,10 @@ mcp-abap-connection/
|
|
|
23
25
|
│ ├── MIGRATION-6.0.md # the factory and the per-credential classes go; RFC is a transport
|
|
24
26
|
│ ├── MIGRATION-4.0.md # JWT error classification: 401 refreshes, 403 propagates
|
|
25
27
|
│ ├── SCOPE.md # What this package does and does not own
|
|
26
|
-
│
|
|
27
|
-
│ └── JWT_AUTH_TOOLS.md # CLI tool for authentication
|
|
28
|
+
│ └── STATEFUL_SESSION_GUIDE.md # Stateful requests and lock windows
|
|
28
29
|
├── examples/ # Working code examples
|
|
29
30
|
│ ├── README.md # Examples overview
|
|
30
31
|
│ └── basic-connection.js # Simple connection example
|
|
31
|
-
├── bin/ # CLI tools
|
|
32
|
-
│ └── sap-abap-auth.js # JWT authentication CLI
|
|
33
32
|
└── src/ # Source code
|
|
34
33
|
├── connection/ # Connection classes
|
|
35
34
|
├── config/ # Configuration utilities
|
|
@@ -45,11 +44,10 @@ mcp-abap-connection/
|
|
|
45
44
|
- 📖 [Main README](../README.md) - Package overview and quick start
|
|
46
45
|
- 🧭 [Scope and Boundaries](./SCOPE.md) - What this package does (and does not), sibling packages, and why there is no RFC to cloud
|
|
47
46
|
|
|
48
|
-
### Core Features
|
|
49
|
-
- 🔑 [JWT Auth Tools](./JWT_AUTH_TOOLS.md) - CLI tool for browser-based authentication
|
|
50
|
-
|
|
51
47
|
### Upgrading
|
|
52
|
-
- 🚚 [Migrating to
|
|
48
|
+
- 🚚 [Migrating to 14.0.0](./MIGRATION-14.0.md) - the `sap-abap-auth` CLI is removed; use `@mcp-abap-adt/auth-broker-cli`
|
|
49
|
+
- 🚚 [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
|
+
- 🚚 [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
|
|
53
51
|
- 🚚 [Migrating to 11.0.0](./MIGRATION-11.0.md) - the server certificate is verified by default; trust a self-signed system with `agentOptions.ca`, or opt out explicitly with `TLS_REJECT_UNAUTHORIZED=0`
|
|
54
52
|
- 🚚 [Migrating to 10.0.0](./MIGRATION-10.0.md) - the credential providers moved to `@mcp-abap-adt/auth-providers`; the connection speaks `IAuthProvider` 3.0 and raises `AuthRefusedError`; the RFC factory takes the logon parameters
|
|
55
53
|
- 🚚 [Migrating to 9.0.0](./MIGRATION-9.0.md) - the contracts split into `interfaces-adt`, `-auth`, `-network` and `-utils`, and this package stopped depending on the umbrella; `interfaces-auth-sap` joined them in the release after, when authentication split into what is SAP's and what is not
|
|
@@ -71,7 +69,7 @@ mcp-abap-connection/
|
|
|
71
69
|
- **Basic Auth**: [USAGE.md - Basic Authentication](./USAGE.md#basic-authentication-on-premise)
|
|
72
70
|
- **JWT/OAuth2**: [USAGE.md - JWT Authentication](./USAGE.md#jwt-authentication-cloudbtp)
|
|
73
71
|
- **Token Refresh**: Handled by `@mcp-abap-adt/auth-broker` package (removed in 0.2.0)
|
|
74
|
-
- **
|
|
72
|
+
- **Obtaining tokens**: `@mcp-abap-adt/auth-broker-cli` (the CLI formerly bundled here was removed in 14.0.0)
|
|
75
73
|
|
|
76
74
|
### Session Management
|
|
77
75
|
- **Overview**: [USAGE.md - Session Management](./USAGE.md#session-management)
|
|
@@ -85,7 +83,7 @@ mcp-abap-connection/
|
|
|
85
83
|
- **Connection Interface**: [USAGE.md - API Reference](./USAGE.md#api-reference)
|
|
86
84
|
- **Configuration Types**: [USAGE.md - Configuration Types](./USAGE.md#configuration-types)
|
|
87
85
|
- **Connectors**: `AdtOnPremConnector`, `AdtCloudConnector`
|
|
88
|
-
- **Credentials**: an `IAuthProvider` (`@mcp-abap-adt/interfaces-auth`); the ready-made providers live in `@mcp-abap-adt/auth-providers`
|
|
86
|
+
- **Credentials**: an `IAuthProvider` (`@mcp-abap-adt/interfaces-auth`); the ready-made providers live in `@mcp-abap-adt/auth-providers` (6.0.0 with connection 13.x)
|
|
89
87
|
- **Errors**: `AuthRefusedError` (its `refusal` an `IAuthProviderError` minted by `@mcp-abap-adt/auth-errors`), `WireLogonError`
|
|
90
88
|
- **Transports**: `HttpTransport`, `RfcTransport` (+ `rfcConversationFrom()`)
|
|
91
89
|
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -47,7 +47,7 @@ SAP_PASSWORD=your-password
|
|
|
47
47
|
|
|
48
48
|
### JWT Authentication (SAP BTP Cloud)
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
A `.env` file that carries a JWT can record its expiry as comments, for example:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
# Token Expiry Information (auto-generated)
|
|
@@ -98,42 +98,6 @@ const config = {
|
|
|
98
98
|
};
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
## CLI Tool Installation
|
|
102
|
-
|
|
103
|
-
The package includes `sap-abap-auth` CLI tool for browser-based JWT authentication.
|
|
104
|
-
|
|
105
|
-
### Global Installation
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
npm install -g @mcp-abap-adt/connection
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Then use directly:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
sap-abap-auth auth -k service-key.json
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Local Project Installation
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
npm install --save-dev @mcp-abap-adt/connection
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Use via npx:
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
npx sap-abap-auth auth -k service-key.json
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### On-Demand (No Installation)
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npx @mcp-abap-adt/connection sap-abap-auth auth -k service-key.json
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
See [JWT_AUTH_TOOLS.md](./JWT_AUTH_TOOLS.md) for detailed CLI documentation.
|
|
136
|
-
|
|
137
101
|
## Verification
|
|
138
102
|
|
|
139
103
|
### Test Installation
|
|
@@ -208,7 +172,7 @@ actually use:
|
|
|
208
172
|
|
|
209
173
|
```bash
|
|
210
174
|
npm install @mcp-abap-adt/interfaces-adt-connection # IAbapConnection, ITimeoutConfig, ADT_SESSION_ERROR
|
|
211
|
-
npm install @mcp-abap-adt/interfaces-auth # IAuthProvider, AuthOutcome, IAuthProviderError, ITokenRefresher (
|
|
175
|
+
npm install @mcp-abap-adt/interfaces-auth # IAuthProvider, AuthOutcome, IAuthProviderError, ITokenRefresher (7.x)
|
|
212
176
|
npm install @mcp-abap-adt/auth-errors # authError builders, classify — to mint a refusal of your own
|
|
213
177
|
npm install @mcp-abap-adt/interfaces-auth-sap # ISapConfig, SapAuthType, ICertificateMaterialLoader
|
|
214
178
|
npm install @mcp-abap-adt/interfaces-network # NETWORK_ERROR_CODES, the WebSocket contracts
|
|
@@ -224,10 +188,12 @@ puts two copies of the same contract in your tree.
|
|
|
224
188
|
|
|
225
189
|
The credential providers (`BasicAuthProvider`, `TokenAuthProvider`,
|
|
226
190
|
`SamlAuthProvider`, `CertificateAuthProvider`) are no longer part of this
|
|
227
|
-
package as of 10.0.0; install `@mcp-abap-adt/auth-providers` for them —
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
[Migration to
|
|
191
|
+
package as of 10.0.0; install `@mcp-abap-adt/auth-providers` for them —
|
|
192
|
+
connection 13.x works with auth-providers **6.0.0** (`^6.0.0`), built on
|
|
193
|
+
interfaces-auth 7 and auth-errors 2; the 5.x providers do not fit.
|
|
194
|
+
See [Migration to 10.0.0](./MIGRATION-10.0.md),
|
|
195
|
+
[Migration to 12.0.0](./MIGRATION-12.0.md) and
|
|
196
|
+
[Migration to 13.0.0](./MIGRATION-13.0.md).
|
|
231
197
|
|
|
232
198
|
### Create `tsconfig.json`
|
|
233
199
|
|
|
@@ -382,5 +348,5 @@ read and change the traffic, credentials included. See
|
|
|
382
348
|
- 📚 Read [USAGE.md](./USAGE.md) for detailed usage examples
|
|
383
349
|
- 🔄 Token refresh is handled by `@mcp-abap-adt/auth-broker` package
|
|
384
350
|
- 💾 Session state persistence is handled by `@mcp-abap-adt/auth-broker` package
|
|
385
|
-
- 🔑
|
|
351
|
+
- 🔑 Obtain tokens for SAP BTP with `@mcp-abap-adt/auth-broker-cli`
|
|
386
352
|
- 📖 Review [CHANGELOG.md](../CHANGELOG.md) for version history
|
package/docs/MIGRATION-12.0.md
CHANGED
|
@@ -30,7 +30,8 @@ unbranded `{ reason, hint }` refusals of interfaces-auth 3–5, and those are no
|
|
|
30
30
|
an `AuthOutcome` of 6.0.0, so handing a 5.x `BasicAuthProvider` (or any other
|
|
31
31
|
5.x provider) to a connector no longer compiles. Move to
|
|
32
32
|
`@mcp-abap-adt/auth-providers` 6.0.0, the release that adopts the same
|
|
33
|
-
contract
|
|
33
|
+
contract. It was published on interfaces-auth 7, so it fits connection
|
|
34
|
+
**13.0.0**, not 12.x: take 13.0.0 with it ([Migration to 13.0](./MIGRATION-13.0.md)).
|
|
34
35
|
|
|
35
36
|
## Reading an `AuthRefusedError`
|
|
36
37
|
|
|
@@ -141,8 +142,8 @@ from `@mcp-abap-adt/auth-errors`. Its `guard(operation, body)` runs one
|
|
|
141
142
|
moment so that a throw becomes a refusal and the answer is classified. A
|
|
142
143
|
provider that still answers `{ ok: false, refusal: { reason } }` compiles no
|
|
143
144
|
more in TypeScript. In JavaScript, the connection answers `provider-threw` for
|
|
144
|
-
it, as described above. `@mcp-abap-adt/auth-providers` 6.0.0
|
|
145
|
-
`AuthProviderBase`, which owns the four moments for you.
|
|
145
|
+
it, as described above. `@mcp-abap-adt/auth-providers` 6.0.0 (with connection
|
|
146
|
+
13.x) ships `AuthProviderBase`, which owns the four moments for you.
|
|
146
147
|
|
|
147
148
|
## Deep imports
|
|
148
149
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Migration to 13.0
|
|
2
|
+
|
|
3
|
+
13.0.0 moves the connection from interfaces-auth 6 to **7**, with
|
|
4
|
+
`@mcp-abap-adt/auth-errors` 2, and is the release that works with
|
|
5
|
+
`@mcp-abap-adt/auth-providers` **6.0.0**. The connection's own behaviour does not
|
|
6
|
+
change: the lifecycle, the one credential retry, the refusals it mints and
|
|
7
|
+
`WireLogonError` are as in 12.x. 12.0.0 was only on the `next` dist-tag, so for
|
|
8
|
+
most consumers this is the step from 11.x with the 12 migration included; read
|
|
9
|
+
[Migration to 12.0.0](./MIGRATION-12.0.md) too.
|
|
10
|
+
|
|
11
|
+
## Dependencies
|
|
12
|
+
|
|
13
|
+
| Package | 12.0 | 13.0 |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `@mcp-abap-adt/interfaces-auth` | `^6.0.0` | `^7.5.0` |
|
|
16
|
+
| `@mcp-abap-adt/interfaces-auth-sap` | `^3.2.0` | `^3.3.0` |
|
|
17
|
+
| `@mcp-abap-adt/auth-errors` | `^1.0.0` | `^2.1.1` |
|
|
18
|
+
| `@mcp-abap-adt/auth-providers` (yours, not a dependency) | none fits | `^6.0.0` |
|
|
19
|
+
|
|
20
|
+
A process should hold **one** interfaces-auth major and one auth-errors copy
|
|
21
|
+
(`npm ls @mcp-abap-adt/interfaces-auth @mcp-abap-adt/auth-errors`; each should
|
|
22
|
+
appear once, the rest `deduped`). Providers must speak interfaces-auth 7 as well.
|
|
23
|
+
|
|
24
|
+
## The providers: auth-providers 6.0.0
|
|
25
|
+
|
|
26
|
+
connection 13.0.0 is tested with `@mcp-abap-adt/auth-providers` 6.0.0, built on
|
|
27
|
+
interfaces-auth 7.5 and auth-errors 2.1. Install it beside the connection:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @mcp-abap-adt/connection@^13 @mcp-abap-adt/auth-providers@^6
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- auth-providers 5.x does not fit: its refusals are unbranded `{ reason, hint }`,
|
|
34
|
+
not an `AuthOutcome` of interfaces-auth 7. No auth-providers release fits
|
|
35
|
+
connection 12.x (6.0.0 is on interfaces-auth 7, 5.x on 3), so move to 13.0.0
|
|
36
|
+
and 6.0.0 together.
|
|
37
|
+
- The credentials the connection docs use keep their constructors:
|
|
38
|
+
`new BasicAuthProvider(user, password)`, `TokenAuthProvider.fixed(token)` /
|
|
39
|
+
`.from(refresher)`, `new SamlAuthProvider(cookies)`,
|
|
40
|
+
`new CertificateAuthProvider(loader, config)` / `.fromFiles(config)`,
|
|
41
|
+
`new SncLogonProvider({ … })`.
|
|
42
|
+
- `CertificateAuthProvider` proves its material usable in `prepare()`, so a
|
|
43
|
+
certificate it cannot use is refused at `connect()` (`AuthRefusedError` at
|
|
44
|
+
`prepare`), before any logon.
|
|
45
|
+
- A token provider (`ClientCredentialsProvider`, `AuthorizationCodeProvider`,
|
|
46
|
+
the OIDC and SAML providers, …) now needs `renewal` — `refreshThenLogin()`
|
|
47
|
+
or `refreshOnly()` — and takes `persistence` in place of `onTokens`; an
|
|
48
|
+
interactive one is handed an `IBrowser`. Each is an `IAuthProvider` itself
|
|
49
|
+
and goes to a connector unwrapped. See auth-providers' README, *Migrating to
|
|
50
|
+
6.0.0*.
|
|
51
|
+
|
|
52
|
+
## What interfaces-auth 7 changes
|
|
53
|
+
|
|
54
|
+
- New error kind `renewal-declined`; a consumer that switches on `kind`
|
|
55
|
+
exhaustively must handle it.
|
|
56
|
+
- New configuration case `invalid-value`; new operation `renewal-strategy`.
|
|
57
|
+
- The operation `on-tokens-hook` is now `persisting-tokens`.
|
|
58
|
+
- The interactive outcome `browser-launch-failed` is gone.
|
|
59
|
+
- `ITokenResult.refreshTokenDisposition` and `RefreshTokenDisposition` are gone.
|
|
60
|
+
|
|
61
|
+
7.1–7.5 add only new types (`IBrowser`, the authorization parts) and new
|
|
62
|
+
members of code lists (`CONFIG_FIELDS`, `OPERATIONS`,
|
|
63
|
+
`INTERACTIVE_LOGIN_STRATEGIES`).
|
|
64
|
+
|
|
65
|
+
The connection reads none of these, so nothing in its API changes. A consumer
|
|
66
|
+
that does must update its own code.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Migration to 14.0
|
|
2
|
+
|
|
3
|
+
14.0.0 removes the bundled `sap-abap-auth` command-line tool, together with the
|
|
4
|
+
two dependencies only it used, `open` and `commander`. The library's API, its
|
|
5
|
+
lifecycle and its behaviour are unchanged.
|
|
6
|
+
|
|
7
|
+
## What a consumer must do
|
|
8
|
+
|
|
9
|
+
- **If you used `sap-abap-auth`** (`npx sap-abap-auth auth -k service-key.json`,
|
|
10
|
+
a global install, or `npx @mcp-abap-adt/connection sap-abap-auth …`): use
|
|
11
|
+
[`@mcp-abap-adt/auth-broker-cli`](https://www.npmjs.com/package/@mcp-abap-adt/auth-broker-cli)
|
|
12
|
+
instead. It provides the `mcp-auth` command (service key to destination) and
|
|
13
|
+
`mcp-sso`; its README lists the options and the `.env` it writes. Its options
|
|
14
|
+
are not those of `sap-abap-auth`, so read it before replacing a script.
|
|
15
|
+
- **If you only used the library**: nothing. You no longer install `open` and
|
|
16
|
+
`commander` through this package; if your code imported either, depend on it
|
|
17
|
+
yourself.
|
package/docs/USAGE.md
CHANGED
|
@@ -928,7 +928,7 @@ export class CloudSdkAbapConnection {
|
|
|
928
928
|
### The credential, and how a refusal is classified
|
|
929
929
|
|
|
930
930
|
For SAP BTP cloud systems, hand `AdtCloudConnector` a token provider from
|
|
931
|
-
`@mcp-abap-adt/auth-providers`
|
|
931
|
+
`@mcp-abap-adt/auth-providers` 6.0.0 (connection 13.x works with `^6.0.0`): `TokenAuthProvider.fixed(token)` is a token with
|
|
932
932
|
nothing behind it, `TokenAuthProvider.from(refresher)` takes an `ITokenRefresher`
|
|
933
933
|
and renews a token the system refused. Obtaining tokens in the first place is
|
|
934
934
|
`@mcp-abap-adt/auth-broker`'s job, not this package's.
|
|
@@ -1091,5 +1091,4 @@ See [CHANGELOG.md](../CHANGELOG.md) for the version history.
|
|
|
1091
1091
|
|
|
1092
1092
|
- Token refresh functionality is now in `@mcp-abap-adt/auth-broker` package
|
|
1093
1093
|
- Session state persistence is now in `@mcp-abap-adt/auth-broker` package
|
|
1094
|
-
- See [JWT_AUTH_TOOLS.md](./JWT_AUTH_TOOLS.md) for CLI authentication tool
|
|
1095
1094
|
- See [INSTALLATION.md](./INSTALLATION.md) for installation instructions
|
package/examples/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This directory contains example code demonstrating how to use the `@mcp-abap-adt
|
|
|
8
8
|
# Install dependencies
|
|
9
9
|
cd packages/connection
|
|
10
10
|
npm install
|
|
11
|
-
npm install @mcp-abap-adt/auth-providers # the credential providers the examples use (6.0.0
|
|
11
|
+
npm install @mcp-abap-adt/auth-providers@^6 # the credential providers the examples use (6.0.0 with connection 13.x)
|
|
12
12
|
|
|
13
13
|
# Build the package
|
|
14
14
|
npm run build
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/connection",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.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",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"bin",
|
|
10
9
|
"docs",
|
|
11
10
|
"examples",
|
|
12
11
|
"README.md",
|
|
@@ -14,9 +13,6 @@
|
|
|
14
13
|
"LICENSE",
|
|
15
14
|
"COPYING"
|
|
16
15
|
],
|
|
17
|
-
"bin": {
|
|
18
|
-
"sap-abap-auth": "./bin/sap-abap-auth.js"
|
|
19
|
-
},
|
|
20
16
|
"keywords": [
|
|
21
17
|
"abap",
|
|
22
18
|
"sap",
|
|
@@ -53,22 +49,20 @@
|
|
|
53
49
|
"node": "^22 || ^24 || ^26"
|
|
54
50
|
},
|
|
55
51
|
"dependencies": {
|
|
56
|
-
"@mcp-abap-adt/auth-errors": "^1.
|
|
52
|
+
"@mcp-abap-adt/auth-errors": "^2.1.1",
|
|
57
53
|
"@mcp-abap-adt/interfaces-adt-connection": "^1.0.0",
|
|
58
|
-
"@mcp-abap-adt/interfaces-auth": "^
|
|
59
|
-
"@mcp-abap-adt/interfaces-auth-sap": "^3.
|
|
54
|
+
"@mcp-abap-adt/interfaces-auth": "^7.5.0",
|
|
55
|
+
"@mcp-abap-adt/interfaces-auth-sap": "^3.3.0",
|
|
60
56
|
"@mcp-abap-adt/interfaces-network": "^2.0.0",
|
|
61
57
|
"@mcp-abap-adt/interfaces-utils": "^1.1.0",
|
|
62
|
-
"axios": "^1.16.0"
|
|
63
|
-
"commander": "^14.0.3",
|
|
64
|
-
"open": "^11.0.0"
|
|
58
|
+
"axios": "^1.16.0"
|
|
65
59
|
},
|
|
66
60
|
"optionalDependencies": {
|
|
67
61
|
"@mcp-abap-adt/sap-rfc-lite": "^0.2.1"
|
|
68
62
|
},
|
|
69
63
|
"devDependencies": {
|
|
70
64
|
"@biomejs/biome": "^2.3.14",
|
|
71
|
-
"@mcp-abap-adt/auth-providers": "^
|
|
65
|
+
"@mcp-abap-adt/auth-providers": "^6.0.0",
|
|
72
66
|
"@types/jest": "^30.0.0",
|
|
73
67
|
"@types/node": "^25.2.3",
|
|
74
68
|
"dotenv": "^17.3.1",
|