priyeshkaratha opened a new pull request, #12170:
URL: https://github.com/apache/ozone/pull/12170

   ## What changes were proposed in this pull request?
   
   AWS S3 returns an `x-amz-expiration` header on HeadObject and GetObject when 
an enabled lifecycle Expiration rule applies to the object. Ozone S3 Gateway 
does not, which breaks S3 compatibility tests and clients that check object 
expiration metadata.
   
   This PR adds the header to HeadObject and GetObject responses:
   
       x-amz-expiration: expiry-date="Fri, 27 Nov 2026 00:00:00 GMT", 
rule-id="rule1"
   
   Following the review discussion on #11157, OM computes the expiry inside the 
existing S3 `getKeyInfo` call and returns it in a new optional 
`lifecycleExpiration` field of `GetKeyInfoResponse`. There is no extra OM call 
and no cache in S3 Gateway.
   
   - Rules are matched by prefix, tag, or `And` filter. If several rules match, 
the earliest expiry wins.
   - For `Days` rules, the expiry date is the key's modification time plus the 
days, rounded up to the next midnight UTC, as AWS S3 does.
   - If the lifecycle lookup fails, the header is omitted and the request still 
succeeds.
   - The new proto field is optional, so old clients ignore it, and an old OM 
sends no header.
   
   ## What is the link to the Apache JIRA
   
   HDDS-16151
   
   ## How was this patch tested?
   
   - New unit tests in `TestOmLCExpiration`, `TestOmLifeCycleConfiguration` and 
`TestOMMetadataReader`.
   - New cases in `TestObjectHead` and `TestObjectGet`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to