Skip to content

add client origin header - #9

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

add client origin header#9
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:30

@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

Adds an X-Engram-Client header to outgoing Engram requests so the backend can identify the calling client (platform + plugin version).

Changes:

  • Introduces plugin/core/client_origin.py to build an origin header using the plugin manifest version.
  • Adds the origin header to both SDK (EngramClient) construction and the REST engram_get helper.
  • Adds unit tests to validate platform/version/header formatting without importing the full plugin package.

Reviewed changes

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

File Description
plugin/core/client.py Attaches the client-origin header to SDK and REST requests.
plugin/core/client_origin.py Implements origin header generation from .claude-plugin/plugin.json.
plugin/tests/test_client_origin.py Adds tests for platform detection, manifest version reading, and header formatting.

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

Comment on lines +1 to +22
import json
import os

_MANIFEST = os.path.join(
os.path.dirname(__file__), "..", ".claude-plugin", "plugin.json"
)


def _platform():
return "claude"


def _plugin_version():
try:
with open(_MANIFEST) as f:
return json.load(f).get("version", "unknown")
except Exception:
return "unknown"


def client_origin_header():
return {"X-Engram-Client": f"{_platform()}-plugin/{_plugin_version()}"}
Comment on lines +9 to +10
def _platform():
return "claude"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can this not just be a constant?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah, it's just left for extending -> later function will resolve which plugin is the origin when there' gonna be multiple

@augustas1
augustas1 merged commit 58122f6 into main Aug 10, 2026
5 checks passed
@augustas1
augustas1 deleted the client-origin branch August 10, 2026 09:02
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