scrum: validate API key presence when enabling a cloud provider #2
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "scrum/provider-key-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Surfaced by the lakehouse scrum-master pipeline (finding F5, grounded by reading
admin_save_configat line 7058). APOST /api/admin/configbody like:...was silently accepted even when no key was stored and no env var was set. The provider got flagged enabled in the UI, and every subsequent query against it 401d at call time with an opaque error.
Fix
When an incoming patch sets
enabled=True, compute the effective key — incoming body → stored config → env var (get_api_key(name)already handles the env fallback at line 1888). If the effective key is empty, reject with400:Behavior unchanged for disabled providers and for updates that dont touch the
enabledflag.Prerequisite commits
Same 4-commit pre-existing local-main tail as PR #1 (needs
fa6ccff Ollama Cloud providerbecauseget_api_keyhasollama_cloudin its env-var map there). Stacked on the same base, will rebase cleanly after #1 lands or main is pushed.Not in this PR
Checkout
From your project repository, check out a new branch and test the changes.