diff --git a/api/polaris-catalog-service/build.gradle.kts b/api/polaris-catalog-service/build.gradle.kts index 1e0778f05d..f16343441b 100644 --- a/api/polaris-catalog-service/build.gradle.kts +++ b/api/polaris-catalog-service/build.gradle.kts @@ -38,6 +38,7 @@ val policyManagementModels = "LoadPolicyResponse", "PolicyIdentifier", "Policy", + "ApplicablePolicy", "PolicyAttachmentTarget", "AttachPolicyRequest", "DetachPolicyRequest", diff --git a/spec/generated/bundled-polaris-catalog-service.yaml b/spec/generated/bundled-polaris-catalog-service.yaml index c0dd88cc48..2a817dd69f 100644 --- a/spec/generated/bundled-polaris-catalog-service.yaml +++ b/spec/generated/bundled-polaris-catalog-service.yaml @@ -4005,18 +4005,36 @@ components: properties: target: $ref: '#/components/schemas/PolicyAttachmentTarget' + ApplicablePolicy: + allOf: + - type: object + description: | + For policies returned by GetApplicablePolicies, there are 2 additional fields + + - **inherited:** A boolean flag indicating whether the policy is inherited from target's parents. For non-inheritable policy, it should always be `false`. + - **namespace:** A list representing the hierarchical parent path to the policy, ordered from higher level namespace to lower. + required: + - inherited + - namespace + properties: + inherited: + type: boolean + default: false + namespace: + $ref: '#/components/schemas/Namespace' + - $ref: '#/components/schemas/Policy' GetApplicablePoliciesResponse: type: object required: - - policies + - applicable-policies properties: next-page-token: $ref: '#/components/schemas/PageToken' - policies: + applicable-policies: type: array uniqueItems: true items: - $ref: '#/components/schemas/Policy' + $ref: '#/components/schemas/ApplicablePolicy' responses: BadRequestErrorResponse: description: Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. diff --git a/spec/polaris-catalog-apis/policy-apis.yaml b/spec/polaris-catalog-apis/policy-apis.yaml index 947e991142..9aa15620cf 100644 --- a/spec/polaris-catalog-apis/policy-apis.yaml +++ b/spec/polaris-catalog-apis/policy-apis.yaml @@ -529,6 +529,26 @@ components: version: type: integer + ApplicablePolicy: + allOf: + - type: object + description: | + For policies returned by GetApplicablePolicies, there are 2 additional fields + + - **inherited:** A boolean flag indicating whether the policy is inherited from target's parents. For non-inheritable policy, it should always be `false`. + - **namespace:** A list representing the hierarchical parent path to the policy, ordered from higher level namespace to lower. + required: + - inherited + - namespace + properties: + inherited: + type: boolean + default: false + namespace: + $ref: '../iceberg-rest-catalog-open-api.yaml#/components/schemas/Namespace' + - $ref: '#/components/schemas/Policy' + + CreatePolicyRequest: type: object required: @@ -633,15 +653,15 @@ components: GetApplicablePoliciesResponse: type: object required: - - policies + - applicable-policies properties: next-page-token: $ref: '../iceberg-rest-catalog-open-api.yaml#/components/schemas/PageToken' - policies: + applicable-policies: type: array uniqueItems: true items: - $ref: '#/components/schemas/Policy' + $ref: '#/components/schemas/ApplicablePolicy' responses: CreatePolicyResponse: