@mcp-abap-adt/core 18.1.0 → 19.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -5
- package/bin/mcp-abap-adt.js +15 -15
- package/dist/StdioServer.d.ts +68 -14
- package/dist/StdioServer.d.ts.map +1 -1
- package/dist/StdioServer.js +101 -31
- package/dist/StdioServer.js.map +1 -1
- package/dist/auth/IAuthBrokerFactory.d.ts +62 -0
- package/dist/auth/IAuthBrokerFactory.d.ts.map +1 -0
- package/dist/auth/IAuthBrokerFactory.js +8 -0
- package/dist/auth/IAuthBrokerFactory.js.map +1 -0
- package/dist/auth/IAuthBrokerFactoryConfig.d.ts +90 -0
- package/dist/auth/IAuthBrokerFactoryConfig.d.ts.map +1 -0
- package/dist/auth/IAuthBrokerFactoryConfig.js +8 -0
- package/dist/auth/IAuthBrokerFactoryConfig.js.map +1 -0
- package/dist/auth/brokerFactory.d.ts +93 -0
- package/dist/auth/brokerFactory.d.ts.map +1 -0
- package/dist/auth/brokerFactory.js +341 -0
- package/dist/auth/brokerFactory.js.map +1 -0
- package/dist/auth/browser.d.ts +60 -0
- package/dist/auth/browser.d.ts.map +1 -0
- package/dist/auth/browser.js +116 -0
- package/dist/auth/browser.js.map +1 -0
- package/dist/auth/countedProvider.d.ts +43 -0
- package/dist/auth/countedProvider.d.ts.map +1 -0
- package/dist/auth/countedProvider.js +105 -0
- package/dist/auth/countedProvider.js.map +1 -0
- package/dist/auth/destinationFailure.d.ts +69 -0
- package/dist/auth/destinationFailure.d.ts.map +1 -0
- package/dist/auth/destinationFailure.js +183 -0
- package/dist/auth/destinationFailure.js.map +1 -0
- package/dist/auth/destinationStores.d.ts +55 -0
- package/dist/auth/destinationStores.d.ts.map +1 -0
- package/dist/auth/destinationStores.js +158 -0
- package/dist/auth/destinationStores.js.map +1 -0
- package/dist/auth/handlers/basic.d.ts +3 -0
- package/dist/auth/handlers/basic.d.ts.map +1 -0
- package/dist/auth/handlers/basic.js +8 -0
- package/dist/auth/handlers/basic.js.map +1 -0
- package/dist/auth/handlers/index.d.ts +15 -0
- package/dist/auth/handlers/index.d.ts.map +1 -0
- package/dist/auth/handlers/index.js +32 -0
- package/dist/auth/handlers/index.js.map +1 -0
- package/dist/auth/handlers/jwtAuthorizationCode.d.ts +8 -0
- package/dist/auth/handlers/jwtAuthorizationCode.d.ts.map +1 -0
- package/dist/auth/handlers/jwtAuthorizationCode.js +32 -0
- package/dist/auth/handlers/jwtAuthorizationCode.js.map +1 -0
- package/dist/auth/handlers/snc.d.ts +3 -0
- package/dist/auth/handlers/snc.d.ts.map +1 -0
- package/dist/auth/handlers/snc.js +14 -0
- package/dist/auth/handlers/snc.js.map +1 -0
- package/dist/auth/handlers/types.d.ts +30 -0
- package/dist/auth/handlers/types.d.ts.map +1 -0
- package/dist/auth/handlers/types.js +3 -0
- package/dist/auth/handlers/types.js.map +1 -0
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +38 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/serverLogin.d.ts +75 -0
- package/dist/auth/serverLogin.d.ts.map +1 -0
- package/dist/auth/serverLogin.js +138 -0
- package/dist/auth/serverLogin.js.map +1 -0
- package/dist/auth/serverSentences.d.ts +39 -0
- package/dist/auth/serverSentences.d.ts.map +1 -0
- package/dist/auth/serverSentences.js +49 -0
- package/dist/auth/serverSentences.js.map +1 -0
- package/dist/auth/vocabulary.d.ts +28 -0
- package/dist/auth/vocabulary.d.ts.map +1 -0
- package/dist/auth/vocabulary.js +67 -0
- package/dist/auth/vocabulary.js.map +1 -0
- package/dist/config/coreParameters.d.ts +125 -0
- package/dist/config/coreParameters.d.ts.map +1 -0
- package/dist/config/coreParameters.js +331 -0
- package/dist/config/coreParameters.js.map +1 -0
- package/dist/config/envFileContext.d.ts +26 -0
- package/dist/config/envFileContext.d.ts.map +1 -0
- package/dist/config/envFileContext.js +90 -0
- package/dist/config/envFileContext.js.map +1 -0
- package/dist/config/envResolver.d.ts +6 -0
- package/dist/config/envResolver.d.ts.map +1 -0
- package/dist/config/envResolver.js +81 -0
- package/dist/config/envResolver.js.map +1 -0
- package/dist/config/platformPaths.d.ts +28 -0
- package/dist/config/platformPaths.d.ts.map +1 -0
- package/dist/config/platformPaths.js +152 -0
- package/dist/config/platformPaths.js.map +1 -0
- package/dist/destinationSource.d.ts +26 -0
- package/dist/destinationSource.d.ts.map +1 -0
- package/dist/destinationSource.js +43 -0
- package/dist/destinationSource.js.map +1 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts +102 -59
- package/dist/launcher.d.ts.map +1 -1
- package/dist/launcher.js +419 -286
- package/dist/launcher.js.map +1 -1
- package/dist/shutdown.d.ts +76 -24
- package/dist/shutdown.d.ts.map +1 -1
- package/dist/shutdown.js +114 -57
- package/dist/shutdown.js.map +1 -1
- package/package.json +22 -39
- package/dist/InstancePool.d.ts +0 -87
- package/dist/InstancePool.d.ts.map +0 -1
- package/dist/InstancePool.js +0 -240
- package/dist/InstancePool.js.map +0 -1
- package/dist/SseServer.d.ts +0 -144
- package/dist/SseServer.d.ts.map +0 -1
- package/dist/SseServer.js +0 -359
- package/dist/SseServer.js.map +0 -1
- package/dist/StreamableHttpServer.d.ts +0 -143
- package/dist/StreamableHttpServer.d.ts.map +0 -1
- package/dist/StreamableHttpServer.js +0 -349
- package/dist/StreamableHttpServer.js.map +0 -1
- package/dist/destinationRequest.d.ts +0 -38
- package/dist/destinationRequest.d.ts.map +0 -1
- package/dist/destinationRequest.js +0 -85
- package/dist/destinationRequest.js.map +0 -1
- package/dist/dnsRebindingProtection.d.ts +0 -21
- package/dist/dnsRebindingProtection.d.ts.map +0 -1
- package/dist/dnsRebindingProtection.js +0 -45
- package/dist/dnsRebindingProtection.js.map +0 -1
- package/dist/stateClose.d.ts +0 -8
- package/dist/stateClose.d.ts.map +0 -1
- package/dist/stateClose.js +0 -14
- package/dist/stateClose.js.map +0 -1
- package/dist/tlsUtils.d.ts +0 -19
- package/dist/tlsUtils.d.ts.map +0 -1
- package/dist/tlsUtils.js +0 -77
- package/dist/tlsUtils.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/auth/handlers/basic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,qBAG1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic.js","sourceRoot":"","sources":["../../../src/auth/handlers/basic.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAA0B;IACjD,QAAQ,EAAE,OAAO;IACjB,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The authentications this server supports — exactly these three: `basic`,
|
|
3
|
+
* `snc` and `jwt` / `authorization_code`. Adding one means a handler here, the
|
|
4
|
+
* docs' table and a test; nothing else. `jwt` / `none` (a token you hold) is
|
|
5
|
+
* not one: it is refused like any authentication not here, and the
|
|
6
|
+
* refusal says where it went — the `x-sap-jwt-token` header of
|
|
7
|
+
* `mcp-abap-adt-http` / `mcp-abap-adt-sse`.
|
|
8
|
+
*/
|
|
9
|
+
import type { VettedAuthentication } from '../vocabulary';
|
|
10
|
+
import type { AuthenticationHandler } from './types.js';
|
|
11
|
+
export type { AuthenticationHandler, AuthHandlerContext } from './types.js';
|
|
12
|
+
export declare const HANDLERS: readonly AuthenticationHandler[];
|
|
13
|
+
/** The handler for a vetted authentication; throws `UnsupportedAuthenticationError`. */
|
|
14
|
+
export declare function handlerFor(destination: string, vetted: VettedAuthentication): AuthenticationHandler;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE5E,eAAO,MAAM,QAAQ,EAAE,SAAS,qBAAqB,EAIpD,CAAC;AASF,wFAAwF;AACxF,wBAAgB,UAAU,CACxB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,oBAAoB,GAC3B,qBAAqB,CAUvB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The authentications this server supports — exactly these three: `basic`,
|
|
4
|
+
* `snc` and `jwt` / `authorization_code`. Adding one means a handler here, the
|
|
5
|
+
* docs' table and a test; nothing else. `jwt` / `none` (a token you hold) is
|
|
6
|
+
* not one: it is refused like any authentication not here, and the
|
|
7
|
+
* refusal says where it went — the `x-sap-jwt-token` header of
|
|
8
|
+
* `mcp-abap-adt-http` / `mcp-abap-adt-sse`.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.HANDLERS = void 0;
|
|
12
|
+
exports.handlerFor = handlerFor;
|
|
13
|
+
const destinationFailure_1 = require("../destinationFailure");
|
|
14
|
+
const basic_1 = require("./basic");
|
|
15
|
+
const jwtAuthorizationCode_1 = require("./jwtAuthorizationCode");
|
|
16
|
+
const snc_1 = require("./snc");
|
|
17
|
+
exports.HANDLERS = [
|
|
18
|
+
basic_1.basicHandler,
|
|
19
|
+
snc_1.sncHandler,
|
|
20
|
+
jwtAuthorizationCode_1.jwtAuthorizationCodeHandler,
|
|
21
|
+
];
|
|
22
|
+
const keyOf = (authType, grantType) => grantType ? `${authType}/${grantType}` : authType;
|
|
23
|
+
const byKey = new Map(exports.HANDLERS.map((h) => [keyOf(h.authType, h.grantType), h]));
|
|
24
|
+
/** The handler for a vetted authentication; throws `UnsupportedAuthenticationError`. */
|
|
25
|
+
function handlerFor(destination, vetted) {
|
|
26
|
+
const found = byKey.get(keyOf(vetted.authType, vetted.grantType));
|
|
27
|
+
if (!found) {
|
|
28
|
+
throw new destinationFailure_1.UnsupportedAuthenticationError(destination, vetted.authType, vetted.grantType);
|
|
29
|
+
}
|
|
30
|
+
return found;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/handlers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAyBH,gCAaC;AApCD,8DAAuE;AAEvE,mCAAuC;AACvC,iEAAqE;AACrE,+BAAmC;AAKtB,QAAA,QAAQ,GAAqC;IACxD,oBAAY;IACZ,gBAAU;IACV,kDAA2B;CAC5B,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAE,SAAkB,EAAE,EAAE,CACrD,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;AAEpD,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,gBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAU,CAAC,CAClE,CAAC;AAEF,wFAAwF;AACxF,SAAgB,UAAU,CACxB,WAAmB,EACnB,MAA4B;IAE5B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAClE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,mDAA8B,CACtC,WAAW,EACX,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,SAAS,CACjB,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuthenticationHandler } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A browser login: each strategy the broker asks for is auth-providers'
|
|
4
|
+
* composed callback strategy inside `serverLogin`. One destination per
|
|
5
|
+
* process, so its provider serializes its own logins; no lock is needed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const jwtAuthorizationCodeHandler: AuthenticationHandler;
|
|
8
|
+
//# sourceMappingURL=jwtAuthorizationCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwtAuthorizationCode.d.ts","sourceRoot":"","sources":["../../../src/auth/handlers/jwtAuthorizationCode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,qBAwBzC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jwtAuthorizationCodeHandler = void 0;
|
|
4
|
+
const auth_1 = require("@mcp-abap-adt/lib/auth");
|
|
5
|
+
const serverLogin_1 = require("../serverLogin");
|
|
6
|
+
/**
|
|
7
|
+
* A browser login: each strategy the broker asks for is auth-providers'
|
|
8
|
+
* composed callback strategy inside `serverLogin`. One destination per
|
|
9
|
+
* process, so its provider serializes its own logins; no lock is needed.
|
|
10
|
+
*/
|
|
11
|
+
exports.jwtAuthorizationCodeHandler = {
|
|
12
|
+
authType: 'jwt',
|
|
13
|
+
grantType: 'authorization_code',
|
|
14
|
+
brokerOptions: (context) => ({
|
|
15
|
+
authorization: () => (0, serverLogin_1.serverLogin)(context.browserStrategy({
|
|
16
|
+
...(context.browser !== undefined && { browser: context.browser }),
|
|
17
|
+
...(context.browserAuthPort !== undefined && {
|
|
18
|
+
port: context.browserAuthPort,
|
|
19
|
+
}),
|
|
20
|
+
}), context.login),
|
|
21
|
+
}),
|
|
22
|
+
/**
|
|
23
|
+
* A browser login needs a browser this platform has: an unavailable
|
|
24
|
+
* one refuses the destination at the startup check, naming `browser`.
|
|
25
|
+
*/
|
|
26
|
+
checkSettings(_settings, context) {
|
|
27
|
+
if (context.browserUnavailable !== undefined) {
|
|
28
|
+
throw new auth_1.SettingsError('browser', context.browserUnavailable);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=jwtAuthorizationCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwtAuthorizationCode.js","sourceRoot":"","sources":["../../../src/auth/handlers/jwtAuthorizationCode.ts"],"names":[],"mappings":";;;AAAA,iDAAuD;AACvD,gDAA6C;AAG7C;;;;GAIG;AACU,QAAA,2BAA2B,GAA0B;IAChE,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,oBAAoB;IAC/B,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC3B,aAAa,EAAE,GAAG,EAAE,CAClB,IAAA,yBAAW,EACT,OAAO,CAAC,eAAe,CAAC;YACtB,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;YAClE,GAAG,CAAC,OAAO,CAAC,eAAe,KAAK,SAAS,IAAI;gBAC3C,IAAI,EAAE,OAAO,CAAC,eAAe;aAC9B,CAAC;SACH,CAAC,EACF,OAAO,CAAC,KAAK,CACd;KACJ,CAAC;IACF;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,OAAO;QAC9B,IAAI,OAAO,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;YAC7C,MAAM,IAAI,oBAAa,CAAC,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snc.d.ts","sourceRoot":"","sources":["../../../src/auth/handlers/snc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,UAAU,EAAE,qBAWxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sncHandler = void 0;
|
|
4
|
+
const auth_1 = require("@mcp-abap-adt/lib/auth");
|
|
5
|
+
exports.sncHandler = {
|
|
6
|
+
authType: 'snc',
|
|
7
|
+
brokerOptions: () => ({}),
|
|
8
|
+
checkSettings(settings) {
|
|
9
|
+
if (settings.connectionType !== 'rfc') {
|
|
10
|
+
throw new auth_1.SettingsError('connection-type', "SNC logs on over RFC; set connection-type to 'rfc'.");
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=snc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snc.js","sourceRoot":"","sources":["../../../src/auth/handlers/snc.ts"],"names":[],"mappings":";;;AAAA,iDAAuD;AAG1C,QAAA,UAAU,GAA0B;IAC/C,QAAQ,EAAE,KAAK;IACf,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACzB,aAAa,CAAC,QAAQ;QACpB,IAAI,QAAQ,CAAC,cAAc,KAAK,KAAK,EAAE,CAAC;YACtC,MAAM,IAAI,oBAAa,CACrB,iBAAiB,EACjB,qDAAqD,CACtD,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AuthBrokerConfig } from '@mcp-abap-adt/auth-broker';
|
|
2
|
+
import type { SapConfig } from '@mcp-abap-adt/connection';
|
|
3
|
+
import type { IAuthorizationStrategy, IBrowser } from '@mcp-abap-adt/interfaces-auth';
|
|
4
|
+
import type { DestinationGrant } from '@mcp-abap-adt/interfaces-auth-broker';
|
|
5
|
+
import type { LoginStrategyOptions } from '../IAuthBrokerFactoryConfig.js';
|
|
6
|
+
import type { ServerLoginContext } from '../serverLogin.js';
|
|
7
|
+
import type { AuthType } from '../vocabulary';
|
|
8
|
+
/**
|
|
9
|
+
* What a handler may use to build its broker options. (Not `HandlerContext`:
|
|
10
|
+
* that name is the tool handlers' context.)
|
|
11
|
+
*/
|
|
12
|
+
export interface AuthHandlerContext {
|
|
13
|
+
browser?: IBrowser;
|
|
14
|
+
/** `--browser` names a browser this platform has none of: the words (`browserFor`). */
|
|
15
|
+
browserUnavailable?: string;
|
|
16
|
+
browserAuthPort?: number;
|
|
17
|
+
/** The launcher passes auth-providers' `browserCallbackStrategy`; no default here. */
|
|
18
|
+
browserStrategy: (options: LoginStrategyOptions) => IAuthorizationStrategy<string>;
|
|
19
|
+
/** The prompt logger and the factory's record of composed logins. */
|
|
20
|
+
login: ServerLoginContext;
|
|
21
|
+
}
|
|
22
|
+
export interface AuthenticationHandler {
|
|
23
|
+
readonly authType: AuthType;
|
|
24
|
+
readonly grantType?: DestinationGrant;
|
|
25
|
+
/** The broker options this authentication needs — nothing else. */
|
|
26
|
+
brokerOptions(context: AuthHandlerContext): Partial<AuthBrokerConfig>;
|
|
27
|
+
/** Refuses settings this authentication cannot use; most accept all. */
|
|
28
|
+
checkSettings?(settings: SapConfig, context: AuthHandlerContext): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/auth/handlers/types.ts"],"names":[],"mappings":"AAAA,OAAO,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core/auth` — the destination layer: one auth broker per
|
|
3
|
+
* destination, built from its service key and session stores; the browser
|
|
4
|
+
* of a login and the server's login wrapper.
|
|
5
|
+
*/
|
|
6
|
+
export { destinationSource } from '../destinationSource';
|
|
7
|
+
export { AuthBrokerFactory } from './brokerFactory';
|
|
8
|
+
export { BROWSER_NAMES, type BrowserChoice, BrowserChoiceError, type BrowserMapping, type BrowserName, browserFor, browserOf, } from './browser';
|
|
9
|
+
export { type DestinationFailureOptions, DestinationRefusal, destinationFailureOf, destinationFailureWords, HINTS, JWT_NONE_HINT, RECORD_FORMAT_HINT, UnsupportedAuthenticationError, } from './destinationFailure';
|
|
10
|
+
export type { IAuthBrokerFactory, IDestinations, SettleReport, } from './IAuthBrokerFactory.js';
|
|
11
|
+
export type { IAuthBrokerFactoryConfig, LoginStrategyOptions, } from './IAuthBrokerFactoryConfig.js';
|
|
12
|
+
export { promptLogger, type ServerLoginContext, serverLogin, } from './serverLogin';
|
|
13
|
+
export { REFRESH_ONLY_SENTENCE, RENEWAL_MODES, type RenewalMode, type ServerState, SHUTDOWN_SENTENCE, serverSentence, } from './serverSentences';
|
|
14
|
+
export { AUTH_TYPES, type AuthType, GRANTS, type VettedAuthentication, vetMeans, } from './vocabulary';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,UAAU,EACV,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,yBAAyB,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EACvB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,KAAK,QAAQ,EACb,MAAM,EACN,KAAK,oBAAoB,EACzB,QAAQ,GACT,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `@mcp-abap-adt/core/auth` — the destination layer: one auth broker per
|
|
4
|
+
* destination, built from its service key and session stores; the browser
|
|
5
|
+
* of a login and the server's login wrapper.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.vetMeans = exports.GRANTS = exports.AUTH_TYPES = exports.serverSentence = exports.SHUTDOWN_SENTENCE = exports.RENEWAL_MODES = exports.REFRESH_ONLY_SENTENCE = exports.serverLogin = exports.promptLogger = exports.UnsupportedAuthenticationError = exports.RECORD_FORMAT_HINT = exports.JWT_NONE_HINT = exports.HINTS = exports.destinationFailureWords = exports.destinationFailureOf = exports.DestinationRefusal = exports.browserOf = exports.browserFor = exports.BrowserChoiceError = exports.BROWSER_NAMES = exports.AuthBrokerFactory = exports.destinationSource = void 0;
|
|
9
|
+
var destinationSource_1 = require("../destinationSource");
|
|
10
|
+
Object.defineProperty(exports, "destinationSource", { enumerable: true, get: function () { return destinationSource_1.destinationSource; } });
|
|
11
|
+
var brokerFactory_1 = require("./brokerFactory");
|
|
12
|
+
Object.defineProperty(exports, "AuthBrokerFactory", { enumerable: true, get: function () { return brokerFactory_1.AuthBrokerFactory; } });
|
|
13
|
+
var browser_1 = require("./browser");
|
|
14
|
+
Object.defineProperty(exports, "BROWSER_NAMES", { enumerable: true, get: function () { return browser_1.BROWSER_NAMES; } });
|
|
15
|
+
Object.defineProperty(exports, "BrowserChoiceError", { enumerable: true, get: function () { return browser_1.BrowserChoiceError; } });
|
|
16
|
+
Object.defineProperty(exports, "browserFor", { enumerable: true, get: function () { return browser_1.browserFor; } });
|
|
17
|
+
Object.defineProperty(exports, "browserOf", { enumerable: true, get: function () { return browser_1.browserOf; } });
|
|
18
|
+
var destinationFailure_1 = require("./destinationFailure");
|
|
19
|
+
Object.defineProperty(exports, "DestinationRefusal", { enumerable: true, get: function () { return destinationFailure_1.DestinationRefusal; } });
|
|
20
|
+
Object.defineProperty(exports, "destinationFailureOf", { enumerable: true, get: function () { return destinationFailure_1.destinationFailureOf; } });
|
|
21
|
+
Object.defineProperty(exports, "destinationFailureWords", { enumerable: true, get: function () { return destinationFailure_1.destinationFailureWords; } });
|
|
22
|
+
Object.defineProperty(exports, "HINTS", { enumerable: true, get: function () { return destinationFailure_1.HINTS; } });
|
|
23
|
+
Object.defineProperty(exports, "JWT_NONE_HINT", { enumerable: true, get: function () { return destinationFailure_1.JWT_NONE_HINT; } });
|
|
24
|
+
Object.defineProperty(exports, "RECORD_FORMAT_HINT", { enumerable: true, get: function () { return destinationFailure_1.RECORD_FORMAT_HINT; } });
|
|
25
|
+
Object.defineProperty(exports, "UnsupportedAuthenticationError", { enumerable: true, get: function () { return destinationFailure_1.UnsupportedAuthenticationError; } });
|
|
26
|
+
var serverLogin_1 = require("./serverLogin");
|
|
27
|
+
Object.defineProperty(exports, "promptLogger", { enumerable: true, get: function () { return serverLogin_1.promptLogger; } });
|
|
28
|
+
Object.defineProperty(exports, "serverLogin", { enumerable: true, get: function () { return serverLogin_1.serverLogin; } });
|
|
29
|
+
var serverSentences_1 = require("./serverSentences");
|
|
30
|
+
Object.defineProperty(exports, "REFRESH_ONLY_SENTENCE", { enumerable: true, get: function () { return serverSentences_1.REFRESH_ONLY_SENTENCE; } });
|
|
31
|
+
Object.defineProperty(exports, "RENEWAL_MODES", { enumerable: true, get: function () { return serverSentences_1.RENEWAL_MODES; } });
|
|
32
|
+
Object.defineProperty(exports, "SHUTDOWN_SENTENCE", { enumerable: true, get: function () { return serverSentences_1.SHUTDOWN_SENTENCE; } });
|
|
33
|
+
Object.defineProperty(exports, "serverSentence", { enumerable: true, get: function () { return serverSentences_1.serverSentence; } });
|
|
34
|
+
var vocabulary_1 = require("./vocabulary");
|
|
35
|
+
Object.defineProperty(exports, "AUTH_TYPES", { enumerable: true, get: function () { return vocabulary_1.AUTH_TYPES; } });
|
|
36
|
+
Object.defineProperty(exports, "GRANTS", { enumerable: true, get: function () { return vocabulary_1.GRANTS; } });
|
|
37
|
+
Object.defineProperty(exports, "vetMeans", { enumerable: true, get: function () { return vocabulary_1.vetMeans; } });
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,0DAAyD;AAAhD,sHAAA,iBAAiB,OAAA;AAC1B,iDAAoD;AAA3C,kHAAA,iBAAiB,OAAA;AAC1B,qCAQmB;AAPjB,wGAAA,aAAa,OAAA;AAEb,6GAAA,kBAAkB,OAAA;AAGlB,qGAAA,UAAU,OAAA;AACV,oGAAA,SAAS,OAAA;AAEX,2DAS8B;AAP5B,wHAAA,kBAAkB,OAAA;AAClB,0HAAA,oBAAoB,OAAA;AACpB,6HAAA,uBAAuB,OAAA;AACvB,2GAAA,KAAK,OAAA;AACL,mHAAA,aAAa,OAAA;AACb,wHAAA,kBAAkB,OAAA;AAClB,oIAAA,8BAA8B,OAAA;AAWhC,6CAIuB;AAHrB,2GAAA,YAAY,OAAA;AAEZ,0GAAA,WAAW,OAAA;AAEb,qDAO2B;AANzB,wHAAA,qBAAqB,OAAA;AACrB,gHAAA,aAAa,OAAA;AAGb,oHAAA,iBAAiB,OAAA;AACjB,iHAAA,cAAc,OAAA;AAEhB,2CAMsB;AALpB,wGAAA,UAAU,OAAA;AAEV,oGAAA,MAAM,OAAA;AAEN,sGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server's login wrapper.
|
|
3
|
+
*
|
|
4
|
+
* With one destination per process, one provider serializes its own logins
|
|
5
|
+
* (its shared attempt), so no cross-destination lock is left. What the server
|
|
6
|
+
* adds to the composed strategy is only this:
|
|
7
|
+
*
|
|
8
|
+
* - the request goes on with its own `signal` (the attempt's) and with the
|
|
9
|
+
* prompt logger in place of the broker's, so a prompt reaches the user
|
|
10
|
+
* whatever `DEBUG_AUTH_LOG` says — never stdout;
|
|
11
|
+
* - `dispose()` is forwarded;
|
|
12
|
+
* - the wrapper is recorded, so the factory disposes it at shutdown;
|
|
13
|
+
* - under `--login-timeout`, each login is bounded: the request's
|
|
14
|
+
* signal combined with the bound's, the bound cleared when it settles.
|
|
15
|
+
*
|
|
16
|
+
* It settles exactly when the composed strategy does: auth-providers'
|
|
17
|
+
* composition settles only after its listener's sockets are closed, so the
|
|
18
|
+
* callback port is free when a login ends, cancelled or not.
|
|
19
|
+
*/
|
|
20
|
+
import type { IAuthorizationStrategy, IAuthProviderError } from '@mcp-abap-adt/interfaces-auth';
|
|
21
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
22
|
+
/**
|
|
23
|
+
* `--login-timeout`: the bound on each login, how it was stated, and
|
|
24
|
+
* which logins it ended — the server's own state its sentence is keyed on.
|
|
25
|
+
* A login's end is recorded on the failure that login ended with, never as
|
|
26
|
+
* "the last login": another login starting before that failure is read
|
|
27
|
+
* cannot take the sentence away, nor make the failure look like another
|
|
28
|
+
* caller's abort.
|
|
29
|
+
*/
|
|
30
|
+
export interface LoginBound {
|
|
31
|
+
/** The bound, in milliseconds. */
|
|
32
|
+
readonly ms: number;
|
|
33
|
+
/** How the bound was set, as the sentence names it (`` `--login-timeout=300` ``). */
|
|
34
|
+
readonly stated: string;
|
|
35
|
+
/** Whether the bound ended the login that failed with `error`. */
|
|
36
|
+
ended(error: IAuthProviderError): boolean;
|
|
37
|
+
/** Records that the bound ended the login that failed with `error`. */
|
|
38
|
+
record(error: IAuthProviderError): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A bound of `ms` milliseconds; `stated` is how it was set (default: the
|
|
42
|
+
* embedder's option, `` `loginTimeoutMs: <ms>` ``).
|
|
43
|
+
*/
|
|
44
|
+
export declare function loginBound(ms: number, stated?: string): LoginBound;
|
|
45
|
+
export interface ServerLoginContext {
|
|
46
|
+
/** The prompt logger: `info` on stderr (see `promptLogger`). */
|
|
47
|
+
readonly logger: ILogger;
|
|
48
|
+
/** Records the wrapper for the factory's disposal at shutdown. */
|
|
49
|
+
record(strategy: IAuthorizationStrategy<string>): void;
|
|
50
|
+
/** `--login-timeout`; absent: no bound. */
|
|
51
|
+
readonly bound?: LoginBound | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the shutdown began: from then on no interactive login starts —
|
|
54
|
+
* it is refused `interactive-login` `aborted`, answered with the shutdown
|
|
55
|
+
* sentence. Absent: never.
|
|
56
|
+
*/
|
|
57
|
+
readonly shuttingDown?: (() => boolean) | undefined;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The logger a login prompts through: `info` — the level auth-providers'
|
|
61
|
+
* strategies prompt at — is one stderr line always; `warn`, `error` and
|
|
62
|
+
* `debug` stay the broker's diagnostics, gated by `DEBUG_AUTH_LOG`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function promptLogger(stderr: (line: string) => void, diagnostics: ILogger): ILogger;
|
|
65
|
+
/**
|
|
66
|
+
* How the chain logs a session write that did not land under
|
|
67
|
+
* `onWriteFailure: 'continue'` (a named destination): auth-broker's
|
|
68
|
+
* writer (`[AuthBroker] Session write for <destination> failed; …`) and
|
|
69
|
+
* auth-providers' `refreshStatePersistence`. That line is a report the user
|
|
70
|
+
* must see. Read by its fixed opening words — the chain gives it no code.
|
|
71
|
+
*/
|
|
72
|
+
export declare const WRITE_FAILED_WORDS: readonly ["[AuthBroker] Session write for ", "[refreshStatePersistence] Writing the tokens failed"];
|
|
73
|
+
export declare function brokerLogger(stderr: (line: string) => void, diagnostics: ILogger): ILogger;
|
|
74
|
+
export declare function serverLogin(strategy: IAuthorizationStrategy<string>, context: ServerLoginContext): IAuthorizationStrategy<string>;
|
|
75
|
+
//# sourceMappingURL=serverLogin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverLogin.d.ts","sourceRoot":"","sources":["../../src/auth/serverLogin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,KAAK,EAGV,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,KAAK,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAC1C,uEAAuE;IACvE,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,EACV,MAAM,SAA8B,GACnC,UAAU,CAUZ;AAED,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,kEAAkE;IAClE,MAAM,CAAC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACvD,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAAC;CACrD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC9B,WAAW,EAAE,OAAO,GACnB,OAAO,CAOT;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,qGAGrB,CAAC;AAUX,wBAAgB,YAAY,CAC1B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC9B,WAAW,EAAE,OAAO,GACnB,OAAO,CAmBT;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,EACxC,OAAO,EAAE,kBAAkB,GAC1B,sBAAsB,CAAC,MAAM,CAAC,CA2BhC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The server's login wrapper.
|
|
4
|
+
*
|
|
5
|
+
* With one destination per process, one provider serializes its own logins
|
|
6
|
+
* (its shared attempt), so no cross-destination lock is left. What the server
|
|
7
|
+
* adds to the composed strategy is only this:
|
|
8
|
+
*
|
|
9
|
+
* - the request goes on with its own `signal` (the attempt's) and with the
|
|
10
|
+
* prompt logger in place of the broker's, so a prompt reaches the user
|
|
11
|
+
* whatever `DEBUG_AUTH_LOG` says — never stdout;
|
|
12
|
+
* - `dispose()` is forwarded;
|
|
13
|
+
* - the wrapper is recorded, so the factory disposes it at shutdown;
|
|
14
|
+
* - under `--login-timeout`, each login is bounded: the request's
|
|
15
|
+
* signal combined with the bound's, the bound cleared when it settles.
|
|
16
|
+
*
|
|
17
|
+
* It settles exactly when the composed strategy does: auth-providers'
|
|
18
|
+
* composition settles only after its listener's sockets are closed, so the
|
|
19
|
+
* callback port is free when a login ends, cancelled or not.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.WRITE_FAILED_WORDS = void 0;
|
|
23
|
+
exports.loginBound = loginBound;
|
|
24
|
+
exports.promptLogger = promptLogger;
|
|
25
|
+
exports.brokerLogger = brokerLogger;
|
|
26
|
+
exports.serverLogin = serverLogin;
|
|
27
|
+
const auth_errors_1 = require("@mcp-abap-adt/auth-errors");
|
|
28
|
+
/**
|
|
29
|
+
* A bound of `ms` milliseconds; `stated` is how it was set (default: the
|
|
30
|
+
* embedder's option, `` `loginTimeoutMs: <ms>` ``).
|
|
31
|
+
*/
|
|
32
|
+
function loginBound(ms, stated = `\`loginTimeoutMs: ${ms}\``) {
|
|
33
|
+
const endedByBound = new WeakSet();
|
|
34
|
+
return {
|
|
35
|
+
ms,
|
|
36
|
+
stated,
|
|
37
|
+
ended: (error) => endedByBound.has(error),
|
|
38
|
+
record: (error) => {
|
|
39
|
+
endedByBound.add(error);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The logger a login prompts through: `info` — the level auth-providers'
|
|
45
|
+
* strategies prompt at — is one stderr line always; `warn`, `error` and
|
|
46
|
+
* `debug` stay the broker's diagnostics, gated by `DEBUG_AUTH_LOG`.
|
|
47
|
+
*/
|
|
48
|
+
function promptLogger(stderr, diagnostics) {
|
|
49
|
+
return {
|
|
50
|
+
info: (message) => stderr(message),
|
|
51
|
+
warn: (message, meta) => diagnostics.warn(message, meta),
|
|
52
|
+
error: (message, meta) => diagnostics.error(message, meta),
|
|
53
|
+
debug: (message, meta) => diagnostics.debug(message, meta),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* How the chain logs a session write that did not land under
|
|
58
|
+
* `onWriteFailure: 'continue'` (a named destination): auth-broker's
|
|
59
|
+
* writer (`[AuthBroker] Session write for <destination> failed; …`) and
|
|
60
|
+
* auth-providers' `refreshStatePersistence`. That line is a report the user
|
|
61
|
+
* must see. Read by its fixed opening words — the chain gives it no code.
|
|
62
|
+
*/
|
|
63
|
+
exports.WRITE_FAILED_WORDS = [
|
|
64
|
+
'[AuthBroker] Session write for ',
|
|
65
|
+
'[refreshStatePersistence] Writing the tokens failed',
|
|
66
|
+
];
|
|
67
|
+
function isWriteFailed(message) {
|
|
68
|
+
return (typeof message === 'string' &&
|
|
69
|
+
exports.WRITE_FAILED_WORDS.some((words) => message.startsWith(words)) &&
|
|
70
|
+
message.includes('fail'));
|
|
71
|
+
}
|
|
72
|
+
function brokerLogger(stderr, diagnostics) {
|
|
73
|
+
return {
|
|
74
|
+
info: (message, meta) => diagnostics.info(message, meta),
|
|
75
|
+
warn: (message, meta) => {
|
|
76
|
+
if (isWriteFailed(message)) {
|
|
77
|
+
// The server's own words and the line's `logFields` — never the
|
|
78
|
+
// chain's message, which names a destination and a path.
|
|
79
|
+
stderr(meta === undefined
|
|
80
|
+
? '[MCP] A session write did not land'
|
|
81
|
+
: `[MCP] A session write did not land: ${JSON.stringify(meta)}`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
diagnostics.warn(message, meta);
|
|
85
|
+
},
|
|
86
|
+
error: (message, meta) => diagnostics.error(message, meta),
|
|
87
|
+
debug: (message, meta) => diagnostics.debug(message, meta),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function serverLogin(strategy, context) {
|
|
91
|
+
const pass = (request, signal) => strategy.authorize({
|
|
92
|
+
buildAuthorizationUrl: (redirectUri) => request.buildAuthorizationUrl(redirectUri),
|
|
93
|
+
signal,
|
|
94
|
+
logger: context.logger,
|
|
95
|
+
});
|
|
96
|
+
const wrapped = {
|
|
97
|
+
authorize: (request) => {
|
|
98
|
+
if (context.shuttingDown?.() === true) {
|
|
99
|
+
return Promise.reject(new auth_errors_1.AuthProviderFailure(auth_errors_1.authError['interactive-login']({ outcome: 'aborted' })));
|
|
100
|
+
}
|
|
101
|
+
const bound = context.bound;
|
|
102
|
+
if (bound === undefined)
|
|
103
|
+
return pass(request, request.signal);
|
|
104
|
+
return bounded(bound, request, (signal) => pass(request, signal));
|
|
105
|
+
},
|
|
106
|
+
dispose: () => strategy.dispose?.() ?? Promise.resolve(),
|
|
107
|
+
};
|
|
108
|
+
context.record(wrapped);
|
|
109
|
+
return wrapped;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* One login under `--login-timeout`: the strategy gets the request's
|
|
113
|
+
* signal combined with the bound's, so either ends the login. The bound is
|
|
114
|
+
* the login's, not the request's: its timer starts with the login and is
|
|
115
|
+
* cleared when the login settles, so no timer outlives it. A login the bound
|
|
116
|
+
* ended has its failure recorded on `bound`.
|
|
117
|
+
*/
|
|
118
|
+
async function bounded(bound, request, run) {
|
|
119
|
+
const elapsed = new AbortController();
|
|
120
|
+
const timer = setTimeout(() => elapsed.abort(), bound.ms);
|
|
121
|
+
const signal = request.signal === undefined
|
|
122
|
+
? elapsed.signal
|
|
123
|
+
: AbortSignal.any([request.signal, elapsed.signal]);
|
|
124
|
+
try {
|
|
125
|
+
return await run(signal);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
// Ended by the bound — not by the request's own signal.
|
|
129
|
+
if (elapsed.signal.aborted && request.signal?.aborted !== true) {
|
|
130
|
+
bound.record((0, auth_errors_1.readFailure)(error, 'token-request'));
|
|
131
|
+
}
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
clearTimeout(timer);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=serverLogin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverLogin.js","sourceRoot":"","sources":["../../src/auth/serverLogin.ts"],"names":[],"mappings":";AAAA;;;;;;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AE,CAAC;QACf,wDAAwD;QACxD,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;YAC/D,KAAK,CAAC,MAAM,CAAC,IAAA,yBAAW,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server's own sentences: added beside a chain failure,
|
|
3
|
+
* keyed on its `kind` and on the server's own state — never on its words.
|
|
4
|
+
* The failure answer renders them as `server`; here they are decided.
|
|
5
|
+
*/
|
|
6
|
+
import type { IAuthProviderError } from '@mcp-abap-adt/interfaces-auth';
|
|
7
|
+
import { SHUTDOWN_SENTENCE } from '@mcp-abap-adt/lib/state';
|
|
8
|
+
/** How the provider renews (`--renewal`). */
|
|
9
|
+
export type RenewalMode = 'refresh-then-login' | 'refresh-only';
|
|
10
|
+
export declare const RENEWAL_MODES: readonly RenewalMode[];
|
|
11
|
+
/** A renewal that would need a login, under `--renewal=refresh-only`. */
|
|
12
|
+
export declare const REFRESH_ONLY_SENTENCE = "Logins are off (`--renewal=refresh-only`): log in with `mcp-auth`, or start without it.";
|
|
13
|
+
/**
|
|
14
|
+
* A provider call behind the closed gate, a login after the shutdown
|
|
15
|
+
* began, or a call a latch refused — lib's one sentence.
|
|
16
|
+
*/
|
|
17
|
+
export { SHUTDOWN_SENTENCE };
|
|
18
|
+
/**
|
|
19
|
+
* A session write that did not land, under `onWriteFailure: 'fail'`
|
|
20
|
+
* (the `--env` / `--env-path` file): `unknown` `persisting-tokens`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PERSISTING_TOKENS_SENTENCE = "The session could not be written to the destination's file.";
|
|
23
|
+
/**
|
|
24
|
+
* The login was ended by the login bound, named as it was set —
|
|
25
|
+
* `stated` (`` `--login-timeout=300` ``, `` `MCP_LOGIN_TIMEOUT=300` ``, …).
|
|
26
|
+
*/
|
|
27
|
+
export declare function loginTimeoutSentence(stated: string): string;
|
|
28
|
+
export interface ServerState {
|
|
29
|
+
readonly renewal: RenewalMode;
|
|
30
|
+
readonly shuttingDown: boolean;
|
|
31
|
+
/** `--login-timeout`: which logins it ended, and how it was set; absent: no bound. */
|
|
32
|
+
readonly loginBound?: {
|
|
33
|
+
readonly stated: string;
|
|
34
|
+
ended(error: IAuthProviderError): boolean;
|
|
35
|
+
} | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** The server's sentence for `error` in `state`; `undefined` when it has none. */
|
|
38
|
+
export declare function serverSentence(error: IAuthProviderError, state: ServerState): string | undefined;
|
|
39
|
+
//# sourceMappingURL=serverSentences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverSentences.d.ts","sourceRoot":"","sources":["../../src/auth/serverSentences.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,6CAA6C;AAC7C,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,cAAc,CAAC;AAEhE,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAG/C,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,4FACyD,CAAC;AAE5F;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;GAGG;AACH,eAAO,MAAM,0BAA0B,gEACwB,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,sFAAsF;IACtF,QAAQ,CAAC,UAAU,CAAC,EAChB;QACE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,KAAK,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC;KAC3C,GACD,SAAS,CAAC;CACf;AAED,kFAAkF;AAClF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,WAAW,GACjB,MAAM,GAAG,SAAS,CAiBpB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The server's own sentences: added beside a chain failure,
|
|
4
|
+
* keyed on its `kind` and on the server's own state — never on its words.
|
|
5
|
+
* The failure answer renders them as `server`; here they are decided.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.PERSISTING_TOKENS_SENTENCE = exports.SHUTDOWN_SENTENCE = exports.REFRESH_ONLY_SENTENCE = exports.RENEWAL_MODES = void 0;
|
|
9
|
+
exports.loginTimeoutSentence = loginTimeoutSentence;
|
|
10
|
+
exports.serverSentence = serverSentence;
|
|
11
|
+
const state_1 = require("@mcp-abap-adt/lib/state");
|
|
12
|
+
Object.defineProperty(exports, "SHUTDOWN_SENTENCE", { enumerable: true, get: function () { return state_1.SHUTDOWN_SENTENCE; } });
|
|
13
|
+
exports.RENEWAL_MODES = [
|
|
14
|
+
'refresh-then-login',
|
|
15
|
+
'refresh-only',
|
|
16
|
+
];
|
|
17
|
+
/** A renewal that would need a login, under `--renewal=refresh-only`. */
|
|
18
|
+
exports.REFRESH_ONLY_SENTENCE = 'Logins are off (`--renewal=refresh-only`): log in with `mcp-auth`, or start without it.';
|
|
19
|
+
/**
|
|
20
|
+
* A session write that did not land, under `onWriteFailure: 'fail'`
|
|
21
|
+
* (the `--env` / `--env-path` file): `unknown` `persisting-tokens`.
|
|
22
|
+
*/
|
|
23
|
+
exports.PERSISTING_TOKENS_SENTENCE = "The session could not be written to the destination's file.";
|
|
24
|
+
/**
|
|
25
|
+
* The login was ended by the login bound, named as it was set —
|
|
26
|
+
* `stated` (`` `--login-timeout=300` ``, `` `MCP_LOGIN_TIMEOUT=300` ``, …).
|
|
27
|
+
*/
|
|
28
|
+
function loginTimeoutSentence(stated) {
|
|
29
|
+
return `The login was ended by the server's login timeout (${stated}).`;
|
|
30
|
+
}
|
|
31
|
+
/** The server's sentence for `error` in `state`; `undefined` when it has none. */
|
|
32
|
+
function serverSentence(error, state) {
|
|
33
|
+
if (error.kind === 'renewal-declined' && state.renewal === 'refresh-only') {
|
|
34
|
+
return exports.REFRESH_ONLY_SENTENCE;
|
|
35
|
+
}
|
|
36
|
+
if (error.kind === 'unknown' &&
|
|
37
|
+
error.facts.operation === 'persisting-tokens') {
|
|
38
|
+
return exports.PERSISTING_TOKENS_SENTENCE;
|
|
39
|
+
}
|
|
40
|
+
if (error.kind === 'interactive-login' && error.facts.outcome === 'aborted') {
|
|
41
|
+
if (state.shuttingDown)
|
|
42
|
+
return state_1.SHUTDOWN_SENTENCE;
|
|
43
|
+
if (state.loginBound?.ended(error) === true) {
|
|
44
|
+
return loginTimeoutSentence(state.loginBound.stated);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=serverSentences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverSentences.js","sourceRoot":"","sources":["../../src/auth/serverSentences.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAkCH,oDAEC;AAeD,wCAoBC;AApED,mDAA4D;AAkBnD,kGAlBA,yBAAiB,OAkBA;AAbb,QAAA,aAAa,GAA2B;IACnD,oBAAoB;IACpB,cAAc;CACf,CAAC;AAEF,yEAAyE;AAC5D,QAAA,qBAAqB,GAChC,yFAAyF,CAAC;AAQ5F;;;GAGG;AACU,QAAA,0BAA0B,GACrC,6DAA6D,CAAC;AAEhE;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,MAAc;IACjD,OAAO,sDAAsD,MAAM,IAAI,CAAC;AAC1E,CAAC;AAcD,kFAAkF;AAClF,SAAgB,cAAc,CAC5B,KAAyB,EACzB,KAAkB;IAElB,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,IAAI,KAAK,CAAC,OAAO,KAAK,cAAc,EAAE,CAAC;QAC1E,OAAO,6BAAqB,CAAC;IAC/B,CAAC;IACD,IACE,KAAK,CAAC,IAAI,KAAK,SAAS;QACvB,KAAK,CAAC,KAAiC,CAAC,SAAS,KAAK,mBAAmB,EAC1E,CAAC;QACD,OAAO,kCAA0B,CAAC;IACpC,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC5E,IAAI,KAAK,CAAC,YAAY;YAAE,OAAO,yBAAiB,CAAC;QACjD,IAAI,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;YAC5C,OAAO,oBAAoB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vocabulary of authentication broker 4 accepts, held in code.
|
|
3
|
+
*
|
|
4
|
+
* A key store answers `authType` and `grantType` as the strings its file
|
|
5
|
+
* holds, unchecked. `vetMeans` checks them before anything is built; an
|
|
6
|
+
* unknown string is refused without being quoted (H4).
|
|
7
|
+
*/
|
|
8
|
+
import type { DestinationGrant, IConnectionConfig } from '@mcp-abap-adt/interfaces-auth-broker';
|
|
9
|
+
/**
|
|
10
|
+
* `certificate` and `kerberos` are known and unsupported: vetted, so the
|
|
11
|
+
* refusal can name them (`UnsupportedAuthenticationError`) instead of calling
|
|
12
|
+
* them an unknown type. Neither reads a grant.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AUTH_TYPES: readonly ["basic", "jwt", "saml", "snc", "certificate", "kerberos"];
|
|
15
|
+
export type AuthType = (typeof AUTH_TYPES)[number];
|
|
16
|
+
/**
|
|
17
|
+
* Every `DestinationGrant`. `satisfies` stops a name the contract lacks; the
|
|
18
|
+
* exhaustiveness check against the type (a member the contract adds) is the
|
|
19
|
+
* test file's, so a contract change breaks `test:check`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const GRANTS: readonly ["authorization_code", "client_credentials", "passcode", "oidc_authorization_code", "device_code", "password", "token_exchange", "saml2_pure", "saml2_bearer", "none"];
|
|
22
|
+
export interface VettedAuthentication {
|
|
23
|
+
authType: AuthType;
|
|
24
|
+
grantType?: DestinationGrant;
|
|
25
|
+
}
|
|
26
|
+
/** Checks what a destination states against the vocabulary; throws `DestinationConfigError`. */
|
|
27
|
+
export declare function vetMeans(destination: string, means: IConnectionConfig | null): VettedAuthentication;
|
|
28
|
+
//# sourceMappingURL=vocabulary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/auth/vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,UAAU,qEAOb,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,MAAM,iLAW6B,CAAC;AAmBjD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,gGAAgG;AAChG,wBAAgB,QAAQ,CACtB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAC9B,oBAAoB,CAgBtB"}
|