diff options
author | Morten Tokle <morten.tokle@gmail.com> | 2017-10-16 22:38:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-16 22:38:43 +0200 |
commit | 18c0d7a09bfa82da57424340a4c8753c15380c56 (patch) | |
tree | 77ae8ca14e0f1632af55e3a836a2f49fd994cc50 | |
parent | 7ebfbf8e3304f5acb2917cbfded7e91fb575fdfa (diff) | |
parent | c98f81ffa25a0f2473598214d1caa11b773127bc (diff) |
Merge pull request #3775 from vespa-engine/bjorncs/athenz-fixes
Bjorncs/athenz fixes
4 files changed, 10 insertions, 10 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/identifiers/AthensDomain.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/identifiers/AthensDomain.java index 194088df7dc..5dade6f1a64 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/identifiers/AthensDomain.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/identifiers/AthensDomain.java @@ -19,7 +19,7 @@ public class AthensDomain extends Identifier { return new AthensDomain(id().substring(0, lastDot())); } - public String getName() { + public String getNameSuffix() { return id().substring(lastDot() + 1); } diff --git a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/IdentifierTest.java b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/IdentifierTest.java index 56825cf7c61..f27bcb0c3af 100644 --- a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/IdentifierTest.java +++ b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/IdentifierTest.java @@ -124,7 +124,7 @@ public class IdentifierTest { @Test public void athens_domain_name_is_last_suffix() { - assertEquals("myapp", new AthensDomain("yby.john.myapp").getName()); + assertEquals("myapp", new AthensDomain("yby.john.myapp").getNameSuffix()); } @Test diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZmsClientImpl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZmsClientImpl.java index 48bd8af7dfe..6fc0558a5a1 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZmsClientImpl.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZmsClientImpl.java @@ -66,16 +66,16 @@ public class ZmsClientImpl implements ZmsClient { List<TenantRoleAction> tenantRoleActions = createTenantRoleActions(); log("putProviderResourceGroupRoles(" + "tenantDomain=%s, providerDomain=%s, service=%s, resourceGroup=%s, roleActions=%s)", - tenantDomain, service.getDomain().getName(), service.getServiceName(), applicationName, tenantRoleActions); + tenantDomain, service.getDomain().id(), service.getServiceName(), applicationName, tenantRoleActions); runOrThrow(() -> { ProviderResourceGroupRoles resourceGroupRoles = new ProviderResourceGroupRoles() - .setDomain(service.getDomain().getName()) + .setDomain(service.getDomain().id()) .setService(service.getServiceName()) .setTenant(tenantDomain.id()) .setResourceGroup(applicationName.id()) .setRoles(tenantRoleActions); zmsClient.putProviderResourceGroupRoles( - tenantDomain.id(), service.getDomain().getName(), service.getServiceName(), + tenantDomain.id(), service.getDomain(), service.getServiceName(), applicationName.id(), /*auditref*/null, resourceGroupRoles); }); } @@ -83,10 +83,10 @@ public class ZmsClientImpl implements ZmsClient { @Override public void deleteApplication(AthensDomain tenantDomain, ApplicationId applicationName) { log("deleteProviderResourceGroupRoles(tenantDomain=%s, providerDomain=%s, service=%s, resourceGroup=%s)", - tenantDomain, service.getDomain().getName(), service.getServiceName(), applicationName); + tenantDomain, service.getDomain().id(), service.getServiceName(), applicationName); runOrThrow(() -> { zmsClient.deleteProviderResourceGroupRoles( - tenantDomain.id(), service.getDomain().getName(), service.getServiceName(), applicationName.id(), /*auditref*/null); + tenantDomain.id(), service.getDomain().id(), service.getServiceName(), applicationName.id(), /*auditref*/null); }); } @@ -197,7 +197,7 @@ public class ZmsClientImpl implements ZmsClient { private String resourceStringPrefix(AthensDomain tenantDomain) { return String.format("%s:service.%s.tenant.%s", - service.getDomain().getName(), service.getServiceName(), tenantDomain.id()); + service.getDomain().id(), service.getServiceName(), tenantDomain.id()); } private String tenantResourceString(AthensDomain tenantDomain) { diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZtsClientImpl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZtsClientImpl.java index d964cc967e8..62b80b898b5 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZtsClientImpl.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/ZtsClientImpl.java @@ -36,10 +36,10 @@ public class ZtsClientImpl implements ZtsClient { public List<AthensDomain> getTenantDomainsForUser(AthenzPrincipal principal) { log.log(LogLevel.DEBUG, String.format( "getTenantDomains(domain=%s, username=%s, rolename=admin, service=%s)", - service.getDomain().getName(), principal, service.getServiceName())); + service.getDomain().id(), principal, service.getServiceName())); try { TenantDomains domains = ztsClient.getTenantDomains( - service.getDomain().getName(), principal.toYRN(), "admin", service.getServiceName()); + service.getDomain().id(), principal.toYRN(), "admin", service.getServiceName()); return domains.getTenantDomainNames().stream() .map(AthensDomain::new) .collect(toList()); |