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
29 changes: 29 additions & 0 deletions api/Apis/FunctionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All URIs are relative to *http://localhost:8080/api/2.1/unity-catalog*
| [**deleteFunction**](FunctionsApi.md#deleteFunction) | **DELETE** /functions/{name} | Delete a function |
| [**getFunction**](FunctionsApi.md#getFunction) | **GET** /functions/{name} | Get a function |
| [**listFunctions**](FunctionsApi.md#listFunctions) | **GET** /functions | List functions |
| [**updateFunction**](FunctionsApi.md#updateFunction) | **PATCH** /functions/{name} | Update a function owner |


<a name="createFunction"></a>
Expand Down Expand Up @@ -123,3 +124,31 @@ No authorization required
- **Content-Type**: Not defined
- **Accept**: application/json

<a name="updateFunction"></a>
# **updateFunction**
> FunctionInfo updateFunction(name, UpdateFunction)

Update a function owner

Transfers ownership of a function to an existing user.

### Parameters

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **name** | **String**| The fully-qualified name of the function (of the form __catalog_name__.__schema_name__.__function__name__). | [default to null] |
| **UpdateFunction** | [**UpdateFunction**](../Models/UpdateFunction.md)| | |

### Return type

[**FunctionInfo**](../Models/FunctionInfo.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

29 changes: 29 additions & 0 deletions api/Apis/TablesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All URIs are relative to *http://localhost:8080/api/2.1/unity-catalog*
| [**deleteTable**](TablesApi.md#deleteTable) | **DELETE** /tables/{full_name} | Delete a table |
| [**getTable**](TablesApi.md#getTable) | **GET** /tables/{full_name} | Get a table |
| [**listTables**](TablesApi.md#listTables) | **GET** /tables | List tables |
| [**updateTable**](TablesApi.md#updateTable) | **PATCH** /tables/{full_name} | Update a table owner |


<a name="createStagingTable"></a>
Expand Down Expand Up @@ -153,3 +154,31 @@ No authorization required
- **Content-Type**: Not defined
- **Accept**: application/json

<a name="updateTable"></a>
# **updateTable**
> TableInfo updateTable(full\_name, UpdateTable)

Update a table owner

Transfers ownership of a table or view to an existing user.

### Parameters

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **full\_name** | **String**| Full name of the table. | [default to null] |
| **UpdateTable** | [**UpdateTable**](../Models/UpdateTable.md)| | |

### Return type

[**TableInfo**](../Models/TableInfo.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

2 changes: 1 addition & 1 deletion api/Apis/VolumesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ No authorization required

Update a Volume

Updates the specified volume under the specified parent catalog and schema. Currently only the name or the comment of the volume could be updated.
Updates the specified volume under the specified parent catalog and schema. You can update the volume&#39;s name, comment, or owner.

### Parameters

Expand Down
1 change: 1 addition & 0 deletions api/Models/UpdateCatalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **owner** | **String** | Username of the new owner. The user must already exist. | [optional] [default to null] |
| **comment** | **String** | User-provided free-form text description. | [optional] [default to null] |
| **properties** | **Map** | A map of key-value properties attached to the securable. | [optional] [default to null] |
| **new\_name** | **String** | New name for the catalog. | [optional] [default to null] |
Expand Down
2 changes: 1 addition & 1 deletion api/Models/UpdateCredentialRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **comment** | **String** | Comment associated with the credential. | [optional] [default to null] |
| **owner** | **String** | Username of current owner of credential. | [optional] [default to null] |
| **owner** | **String** | Username of the new owner. The user must already exist. | [optional] [default to null] |
| **aws\_iam\_role** | [**AwsIamRoleRequest**](AwsIamRoleRequest.md) | | [optional] [default to null] |
| **s3\_compatible** | [**S3CompatibleRequest**](S3CompatibleRequest.md) | | [optional] [default to null] |
| **new\_name** | **String** | New name for the credential. | [optional] [default to null] |
Expand Down
2 changes: 1 addition & 1 deletion api/Models/UpdateExternalLocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| **url** | **String** | Path URL of the external location. | [optional] [default to null] |
| **credential\_name** | **String** | Name of the storage credential used with this location. Setting it on an external location whose credential was force-deleted repairs the location. | [optional] [default to null] |
| **comment** | **String** | User-provided free-form text description. | [optional] [default to null] |
| **owner** | **String** | The owner of the external location. | [optional] [default to null] |
| **owner** | **String** | Username of the new owner. The user must already exist. | [optional] [default to null] |
| **new\_name** | **String** | New name for the external location. | [optional] [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
9 changes: 9 additions & 0 deletions api/Models/UpdateFunction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# UpdateFunction
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **owner** | **String** | Username of the new owner. Only a metastore admin can transfer a function to another user. | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

1 change: 1 addition & 0 deletions api/Models/UpdateRegisteredModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **owner** | **String** | Username of the new owner. Only a metastore admin can transfer a model to another user. | [optional] [default to null] |
| **comment** | **String** | User-provided free-form text description. | [optional] [default to null] |
| **new\_name** | **String** | New name for the model. | [optional] [default to null] |

Expand Down
1 change: 1 addition & 0 deletions api/Models/UpdateSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **owner** | **String** | Username of the new owner. The user must already exist. | [optional] [default to null] |
| **comment** | **String** | User-provided free-form text description. | [optional] [default to null] |
| **properties** | **Map** | A map of key-value properties attached to the securable. | [optional] [default to null] |
| **new\_name** | **String** | New name for the schema. | [optional] [default to null] |
Expand Down
9 changes: 9 additions & 0 deletions api/Models/UpdateTable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# UpdateTable
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **owner** | **String** | Username of the new owner. Only a metastore admin can transfer a view to another user. | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

1 change: 1 addition & 0 deletions api/Models/UpdateVolumeRequestContent.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **owner** | **String** | Username of the new owner. The user must already exist. | [optional] [default to null] |
| **comment** | **String** | The comment attached to the volume | [optional] [default to null] |
| **new\_name** | **String** | New name for the volume. | [optional] [default to null] |

Expand Down
4 changes: 4 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All URIs are relative to *http://localhost:8080/api/2.1/unity-catalog*
*FunctionsApi* | [**deleteFunction**](Apis/FunctionsApi.md#deletefunction) | **DELETE** /functions/{name} | Delete a function |
*FunctionsApi* | [**getFunction**](Apis/FunctionsApi.md#getfunction) | **GET** /functions/{name} | Get a function |
*FunctionsApi* | [**listFunctions**](Apis/FunctionsApi.md#listfunctions) | **GET** /functions | List functions |
*FunctionsApi* | [**updateFunction**](Apis/FunctionsApi.md#updatefunction) | **PATCH** /functions/{name} | Update a function owner |
| *GrantsApi* | [**get**](Apis/GrantsApi.md#get) | **GET** /permissions/{securable_type}/{full_name} | Get permissions |
*GrantsApi* | [**update**](Apis/GrantsApi.md#update) | **PATCH** /permissions/{securable_type}/{full_name} | Update a permission |
| *MetastoresApi* | [**summary**](Apis/MetastoresApi.md#summary) | **GET** /metastore_summary | Get metastore summary |
Expand All @@ -52,6 +53,7 @@ All URIs are relative to *http://localhost:8080/api/2.1/unity-catalog*
*TablesApi* | [**deleteTable**](Apis/TablesApi.md#deletetable) | **DELETE** /tables/{full_name} | Delete a table |
*TablesApi* | [**getTable**](Apis/TablesApi.md#gettable) | **GET** /tables/{full_name} | Get a table |
*TablesApi* | [**listTables**](Apis/TablesApi.md#listtables) | **GET** /tables | List tables |
*TablesApi* | [**updateTable**](Apis/TablesApi.md#updatetable) | **PATCH** /tables/{full_name} | Update a table owner |
| *TemporaryCredentialsApi* | [**generateTemporaryModelVersionCredentials**](Apis/TemporaryCredentialsApi.md#generatetemporarymodelversioncredentials) | **POST** /temporary-model-version-credentials | Generate temporary model version credentials. These credentials are used by clients to write and retrieve model artifacts from the model versions external storage location. |
*TemporaryCredentialsApi* | [**generateTemporaryPathCredentials**](Apis/TemporaryCredentialsApi.md#generatetemporarypathcredentials) | **POST** /temporary-path-credentials | Generate temporary path credentials. |
*TemporaryCredentialsApi* | [**generateTemporaryTableCredentials**](Apis/TemporaryCredentialsApi.md#generatetemporarytablecredentials) | **POST** /temporary-table-credentials | Generate temporary table credentials. |
Expand Down Expand Up @@ -145,10 +147,12 @@ All URIs are relative to *http://localhost:8080/api/2.1/unity-catalog*
- [UpdateCatalog](./Models/UpdateCatalog.md)
- [UpdateCredentialRequest](./Models/UpdateCredentialRequest.md)
- [UpdateExternalLocation](./Models/UpdateExternalLocation.md)
- [UpdateFunction](./Models/UpdateFunction.md)
- [UpdateModelVersion](./Models/UpdateModelVersion.md)
- [UpdatePermissions](./Models/UpdatePermissions.md)
- [UpdateRegisteredModel](./Models/UpdateRegisteredModel.md)
- [UpdateSchema](./Models/UpdateSchema.md)
- [UpdateTable](./Models/UpdateTable.md)
- [UpdateVolumeRequestContent](./Models/UpdateVolumeRequestContent.md)
- [VolumeInfo](./Models/VolumeInfo.md)
- [VolumeOperation](./Models/VolumeOperation.md)
Expand Down
72 changes: 69 additions & 3 deletions api/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,25 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/TableInfo'
patch:
tags:
- Tables
operationId: updateTable
summary: Update a table owner
description: Transfers ownership of a table or view to an existing user.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateTable'
responses:
'200':
description: The table owner was successfully updated.
content:
application/json:
schema:
$ref: '#/components/schemas/TableInfo'
delete:
tags:
- Tables
Expand Down Expand Up @@ -614,7 +633,7 @@ paths:
description: |
Updates the specified volume under the specified parent catalog and schema.

Currently only the name or the comment of the volume could be updated.
You can update the volume's name, comment, or owner.
requestBody:
content:
application/json:
Expand Down Expand Up @@ -811,6 +830,25 @@ paths:
application/json:
schema:
"$ref": "#/components/schemas/FunctionInfo"
patch:
tags:
- Functions
operationId: updateFunction
summary: Update a function owner
description: Transfers ownership of a function to an existing user.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateFunction'
responses:
'200':
description: The function owner was successfully updated.
content:
application/json:
schema:
$ref: '#/components/schemas/FunctionInfo'
delete:
tags:
- Functions
Expand Down Expand Up @@ -1647,6 +1685,9 @@ components:
UpdateVolumeRequestContent:
type: object
properties:
owner:
description: Username of the new owner. The user must already exist.
type: string
comment:
type: string
maxLength: 65536
Expand Down Expand Up @@ -2018,6 +2059,9 @@ components:
UpdateSchema:
type: object
properties:
owner:
description: Username of the new owner. The user must already exist.
type: string
comment:
description: User-provided free-form text description.
type: string
Expand Down Expand Up @@ -2104,6 +2148,9 @@ components:
UpdateCatalog:
type: object
properties:
owner:
description: Username of the new owner. The user must already exist.
type: string
comment:
description: User-provided free-form text description.
type: string
Expand Down Expand Up @@ -2197,6 +2244,22 @@ components:
"$ref": "#/components/schemas/CreateFunction"
required:
- function_info
UpdateFunction:
type: object
properties:
owner:
description: Username of the new owner. Only a metastore admin can transfer a function to another user.
type: string
required:
- owner
UpdateTable:
type: object
properties:
owner:
description: Username of the new owner. Only a metastore admin can transfer a view to another user.
type: string
required:
- owner
FunctionDependency:
description: A function that is dependent on a SQL object.
type: object
Expand Down Expand Up @@ -2681,6 +2744,9 @@ components:
UpdateRegisteredModel:
type: object
properties:
owner:
description: Username of the new owner. Only a metastore admin can transfer a model to another user.
type: string
comment:
description: User-provided free-form text description.
type: string
Expand Down Expand Up @@ -2996,7 +3062,7 @@ components:
description: Comment associated with the credential.
type: string
owner:
description: Username of current owner of credential.
description: Username of the new owner. The user must already exist.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] The owner field on UpdateCredentialRequest (here, and on UpdateExternalLocation at line 3116) shipped in v0.3.0, and the server ignored it on PATCH until now. Existing clients that echo a stored owner back in an update will now transfer ownership, or move it back if their copy is stale. Can we call this out explicitly in the PR description, docs/server/auth.md, and the release notes, and say whether a migration path is needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an upgrade note to the PR description and auth guide. Clients must omit owner unless they intend to transfer ownership. No database migration is needed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] Nit: the upgrade note covers credential and external location only. Could it also name the other PATCH endpoints that accept owner now (catalog, schema, volume, and registered model)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added catalog, schema, volume, and registered model PATCH requests to the ownership-transfer documentation. (AI assisted)

type: string
aws_iam_role:
$ref: '#/components/schemas/AwsIamRoleRequest'
Expand Down Expand Up @@ -3211,7 +3277,7 @@ components:
description: User-provided free-form text description.
type: string
owner:
description: The owner of the external location.
description: Username of the new owner. The user must already exist.
type: string
new_name:
description: New name for the external location.
Expand Down
40 changes: 36 additions & 4 deletions docs/server/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,11 @@ Optional tuning:
| `server.authorization.policy-refresh-interval` | `PT1M` | How often each instance polls `casbin_rule` |
| `server.authorization.policy-refresh-min-probe-interval` | `PT1S` | Minimum gap between deny-path `max(id)` probes. Quiet traffic is unlikely to wait. Lower toward `PT0S` under heavy 403 load for faster grant visibility; that increases `casbin_rule` queries. |

Revocations propagate on the poll interval. A stale deny can trigger one `max(id)` probe
before returning 403. Concurrent denials and list-filter items share a probe that started after the
request.
Each poll compares the policy row count and maximum row ID. Concurrent commits can leave both
values unchanged, so a poll can miss an ownership transfer until another detectable policy change
or a restart. The poll interval is not a guaranteed revocation deadline. A stale deny can trigger
one `max(id)` probe before returning 403. Concurrent denials and list-filter items share a probe
that started after the request.

### Valid privilege grants

Expand Down Expand Up @@ -381,7 +383,8 @@ to use the correct object types before adding or reapplying grants.
### MANAGE

`MANAGE` permits full metadata and grant inspection, grant changes, supported metadata updates,
and deletion. Managers can grant themselves other privileges, including data access.
deletion, and ownership transfer. Managers can grant themselves other privileges, including data
access.

Catalog and schema grants also cover their children. Usage grants are required only above the
scope where `MANAGE` is granted. A schema grant needs `USE CATALOG`. A grant on an object inside
Expand All @@ -408,6 +411,35 @@ BROWSE does not permit data access, credentials, changes, or engine table loads.
Lists can mix full and browse-only objects. A filtered page can be empty and still have a
`next_page_token`; continue until the token is absent.

### Ownership transfer

Set `owner` in an object's PATCH request to transfer ownership to an existing user. Table and
function PATCH requests support only ownership changes. For views, functions, and models, a user
can transfer ownership to themselves; a metastore admin can transfer to another user.

Omit `owner` when updating other fields. In v0.3.0, credential and external location PATCH
requests accepted `owner` but ignored it. These requests now transfer ownership when `owner`
is set. Update clients that copy an object's old owner into PATCH requests. No database
migration is required.

Catalog, schema, volume, and registered model PATCH requests also accept `owner` for ownership
transfer.

The object owner and its `OWNER` grant are saved in one database transaction. After commit,
the server reloads its local permission cache. Enable [policy refresh](#multiple-server-instances)
on every instance to detect changes from other servers, subject to its concurrent-commit limitation.

If the local reload fails, the request returns `UNAVAILABLE` even though the transfer may have
committed. With native authorization, permission checks on this instance deny every user,
including metastore admins, until a reload succeeds. A denied request retries the reload even
when policy refresh is disabled. Native grant changes and permission listings also retry the
reload. Read the owner after recovery before retrying a transfer.

Creation also saves its `OWNER` grant and any parent permission link in the resource transaction.
A failed cache load returns `UNAVAILABLE` after creation commits. Later denied requests and native
grant operations retry the load, even when policy refresh is disabled. Read the object after
recovery before retrying creation.

### Restart the UC Server

Now that the Google Authentication is configured, restart the UC Server with the following command.
Expand Down
Loading
Loading