Skip to content

Commit 3f42a7a

Browse files
authored
Spec: Add 'inherited' and 'namespace' Fields to GetApplicablePolicies API Response (#1277)
1 parent c39c263 commit 3f42a7a

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

api/polaris-catalog-service/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ val policyManagementModels =
3737
"CreatePolicyRequest",
3838
"LoadPolicyResponse",
3939
"Policy",
40+
"ApplicablePolicy",
4041
"PolicyAttachmentTarget",
4142
"AttachPolicyRequest",
4243
"DetachPolicyRequest",

spec/generated/bundled-polaris-catalog-service.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4005,18 +4005,36 @@ components:
40054005
properties:
40064006
target:
40074007
$ref: '#/components/schemas/PolicyAttachmentTarget'
4008+
ApplicablePolicy:
4009+
allOf:
4010+
- type: object
4011+
description: |
4012+
For policies returned by GetApplicablePolicies, there are 2 additional fields
4013+
4014+
- **inherited:** A boolean flag indicating whether the policy is inherited from target's parents. For non-inheritable policy, it should always be `false`.
4015+
- **namespace:** A list representing the hierarchical parent path to the policy, ordered from higher level namespace to lower.
4016+
required:
4017+
- inherited
4018+
- namespace
4019+
properties:
4020+
inherited:
4021+
type: boolean
4022+
default: false
4023+
namespace:
4024+
$ref: '#/components/schemas/Namespace'
4025+
- $ref: '#/components/schemas/Policy'
40084026
GetApplicablePoliciesResponse:
40094027
type: object
40104028
required:
4011-
- policies
4029+
- applicable-policies
40124030
properties:
40134031
next-page-token:
40144032
$ref: '#/components/schemas/PageToken'
4015-
policies:
4033+
applicable-policies:
40164034
type: array
40174035
uniqueItems: true
40184036
items:
4019-
$ref: '#/components/schemas/Policy'
4037+
$ref: '#/components/schemas/ApplicablePolicy'
40204038
responses:
40214039
BadRequestErrorResponse:
40224040
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.

spec/polaris-catalog-apis/policy-apis.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,26 @@ components:
529529
version:
530530
type: integer
531531

532+
ApplicablePolicy:
533+
allOf:
534+
- type: object
535+
description: |
536+
For policies returned by GetApplicablePolicies, there are 2 additional fields
537+
538+
- **inherited:** A boolean flag indicating whether the policy is inherited from target's parents. For non-inheritable policy, it should always be `false`.
539+
- **namespace:** A list representing the hierarchical parent path to the policy, ordered from higher level namespace to lower.
540+
required:
541+
- inherited
542+
- namespace
543+
properties:
544+
inherited:
545+
type: boolean
546+
default: false
547+
namespace:
548+
$ref: '../iceberg-rest-catalog-open-api.yaml#/components/schemas/Namespace'
549+
- $ref: '#/components/schemas/Policy'
550+
551+
532552
CreatePolicyRequest:
533553
type: object
534554
required:
@@ -633,15 +653,15 @@ components:
633653
GetApplicablePoliciesResponse:
634654
type: object
635655
required:
636-
- policies
656+
- applicable-policies
637657
properties:
638658
next-page-token:
639659
$ref: '../iceberg-rest-catalog-open-api.yaml#/components/schemas/PageToken'
640-
policies:
660+
applicable-policies:
641661
type: array
642662
uniqueItems: true
643663
items:
644-
$ref: '#/components/schemas/Policy'
664+
$ref: '#/components/schemas/ApplicablePolicy'
645665

646666
responses:
647667
CreatePolicyResponse:

0 commit comments

Comments
 (0)