@mcp-abap-adt/interfaces-auth-broker 1.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 +61 -0
- package/COPYING +674 -0
- package/LICENSE +165 -0
- package/README.md +57 -0
- package/dist/auth/DestinationGrant.d.ts +34 -0
- package/dist/auth/DestinationGrant.d.ts.map +1 -0
- package/dist/auth/DestinationGrant.js +2 -0
- package/dist/auth/IConfig.d.ts +8 -0
- package/dist/auth/IConfig.d.ts.map +1 -0
- package/dist/auth/IConfig.js +6 -0
- package/dist/auth/IConnectionConfig.d.ts +75 -0
- package/dist/auth/IConnectionConfig.d.ts.map +1 -0
- package/dist/auth/IConnectionConfig.js +2 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/serviceKey/IServiceKeyStore.d.ts +31 -0
- package/dist/serviceKey/IServiceKeyStore.d.ts.map +1 -0
- package/dist/serviceKey/IServiceKeyStore.js +7 -0
- package/dist/session/ISessionStore.d.ts +59 -0
- package/dist/session/ISessionStore.d.ts.map +1 -0
- package/dist/session/ISessionStore.js +7 -0
- package/dist/token/ITokenProviderResult.d.ts +12 -0
- package/dist/token/ITokenProviderResult.d.ts.map +1 -0
- package/dist/token/ITokenProviderResult.js +2 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @mcp-abap-adt/interfaces-auth-broker
|
|
2
|
+
|
|
3
|
+
The broker's port: what a destination states — its connection settings, how it
|
|
4
|
+
renews its credential — and the stores that hold it. Types only; no
|
|
5
|
+
implementation.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mcp-abap-adt/interfaces-auth-broker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| symbol | what it is |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `IConnectionConfig` | a destination's connection settings, as a store hands them to the broker: `serviceUrl`, `sapClient`, `language`, the credential (`authorizationToken`, `username`/`password`, `sessionCookies`), `authType`, `grantType`, `expiresAt`, and the settings a grant needs — SNC (`snc*`), OIDC (`oidc*`) and the SAML IdP's trust (`saml*`) |
|
|
14
|
+
| `DestinationGrant` | how a destination obtains a new credential: the UAA, OIDC and SAML grants, or `'none'` — handed over, not renewed |
|
|
15
|
+
| `IConfig` | `Partial<IAuthorizationConfig> & Partial<IConnectionConfig>` — what a session store loads and saves |
|
|
16
|
+
| `ISessionStore` | loads, saves and updates a destination's session |
|
|
17
|
+
| `IServiceKeyStore` | reads a destination's service key as authorization and connection settings |
|
|
18
|
+
| `ITokenProviderResult` | the result of authenticating a destination: its `IConnectionConfig` and a refresh token |
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import type { IConnectionConfig, ISessionStore } from '@mcp-abap-adt/interfaces-auth-broker';
|
|
22
|
+
import type { IAuthorizationConfig, ISapConfig } from '@mcp-abap-adt/interfaces-auth-sap';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Why this package exists
|
|
26
|
+
|
|
27
|
+
**`interfaces-auth-sap` 1.x held two subjects.** One is the SAP system and the
|
|
28
|
+
UAA client — `ISapConfig`, `IAuthorizationConfig`, XSUAA, the certificate
|
|
29
|
+
loader — which a token provider, the ABAP connection and the ADT clients take.
|
|
30
|
+
The other is the destination and its storage, which only the stores, the
|
|
31
|
+
broker and the servers that build a broker import. The broker states what it
|
|
32
|
+
needs from a destination and the stores implement it: that is the broker's
|
|
33
|
+
port, and its fields name the destination, not the SAP system. A contract lives
|
|
34
|
+
in the package whose subject its own fields name (decision 35); decision 41 in
|
|
35
|
+
the repository's `docs/architecture/DECISIONS.md` records this split.
|
|
36
|
+
|
|
37
|
+
Kept apart, a release of the destination — new grant settings for the broker —
|
|
38
|
+
no longer asks every provider and connection to follow, and a change to the
|
|
39
|
+
SAP system's configuration no longer reaches the stores.
|
|
40
|
+
|
|
41
|
+
## Where these contracts were
|
|
42
|
+
|
|
43
|
+
`@mcp-abap-adt/interfaces-auth-sap`, until its 2.0.0 — same names, same shapes;
|
|
44
|
+
only the package changed. Before that, `@mcp-abap-adt/interfaces-adt` until its
|
|
45
|
+
9.0.0. Not re-exported from `interfaces-auth-sap`: import them from here
|
|
46
|
+
(decision 34).
|
|
47
|
+
|
|
48
|
+
## Dependencies
|
|
49
|
+
|
|
50
|
+
Depends on `@mcp-abap-adt/interfaces-auth-sap` (`^2.0.0`), for
|
|
51
|
+
`IAuthorizationConfig` — the UAA client a store returns beside the connection
|
|
52
|
+
settings — and on nothing else. `interfaces-auth` and `interfaces-utils` reach
|
|
53
|
+
it through that package.
|
|
54
|
+
|
|
55
|
+
## Licence
|
|
56
|
+
|
|
57
|
+
`LGPL-3.0-only`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a destination obtains a new credential — stated by the destination's
|
|
3
|
+
* configuration, never inferred from the host or the shape of a service key.
|
|
4
|
+
*
|
|
5
|
+
* Read with `IConnectionConfig.authType`: the grants in the first group renew
|
|
6
|
+
* a `'jwt'` destination, those in the second a `'saml'` one, and `'none'`
|
|
7
|
+
* either — a credential handed over and not renewed.
|
|
8
|
+
*
|
|
9
|
+
* Not `OAuth2GrantType` (`@mcp-abap-adt/interfaces-auth`): that lists OAuth
|
|
10
|
+
* grants on the wire; this lists the ways a destination is renewed, which
|
|
11
|
+
* include a UAA passcode, SAML session cookies and no renewal at all.
|
|
12
|
+
*/
|
|
13
|
+
export type DestinationGrant =
|
|
14
|
+
/** UAA authorization code */
|
|
15
|
+
'authorization_code'
|
|
16
|
+
/** UAA client credentials */
|
|
17
|
+
| 'client_credentials'
|
|
18
|
+
/** UAA one-time passcode */
|
|
19
|
+
| 'passcode'
|
|
20
|
+
/** OIDC authorization code with PKCE */
|
|
21
|
+
| 'oidc_authorization_code'
|
|
22
|
+
/** OIDC device authorization */
|
|
23
|
+
| 'device_code'
|
|
24
|
+
/** OIDC resource owner password */
|
|
25
|
+
| 'password'
|
|
26
|
+
/** OAuth 2.0 token exchange (RFC 8693) */
|
|
27
|
+
| 'token_exchange'
|
|
28
|
+
/** A SAML assertion exchanged for session cookies */
|
|
29
|
+
| 'saml2_pure'
|
|
30
|
+
/** A SAML assertion exchanged for an OAuth token (RFC 7522) */
|
|
31
|
+
| 'saml2_bearer'
|
|
32
|
+
/** Handed over, not renewed */
|
|
33
|
+
| 'none';
|
|
34
|
+
//# sourceMappingURL=DestinationGrant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DestinationGrant.d.ts","sourceRoot":"","sources":["../../src/auth/DestinationGrant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,gBAAgB;AAE1B,6BAA6B;AAC3B,oBAAoB;AACtB,6BAA6B;GAC3B,oBAAoB;AACtB,4BAA4B;GAC1B,UAAU;AACZ,wCAAwC;GACtC,yBAAyB;AAC3B,gCAAgC;GAC9B,aAAa;AACf,mCAAmC;GACjC,UAAU;AACZ,0CAA0C;GACxC,gBAAgB;AAElB,qDAAqD;GACnD,YAAY;AACd,+DAA+D;GAC7D,cAAc;AAEhB,+BAA+B;GAC7B,MAAM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration - optional composition of authorization and connection configuration
|
|
3
|
+
* Can contain either authorization config, or connection config, or both
|
|
4
|
+
*/
|
|
5
|
+
import type { IAuthorizationConfig } from '@mcp-abap-adt/interfaces-auth-sap';
|
|
6
|
+
import type { IConnectionConfig } from './IConnectionConfig';
|
|
7
|
+
export type IConfig = Partial<IAuthorizationConfig> & Partial<IConnectionConfig>;
|
|
8
|
+
//# sourceMappingURL=IConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConfig.d.ts","sourceRoot":"","sources":["../../src/auth/IConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,GACjD,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { DestinationGrant } from './DestinationGrant';
|
|
2
|
+
/**
|
|
3
|
+
* Connection configuration - values needed for connecting to services
|
|
4
|
+
* Returned by stores with actual values (not file paths)
|
|
5
|
+
*/
|
|
6
|
+
export interface IConnectionConfig {
|
|
7
|
+
/** Service URL (SAP/ABAP/MCP URL) - undefined for XSUAA if not provided */
|
|
8
|
+
serviceUrl?: string;
|
|
9
|
+
/** Authorization token (JWT token) - required for JWT auth, optional for basic auth */
|
|
10
|
+
authorizationToken?: string;
|
|
11
|
+
/** Username for basic authentication - required for basic auth, optional for JWT auth */
|
|
12
|
+
username?: string;
|
|
13
|
+
/** Password for basic authentication - required for basic auth, optional for JWT auth */
|
|
14
|
+
password?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Authentication type - 'basic' for on-premise, 'jwt' for cloud, 'snc' for SNC over RFC.
|
|
17
|
+
* A store states it for every destination that holds a credential or a grant.
|
|
18
|
+
*/
|
|
19
|
+
authType?: 'basic' | 'jwt' | 'saml' | 'snc';
|
|
20
|
+
/** How the destination obtains a new credential; absent means the destination does not say */
|
|
21
|
+
grantType?: DestinationGrant;
|
|
22
|
+
/**
|
|
23
|
+
* When the stored credential stops being valid, in epoch milliseconds, as the
|
|
24
|
+
* provider reported it. A JWT carries its own `exp`; session cookies do not.
|
|
25
|
+
*/
|
|
26
|
+
expiresAt?: number;
|
|
27
|
+
/** SAP client number (optional, for ABAP/BTP) */
|
|
28
|
+
sapClient?: string;
|
|
29
|
+
/** Language (optional, for ABAP/BTP) */
|
|
30
|
+
language?: string;
|
|
31
|
+
/** Session cookies for SAML authentication (raw Cookie header value) */
|
|
32
|
+
sessionCookies?: string;
|
|
33
|
+
/** The system's SNC name, e.g. "p:CN=SID, O=ACME" */
|
|
34
|
+
sncPartnerName?: string;
|
|
35
|
+
/** Quality of protection: "1" auth, "2" integrity, "3" privacy, "8" default, "9" maximum available */
|
|
36
|
+
sncQop?: string;
|
|
37
|
+
/** The SNC (GSS) library; discovered when absent */
|
|
38
|
+
sncLib?: string;
|
|
39
|
+
/** The user's SNC name; taken from the credential when absent */
|
|
40
|
+
sncMyName?: string;
|
|
41
|
+
/** The issuer; its discovery document supplies any endpoint not given */
|
|
42
|
+
oidcIssuerUrl?: string;
|
|
43
|
+
oidcAuthorizationEndpoint?: string;
|
|
44
|
+
oidcTokenEndpoint?: string;
|
|
45
|
+
oidcDeviceAuthorizationEndpoint?: string;
|
|
46
|
+
oidcScopes?: string[];
|
|
47
|
+
/** token_exchange: the token exchanged (RFC 8693 subject_token) */
|
|
48
|
+
oidcSubjectToken?: string;
|
|
49
|
+
/** token_exchange: its type URI */
|
|
50
|
+
oidcSubjectTokenType?: string;
|
|
51
|
+
/** token_exchange: the audience asked for */
|
|
52
|
+
oidcAudience?: string;
|
|
53
|
+
/** token_exchange: the actor token, when acting on behalf of the subject */
|
|
54
|
+
oidcActorToken?: string;
|
|
55
|
+
/** token_exchange: its type URI */
|
|
56
|
+
oidcActorTokenType?: string;
|
|
57
|
+
/** The IdP's single sign-on URL */
|
|
58
|
+
samlIdpSsoUrl?: string;
|
|
59
|
+
/** The Issuer every assertion must name */
|
|
60
|
+
samlIdpEntityId?: string;
|
|
61
|
+
/** The IdP's signing certificates, PEM or base64 DER; several during a key rotation */
|
|
62
|
+
samlIdpCertificates?: string[];
|
|
63
|
+
/** This service provider's entity ID — the assertion's Audience */
|
|
64
|
+
samlSpEntityId?: string;
|
|
65
|
+
/** The assertion consumer service URL — the assertion's Recipient */
|
|
66
|
+
samlAcsUrl?: string;
|
|
67
|
+
samlRelayState?: string;
|
|
68
|
+
/** IdP-initiated: no AuthnRequest, and the assertion carries no InResponseTo */
|
|
69
|
+
samlIdpInitiated?: boolean;
|
|
70
|
+
/** Clock skew allowed when checking the assertion's times, in milliseconds */
|
|
71
|
+
samlClockSkewMs?: number;
|
|
72
|
+
/** saml2_bearer: the token endpoint the assertion is exchanged at */
|
|
73
|
+
samlTokenUrl?: string;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=IConnectionConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConnectionConfig.d.ts","sourceRoot":"","sources":["../../src/auth/IConnectionConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IAC5C,8FAA8F;IAC9F,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IAIxB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @mcp-abap-adt/interfaces-auth-broker
|
|
3
|
+
*
|
|
4
|
+
* The broker's port: what `@mcp-abap-adt/auth-broker` needs from a destination,
|
|
5
|
+
* and the stores that hold one.
|
|
6
|
+
*
|
|
7
|
+
* **What makes a contract belong here is that its own fields name the
|
|
8
|
+
* destination or its storage** — the connection settings a store hands the
|
|
9
|
+
* broker (`IConnectionConfig`), how that destination renews its credential
|
|
10
|
+
* (`DestinationGrant`), the composition a store saves (`IConfig`), the stores
|
|
11
|
+
* themselves (`ISessionStore`, `IServiceKeyStore`), and the result of
|
|
12
|
+
* authenticating a destination (`ITokenProviderResult`). That is decision 35
|
|
13
|
+
* applied to the second subject `interfaces-auth-sap` 1.x held; decision 41
|
|
14
|
+
* records the split.
|
|
15
|
+
*
|
|
16
|
+
* **Who imports it**: the stores (`@mcp-abap-adt/auth-stores`), the broker,
|
|
17
|
+
* and the servers that build a broker. A token provider, the ABAP connection
|
|
18
|
+
* and the ADT clients take nothing from here — what they take, `ISapConfig` and
|
|
19
|
+
* the UAA client, stayed in `interfaces-auth-sap`.
|
|
20
|
+
*
|
|
21
|
+
* **Depends on `interfaces-auth-sap`, and on nothing else**, for
|
|
22
|
+
* `IAuthorizationConfig` — the UAA client a store returns beside the
|
|
23
|
+
* connection settings. It is imported, not re-exported (decision 34).
|
|
24
|
+
*/
|
|
25
|
+
export type { DestinationGrant } from './auth/DestinationGrant';
|
|
26
|
+
export type { IConfig } from './auth/IConfig';
|
|
27
|
+
export type { IConnectionConfig } from './auth/IConnectionConfig';
|
|
28
|
+
export type { IServiceKeyStore } from './serviceKey/IServiceKeyStore';
|
|
29
|
+
export type { ISessionStore } from './session/ISessionStore';
|
|
30
|
+
export type { ITokenProviderResult } from './token/ITokenProviderResult';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for storing and retrieving service keys
|
|
3
|
+
*
|
|
4
|
+
* Service keys contain UAA credentials and connection URLs.
|
|
5
|
+
*/
|
|
6
|
+
import type { IAuthorizationConfig } from '@mcp-abap-adt/interfaces-auth-sap';
|
|
7
|
+
import type { IConfig } from '../auth/IConfig';
|
|
8
|
+
import type { IConnectionConfig } from '../auth/IConnectionConfig';
|
|
9
|
+
export interface IServiceKeyStore {
|
|
10
|
+
/**
|
|
11
|
+
* Get raw service key for destination
|
|
12
|
+
* @param destination Destination name (e.g., "TRIAL")
|
|
13
|
+
* @returns Service key object (implementation-specific) or null if not found
|
|
14
|
+
*/
|
|
15
|
+
getServiceKey(destination: string): Promise<IConfig | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Get authorization configuration from service key
|
|
18
|
+
* Returns values needed for obtaining and refreshing tokens
|
|
19
|
+
* @param destination Destination name (e.g., "TRIAL")
|
|
20
|
+
* @returns IAuthorizationConfig with actual values or null if not found
|
|
21
|
+
*/
|
|
22
|
+
getAuthorizationConfig(destination: string): Promise<IAuthorizationConfig | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Get connection configuration from service key
|
|
25
|
+
* Returns values needed for connecting to services
|
|
26
|
+
* @param destination Destination name (e.g., "TRIAL")
|
|
27
|
+
* @returns IConnectionConfig with actual values or null if not found
|
|
28
|
+
*/
|
|
29
|
+
getConnectionConfig(destination: string): Promise<IConnectionConfig | null>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=IServiceKeyStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IServiceKeyStore.d.ts","sourceRoot":"","sources":["../../src/serviceKey/IServiceKeyStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,sBAAsB,CACpB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC7E"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for session stores - stores and retrieves session data
|
|
3
|
+
*
|
|
4
|
+
* Session stores handle loading, saving, and managing session data (tokens, configuration).
|
|
5
|
+
*/
|
|
6
|
+
import type { IAuthorizationConfig } from '@mcp-abap-adt/interfaces-auth-sap';
|
|
7
|
+
import type { IConfig } from '../auth/IConfig';
|
|
8
|
+
import type { IConnectionConfig } from '../auth/IConnectionConfig';
|
|
9
|
+
export interface ISessionStore {
|
|
10
|
+
/**
|
|
11
|
+
* Load session configuration for destination
|
|
12
|
+
* Returns optional composition of IAuthorizationConfig and IConnectionConfig
|
|
13
|
+
* Can contain either authorization config, or connection config, or both
|
|
14
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
15
|
+
* @returns IConfig with actual values or null if not found
|
|
16
|
+
*/
|
|
17
|
+
loadSession(destination: string): Promise<IConfig | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Save session configuration for destination
|
|
20
|
+
* Accepts IConfig (optional composition) or internal representation (for backward compatibility)
|
|
21
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
22
|
+
* @param config IConfig or internal session configuration to save
|
|
23
|
+
*/
|
|
24
|
+
saveSession(destination: string, config: IConfig | unknown): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete session for destination (optional)
|
|
27
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
28
|
+
*/
|
|
29
|
+
deleteSession?(destination: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Get authorization configuration with actual values (not file paths)
|
|
32
|
+
* Returns values needed for obtaining and refreshing tokens
|
|
33
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
34
|
+
* @returns IAuthorizationConfig with actual values or null if not found
|
|
35
|
+
*/
|
|
36
|
+
getAuthorizationConfig(destination: string): Promise<IAuthorizationConfig | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Get connection configuration with actual values (not file paths)
|
|
39
|
+
* Returns values needed for connecting to services
|
|
40
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
41
|
+
* @returns IConnectionConfig with actual values or null if not found
|
|
42
|
+
*/
|
|
43
|
+
getConnectionConfig(destination: string): Promise<IConnectionConfig | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Set authorization configuration
|
|
46
|
+
* Updates values needed for obtaining and refreshing tokens
|
|
47
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
48
|
+
* @param config IAuthorizationConfig with values to set
|
|
49
|
+
*/
|
|
50
|
+
setAuthorizationConfig(destination: string, config: IAuthorizationConfig): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Set connection configuration
|
|
53
|
+
* Updates values needed for connecting to services
|
|
54
|
+
* @param destination Destination name (e.g., "TRIAL" or "mcp")
|
|
55
|
+
* @param config IConnectionConfig with values to set
|
|
56
|
+
*/
|
|
57
|
+
setConnectionConfig(destination: string, config: IConnectionConfig): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=ISessionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionStore.d.ts","sourceRoot":"","sources":["../../src/session/ISessionStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E;;;OAGG;IACH,aAAa,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,sBAAsB,CACpB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAExC;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAE5E;;;;;OAKG;IACH,sBAAsB,CACpB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,mBAAmB,CACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result from token provider
|
|
3
|
+
*/
|
|
4
|
+
import type { IConnectionConfig } from '../auth/IConnectionConfig';
|
|
5
|
+
/** Nothing imports this yet; it sits with the session and token contracts it belongs to. */
|
|
6
|
+
export interface ITokenProviderResult {
|
|
7
|
+
/** Connection configuration with authorization token */
|
|
8
|
+
connectionConfig: IConnectionConfig;
|
|
9
|
+
/** Refresh token (optional, for BTP/ABAP) */
|
|
10
|
+
refreshToken?: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ITokenProviderResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITokenProviderResult.d.ts","sourceRoot":"","sources":["../../src/token/ITokenProviderResult.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,4FAA4F;AAC5F,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcp-abap-adt/interfaces-auth-broker",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The broker's port: the destination (IConnectionConfig, DestinationGrant, IConfig) and the stores that hold it",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"COPYING"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"author": "Oleksii Kyslytsia <oleksij.kyslytsja@gmail.com>",
|
|
16
|
+
"license": "LGPL-3.0-only",
|
|
17
|
+
"homepage": "https://github.com/fr0ster/mcp-abap-adt-interfaces/tree/master/packages/interfaces-auth-broker#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/fr0ster/mcp-abap-adt-interfaces/issues"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/fr0ster/mcp-abap-adt-interfaces.git",
|
|
24
|
+
"directory": "packages/interfaces-auth-broker"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo",
|
|
31
|
+
"build": "tsc -b tsconfig.build.json",
|
|
32
|
+
"test:check": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"prepublishOnly": "npm run --prefix ../.. check"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.0.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@mcp-abap-adt/interfaces-auth-sap": "^2.0.0"
|
|
40
|
+
}
|
|
41
|
+
}
|