Skip to content

Verify object tagging #2473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2025
Merged

Verify object tagging #2473

merged 3 commits into from
Jun 30, 2025

Conversation

afranken
Copy link
Member

@afranken afranken commented Jun 23, 2025

Description

Tags are now verified for correctness.

Related Issue

N/A

Tasks

  • I have signed the CLA.
  • I have written tests and verified that they fail without my change.

@afranken afranken force-pushed the verify-object-tagging branch 2 times, most recently from 9c312f3 to d07e22d Compare June 27, 2025 12:24
@afranken afranken requested a review from Copilot June 27, 2025 12:35
Copilot

This comment was marked as outdated.

@afranken afranken force-pushed the verify-object-tagging branch from d07e22d to 3a3a33a Compare June 27, 2025 13:17
@afranken afranken requested a review from Copilot June 27, 2025 13:42
Copilot

This comment was marked as outdated.

@afranken afranken force-pushed the verify-object-tagging branch from 3a3a33a to ac68688 Compare June 27, 2025 14:18
@afranken afranken requested a review from Copilot June 30, 2025 15:21
Copilot

This comment was marked as outdated.

@afranken afranken force-pushed the verify-object-tagging branch from ac68688 to e1633d9 Compare June 30, 2025 15:28
@afranken afranken requested a review from Copilot June 30, 2025 15:38
Copilot

This comment was marked as outdated.

@afranken afranken force-pushed the verify-object-tagging branch from e1633d9 to d673c89 Compare June 30, 2025 15:58
@afranken afranken requested a review from Copilot June 30, 2025 16:56
Copilot

This comment was marked as outdated.

@afranken afranken force-pushed the verify-object-tagging branch from d673c89 to a94ac89 Compare June 30, 2025 17:35
@afranken afranken requested a review from Copilot June 30, 2025 17:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds server-side validation for S3 object tags, introduces a new INVALID_TAG exception, and updates related tests and documentation.

  • Implements verifyObjectTags in ObjectService and calls it in the controller
  • Defines INVALID_TAG in S3Exception and adds unit tests covering various tag validation scenarios
  • Renames writeVersionsfile to writeVersionsFile in ObjectStore and applies minor metadata updates

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
server/src/main/java/com/adobe/testing/s3mock/service/ObjectService.java Add verifyObjectTags and helper methods for tag validation
server/src/main/java/com/adobe/testing/s3mock/S3Exception.java Add INVALID_TAG exception constant
server/src/main/java/com/adobe/testing/s3mock/ObjectController.java Call verifyObjectTags before applying tags
server/src/main/java/com/adobe/testing/s3mock/store/ObjectStore.java Rename writeVersionsfilewriteVersionsFile and null checks
server/src/main/java/com/adobe/testing/s3mock/store/S3ObjectMetadata.java Annotate deleteMarker’s versionId parameter as @Nullable
server/src/test/kotlin/com/adobe/testing/s3mock/service/ObjectServiceTest.kt Add tests for valid/invalid tag lists
README.md Fix typos, headings, wording, and add "Powered by" section
CHANGELOG.md Document tag verification feature and minor version bumps
Comments suppressed due to low confidence (5)

server/src/test/kotlin/com/adobe/testing/s3mock/service/ObjectServiceTest.kt:314

  • [nitpick] Test name refers to 'store tags' but the method under test is verifyObjectTags; consider renaming to 'verify tags succeeds' for clarity.
  fun `store tags succeeds`() {

server/src/test/kotlin/com/adobe/testing/s3mock/service/ObjectServiceTest.kt:334

  • [nitpick] Add boundary tests for exactly MAX_ALLOWED_TAGS (50) and just above (51) to ensure edge conditions are handled correctly.
    for (i in 0..60) {

server/src/main/java/com/adobe/testing/s3mock/store/ObjectStore.java:518

  • [nitpick] The method name writeMetafile is inconsistent with writeVersionsFile; consider renaming to writeMetaFile for consistent camel-case.
        writeMetafile(bucket, S3ObjectMetadata.deleteMarker(s3ObjectMetadata, versionId));

server/src/main/java/com/adobe/testing/s3mock/store/S3ObjectMetadata.java:79

  • Make sure the correct @Nullable import (e.g., org.jspecify.annotations.Nullable) is present to avoid compilation errors.
  public static S3ObjectMetadata deleteMarker(S3ObjectMetadata metadata, @Nullable String versionId) {

README.md:576

  • [nitpick] Consider splitting this sentence or replacing the comma with a semicolon to avoid a run-on sentence.
`S3Mock` dependencies are updated regularly, any update could break any number of projects.  

@afranken afranken self-assigned this Jun 30, 2025
@afranken afranken merged commit 9bdac03 into main Jun 30, 2025
6 checks passed
@afranken afranken deleted the verify-object-tagging branch June 30, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant