@mcp-abap-adt/auth-providers 2.0.0 → 2.2.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 +38 -0
- package/COPYING +674 -0
- package/LICENSE +160 -17
- package/README.md +31 -7
- package/dist/__tests__/helpers/testLogger.d.ts +1 -1
- package/dist/__tests__/helpers/testLogger.d.ts.map +1 -1
- package/dist/auth/announce.d.ts +1 -1
- package/dist/auth/announce.d.ts.map +1 -1
- package/dist/auth/browserAuth.d.ts +2 -1
- package/dist/auth/browserAuth.d.ts.map +1 -1
- package/dist/auth/callbackServer.d.ts +1 -1
- package/dist/auth/callbackServer.d.ts.map +1 -1
- package/dist/auth/deviceFlowAuth.d.ts +1 -1
- package/dist/auth/deviceFlowAuth.d.ts.map +1 -1
- package/dist/auth/oidcBrowserAuth.d.ts +1 -1
- package/dist/auth/oidcBrowserAuth.d.ts.map +1 -1
- package/dist/auth/oidcDiscovery.d.ts +1 -1
- package/dist/auth/oidcDiscovery.d.ts.map +1 -1
- package/dist/auth/oidcToken.d.ts +1 -1
- package/dist/auth/oidcToken.d.ts.map +1 -1
- package/dist/auth/saml2Auth.d.ts +1 -1
- package/dist/auth/saml2Auth.d.ts.map +1 -1
- package/dist/auth/saml2TokenExchange.d.ts +1 -1
- package/dist/auth/saml2TokenExchange.d.ts.map +1 -1
- package/dist/errors/TokenProviderErrors.js +6 -6
- package/dist/providers/AuthorizationCodeProvider.d.ts +2 -1
- package/dist/providers/AuthorizationCodeProvider.d.ts.map +1 -1
- package/dist/providers/AuthorizationCodeProvider.js +4 -4
- package/dist/providers/BaseTokenProvider.d.ts +2 -1
- package/dist/providers/BaseTokenProvider.d.ts.map +1 -1
- package/dist/providers/ClientCredentialsProvider.d.ts +1 -1
- package/dist/providers/ClientCredentialsProvider.d.ts.map +1 -1
- package/dist/providers/ClientCredentialsProvider.js +3 -3
- package/dist/providers/DeviceFlowProvider.d.ts +2 -1
- package/dist/providers/DeviceFlowProvider.d.ts.map +1 -1
- package/dist/providers/DeviceFlowProvider.js +4 -4
- package/dist/providers/OidcBrowserProvider.d.ts +2 -1
- package/dist/providers/OidcBrowserProvider.d.ts.map +1 -1
- package/dist/providers/OidcBrowserProvider.js +4 -4
- package/dist/providers/OidcDeviceFlowProvider.d.ts +2 -1
- package/dist/providers/OidcDeviceFlowProvider.d.ts.map +1 -1
- package/dist/providers/OidcDeviceFlowProvider.js +4 -4
- package/dist/providers/OidcPasswordProvider.d.ts +2 -1
- package/dist/providers/OidcPasswordProvider.d.ts.map +1 -1
- package/dist/providers/OidcPasswordProvider.js +4 -4
- package/dist/providers/OidcTokenExchangeProvider.d.ts +2 -1
- package/dist/providers/OidcTokenExchangeProvider.d.ts.map +1 -1
- package/dist/providers/OidcTokenExchangeProvider.js +3 -3
- package/dist/providers/Saml2BearerProvider.d.ts +2 -1
- package/dist/providers/Saml2BearerProvider.d.ts.map +1 -1
- package/dist/providers/Saml2BearerProvider.js +3 -3
- package/dist/providers/Saml2PureProvider.d.ts +2 -1
- package/dist/providers/Saml2PureProvider.d.ts.map +1 -1
- package/dist/providers/Saml2PureProvider.js +3 -3
- package/dist/providers/saml2Utils.d.ts +2 -1
- package/dist/providers/saml2Utils.d.ts.map +1 -1
- package/dist/sso/SsoProviderFactory.d.ts +1 -1
- package/dist/sso/SsoProviderFactory.d.ts.map +1 -1
- package/dist/sso/types.d.ts +1 -1
- package/dist/sso/types.d.ts.map +1 -1
- package/dist/strategies/BrowserCallbackStrategy.d.ts +1 -1
- package/dist/strategies/BrowserCallbackStrategy.d.ts.map +1 -1
- package/dist/strategies/asOidcResult.d.ts +1 -1
- package/dist/strategies/asOidcResult.d.ts.map +1 -1
- package/dist/strategies/codeStrategies.d.ts +1 -1
- package/dist/strategies/codeStrategies.d.ts.map +1 -1
- package/dist/strategies/manualStrategies.d.ts +1 -1
- package/dist/strategies/manualStrategies.d.ts.map +1 -1
- package/package.json +8 -5
package/LICENSE
CHANGED
|
@@ -1,22 +1,165 @@
|
|
|
1
|
-
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
2
3
|
|
|
3
|
-
Copyright (
|
|
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.
|
|
4
7
|
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
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.
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
13
|
+
0. Additional Definitions.
|
|
22
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
CHANGED
|
@@ -13,7 +13,7 @@ npm install @mcp-abap-adt/auth-providers
|
|
|
13
13
|
|
|
14
14
|
## Overview
|
|
15
15
|
|
|
16
|
-
This package implements the `ITokenProvider` interface from `@mcp-abap-adt/interfaces`:
|
|
16
|
+
This package implements the `ITokenProvider` interface from `@mcp-abap-adt/interfaces-auth`:
|
|
17
17
|
|
|
18
18
|
- **AuthorizationCodeProvider** - Uses browser-based OAuth2 authorization code flow (user token)
|
|
19
19
|
- **ClientCredentialsProvider** - Uses `client_credentials` grant type (no browser required)
|
|
@@ -21,7 +21,7 @@ This package implements the `ITokenProvider` interface from `@mcp-abap-adt/inter
|
|
|
21
21
|
Providers are configured via constructor; `getTokens()` takes no parameters and handles refresh/login internally.
|
|
22
22
|
|
|
23
23
|
Since 2.0.0 an interactive login is conducted by an **authorization strategy**
|
|
24
|
-
(`IAuthorizationStrategy` from `@mcp-abap-adt/interfaces`) passed as
|
|
24
|
+
(`IAuthorizationStrategy` from `@mcp-abap-adt/interfaces-auth`) passed as
|
|
25
25
|
`authorization`. The provider owns what it can compute — the authorization URL
|
|
26
26
|
and the token exchange; everything between them (reaching the URL, receiving
|
|
27
27
|
what comes back, the port, the timeout) belongs to the strategy, which a
|
|
@@ -51,7 +51,7 @@ This principle ensures:
|
|
|
51
51
|
|
|
52
52
|
This package is responsible for:
|
|
53
53
|
|
|
54
|
-
1. **Implementing token provider interface**: Provides concrete implementations of `ITokenProvider` interface defined in `@mcp-abap-adt/interfaces`
|
|
54
|
+
1. **Implementing token provider interface**: Provides concrete implementations of `ITokenProvider` interface defined in `@mcp-abap-adt/interfaces-auth`
|
|
55
55
|
2. **Token acquisition**: Handles OAuth2 flows (browser-based, refresh token, client credentials) to obtain JWT tokens
|
|
56
56
|
3. **Token validation**: Validates JWT locally by checking exp claim (no HTTP requests)
|
|
57
57
|
4. **OAuth2 flows**: Manages browser-based OAuth2 authorization code flow and refresh token flow
|
|
@@ -174,7 +174,7 @@ const strategy = new BrowserCallbackStrategy<MyPayload>({
|
|
|
174
174
|
#### Bringing your own
|
|
175
175
|
|
|
176
176
|
```typescript
|
|
177
|
-
import type { IAuthorizationStrategy } from '@mcp-abap-adt/interfaces';
|
|
177
|
+
import type { IAuthorizationStrategy } from '@mcp-abap-adt/interfaces-auth';
|
|
178
178
|
|
|
179
179
|
const fromOurPortal: IAuthorizationStrategy<string> = {
|
|
180
180
|
async authorize(request) {
|
|
@@ -671,7 +671,7 @@ try {
|
|
|
671
671
|
- `ServiceKeyError` - Service key data invalid, includes `missingFields: string[]`
|
|
672
672
|
- `BrowserAuthError` - Browser auth failed, includes `cause?: Error`
|
|
673
673
|
|
|
674
|
-
All error codes are defined in `@mcp-abap-adt/interfaces` package as `TOKEN_PROVIDER_ERROR_CODES`.
|
|
674
|
+
All error codes are defined in `@mcp-abap-adt/interfaces-auth` package as `TOKEN_PROVIDER_ERROR_CODES`.
|
|
675
675
|
|
|
676
676
|
## Migrating from 1.x to 2.0
|
|
677
677
|
|
|
@@ -858,7 +858,9 @@ Example output:
|
|
|
858
858
|
|
|
859
859
|
## Dependencies
|
|
860
860
|
|
|
861
|
-
- `@mcp-abap-adt/interfaces` (^
|
|
861
|
+
- `@mcp-abap-adt/interfaces-auth` (^1.2.0) - Token provider and authorization contracts (`ITokenProvider`, `IAuthorizationStrategy`, `CallbackServerFactory`) and error code constants
|
|
862
|
+
- `@mcp-abap-adt/interfaces-auth-sap` (^1.0.0) - XSUAA authorization configuration (`IAuthorizationConfig`)
|
|
863
|
+
- `@mcp-abap-adt/interfaces-utils` (^1.1.0) - `ILogger`
|
|
862
864
|
- `axios` - HTTP client
|
|
863
865
|
- `express` - OAuth2 callback server
|
|
864
866
|
- `open` - Browser opening utility
|
|
@@ -867,4 +869,26 @@ Requires Node.js `>=18.2.0`.
|
|
|
867
869
|
|
|
868
870
|
## License
|
|
869
871
|
|
|
870
|
-
|
|
872
|
+
**GNU Lesser General Public License v3.0 only** (`LGPL-3.0-only`).
|
|
873
|
+
Earlier published versions were MIT and stay MIT — a licence change is not
|
|
874
|
+
retroactive.
|
|
875
|
+
|
|
876
|
+
Copyright © 2025–2026 Oleksii Kyslytsia
|
|
877
|
+
|
|
878
|
+
This library is free software: you can redistribute it and/or modify it under the
|
|
879
|
+
terms of the GNU Lesser General Public License as published by the Free Software
|
|
880
|
+
Foundation, version 3.
|
|
881
|
+
|
|
882
|
+
It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
883
|
+
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
884
|
+
PURPOSE. See the GNU Lesser General Public License for more details.
|
|
885
|
+
|
|
886
|
+
Both texts ship with the package and both are needed: [`LICENSE`](LICENSE) is the
|
|
887
|
+
LGPL, [`COPYING`](COPYING) is the GPL it is written on top of, since the LGPL is a
|
|
888
|
+
set of additional permissions over the GPL and cannot be read alone.
|
|
889
|
+
|
|
890
|
+
**What this means if you depend on this package.** Linking it into your own
|
|
891
|
+
program — importing it, as every consumer of an npm package does — does not put
|
|
892
|
+
your program under the LGPL. What the licence asks is that changes *to this
|
|
893
|
+
library* stay free, and that your users can replace it with their own build.
|
|
894
|
+
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Test logger with environment variable control
|
|
3
3
|
* Uses DefaultLogger from @mcp-abap-adt/logger for proper formatting
|
|
4
4
|
*/
|
|
5
|
-
import type { ILogger } from '@mcp-abap-adt/interfaces';
|
|
5
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
6
6
|
export declare function createTestLogger(prefix?: string): ILogger;
|
|
7
7
|
//# sourceMappingURL=testLogger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testLogger.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/testLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"testLogger.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/testLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAG9D,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,MAAe,GAAG,OAAO,CAwCjE"}
|
package/dist/auth/announce.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* logger. They must equally never reach stdout, which carries protocol traffic
|
|
7
7
|
* under an MCP or LSP stdio transport.
|
|
8
8
|
*/
|
|
9
|
-
import type { ILogger } from '@mcp-abap-adt/interfaces';
|
|
9
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
10
10
|
export declare function announcer(logger?: ILogger): (msg: string) => void;
|
|
11
11
|
//# sourceMappingURL=announce.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announce.d.ts","sourceRoot":"","sources":["../../src/auth/announce.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"announce.d.ts","sourceRoot":"","sources":["../../src/auth/announce.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAKjE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Browser authentication - OAuth2 flow for obtaining tokens
|
|
3
3
|
*/
|
|
4
|
-
import type { IAuthorizationConfig
|
|
4
|
+
import type { IAuthorizationConfig } from '@mcp-abap-adt/interfaces-auth-sap';
|
|
5
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
5
6
|
/**
|
|
6
7
|
* Extract an OAuth2 authorization code from arbitrary pasted input.
|
|
7
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserAuth.d.ts","sourceRoot":"","sources":["../../src/auth/browserAuth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"browserAuth.d.ts","sourceRoot":"","sources":["../../src/auth/browserAuth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAa9D;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBxD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,oBAAoB,EAChC,WAAW,EAAE,MAAM,GAClB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,oBAAoB,EAChC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,GAAG,CAAC,EAAE,OAAO,GAAG,IAAI,GACnB,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA+CzD;AAeD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC/B,GAAG,EAAE,OAAO,GAAG,IAAI;AACnB;;;;;GAKG;AACH,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAiGf"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* See `docs/superpowers/specs/2026-07-28-callback-server-contract-design.md`.
|
|
10
10
|
*/
|
|
11
|
-
import type { CallbackServerFactory, ICallbackServerHandle, ICallbackServerOptions } from '@mcp-abap-adt/interfaces';
|
|
11
|
+
import type { CallbackServerFactory, ICallbackServerHandle, ICallbackServerOptions } from '@mcp-abap-adt/interfaces-auth';
|
|
12
12
|
import express from 'express';
|
|
13
13
|
/**
|
|
14
14
|
* How a route reports an outcome. Settling is deferred until the response has
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbackServer.d.ts","sourceRoot":"","sources":["../../src/auth/callbackServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"callbackServer.d.ts","sourceRoot":"","sources":["../../src/auth/callbackServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,OAAO,MAAM,SAAS,CAAC;AAS9B;;;;GAIG;AACH,MAAM,WAAW,MAAM,CAAC,OAAO;IAC7B,yEAAyE;IACzE,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjD,uDAAuD;IACvD,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAChD;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,CAChC,GAAG,EAAE,OAAO,CAAC,OAAO,EACpB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KACpB,IAAI,CAAC;AAqBV;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EACrD,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,EAC3B,GAAG,EAAE,CAAC,MAAM,EAAE,qBAAqB,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GAChE,OAAO,CAAC,OAAO,CAAC,CAqMlB;AAyCD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,qBAAqB,CAAC,MAAM,CA4DjE,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* OAuth2 Device Flow for devices without browser or input capabilities.
|
|
5
5
|
* User authorizes on another device by entering a code.
|
|
6
6
|
*/
|
|
7
|
-
import type { ILogger } from '@mcp-abap-adt/interfaces';
|
|
7
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
8
8
|
export interface DeviceFlowResult {
|
|
9
9
|
deviceCode: string;
|
|
10
10
|
userCode: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceFlowAuth.d.ts","sourceRoot":"","sources":["../../src/auth/deviceFlowAuth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"deviceFlowAuth.d.ts","sourceRoot":"","sources":["../../src/auth/deviceFlowAuth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAG9D,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC,CA4D3B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAU,EACpB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC,CAoG3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OIDC browser authorization code flow (capture code)
|
|
3
3
|
*/
|
|
4
|
-
import type { CallbackServerFactory } from '@mcp-abap-adt/interfaces';
|
|
4
|
+
import type { CallbackServerFactory } from '@mcp-abap-adt/interfaces-auth';
|
|
5
5
|
export interface OidcCallbackResult {
|
|
6
6
|
code: string;
|
|
7
7
|
state?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidcBrowserAuth.d.ts","sourceRoot":"","sources":["../../src/auth/oidcBrowserAuth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,
|
|
1
|
+
{"version":3,"file":"oidcBrowserAuth.d.ts","sourceRoot":"","sources":["../../src/auth/oidcBrowserAuth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,+BAA+B,CAAC;AAGvC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,sBAAsB,EAAE,qBAAqB,CACxD,kBAAkB,CA6CjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidcDiscovery.d.ts","sourceRoot":"","sources":["../../src/auth/oidcDiscovery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"oidcDiscovery.d.ts","sourceRoot":"","sources":["../../src/auth/oidcDiscovery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAG9D,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAWD,wBAAsB,YAAY,CAChC,oBAAoB,EAAE,MAAM,EAC5B,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,qBAAqB,CAAC,CAkBhC"}
|
package/dist/auth/oidcToken.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidcToken.d.ts","sourceRoot":"","sources":["../../src/auth/oidcToken.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"oidcToken.d.ts","sourceRoot":"","sources":["../../src/auth/oidcToken.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAG9D,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6BD,wBAAsB,yBAAyB,CAC7C,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CAoB5B;AAED,wBAAsB,gBAAgB,CACpC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CAgB5B;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,2BAA2B,CAC/C,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,0BAA0B,CAAC,CA0BrC;AAED,wBAAsB,gBAAgB,CACpC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAU,EACpB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CA8B5B;AAED,wBAAsB,aAAa,CACjC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CA6B5B;AAED,wBAAsB,aAAa,CACjC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,UAAU,CAAC,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CAgC5B"}
|
package/dist/auth/saml2Auth.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saml2Auth.d.ts","sourceRoot":"","sources":["../../src/auth/saml2Auth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,
|
|
1
|
+
{"version":3,"file":"saml2Auth.d.ts","sourceRoot":"","sources":["../../src/auth/saml2Auth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EACV,qBAAqB,EAGtB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAyBD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAazE;AAED,eAAO,MAAM,sBAAsB,EAAE,qBAAqB,CAAC,MAAM,CAgC9D,CAAC;AAEJ,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,GACnB,MAAM,GAAG,SAAS,CAYpB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SAML 2.0 bearer assertion exchange
|
|
3
3
|
*/
|
|
4
|
-
import type { ILogger } from '@mcp-abap-adt/interfaces';
|
|
4
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
5
5
|
export interface Saml2TokenExchangeResponse {
|
|
6
6
|
accessToken: string;
|
|
7
7
|
refreshToken?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saml2TokenExchange.d.ts","sourceRoot":"","sources":["../../src/auth/saml2TokenExchange.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"saml2TokenExchange.d.ts","sourceRoot":"","sources":["../../src/auth/saml2TokenExchange.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAG9D,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,0BAA0B,CAAC,CAwCrC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.BrowserAuthError = exports.ServiceKeyError = exports.SessionDataError = exports.RefreshError = exports.ValidationError = exports.TokenProviderError = void 0;
|
|
10
|
-
const
|
|
10
|
+
const interfaces_auth_1 = require("@mcp-abap-adt/interfaces-auth");
|
|
11
11
|
/**
|
|
12
12
|
* Base class for all token provider errors
|
|
13
13
|
*/
|
|
@@ -27,7 +27,7 @@ exports.TokenProviderError = TokenProviderError;
|
|
|
27
27
|
class ValidationError extends TokenProviderError {
|
|
28
28
|
missingFields;
|
|
29
29
|
constructor(message, missingFields) {
|
|
30
|
-
super(message,
|
|
30
|
+
super(message, interfaces_auth_1.TOKEN_PROVIDER_ERROR_CODES.VALIDATION_ERROR);
|
|
31
31
|
this.missingFields = missingFields;
|
|
32
32
|
this.name = 'ValidationError';
|
|
33
33
|
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
@@ -40,7 +40,7 @@ exports.ValidationError = ValidationError;
|
|
|
40
40
|
class RefreshError extends TokenProviderError {
|
|
41
41
|
cause;
|
|
42
42
|
constructor(message, cause) {
|
|
43
|
-
super(message,
|
|
43
|
+
super(message, interfaces_auth_1.TOKEN_PROVIDER_ERROR_CODES.REFRESH_ERROR);
|
|
44
44
|
this.cause = cause;
|
|
45
45
|
this.name = 'RefreshError';
|
|
46
46
|
Object.setPrototypeOf(this, RefreshError.prototype);
|
|
@@ -53,7 +53,7 @@ exports.RefreshError = RefreshError;
|
|
|
53
53
|
class SessionDataError extends TokenProviderError {
|
|
54
54
|
missingFields;
|
|
55
55
|
constructor(message, missingFields) {
|
|
56
|
-
super(message,
|
|
56
|
+
super(message, interfaces_auth_1.TOKEN_PROVIDER_ERROR_CODES.SESSION_DATA_ERROR);
|
|
57
57
|
this.missingFields = missingFields;
|
|
58
58
|
this.name = 'SessionDataError';
|
|
59
59
|
Object.setPrototypeOf(this, SessionDataError.prototype);
|
|
@@ -66,7 +66,7 @@ exports.SessionDataError = SessionDataError;
|
|
|
66
66
|
class ServiceKeyError extends TokenProviderError {
|
|
67
67
|
missingFields;
|
|
68
68
|
constructor(message, missingFields) {
|
|
69
|
-
super(message,
|
|
69
|
+
super(message, interfaces_auth_1.TOKEN_PROVIDER_ERROR_CODES.SERVICE_KEY_ERROR);
|
|
70
70
|
this.missingFields = missingFields;
|
|
71
71
|
this.name = 'ServiceKeyError';
|
|
72
72
|
Object.setPrototypeOf(this, ServiceKeyError.prototype);
|
|
@@ -79,7 +79,7 @@ exports.ServiceKeyError = ServiceKeyError;
|
|
|
79
79
|
class BrowserAuthError extends TokenProviderError {
|
|
80
80
|
cause;
|
|
81
81
|
constructor(message, cause) {
|
|
82
|
-
super(message,
|
|
82
|
+
super(message, interfaces_auth_1.TOKEN_PROVIDER_ERROR_CODES.BROWSER_AUTH_ERROR);
|
|
83
83
|
this.cause = cause;
|
|
84
84
|
this.name = 'BrowserAuthError';
|
|
85
85
|
Object.setPrototypeOf(this, BrowserAuthError.prototype);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Uses authorization_code grant type with browser-based OAuth2 flow.
|
|
5
5
|
* Supports pre-built authorization URLs and automatic refresh.
|
|
6
6
|
*/
|
|
7
|
-
import type { IAuthorizationStrategy,
|
|
7
|
+
import type { IAuthorizationStrategy, ITokenResult, OAuth2GrantType } from '@mcp-abap-adt/interfaces-auth';
|
|
8
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
8
9
|
import { BaseTokenProvider } from './BaseTokenProvider';
|
|
9
10
|
export interface AuthorizationCodeProviderConfig {
|
|
10
11
|
uaaUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationCodeProvider.d.ts","sourceRoot":"","sources":["../../src/providers/AuthorizationCodeProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AuthorizationCodeProvider.d.ts","sourceRoot":"","sources":["../../src/providers/AuthorizationCodeProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,eAAe,EAChB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAO9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,+BAA+B;IAE9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IAErB,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAG/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB;IAC9D,OAAO,CAAC,MAAM,CAAkC;gBAEpC,MAAM,EAAE,+BAA+B;IA4D7C,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IAIxC,SAAS,CAAC,WAAW,IAAI,eAAe;cAIxB,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC;cA+ErC,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;CA0CxD"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.AuthorizationCodeProvider = void 0;
|
|
10
|
-
const
|
|
10
|
+
const interfaces_auth_1 = require("@mcp-abap-adt/interfaces-auth");
|
|
11
11
|
const browserAuth_1 = require("../auth/browserAuth");
|
|
12
12
|
const tokenRefresher_1 = require("../auth/tokenRefresher");
|
|
13
13
|
const strategies_1 = require("../strategies");
|
|
@@ -72,7 +72,7 @@ class AuthorizationCodeProvider extends BaseTokenProvider_1.BaseTokenProvider {
|
|
|
72
72
|
return super.getTokens();
|
|
73
73
|
}
|
|
74
74
|
getAuthType() {
|
|
75
|
-
return
|
|
75
|
+
return interfaces_auth_1.AUTH_TYPE_AUTHORIZATION_CODE;
|
|
76
76
|
}
|
|
77
77
|
async performLogin() {
|
|
78
78
|
const authConfig = {
|
|
@@ -134,7 +134,7 @@ class AuthorizationCodeProvider extends BaseTokenProvider_1.BaseTokenProvider {
|
|
|
134
134
|
return {
|
|
135
135
|
authorizationToken: result.accessToken,
|
|
136
136
|
refreshToken: result.refreshToken,
|
|
137
|
-
authType:
|
|
137
|
+
authType: interfaces_auth_1.AUTH_TYPE_AUTHORIZATION_CODE,
|
|
138
138
|
expiresIn: this.calculateExpiresIn(result.accessToken),
|
|
139
139
|
};
|
|
140
140
|
}
|
|
@@ -157,7 +157,7 @@ class AuthorizationCodeProvider extends BaseTokenProvider_1.BaseTokenProvider {
|
|
|
157
157
|
return {
|
|
158
158
|
authorizationToken: result.accessToken,
|
|
159
159
|
refreshToken: result.refreshToken || this.refreshToken, // Keep old if new not provided
|
|
160
|
-
authType:
|
|
160
|
+
authType: interfaces_auth_1.AUTH_TYPE_AUTHORIZATION_CODE,
|
|
161
161
|
expiresIn,
|
|
162
162
|
};
|
|
163
163
|
}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* - Expiration checking
|
|
8
8
|
* - Automatic refresh/relogin
|
|
9
9
|
*/
|
|
10
|
-
import type {
|
|
10
|
+
import type { ITokenProvider, ITokenResult, OAuth2GrantType } from '@mcp-abap-adt/interfaces-auth';
|
|
11
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
11
12
|
/**
|
|
12
13
|
* Abstract base class for token providers
|
|
13
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTokenProvider.d.ts","sourceRoot":"","sources":["../../src/providers/BaseTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"BaseTokenProvider.d.ts","sourceRoot":"","sources":["../../src/providers/BaseTokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,eAAe,EAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D;;;;;;;;GAQG;AACH,8BAAsB,iBAAkB,YAAW,cAAc;IAC/D,SAAS,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IAChD,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAWzD;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMzD;;;OAGG;IACH,SAAS,CAAC,YAAY,IAAI,OAAO;IAyBjC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC;IAExD;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;IAE1D;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,IAAI,eAAe;IAEjD;;;;;;;;OAQG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IAyElC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoC3E;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IA0BlD;;;;OAIG;IACH,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IA0BnE;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAShE"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Uses client_credentials grant type for service-to-service authentication.
|
|
5
5
|
* No browser required, no refresh token provided.
|
|
6
6
|
*/
|
|
7
|
-
import type { ITokenResult, OAuth2GrantType } from '@mcp-abap-adt/interfaces';
|
|
7
|
+
import type { ITokenResult, OAuth2GrantType } from '@mcp-abap-adt/interfaces-auth';
|
|
8
8
|
import { BaseTokenProvider } from './BaseTokenProvider';
|
|
9
9
|
export interface ClientCredentialsProviderConfig {
|
|
10
10
|
uaaUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientCredentialsProvider.d.ts","sourceRoot":"","sources":["../../src/providers/ClientCredentialsProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ClientCredentialsProvider.d.ts","sourceRoot":"","sources":["../../src/providers/ClientCredentialsProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB;IAC9D,OAAO,CAAC,MAAM,CAAkC;gBAEpC,MAAM,EAAE,+BAA+B;IAuB7C,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IAIxC,SAAS,CAAC,WAAW,IAAI,eAAe;cAIxB,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC;cAerC,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;CAIxD"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ClientCredentialsProvider = void 0;
|
|
10
|
-
const
|
|
10
|
+
const interfaces_auth_1 = require("@mcp-abap-adt/interfaces-auth");
|
|
11
11
|
const clientCredentialsAuth_1 = require("../auth/clientCredentialsAuth");
|
|
12
12
|
const BaseTokenProvider_1 = require("./BaseTokenProvider");
|
|
13
13
|
/**
|
|
@@ -42,14 +42,14 @@ class ClientCredentialsProvider extends BaseTokenProvider_1.BaseTokenProvider {
|
|
|
42
42
|
return super.getTokens();
|
|
43
43
|
}
|
|
44
44
|
getAuthType() {
|
|
45
|
-
return
|
|
45
|
+
return interfaces_auth_1.AUTH_TYPE_CLIENT_CREDENTIALS;
|
|
46
46
|
}
|
|
47
47
|
async performLogin() {
|
|
48
48
|
const result = await (0, clientCredentialsAuth_1.getTokenWithClientCredentials)(this.config.uaaUrl, this.config.clientId, this.config.clientSecret);
|
|
49
49
|
return {
|
|
50
50
|
authorizationToken: result.accessToken,
|
|
51
51
|
refreshToken: undefined, // client_credentials doesn't provide refresh token
|
|
52
|
-
authType:
|
|
52
|
+
authType: interfaces_auth_1.AUTH_TYPE_CLIENT_CREDENTIALS,
|
|
53
53
|
expiresIn: result.expiresIn,
|
|
54
54
|
};
|
|
55
55
|
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Uses OAuth2 Device Flow for devices without browser or input capabilities.
|
|
5
5
|
* User authorizes on another device by entering a code.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { ITokenResult, OAuth2GrantType } from '@mcp-abap-adt/interfaces-auth';
|
|
8
|
+
import type { ILogger } from '@mcp-abap-adt/interfaces-utils';
|
|
8
9
|
import { BaseTokenProvider } from './BaseTokenProvider';
|
|
9
10
|
export interface DeviceFlowProviderConfig {
|
|
10
11
|
uaaUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceFlowProvider.d.ts","sourceRoot":"","sources":["../../src/providers/DeviceFlowProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"DeviceFlowProvider.d.ts","sourceRoot":"","sources":["../../src/providers/DeviceFlowProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAO9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,OAAO,CAAC,MAAM,CAA2B;gBAE7B,MAAM,EAAE,wBAAwB;IAc5C,SAAS,CAAC,WAAW,IAAI,eAAe;cAOxB,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC;cAyCrC,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;CA2BxD"}
|