MCPcopy
hub / github.com/feast-dev/feast / is_auth_necessary

Function is_auth_necessary

sdk/python/feast/permissions/security_manager.py:238–254  ·  view source on GitHub ↗
(sm: Optional[SecurityManager])

Source from the content-addressed store, hash-verified

236
237
238def is_auth_necessary(sm: Optional[SecurityManager]) -> bool:
239 intra_communication_base64 = os.getenv("INTRA_COMMUNICATION_BASE64")
240
241 # If no security manager, no auth is necessary
242 if sm is None:
243 return False
244
245 # If security manager exists but no user context, auth is necessary (security-first approach)
246 if sm.current_user is None:
247 return True
248
249 # If user is intra-communication, no auth is necessary
250 if sm.current_user.username == intra_communication_base64:
251 return False
252
253 # Otherwise, auth is necessary
254 return True

Callers 4

_get_featuresFunction · 0.90
assert_permissionsFunction · 0.85
permitted_resourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected