MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / log_auth_status

Function log_auth_status

src/codegraphcontext/api/auth.py:110–123  ·  view source on GitHub ↗

Log the authentication status at app startup. Emits a prominent WARNING when the API is unauthenticated so the insecure default is impossible to miss in logs.

()

Source from the content-addressed store, hash-verified

108
109
110def log_auth_status() -> None:
111 """Log the authentication status at app startup.
112
113 Emits a prominent WARNING when the API is unauthenticated so the insecure
114 default is impossible to miss in logs.
115 """
116 if get_configured_api_key():
117 logger.info("API key authentication is ENABLED (CGC_API_KEY is set).")
118 else:
119 logger.warning(
120 "⚠️ CodeGraphContext API is running WITHOUT authentication. "
121 "Anyone who can reach this server can index code, run Cypher queries "
122 "and call tools. Set CGC_API_KEY to require a key."
123 )

Callers 1

create_appFunction · 0.85

Calls 2

get_configured_api_keyFunction · 0.85
infoMethod · 0.80

Tested by

no test coverage detected