Skip to content

Commit

Permalink
Add a systemPrefix helper, to filter athenz roles
Browse files Browse the repository at this point in the history
  • Loading branch information
gjoranv committed Dec 17, 2024
1 parent cfa3f3c commit 51d4588
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ public class AthenzUtil {
// Serves as a namespace for resources in athenz and AWS
public static final String PREFIX = "tenant-secret";

public static String systemPrefix(String systemName) {
return String.join(".", PREFIX, systemName).toLowerCase();
}

/* tenant-secret.<system>.<tenant> */
public static String roleAndPolicyPrefix(String systemName, String tenantName) {
return String.join(".", PREFIX, systemName, tenantName).toLowerCase();
return String.join(".", systemPrefix(systemName), tenantName).toLowerCase();
}

/* tenant-secret.<system>.<tenant>.<vaultName>.reader */
Expand Down

0 comments on commit 51d4588

Please sign in to comment.