MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / build_request_headers

Function build_request_headers

api/integrations/github/client.py:34–50  ·  view source on GitHub ↗
(
    installation_id: str, use_jwt: bool = False
)

Source from the content-addressed store, hash-verified

32
33
34def build_request_headers(
35 installation_id: str, use_jwt: bool = False
36) -> dict[str, str]:
37 token = (
38 generate_jwt_token(settings.GITHUB_APP_ID)
39 if use_jwt
40 else generate_token(
41 installation_id,
42 settings.GITHUB_APP_ID,
43 )
44 )
45
46 return {
47 "X-GitHub-Api-Version": GITHUB_API_VERSION,
48 "Accept": "application/vnd.github.v3+json",
49 "Authorization": f"Bearer {token}",
50 }
51
52
53def generate_token(installation_id: str, app_id: int) -> str:

Calls 2

generate_jwt_tokenFunction · 0.85
generate_tokenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…