apache/gravitino

[Subtask] Support policies for function metadata objects

开放

#12,501 创建于 2026年8月18日

 (2 条评论) (0 个反应) (0 位负责人)Java (887 个派生)auto 404
good first issuesubtask

仓库指标

星标
 (3,058 个星标)
PR 合并指标
 (平均合并 6天 6小时) (30 天内合并 148 个 PR)

描述

Describe the subtask

Support associating policies with FUNCTION metadata objects through the existing metadata object policy REST APIs.

Currently, FUNCTION exists in MetadataObject.Type, but it is excluded from PolicyManager.SUPPORTED_METADATA_OBJECT_TYPES_FOR_POLICIES. As a result, policy association requests for functions are rejected with Cannot associate policies for unsupported metadata object type FUNCTION.

Implementation scope:

  • Add FUNCTION to the supported metadata object types in PolicyManager.
  • Clean up function policy relations when a function is dropped.
  • Extend catalog and schema cascade cleanup for function policy relations across H2, MySQL, and PostgreSQL.
  • Update docs/open-api/policies.yaml to include FUNCTION.
  • Add unit and integration tests covering policy association, listing, retrieval, removal, direct function deletion, and cascade cleanup.

The completed function tag implementation in #11844 and #11897 can be used as a reference.

This task covers the server, core relational storage, OpenAPI, and their tests. Typed Java and Python client APIs can be handled in follow-up issues.

This task extends the current direct object-policy model and does not implement the policy-on-tag model proposed in #12176.

Parent issue

#6158

贡献者指南