Repository navigation
Conversation
The website proxy is gaining API keys (website#142). Limits are per account, so a keyed call reaches dfo-ai with `x-dfo-caller: user:<32 hex>` (an HMAC digest of the account id, the same shape as `ip:<32 hex>`). The data, presentation and analysis clients forwarded the caller to dfo-apis, beside the caller principal, only for `ip:`, and dropped anything else, which would have counted a keyed caller's allowances against dfo-ai itself. Replace `ADDRESS_CALLER` with `WEBSITE_CALLER`, matching `ip:` or `user:` plus 32 lowercase hex digits, and use it in all three clients. A malformed caller is still dropped. Correct the docs: `key:` is not a form the website sends. Requires the matching dfo-apis change (accept `user:` beside the principal) to be deployed first; until then dfo-apis would refuse a `user:` caller. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf
connect.md said no token is needed. Anonymous use still needs none, but an optional API key raises the call limit and developer clients and Claude custom connectors can send it as a header. Update the 429 troubleshooting row and link the API keys page. Refs DevelopmentFinanceObservatory/website#142 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What and why
Part of DevelopmentFinanceObservatory/website#142, API keys on the website's platform proxy. Limits are per account, so the website names a call made with an API key as
x-dfo-caller: user:<32 hex>, beside today'sip:<32 hex>.The data, presentation and analysis MCP clients forwarded the caller to dfo-apis only when it matched
ip:, and dropped anything else. A keyed caller's allowances would then have counted against dfo-ai itself.common.caller:ADDRESS_CALLERbecomesWEBSITE_CALLER,(ip|user):[0-9a-f]{32}. Its docstring drops thekey:form, since limits are per account.data-mcp,presentation-mcpandanalysis-mcpforwarduser:callers with the principal exactly as they forwardip:.conversation:callers and malformed values are still dropped.current_writer()records the caller string as is.Verification
just lintandjust typecheckpass.packages/common/tests/test_caller.py: the pattern acceptsip:anduser:and refuses other prefixes, wrong lengths, non-hex, uppercase and whitespace.user:caller is forwarded with the principal and dropped without it, and malformedip:anduser:callers are dropped.Coordination
Merge and deploy after dfo-apis accepts
user:callers (DevelopmentFinanceObservatory/apis#320). Until then dfo-apis answers 400 to them. The website starts sending them in website #143, which ships last.Docs:
docs/guide/connect.mdnow covers API keys, and its 429 row says a key raises the limit, linking the hub's new "Use an API key" page. Merge DevelopmentFinanceObservatory/docs#26 first, or the docs build's link check reports that link as broken.🤖 Generated with Claude Code
https://claude.ai/code/session_015QQk2mKJZzXv2AYykDjvQf