Skip to content

compose client origin header - #20

Merged
augustas1 merged 1 commit into
mainfrom
client-origin
Aug 10, 2026
Merged

compose client origin header#20
augustas1 merged 1 commit into
mainfrom
client-origin

Conversation

@augustas1

Copy link
Copy Markdown
Collaborator

No description provided.

@augustas1
augustas1 requested review from a team and a lite review from Copilot August 10, 2026 07:36

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an X-Engram-Client “client origin” header to the shared client header builder, including SDK version info, and updates tests to assert the new default/composed header behavior.

Changes:

  • Add X-Engram-Client: python-sdk/<version> by default in the base client header construction.
  • When callers provide X-Engram-Client, compose it as <caller> python-sdk/<version>.
  • Update sync/async client tests to validate the new header behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/engram/_base_client.py Builds and composes the new X-Engram-Client header in shared header logic.
tests/test_client_sync.py Asserts the new default header and adds a test for composition behavior.
tests/test_client_async.py Asserts the new default header for the async client.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +55 to 66
headers = dict(extra_headers)
headers.update(
{
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}",
}
)

caller = extra_headers.get(CLIENT_ORIGIN_HEADER)
headers[CLIENT_ORIGIN_HEADER] = f"{caller} {SDK_CLIENT_TOKEN}" if caller else SDK_CLIENT_TOKEN
return headers
@augustas1
augustas1 merged commit 0d62278 into main Aug 10, 2026
15 checks passed
@augustas1
augustas1 deleted the client-origin branch August 10, 2026 08:58
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.

3 participants