Repository navigation
fix(sdk): route the tenant key through one shared credentialFetch, enforced in CI [SAP-4106] #1236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
antoine-berger
wants to merge
11
commits into
main
Choose a base branch
from
antoine-berger/sap-4106-sdk-tenant-key-channel-check
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,208
−142
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
26813d8
fix(sdk): route the tenant key through one shared credentialFetch, en…
antoine-berger e528cc8
fix(sdk): normalize Headers in credentialFetch, match split header wr…
antoine-berger 2f45c39
docs(sdk): shorten module comments on the credential path [SAP-4106]
antoine-berger 8f394f6
fix(sdk): keep the TypeError name on a refused credential channel [SA…
antoine-berger 2ddfaec
chore: restore the electron node-gyp integrity hash in the lockfile […
antoine-berger 5ae9446
fix(analytics-core): strip SRI digest padding without a quadratic reg…
antoine-berger d8ac7d9
fix(analytics-core): follow plain http redirects when no key is sent …
antoine-berger cbe7b79
docs(core, mcp): document the plain-http opt-in for the API key [SAP-…
antoine-berger 46996a5
fix(analytics-core): never downgrade a keyless request from https to …
antoine-berger 035841b
fix(analytics-core): refuse any TLS downgrade on a keyless redirect c…
antoine-berger 7b8eaeb
revert(analytics-core): one channel rule for every redirect hop, keye…
antoine-berger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| "@sapiom/analytics-core": minor | ||
| "@sapiom/core": minor | ||
| "@sapiom/agent-core": minor | ||
| "@sapiom/mcp": patch | ||
| "@sapiom/tools": patch | ||
| --- | ||
|
|
||
| The tenant API key now only travels over HTTPS, or plain HTTP to a loopback | ||
| host, from every SDK client, and never follows a redirect to another origin. | ||
| One function, `credentialFetch` from the new `@sapiom/analytics-core/credential` | ||
| subpath, is the only code that sets the key header. | ||
|
|
||
| - `@sapiom/core`, `@sapiom/agent-core` and `@sapiom/mcp`: a plain `http://` | ||
| URL to a non-loopback host (for example a Docker service name or a LAN IP) | ||
| now fails before the request is sent. On a trusted private network, opt in | ||
| with `new SapiomClient({ allowInsecureHttp: true })` (core), | ||
| `createClient({ allowInsecureHttp: true })` (agent-core) or | ||
| `SAPIOM_ALLOW_INSECURE_HTTP=1` (all clients). `localhost`, `*.localhost`, | ||
| `127.0.0.1` and `[::1]` work as before. Core does not retry a refused channel. | ||
| - `@sapiom/analytics-core`: on such an endpoint the batch is still sent, without | ||
| the key. A redirect to a refused channel drops the batch. | ||
| - Every client follows redirects itself: the first hop to another origin drops | ||
| `x-api-key`, `x-sapiom-api-key` and every `x-sapiom-*` header. | ||
| - `@sapiom/core`: `getHttpClient().defaults.headers` no longer carries the key; | ||
| read `defaults.credential` instead. | ||
| - `@sapiom/tools`: no behavior change. A refused call now throws a | ||
| `CredentialChannelError`, a `TypeError` subclass that keeps `name: "TypeError"`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.