Skip to content
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

[FFM-9482] - Mark private attributes for removal #165

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/code_cleanup_examples/SampleClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public static void main(String... args) throws FeatureFlagInitializeException, I
final Target target =
Target.builder()
.identifier("target1")
.isPrivate(false)
.attribute("testKey", "TestValue")
.name("target1")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public static void main(String... args) {
final Target target =
Target.builder()
.identifier("target1")
.isPrivate(false)
.attribute("testKey", "TestValue")
.name("target1")
.build();
Expand Down
1 change: 0 additions & 1 deletion examples/src/main/java/io/harness/ff/examples/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public static void main(String... args) {
final Target target =
Target.builder()
.identifier("Target_" + random)
.isPrivate(false)
.attribute("Test_key_" + getRandom(), getRandom())
.attribute("Test_key_" + getRandom(), getRandom())
.attribute("Test_key_" + getRandom(), getRandom())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public static void main(String... args) throws FeatureFlagInitializeException, I
final Target target =
Target.builder()
.identifier("target1")
.isPrivate(false)
.attribute("testKey", "TestValue")
.name("target1")
.build();
Expand Down
1 change: 0 additions & 1 deletion examples/src/main/java/io/harness/ff/examples/Local.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public static void main(String... args) throws InterruptedException {
final Target target =
Target.builder()
.identifier("target1")
.isPrivate(false)
.attribute("testKey", "TestValue")
.name("target1")
.build();
Expand Down
1 change: 0 additions & 1 deletion examples/src/main/java/io/harness/ff/examples/Simple.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public static void main(String... args) throws FeatureFlagInitializeException, I
final Target target =
Target.builder()
.identifier("target1")
.isPrivate(false)
.attribute("testKey", "TestValue")
.name("target1")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public static void main(String... args)
final Target target =
Target.builder()
.identifier("target1")
.isPrivate(false)
.attribute("testKey", "TestValue")
.name("target1")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public static void main(String... args) {

final Target target = Target.builder()
.identifier("Target_" + random)
.isPrivate(false)
.name("Target_" + random)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public static void main(String... args) throws InterruptedException {
final Target target =
Target.builder()
.identifier("target1")
.isPrivate(false)
.attribute("testKey", "TestValue")
.name("target1")
.build();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/harness/cf/client/api/BaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class BaseConfig {
@Builder.Default private final int bufferSize = 2048;

// Flag to set all attributes as private
@Builder.Default private final boolean allAttributesPrivate = false;
@Deprecated @Builder.Default private final boolean allAttributesPrivate = false;
// Custom list to set the attributes which are private; move over to target
@Builder.Default private final Set<String> privateAttributes = Collections.emptySet();
@Deprecated @Builder.Default private final Set<String> privateAttributes = Collections.emptySet();

@Builder.Default private final boolean debug = false;
/** If metrics service POST call is taking > this time, we need to know about it */
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/io/harness/cf/client/dto/Target.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.harness.cf.client.dto;

import io.harness.cf.client.common.StringUtils;
import java.util.Map;
import java.util.Set;

import io.harness.cf.client.common.StringUtils;
import lombok.*;
import lombok.experimental.Accessors;

@Builder
@Getter
Expand All @@ -18,10 +18,14 @@ public class Target {
private String identifier;

@Singular private Map<String, Object> attributes;
private boolean isPrivate; // If the target is private

@Singular
private Set<String> privateAttributes; // Custom set to set the attributes which are private
@Deprecated // private attributes will be removed in a future release
@Getter
@Accessors(fluent = true)
@Builder.Default
private Boolean isPrivate = false;

@Deprecated @Singular private Set<String> privateAttributes;

@Override
public String toString() {
Expand Down
Loading