mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-23 11:14:11 +00:00
docs: record authorization invariants in servers and frontend guides (#10384)
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
This commit is contained in:
@@ -126,6 +126,14 @@ cargo nextest run -p frontend
|
||||
|
||||
- Keep the frontend/servers split straight: wire format and network live in
|
||||
`servers`; permissions, planning, and routing live here.
|
||||
- A statement whose tables are known only at execution time (`COPY DATABASE`)
|
||||
resolves them first, authorizes every resolved table, then executes exactly
|
||||
the authorized set. Do not authorize such a statement with empty targets.
|
||||
- Built-in permission action names are a contract with external
|
||||
`PermissionChecker` implementations. Define each as a constant in
|
||||
`src/auth/src/permission.rs` and list it in `ALL_ACTIONS`; do not build them
|
||||
from string literals at call sites. A new action or access-mode requirement
|
||||
on an existing statement or endpoint is a user-visible permission change.
|
||||
- Standalone vs distributed diverge in datanode access (the `standalone` crate's
|
||||
local `RegionServer` adapter vs `NodeClients` RPC), MetaClient usage, and
|
||||
whether heartbeat matters. The builder defaults local invalidation to its
|
||||
|
||||
@@ -26,6 +26,11 @@ provided through handler traits, mostly implemented by `frontend`.
|
||||
after bumping it.
|
||||
- Auth or `QueryContext` changes must cover HTTP, gRPC, MySQL, and PostgreSQL
|
||||
entry points.
|
||||
- A protocol handler that changes the `QueryContext` catalog or schema after
|
||||
authentication (HTTP `db` query/form parameters, MySQL `COM_INIT_DB`) calls
|
||||
`UserProvider::authorize` for the new scope before mutating the context. The
|
||||
HTTP middleware authorizes only the scope it extracts itself
|
||||
(`extract_catalog_and_schema` in `http/authorize.rs`).
|
||||
- Internal frontend gRPC listeners set `Channel::Internal` in server-owned request
|
||||
extensions. Handlers preserve it through query execution and metering; client
|
||||
flow metadata does not grant an internal channel.
|
||||
|
||||
Reference in New Issue
Block a user