Files
greptimedb/tests-integration/src
Ning Sun 9cf76e20ad feat(postgres): support COPY targets for OTLP logs and traces (#10449)
* feat(postgres): support COPY targets for OTLP logs and traces

Signed-off-by: Ning Sun <sunning@greptime.com>

* fix(postgres): guard OTLP COPY targets with catalog restriction and denial observability

Address review findings on the OTLP COPY target feature:

- Enforce the `disallow_cross_catalog_query` restriction for qualified
  OTLP COPY targets through the new `CopyInHandler::copy_in_validate_scope`,
  mirroring SQL INSERT and the csv format; it runs against the original
  session context before any data is transferred and before the
  user-provider scope check.
- Meter and log `authorize_database` denials like startup authorization
  (`METRIC_AUTH_FAILURE` plus a scoped warn/error log).
- Add an end-to-end denial test through COPY with a scoped user provider:
  cross-schema, cross-catalog, and `table_name`-override targets are
  rejected before ingestion, the OTLP handler is never reached, and the
  session scope stays usable afterwards.
- Check the server's OTLP wiring before target errors, reword the metrics
  target rejection (no false 'with signal metrics' claim for the default
  signal), and avoid the second `OtlpOptions` clone in `new_otlp`.

Signed-off-by: Ning Sun <sunning@greptime.com>

* fix(postgres): surface OTLP COPY target denials as insufficient privilege

Address review feedback: wrap the authorize_database failure with
convert_err instead of PgWireError::ApiError, so a denied qualified COPY
target returns SQLSTATE 42501 (insufficient privilege) rather than XX000
(internal error). The end-to-end authorization test now expects
INSUFFICIENT_PRIVILEGE.

Signed-off-by: Ning Sun <sunning@greptime.com>

---------

Signed-off-by: Ning Sun <sunning@greptime.com>
2026-11-18 16:40:34 +00:00
..