MCPcopy Create free account
hub / github.com/instantdb/instant / _validate_auth

Method _validate_auth

client/packages/python/src/instantdb/_sync/http.py:72–85  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

70 return h
71
72 def _validate_auth(self) -> None:
73 if self._admin_token:
74 return
75 if "as-token" in self._impersonation or "as-guest" in self._impersonation:
76 return
77 if "as-email" in self._impersonation:
78 raise InstantError(
79 "admin_token is required to impersonate a user by email: "
80 "pass admin_token=... or set INSTANT_APP_ADMIN_TOKEN"
81 )
82 raise InstantError(
83 "admin_token is required for this operation: "
84 "pass admin_token=..., set INSTANT_APP_ADMIN_TOKEN, or use as_user(...)"
85 )
86
87 def post(
88 self,

Callers 1

_headersMethod · 0.95

Calls 1

InstantErrorClass · 0.90

Tested by

no test coverage detected