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

introduce feature-flags system attribute for domains #2250

Merged
merged 1 commit into from
Jul 24, 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
30 changes: 30 additions & 0 deletions clients/go/zms/model.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/go/zms/zms_schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions core/zms/src/main/java/com/yahoo/athenz/zms/Domain.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public class Domain {
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public String productId;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public Integer featureFlags;
public String name;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down Expand Up @@ -256,6 +259,13 @@ public Domain setProductId(String productId) {
public String getProductId() {
return productId;
}
public Domain setFeatureFlags(Integer featureFlags) {
this.featureFlags = featureFlags;
return this;
}
public Integer getFeatureFlags() {
return featureFlags;
}
public Domain setName(String name) {
this.name = name;
return this;
Expand Down Expand Up @@ -354,6 +364,9 @@ public boolean equals(Object another) {
if (productId == null ? a.productId != null : !productId.equals(a.productId)) {
return false;
}
if (featureFlags == null ? a.featureFlags != null : !featureFlags.equals(a.featureFlags)) {
return false;
}
if (name == null ? a.name != null : !name.equals(a.name)) {
return false;
}
Expand Down
13 changes: 13 additions & 0 deletions core/zms/src/main/java/com/yahoo/athenz/zms/DomainData.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public class DomainData {
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public String productId;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public Integer featureFlags;
public String name;
public List<Role> roles;
public SignedPolicies policies;
Expand Down Expand Up @@ -252,6 +255,13 @@ public DomainData setProductId(String productId) {
public String getProductId() {
return productId;
}
public DomainData setFeatureFlags(Integer featureFlags) {
this.featureFlags = featureFlags;
return this;
}
public Integer getFeatureFlags() {
return featureFlags;
}
public DomainData setName(String name) {
this.name = name;
return this;
Expand Down Expand Up @@ -378,6 +388,9 @@ public boolean equals(Object another) {
if (productId == null ? a.productId != null : !productId.equals(a.productId)) {
return false;
}
if (featureFlags == null ? a.featureFlags != null : !featureFlags.equals(a.featureFlags)) {
return false;
}
if (name == null ? a.name != null : !name.equals(a.name)) {
return false;
}
Expand Down
13 changes: 13 additions & 0 deletions core/zms/src/main/java/com/yahoo/athenz/zms/DomainMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public class DomainMeta {
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public String productId;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public Integer featureFlags;

public DomainMeta setDescription(String description) {
this.description = description;
Expand Down Expand Up @@ -245,6 +248,13 @@ public DomainMeta setProductId(String productId) {
public String getProductId() {
return productId;
}
public DomainMeta setFeatureFlags(Integer featureFlags) {
this.featureFlags = featureFlags;
return this;
}
public Integer getFeatureFlags() {
return featureFlags;
}

@Override
public boolean equals(Object another) {
Expand Down Expand Up @@ -322,6 +332,9 @@ public boolean equals(Object another) {
if (productId == null ? a.productId != null : !productId.equals(a.productId)) {
return false;
}
if (featureFlags == null ? a.featureFlags != null : !featureFlags.equals(a.featureFlags)) {
return false;
}
}
return true;
}
Expand Down
13 changes: 13 additions & 0 deletions core/zms/src/main/java/com/yahoo/athenz/zms/SubDomain.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public class SubDomain {
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public String productId;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public Integer featureFlags;
public String name;
public List<String> adminUsers;
@RdlOptional
Expand Down Expand Up @@ -251,6 +254,13 @@ public SubDomain setProductId(String productId) {
public String getProductId() {
return productId;
}
public SubDomain setFeatureFlags(Integer featureFlags) {
this.featureFlags = featureFlags;
return this;
}
public Integer getFeatureFlags() {
return featureFlags;
}
public SubDomain setName(String name) {
this.name = name;
return this;
Expand Down Expand Up @@ -356,6 +366,9 @@ public boolean equals(Object another) {
if (productId == null ? a.productId != null : !productId.equals(a.productId)) {
return false;
}
if (featureFlags == null ? a.featureFlags != null : !featureFlags.equals(a.featureFlags)) {
return false;
}
if (name == null ? a.name != null : !name.equals(a.name)) {
return false;
}
Expand Down
13 changes: 13 additions & 0 deletions core/zms/src/main/java/com/yahoo/athenz/zms/TopLevelDomain.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public class TopLevelDomain {
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public String productId;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public Integer featureFlags;
public String name;
public List<String> adminUsers;
@RdlOptional
Expand Down Expand Up @@ -251,6 +254,13 @@ public TopLevelDomain setProductId(String productId) {
public String getProductId() {
return productId;
}
public TopLevelDomain setFeatureFlags(Integer featureFlags) {
this.featureFlags = featureFlags;
return this;
}
public Integer getFeatureFlags() {
return featureFlags;
}
public TopLevelDomain setName(String name) {
this.name = name;
return this;
Expand Down Expand Up @@ -349,6 +359,9 @@ public boolean equals(Object another) {
if (productId == null ? a.productId != null : !productId.equals(a.productId)) {
return false;
}
if (featureFlags == null ? a.featureFlags != null : !featureFlags.equals(a.featureFlags)) {
return false;
}
if (name == null ? a.name != null : !name.equals(a.name)) {
return false;
}
Expand Down
13 changes: 13 additions & 0 deletions core/zms/src/main/java/com/yahoo/athenz/zms/UserDomain.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public class UserDomain {
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public String productId;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public Integer featureFlags;
public String name;
@RdlOptional
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down Expand Up @@ -249,6 +252,13 @@ public UserDomain setProductId(String productId) {
public String getProductId() {
return productId;
}
public UserDomain setFeatureFlags(Integer featureFlags) {
this.featureFlags = featureFlags;
return this;
}
public Integer getFeatureFlags() {
return featureFlags;
}
public UserDomain setName(String name) {
this.name = name;
return this;
Expand Down Expand Up @@ -340,6 +350,9 @@ public boolean equals(Object another) {
if (productId == null ? a.productId != null : !productId.equals(a.productId)) {
return false;
}
if (featureFlags == null ? a.featureFlags != null : !featureFlags.equals(a.featureFlags)) {
return false;
}
if (name == null ? a.name != null : !name.equals(a.name)) {
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion core/zms/src/main/java/com/yahoo/athenz/zms/ZMSSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ private static Schema build() {
.mapField("tags", "CompoundName", "TagValueList", true, "key-value pair tags, tag might contain multiple values")
.field("businessService", "String", true, "associated business service with domain")
.field("memberPurgeExpiryDays", "Int32", true, "purge role/group members with expiry date configured days in the past")
.field("productId", "String", true, "associated product id (system attribute - uniqueness check - if enabled)");
.field("productId", "String", true, "associated product id (system attribute - uniqueness check - if enabled)")
.field("featureFlags", "Int32", true, "features enabled per domain (system attribute)");

sb.structType("Domain", "DomainMeta")
.comment("A domain is an independent partition of users, roles, and resources. Its name represents the definition of a namespace; the only way a new namespace can be created, from the top, is by creating Domains. Administration of a domain is governed by the parent domain (using reverse-DNS namespaces). The top level domains are governed by the special \"sys.auth\" domain.")
Expand Down
1 change: 1 addition & 0 deletions core/zms/src/main/rdl/Domain.tdl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type DomainMeta Struct {
String businessService (optional, x_allowempty="true"); //associated business service with domain
Int32 memberPurgeExpiryDays (optional); //purge role/group members with expiry date configured days in the past
String productId (optional); //associated product id (system attribute - uniqueness check - if enabled)
Int32 featureFlags (optional); //features enabled per domain (system attribute)
}

//A domain is an independent partition of users, roles, and resources.
Expand Down
Loading