Skip to content

Commit

Permalink
Merge pull request #33047 from vespa-engine/system-prefix-helper
Browse files Browse the repository at this point in the history
Add a systemPrefix helper, to filter athenz roles
  • Loading branch information
tokle authored Dec 18, 2024
2 parents 0d9e9ae + 51d4588 commit 9c9e1f7
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 9c9e1f7

Please sign in to comment.