Skip to content

Commit

Permalink
fix issue when listing transactionId resourceType in the RBAC provide…
Browse files Browse the repository at this point in the history
…r as name is transient from the ACLs default one
  • Loading branch information
purbon committed May 3, 2021
1 parent 6c48ea4 commit dd33e45
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,19 @@ public String getName() {
public String getPatternType() {
return patternType;
}

@Override
public String toString() {
return "RbacResourceType{"
+ "resourceType='"
+ resourceType
+ '\''
+ ", name='"
+ name
+ '\''
+ ", patternType='"
+ patternType
+ '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Map<String, List<TopologyAclBinding>> listAcls() {
}
TopologyAclBinding binding =
TopologyAclBinding.build(
resource.getResourceType().toUpperCase(),
normalize(resource.getResourceType()),
resource.getName(),
"*",
roleName,
Expand All @@ -77,4 +77,9 @@ public Map<String, List<TopologyAclBinding>> listAcls() {
}
return map;
}

private String normalize(String resourceType) {
String[] fields = resourceType.split("(?=\\p{Upper})");
return String.join("_", fields).toUpperCase();
}
}

0 comments on commit dd33e45

Please sign in to comment.