Skip to content

Commit

Permalink
Added min size validation on bucket name
Browse files Browse the repository at this point in the history
Signed-off-by: Asif Sohail Mohammed <[email protected]>
  • Loading branch information
asifsmohammed committed Aug 14, 2023
1 parent fc943b0 commit 9a45736
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class S3DlqWriterConfig {

@JsonProperty("bucket")
@NotEmpty
@Size(min = 3, max = 500, message = "bucket length should be at least 3 characters")
private String bucket;

@JsonProperty("key_path_prefix")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.opensearch.dataprepper.model.configuration.PluginModel;
import org.opensearch.dataprepper.plugins.sink.s3.accumulator.BufferTypeOptions;
import org.opensearch.dataprepper.plugins.sink.s3.compression.CompressionOption;
Expand All @@ -32,6 +33,7 @@ public class S3SinkConfig {

@JsonProperty("bucket")
@NotEmpty
@Size(min = 3, max = 500, message = "bucket length should be at least 3 characters")
private String bucketName;

@JsonProperty("object_key")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
import org.opensearch.dataprepper.plugins.source.CustomLocalDateTimeDeserializer;

import java.time.Duration;
Expand All @@ -23,6 +24,7 @@ public class S3ScanBucketOption {

@JsonProperty("name")
@NotEmpty
@Size(min = 3, max = 500, message = "bucket length should be at least 3 characters")
private String name;

@JsonDeserialize(using = CustomLocalDateTimeDeserializer.class)
Expand Down

0 comments on commit 9a45736

Please sign in to comment.