Chung-En Lee created HDDS-16492:
-----------------------------------

             Summary: Implement GetObjectLegalHold
                 Key: HDDS-16492
                 URL: https://issues.apache.org/jira/browse/HDDS-16492
             Project: Apache Ozone
          Issue Type: Sub-task
            Reporter: Chung-En Lee


Implement the S3 {{GetObjectLegalHold}} operation to query the legal hold 
status ({{{}ON{}}} or {{{}OFF{}}}) of an individual key. This task covers S3 
Gateway REST routing, OM client protocol translation, Ranger authorization, and 
metadata lookup in {{{}KeyTable{}}}.

{*}1. S3 Gateway ({{{}hadoop-ozone/s3gateway{}}}){*}:
 * Route {{{}GET /\{bucket}/\{key}?legal-hold{}}}.

 * Forward the request to Ozone Manager via client protocol.

 * Serialize the returned status into standard S3 {{LegalHold}} XML:
XML
 * Map OM exceptions to standard S3 error responses:

 ** Return {{404 NoSuchKey}} if the target key does not exist.

 ** Return {{404 NoSuchObjectLockConfiguration}} ({{{}The specified object does 
not have a ObjectLock configuration{}}}) if the key exists but has no legal 
hold status configured.

{*}2. Protobuf Protocol ({{{}OmClientProtocol.proto{}}}) & OM Client{*}:
 * Add RPC messages:

 ** {{GetObjectLegalHoldRequest}} (contains {{{}volumeName{}}}, 
{{{}bucketName{}}}, {{{}keyName{}}}).

 ** {{GetObjectLegalHoldResponse}} (contains {{{}bool legalHold{}}}).

 * Register the new request type in {{OmClientProtocol}} and wire through 
{{{}OzoneManagerProtocolClientSideTranslatorPB{}}}.

{*}3. OM Read Path / Metadata Handler ({{{}hadoop-ozone/ozone-manager{}}}){*}:
 * Authorize the incoming request against Ranger action {{GetObjectLegalHold}} 
(requiring key-level {{READ}} permission).

 * Acquire bucket/key read lock and retrieve {{OmKeyInfo}} from 
{{{}KeyTable{}}}.

 * If key is absent, throw {{{}KEY_NOT_FOUND{}}}.

 * Inspect {{{}OmKeyInfo.getLegalHold(){}}}:

 ** If legal hold was never explicitly configured on the object, throw 
{{OBJECT_LOCK_CONFIG_NOT_FOUND}} (mapped to S3 {{{}404 
NoSuchObjectLockConfiguration{}}}).

 ** If configured, return the status ({{{}true{}}} $\rightarrow$ {{{}ON{}}}, 
{{false}} $\rightarrow$ {{{}OFF{}}}).

h4.  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to