Repository navigation
feat: one-key client for the new private key - #137
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested locally at this PR's head (
No key showed up in the SDK's output or logs. All passed. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 851a0b7. Configure here.
Shahroz16
left a comment
There was a problem hiding this comment.
There's also a .netrc case in _BearerTrackClient: setting session.auth = None lets Requests replace the supplied Bearer header with Basic auth if there's a matching entry for the API host. Could we use an explicit Bearer auth handler and cover that with a prepared-request check? It only happens with that matching entry, but we'd still be sending different credentials from the ones the caller passed.
Two smaller wording follow-ups: 401/403 can also mean an IP restriction or a disabled workspace, so “this key can't…” is a bit too specific. And the README should qualify legacy-key support: transactional calls work, but Bearer Track calls on Pipelines workspaces need a source-bound new key.
I'd like us to sort out the URL handling in the existing thread and this auth case before merging. That's my take. Let's also get Bernard or the NF team to review this.
Read the region from any key shaped {xx}_{us|eu}_ and treat pk_ as the
public key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… errors A matching .netrc entry could replace the Bearer header with Basic auth. 401/403 errors no longer blame the key, and the README says which calls legacy keys still cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed the review in 72295df:
|
|
Could we limit the |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The description now limits the |
Shahroz16
left a comment
There was a problem hiding this comment.
One case I'd like us to fix before this goes in: a key with a trailing newline ends up in the exception message. A couple of smaller ones inline.
That's my take.
… and use the Bearer auth handler for send_* Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ient Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…drop a trailing slash on api_url Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shahroz16
left a comment
There was a problem hiding this comment.
Looks good to me now. The key is stripped, send_* goes through the Bearer auth handler too, and both URL overrides are checked.

Adds a one-key client for the new secret
sk_API keys.sk_key covers Track and the App API, sent as a Bearer token. Both APIs use an explicit auth handler, so a.netrcentry can't replace it.sk_us_…/sk_eu_…).pk_keys are refused for App API calls, since they are for tracking only.sk_key.