Commit 957b613
committed
feat(@angular/cli): allow Algolia search key override via env var
The MCP `search_documentation` tool currently uses a single bundled
Algolia API key for the public Angular documentation index. This works
out of the box but gives operators no way to:
* substitute a different key for self-hosted documentation indices,
* point an internal CI environment at a separate Algolia application
to avoid sharing the public rate-limit budget,
* test key rotation without rebuilding the CLI.
This change adds a `NG_DOCS_SEARCH_API_KEY` environment variable that,
when set to a non-empty string, is used verbatim in place of the
bundled key. When the variable is absent or empty, behaviour is
unchanged — the bundled key continues to be used.
The override path is factored into a small `resolveAlgoliaApiKey()`
helper so the env-var precedence rules are unit-testable without
spinning up the full MCP tool runner. Three Jasmine specs cover:
override set, override unset, and override set to empty string.
The previous comment block on `ALGOLIA_API_E` is replaced with a
short note describing the override mechanism and the operator
scenarios it enables.1 parent 7da255d commit 957b613
2 files changed
Lines changed: 70 additions & 12 deletions
Lines changed: 25 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
22 | 43 | | |
23 | 44 | | |
24 | 45 | | |
| |||
129 | 150 | | |
130 | 151 | | |
131 | 152 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 153 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 154 | + | |
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments