flyrain commented on code in PR #808: URL: https://github.com/apache/polaris/pull/808#discussion_r1943838449
########## spec/polaris-catalog-apis/policy-management-apis.yaml: ########## @@ -0,0 +1,579 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +--- +paths: + + /v1/{prefix}/namespaces/{namespace}/policies: + parameters: + - $ref: '../rest-catalog-open-api.yaml#/components/parameters/prefix' + - $ref: '../rest-catalog-open-api.yaml#/components/parameters/namespace' + + post: + tags: + - Catalog API + summary: 'Create a policy in the given namespace' + operationId: createPolicy + description: > + Creates a policy within the specified namespace. + + + A policy defines a set of rules governing actions on specified resources under predefined conditions. + + In Apache Polaris, policies are created, stored, and later referenced by external engines to enforce access controls on associated resources. + + + User provides the following inputs when creating a policy + + - `name`(REQUIRED): The name of the policy. It Must include only unreserved URL characters: letters(A-Z, a-z), digits (0-9), hyphens (-), periods (.), underscores (_) and tildes (~) + + - `type` (REQUIRED): The type of the policy. It can be either predefined type or custom type. + - **Predefined Policies:** system.compaction, system.snapshot_retention + - **Custom Policies:** custom.<org_name>.data_masking, custom.<user_id>.audit_policy + + - `description` (OPTIONAL): Provides details about the policy's purpose and functionality + + - `content` (OPTIONAL): Defines the rules that control actions and access conditions on resources. The format can be JSON, SQL, or any other format. + + + The policy content is validated by the server upon creation or update: + + - Predefined policies are validated using built-in server-side validators + + - Custom policies rely on user-provided validators. + + Review Comment: Style: can we remove the empty lines to make it compact? We could just copy the style from the generated one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org