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

Method _headers

client/packages/python/src/instantdb/_sync/http.py:53–70  ·  view source on GitHub ↗
(
        self, *, unauthenticated: bool = False, admin_only: bool = False
    )

Source from the content-addressed store, hash-verified

51 self._owns_client = True
52
53 def _headers(
54 self, *, unauthenticated: bool = False, admin_only: bool = False
55 ) -> dict[str, str]:
56 if unauthenticated:
57 return {"content-type": "application/json"}
58 self._validate_auth()
59 h: dict[str, str] = {
60 "content-type": "application/json",
61 "app-id": self._app_id,
62 "Instant-Admin-Version": __version__,
63 "Instant-Core-Version": __version__,
64 }
65 if self._admin_token:
66 h["authorization"] = f"Bearer {self._admin_token}"
67 # admin_only skips impersonation so the request uses admin auth.
68 if not admin_only:
69 h.update(self._impersonation)
70 return h
71
72 def _validate_auth(self) -> None:
73 if self._admin_token:

Calls 2

_validate_authMethod · 0.95
updateMethod · 0.45