Skip to content

Commit 1eea05e

Browse files
committed
feat(http): send X-Privacy-Mode header on all API requests
Ensures all GitGuardian API calls from the MCP server use privacy mode, so secrets are obfuscated in responses. Issue: APPAI-110
1 parent 133790f commit 1eea05e

File tree

1 file changed

+2
-0
lines changed
  • packages/gg_api_core/src/gg_api_core

1 file changed

+2
-0
lines changed

packages/gg_api_core/src/gg_api_core/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ async def _request(self, method: str, endpoint: str, **kwargs) -> Any:
501501
"Authorization": f"Token {self._oauth_token}",
502502
"Content-Type": "application/json",
503503
"User-Agent": self._user_agent,
504+
"X-Privacy-Mode": "true",
504505
}
505506
logger.debug("Using token for authorization")
506507

@@ -736,6 +737,7 @@ async def _request_list(self, endpoint: str, **kwargs) -> ListResponse:
736737
"Authorization": f"Token {self._oauth_token}",
737738
"Content-Type": "application/json",
738739
"User-Agent": self._user_agent,
740+
"X-Privacy-Mode": "true",
739741
}
740742
headers.update(kwargs.pop("headers", {}))
741743

0 commit comments

Comments
 (0)