@mcp-abap-adt/auth-broker 1.0.8 → 2.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/CHANGELOG.md CHANGED
@@ -11,6 +11,110 @@ Thank you to all contributors! See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the co
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [2.1.0] - 2026-09-03
15
+
16
+ ### Licence
17
+
18
+ - **This package is now `LGPL-3.0-only`.** It was MIT up to and including 2.0.0, and
19
+ those versions stay MIT — a licence change is not retroactive, and anyone
20
+ already using 2.0.0 under MIT keeps that grant for 2.0.0.
21
+
22
+ The library licence of the GNU family, chosen for what it does *not* ask:
23
+ linking it into your own program — importing it, as every consumer of an npm
24
+ package does — does not put your program under the LGPL. What it asks is that
25
+ changes to this library stay free and that your users can substitute their own
26
+ build of it.
27
+
28
+ Both texts ship in the package: `LICENSE` is the LGPL, `COPYING` is the GPL it
29
+ is written on top of. The LGPL is a set of additional permissions over the GPL,
30
+ so it cannot be read without both.
31
+
32
+ Copyright © 2025–2026 Oleksii Kyslytsia.
33
+
34
+
35
+ ## [2.0.0] - 2026-08-02
36
+
37
+ ### Breaking Changes
38
+
39
+ **⚠️ The default OAuth callback port for `mcp-auth` and `mcp-sso` moves from `3001` to
40
+ whatever `@mcp-abap-adt/auth-providers` supplies (currently `61001`).** `3001` was never a
41
+ default this package chose: neither CLI listens on a port of its own — `auth-broker` is a
42
+ library plus these two CLIs, not a server — so `3001` only ever arrived by accident, carried in
43
+ from inside the token-provider library's old internal default. That default was itself moved,
44
+ deliberately, in `auth-providers` 2.0.0, to sit above the ephemeral port range and clear of the
45
+ `3001`/`3333` range application servers and proxies typically use. **If you registered
46
+ `http://localhost:3001/callback` (or any other specific port) with your identity provider, pass
47
+ `--redirect-port <that-port>` explicitly from now on** — omitting it no longer lands on `3001`.
48
+
49
+ - Requires `@mcp-abap-adt/auth-providers` `^2.0.0` (was `^1.2.0`). Every provider config's
50
+ `browser`/`redirectPort` fields are gone; how a login is conducted is now an
51
+ `IAuthorizationStrategy` passed as `authorization`. `AuthBroker` itself never imported those
52
+ fields — the exposure was entirely in the `mcp-auth`/`mcp-sso` CLIs and
53
+ `generate-env-from-service-key` (`bin/`), which construct providers directly.
54
+
55
+ ### Changed
56
+ - **`mcp-auth`, `mcp-sso`, `npm run generate-env`**: every browser-opening flow (`mcp-auth`'s
57
+ default `authorization_code` flow, `mcp-sso oidc --flow browser`, `mcp-sso saml2`/`bearer`
58
+ with the default browser assertion flow) now routes `--browser` and `--redirect-port` into
59
+ `browserCallbackStrategy` / `oidcCallbackStrategy` / `samlCallbackStrategy` instead of a
60
+ removed provider field. `--redirect-port` still overrides the port when given; see Breaking
61
+ Changes above for what happens when it is omitted.
62
+
63
+ - **Login timeout for these three CLIs raised from 30s to 5 minutes.** 30s was the token
64
+ provider's own default, sized for an unattended caller. These CLIs hand the login to a person
65
+ at a keyboard, who needs time to reach the browser, authenticate — possibly through SSO/MFA —
66
+ and get redirected back.
67
+
68
+ - `mcp-sso oidc --flow browser --code <value>`: manual/OOB code paste now goes through the
69
+ library's `staticCodeStrategy` (adapted with `asOidcResult`) instead of a removed
70
+ `authorizationCode` field. Behaviour for this combination is unchanged.
71
+
72
+ - `--redirect-uri` now only takes effect on the manual/static (OOB) code path. Combining it
73
+ with the listening browser flow is no longer meaningful: the local callback server always
74
+ derives its own redirect URI from `--redirect-port`.
75
+
76
+ - OIDC `device`/`password`/`token_exchange` flows never accepted `--browser`/`--redirect-port`
77
+ in the underlying library, before or after this change — `mcp-sso` was building them into the
78
+ config regardless, where they were silently ignored (masked by a cast, see below). They are
79
+ no longer passed at all; passing them for these flows now has visibly no effect, same as it
80
+ always did.
81
+
82
+ - `mcp-sso`'s per-flow config builders now construct the real `@mcp-abap-adt/auth-providers`
83
+ config types directly (`OidcBrowserProviderConfig`, `Saml2BearerProviderConfig`, etc.)
84
+ instead of building an untyped bag and force-casting it with `as unknown as X`. That cast is
85
+ exactly what let the `browser`/`redirectPort` regression above compile silently. Required
86
+ fields (`--client-id`, `--idp-sso-url`, `--sp-entity-id`, `--subject-token`,
87
+ `--username`/`--password`) are now checked and reported per flow instead of reaching the
88
+ provider as `undefined` behind the cast.
89
+
90
+ ### Fixed
91
+ - **`mcp-sso --config <path.json>` now reaches the strategy-building code at all.** Until this
92
+ fix, `buildProviderConfig` only built a config when `--protocol`/`--flow` were given on the
93
+ command line; a run driven by `--config` alone (the documented, supported way to use this flag)
94
+ left the file's fields completely untouched, and they reached `SsoProviderFactory.create()`
95
+ exactly as written — including a `browser`, `redirectPort`, `authorizationCode`, or
96
+ `assertionFlow` a 2.0.0 provider no longer accepts directly, with no error and no warning. The
97
+ merge between the file and CLI flags now happens once, before any validation or strategy
98
+ building, so `--config` alone, `--protocol`/`--flow` alone, and any combination of the two all
99
+ go through the same code. `--protocol`/`--flow`/CLI option flags still override the
100
+ corresponding value from the file. Every field a pre-2.0.0 config could carry either converts
101
+ onto the strategy (`browser`, `redirectPort`, `authorizationCode`, `assertionFlow`) or the run
102
+ is refused with a message naming the replacement (`authorizationCodeProvider`,
103
+ `assertionProvider`, `manualInput` — all function-valued, so a JSON file could never carry a
104
+ working one regardless).
105
+ - Relatedly, required-field validation (`--client-id`, `--idp-sso-url`, etc.) now runs against
106
+ the *merged* result. Previously it ran only against CLI options before the file was merged in,
107
+ so `--config file-with-credentials.json --protocol oidc --flow browser --redirect-port 3001`
108
+ demanded credentials that were already in the file.
109
+ - `mcp-sso saml2`/`bearer --assertion-flow manual`, and an `--assertion-flow assertion` with no
110
+ `--assertion` value supplied, now announce the authorization URL before prompting for a pasted
111
+ `SAMLResponse` (via `manualSamlResponseStrategy`). The old fallback for the latter combination
112
+ prompted without ever showing the URL the user needed to visit.
113
+
114
+ ### Notes
115
+ - `AuthBroker`'s own constructor and public API are unchanged; this is a realignment with the
116
+ provider library plus the CLI-level fixes above.
117
+
14
118
  ## [1.0.8] - 2026-07-29
15
119
 
16
120
  ### Changed