| 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, |