Skip to content

fix(api): clear saved BookOrbit and ABS key when the base URL changes (#3944) - #4082

Merged
vavallee merged 2 commits into
mainfrom
fix/bookorbit-key-on-url-change
Nov 20, 2026
Merged

vavallee merged 2 commits into
mainfrom
fix/bookorbit-key-on-url-change

Conversation

@vavallee

Copy link
Copy Markdown
Owner

Summary

Hardening for saved integration keys. When an admin saved a different base URL without typing a new key, the stored key was kept and later sent to the new address by Test, Libraries and import. Saving a changed URL without a replacement key now clears the stored key.

Test plan

  • New TestBookOrbitConfigURLChangeDropsSavedKey and TestABSSetConfig_URLChangeDropsSavedKey: same URL (trailing slash) keeps the key, new URL clears it, new URL with a key saves it, probe after the move builds no client with the old key.
  • Both fail on main without the source change, pass with it.
  • go test -p 2 ./internal/api -run 'ABS|BookOrbit' green.

Grimmory: SetConfig has the same keep-the-key behaviour, and its Test additionally accepts a baseUrl from the request body while falling back to the stored key, username and password. That is a wider shape than this PR and is left for a separate change.

🤖 Generated with Claude Code

…#3944)

Hardening: a saved integration key is tied to the server it was issued
for. Saving a different base URL without a replacement key now clears the
stored key instead of sending it to the new address.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: vavallee <vavallee@protonmail.com>
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vavallee
vavallee merged commit 6b04207 into main Nov 20, 2026
62 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant