[ 
https://issues.apache.org/jira/browse/KUDU-3639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913925#comment-17913925
 ] 

Alexey Serbin commented on KUDU-3639:
-------------------------------------

The proposed approach might work if the implementation of the methods would 
require only username/principal for the rest of the code, except maybe for the 
very last phase of sending back the response for the RPC.

However, taking a quick looks shows that's not exactly so: e.g., 
{{CatalogManager::CreateTable()}} calls 
{{WaitForNotificationLogListenerCatchUp()}} that require RpcContext to get 
information on RPC deadline set by the client.  Essentially, that means that 
not only username needs to be passed along, but some other information from the 
RPC context.

> Implement {Delete/Alter/Create}Table Functions Without RpcContext
> -----------------------------------------------------------------
>
>                 Key: KUDU-3639
>                 URL: https://issues.apache.org/jira/browse/KUDU-3639
>             Project: Kudu
>          Issue Type: New Feature
>            Reporter: Gabriella Lotz
>            Assignee: Gabriella Lotz
>            Priority: Major
>
> The CatalogManager::\{DeleteTableRpc, CreateTable, AlterTableRpc} functions 
> currently rely on rpc::RpcContext to extract the username of the requestor 
> for authorization. However, in the REST catalog API implementation, 
> RpcContext is not used, and only the username is directly available.
> To support REST API functionality, new functions are required that replace 
> RpcContext with an explicitly provided username while maintaining the same 
> core logic for table operations.
> Requirements:
>  * Create new functions:
>  ** CatalogManager::DeleteTableWithUser
>  ** CatalogManager::AlterTableWithUser
>  ** CatalogManager::CreateTableWithUser
>  * These functions should:
>  ** Accept a username parameter instead of rpc::RpcContext.
>  ** Implement the same authorization, logging, and HMS integration logic as 
> their corresponding RPC versions (DeleteTableRpc, AlterTableRpc, and 
> CreateTable).
>  ** Refactor shared logic between the existing RPC functions and the new 
> \{Delete/Alter/Create}TableWithUser functions into reusable helper functions 
> to minimize code duplication.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to