Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions open-api/rest-catalog-open-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ class SortOrder(BaseModel):
fields: List[SortField]


class EncryptedKey(BaseModel):
key_id: str = Field(..., alias='key-id')
encrypted_key_metadata: str = Field(..., alias='encrypted-key-metadata')
encrypted_by_id: Optional[str] = Field(None, alias='encrypted-by-id')
properties: Optional[Dict[str, str]] = None


class Summary(BaseModel):
operation: Literal['append', 'replace', 'overwrite', 'delete']

Expand Down Expand Up @@ -395,6 +402,16 @@ class RemoveSchemasUpdate(BaseUpdate):
schema_ids: List[int] = Field(..., alias='schema-ids')


class AddEncryptionKeyUpdate(BaseUpdate):
action: str = Field('add-encryption-key', const=True)
encryption_key: EncryptedKey = Field(..., alias='encryption-key')


class RemoveEncryptionKeyUpdate(BaseUpdate):
action: str = Field('remove-encryption-key', const=True)
key_id: str = Field(..., alias='key-id')


class TableRequirement(BaseModel):
type: str

Expand Down Expand Up @@ -1135,6 +1152,7 @@ class TableMetadata(BaseModel):
last_partition_id: Optional[int] = Field(None, alias='last-partition-id')
sort_orders: Optional[List[SortOrder]] = Field(None, alias='sort-orders')
default_sort_order_id: Optional[int] = Field(None, alias='default-sort-order-id')
encryption_keys: Optional[List[EncryptedKey]] = Field(None, alias='encryption-keys')
snapshots: Optional[List[Snapshot]] = None
refs: Optional[SnapshotReferences] = None
current_snapshot_id: Optional[int] = Field(None, alias='current-snapshot-id')
Expand Down Expand Up @@ -1189,6 +1207,8 @@ class TableUpdate(BaseModel):
RemoveStatisticsUpdate,
RemovePartitionSpecsUpdate,
RemoveSchemasUpdate,
AddEncryptionKeyUpdate,
RemoveEncryptionKeyUpdate,
]


Expand Down
52 changes: 52 additions & 0 deletions open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2388,6 +2388,25 @@ components:
items:
$ref: '#/components/schemas/SortField'

EncryptedKey:
type: object
required:
- key-id
- encrypted-key-metadata
properties:
key-id:
type: string
encrypted-key-metadata:
type: string
format: byte # for compatibility
contentEncoding: base64
encrypted-by-id:
type: string
properties:
type: object
additionalProperties:
type: string

Snapshot:
type: object
required:
Expand Down Expand Up @@ -2525,6 +2544,11 @@ components:
$ref: '#/components/schemas/SortOrder'
default-sort-order-id:
type: integer
# encryption
encryption-keys:
type: list
items:
$ref: '#/components/schemas/EncryptedKey'
# snapshot tracking
snapshots:
type: array
Expand Down Expand Up @@ -2679,6 +2703,8 @@ components:
remove-partition-statistics: '#/components/schemas/RemovePartitionStatisticsUpdate'
remove-partition-specs: '#/components/schemas/RemovePartitionSpecsUpdate'
remove-schemas: '#/components/schemas/RemoveSchemasUpdate'
add-encryption-key: '#/components/schemas/AddEncryptionKeyUpdate'
remove-encryption-key: '#/components/schemas/RemoveEncryptionKeyUpdate'
type: object
required:
- action
Expand Down Expand Up @@ -2997,6 +3023,30 @@ components:
items:
type: integer

AddEncryptionKeyUpdate:
allOf:
- $ref: '#/components/schemas/BaseUpdate'
required:
- encryption-key
properties:
action:
type: string
const: "add-encryption-key"
encryption-key:
$ref: '#/components/schemas/EncryptedKey'

RemoveEncryptionKeyUpdate:
allOf:
- $ref: '#/components/schemas/BaseUpdate'
required:
- key-id
properties:
action:
type: string
const: "remove-encryption-key"
key-id:
type: string

TableUpdate:
anyOf:
- $ref: '#/components/schemas/AssignUUIDUpdate'
Expand All @@ -3018,6 +3068,8 @@ components:
- $ref: '#/components/schemas/RemoveStatisticsUpdate'
- $ref: '#/components/schemas/RemovePartitionSpecsUpdate'
- $ref: '#/components/schemas/RemoveSchemasUpdate'
- $ref: '#/components/schemas/AddEncryptionKeyUpdate'
- $ref: '#/components/schemas/RemoveEncryptionKeyUpdate'

ViewUpdate:
anyOf:
Expand Down