claude hooks custom hostname#4927
Open
DharunThota wants to merge 2 commits intoakto-api-security:masterfrom
Open
claude hooks custom hostname#4927DharunThota wants to merge 2 commits intoakto-api-security:masterfrom
DharunThota wants to merge 2 commits intoakto-api-security:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for overriding the host request header used by the Claude CLI hook ingestion/validation payloads, enabling custom hostname reporting independent of CLAUDE_API_URL.
Changes:
- Add
AKTO_HOSTNAMEenv var support to override thehostheader in request payloads (non-MCP paths). - Update
.env.examplewithMODE,DEVICE_ID, andAKTO_HOSTNAMEdocumentation and clarifyCLAUDE_API_URLbehavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-response.py | Allow overriding host header via AKTO_HOSTNAME. |
| apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-prompt.py | Allow overriding host header via AKTO_HOSTNAME. |
| apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-mcp-response.py | Allow overriding host header via AKTO_HOSTNAME for non-MCP traffic. |
| apps/mcp-endpoint-shield/claude-cli-hooks/akto-validate-mcp-request.py | Allow overriding host header via AKTO_HOSTNAME for non-MCP traffic. |
| apps/mcp-endpoint-shield/claude-cli-hooks/.env.example | Document MODE, DEVICE_ID, AKTO_HOSTNAME; clarify CLAUDE_API_URL usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+131
to
132
| host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "") | ||
|
|
Comment on lines
+129
to
130
| host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "") | ||
|
|
Comment on lines
+216
to
217
| host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "") | ||
|
|
Comment on lines
+216
to
217
| host = os.getenv("AKTO_HOSTNAME") or CLAUDE_API_URL.replace("https://", "").replace("http://", "") | ||
|
|
| AKTO_SYNC_MODE=true | ||
| MODE=argus # Optional: "argus" (default) or "atlas" for device-scoped URL format | ||
| DEVICE_ID= # Optional: overrides auto-detected machine id (used in atlas mode) | ||
| AKTO_HOSTNAME= # Optional: overrides the "host" request header; falls back to host derived from CLAUDE_API_URL |
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.
No description provided.