MCPcopy Create free account
hub / github.com/SuperJJ007/CSSwitch / _upstream_auth_headers

Function _upstream_auth_headers

proxy/csswitch_proxy.py:344–353  ·  view source on GitHub ↗

上游鉴权头:按当前 provider 的 auth_style 装 x-api-key / bearer / both。 deepseek 未设 → 默认 x-api-key(保持原状);relay = both。

()

Source from the content-addressed store, hash-verified

342
343
344def _upstream_auth_headers():
345 """上游鉴权头:按当前 provider 的 auth_style 装 x-api-key / bearer / both。
346 deepseek 未设 → 默认 x-api-key(保持原状);relay = both。"""
347 style = PROV.get("auth_style", "x-api-key")
348 h = {}
349 if style in ("x-api-key", "both"):
350 h["x-api-key"] = KEY
351 if style in ("bearer", "both"):
352 h["Authorization"] = f"Bearer {KEY}"
353 return h
354
355
356def fetch_relay_models():

Callers 2

fetch_relay_modelsFunction · 0.85
_handle_anthropicMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected