Source credentials stay on the server - #249
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #246.
Until now only
auth_headerwas stripped from source responses; the object-storage, WebDAV and Notion keys went out to every viewer of the knowledge base, on listing as well as on create / update.One list, four consumers.
SOURCE_SECRET_KEYSinutopia-core(auth_header,token,password,secret_access_key,account_key,service_account_key) is used by the listing SQL (config - $2::text[]), bySource::without_secretsfor the create / update responses, by the update merge (keep_secrets: blank or missing keeps the stored value, an explicitnullremoves it, a new value replaces), and the audit log records only whether the config changed. Identifiers stay visible (username,account_name,access_key_id,bucket): alone they authenticate nothing, and the UI needs them to say which account a source uses. Adding a connector means adding its keys to that list first.Along the way: every source handler now confirms the source belongs to the KB in the path (
source_in_kb).require_kbonly checked the person's role on the KB; with a source id from another KB an editor could sync, clean up or delete it, and a viewer could read its sync runs.get_tokenalready did this check; the rest now share it.Tests:
a_viewer_never_sees_a_credentialinserts one source per connector with real key names and asserts the listing carries none of the secret keys whilesources::get(the sync path) still has them all; unit tests cover the merge rule and the response masking.0013 carries a revision note.
🤖 Generated with Claude Code