@mcp-abap-adt/auth-broker 0.1.9 → 0.1.11

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
@@ -11,6 +11,28 @@ Thank you to all contributors! See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the co
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [0.1.11] - 2025-12-07
15
+
16
+ ### Changed
17
+ - **Dependency Updates**: Updated dependencies to latest versions
18
+ - `@mcp-abap-adt/interfaces`: `^0.1.1` → `^0.1.3` (includes new header constants and session ID header constants)
19
+ - `@mcp-abap-adt/auth-providers`: `^0.1.2` → `^0.1.3` (includes configurable browser auth port and implementation isolation)
20
+ - `@mcp-abap-adt/auth-stores`: `^0.1.4` → `^0.1.5` (updated to use latest interfaces package)
21
+ - **Documentation Updates**: Updated README with examples for `BtpTokenProvider` with custom browser auth port
22
+ - Added example showing how to use `BtpTokenProvider(4001)` to avoid port conflicts
23
+ - Added note about `browserAuthPort` parameter in token provider section
24
+
25
+ ## [0.1.10] - 2025-12-07
26
+
27
+ ### Added
28
+ - **Constructor Validation**: Added validation checks in `AuthBroker` constructor to ensure all required dependencies are provided
29
+ - Validates that `stores` parameter is not null/undefined
30
+ - Validates that `serviceKeyStore` is provided
31
+ - Validates that `sessionStore` is provided
32
+ - Validates that `tokenProvider` is provided
33
+ - Throws descriptive error messages if any required dependency is missing
34
+ - Helps catch configuration errors early during development
35
+
14
36
  ## [0.1.9] - 2025-12-05
15
37
 
16
38
  ### Changed
package/README.md CHANGED
@@ -45,6 +45,13 @@ const broker = new AuthBroker({
45
45
  tokenProvider: new BtpTokenProvider(),
46
46
  });
47
47
 
48
+ // Use BtpTokenProvider with custom browser auth port (to avoid port conflicts)
49
+ const brokerWithCustomPort = new AuthBroker({
50
+ serviceKeyStore: new AbapServiceKeyStore(['/path/to/destinations']),
51
+ sessionStore: new AbapSessionStore(['/path/to/destinations']),
52
+ tokenProvider: new BtpTokenProvider(4001), // Custom port for OAuth callback server
53
+ });
54
+
48
55
  // Get token for destination (loads from .env, validates, refreshes if needed)
49
56
  const token = await broker.getToken('TRIAL');
50
57
 
@@ -325,6 +332,8 @@ The package uses `ITokenProvider` interface for token acquisition. Two implement
325
332
  - No refresh token provided
326
333
 
327
334
  - **`BtpTokenProvider`** - For BTP/ABAP authentication (full scope)
335
+ - Constructor accepts optional `browserAuthPort?: number` parameter (default: 3001)
336
+ - Use custom port to avoid conflicts when running alongside other services (e.g., proxy server)
328
337
  - Uses browser-based OAuth2 flow (if no refresh token)
329
338
  - Uses refresh token if available
330
339
  - Provides refresh token for future use
@@ -1 +1 @@
1
- {"version":3,"file":"AuthBroker.d.ts","sourceRoot":"","sources":["../src/AuthBroker.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAY7C;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,aAAa,CAAiB;IAEtC;;;;;;;;;;OAUG;gBAED,MAAM,EAAE;QAAE,eAAe,EAAE,gBAAgB,CAAC;QAAC,YAAY,EAAE,aAAa,CAAC;QAAC,aAAa,EAAE,cAAc,CAAA;KAAE,EACzG,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,OAAO;IASlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmIpD;;;;;OAKG;I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AAG,IAAI,CAAC;IAWvF;;;;OAIG;IACG,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CAWlF"}
@@ -34,6 +34,19 @@ class AuthBroker {
34
34
  * @param logger Optional logger instance implementing ILogger interface. If not provided, uses no-op logger.
35
35
  */
36
36
  constructor(stores, browser, logger) {
37
+ // Validate that stores and provider are provided and not null/undefined
38
+ if (!stores) {
39
+ throw new Error('AuthBroker: stores parameter is required');
40
+ }
41
+ if (!stores.serviceKeyStore) {
42
+ throw new Error('AuthBroker: serviceKeyStore is required');
43
+ }
44
+ if (!stores.sessionStore) {
45
+ throw new Error('AuthBroker: sessionStore is required');
46
+ }
47
+ if (!stores.tokenProvider) {
48
+ throw new Error('AuthBroker: tokenProvider is required');
49
+ }
37
50
  this.serviceKeyStore = stores.serviceKeyStore;
38
51
  this.sessionStore = stores.sessionStore;
39
52
  this.tokenProvider = stores.tokenProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/auth-broker",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "JWT authentication broker for MCP ABAP ADT - manages tokens based on destination headers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -51,11 +51,11 @@
51
51
  "node": ">=18.0.0"
52
52
  },
53
53
  "dependencies": {
54
- "@mcp-abap-adt/interfaces": "^0.1.1"
54
+ "@mcp-abap-adt/interfaces": "^0.1.3"
55
55
  },
56
56
  "devDependencies": {
57
- "@mcp-abap-adt/auth-providers": "^0.1.2",
58
- "@mcp-abap-adt/auth-stores": "^0.1.4",
57
+ "@mcp-abap-adt/auth-providers": "^0.1.3",
58
+ "@mcp-abap-adt/auth-stores": "^0.1.5",
59
59
  "@types/express": "^5.0.5",
60
60
  "@types/jest": "^30.0.0",
61
61
  "@types/js-yaml": "^4.0.9",