diff options
author | Harald Musum <musum@verizonmedia.com> | 2021-01-12 08:07:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 08:07:18 +0100 |
commit | ab7a73aa95e69c5ebb760c6d2b5b153670a0e49a (patch) | |
tree | 4a03a8e185c4680c6308dbed1678cb93a9975541 /configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java | |
parent | 14666cbe555006bfe675cbe0052474c644235267 (diff) |
Revert "Reapply "Remove unnecessary component" [run-systemtest]""
Diffstat (limited to 'configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java')
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java index 12debc347de..9e1edb35b8f 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java @@ -7,6 +7,7 @@ import com.yahoo.config.FileReference; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.HostName; import com.yahoo.config.provision.NodeType; +import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.security.NodeIdentifier; import com.yahoo.config.provision.security.NodeIdentifierException; import com.yahoo.config.provision.security.NodeIdentity; @@ -65,7 +66,7 @@ public class MultiTenantRpcAuthorizerTest { @Test public void configserver_can_access_files_and_config() throws InterruptedException, ExecutionException { RpcAuthorizer authorizer = createAuthorizer(new NodeIdentity.Builder(NodeType.config).build(), - new HostRegistry()); + new HostRegistry<>()); Request configRequest = createConfigRequest(new ConfigKey<>("name", "configid", "namespace"), HOSTNAME); authorizer.authorizeConfigRequest(configRequest) @@ -82,8 +83,8 @@ public class MultiTenantRpcAuthorizerTest { .applicationId(APPLICATION_ID) .build(); - HostRegistry hostRegistry = new HostRegistry(); - hostRegistry.update(APPLICATION_ID, List.of(HOSTNAME.value())); + HostRegistry<TenantName> hostRegistry = new HostRegistry<>(); + hostRegistry.update(APPLICATION_ID.tenant(), List.of(HOSTNAME.value())); RpcAuthorizer authorizer = createAuthorizer(identity, hostRegistry); @@ -98,7 +99,7 @@ public class MultiTenantRpcAuthorizerTest { @Test public void proxy_node_can_access_lbservice_config() throws ExecutionException, InterruptedException { - RpcAuthorizer authorizer = createAuthorizer(new NodeIdentity.Builder(NodeType.proxy).build(), new HostRegistry()); + RpcAuthorizer authorizer = createAuthorizer(new NodeIdentity.Builder(NodeType.proxy).build(), new HostRegistry<>()); Request configRequest = createConfigRequest( new ConfigKey<>(LbServicesConfig.CONFIG_DEF_NAME, "*", LbServicesConfig.CONFIG_DEF_NAMESPACE), @@ -109,7 +110,7 @@ public class MultiTenantRpcAuthorizerTest { @Test public void tenant_node_cannot_access_lbservice_config() throws ExecutionException, InterruptedException { - RpcAuthorizer authorizer = createAuthorizer(new NodeIdentity.Builder(NodeType.tenant).build(), new HostRegistry()); + RpcAuthorizer authorizer = createAuthorizer(new NodeIdentity.Builder(NodeType.tenant).build(), new HostRegistry<>()); Request configRequest = createConfigRequest( new ConfigKey<>(LbServicesConfig.CONFIG_DEF_NAME, "*", LbServicesConfig.CONFIG_DEF_NAMESPACE), @@ -128,8 +129,8 @@ public class MultiTenantRpcAuthorizerTest { .applicationId(APPLICATION_ID) .build(); - HostRegistry hostRegistry = new HostRegistry(); - hostRegistry.update(APPLICATION_ID, List.of(HOSTNAME.value())); + HostRegistry<TenantName> hostRegistry = new HostRegistry<>(); + hostRegistry.update(APPLICATION_ID.tenant(), List.of(HOSTNAME.value())); RpcAuthorizer authorizer = createAuthorizer(identity, hostRegistry); @@ -148,8 +149,8 @@ public class MultiTenantRpcAuthorizerTest { .applicationId(EVIL_APP_ID) .build(); - HostRegistry hostRegistry = new HostRegistry(); - hostRegistry.update(APPLICATION_ID, List.of(HOSTNAME.value())); + HostRegistry<TenantName> hostRegistry = new HostRegistry<>(); + hostRegistry.update(APPLICATION_ID.tenant(), List.of(HOSTNAME.value())); RpcAuthorizer authorizer = createAuthorizer(identity, hostRegistry); @@ -168,7 +169,7 @@ public class MultiTenantRpcAuthorizerTest { .applicationId(EVIL_APP_ID) .build(); - HostRegistry hostRegistry = new HostRegistry(); + HostRegistry<TenantName> hostRegistry = new HostRegistry<>(); RpcAuthorizer authorizer = createAuthorizer(identity, hostRegistry); @@ -187,8 +188,8 @@ public class MultiTenantRpcAuthorizerTest { .applicationId(EVIL_APP_ID) .build(); - HostRegistry hostRegistry = new HostRegistry(); - hostRegistry.update(EVIL_APP_ID, List.of(HOSTNAME.value())); + HostRegistry<TenantName> hostRegistry = new HostRegistry<>(); + hostRegistry.update(EVIL_APP_ID.tenant(), List.of(HOSTNAME.value())); RpcAuthorizer authorizer = createAuthorizer(identity, hostRegistry); @@ -207,7 +208,7 @@ public class MultiTenantRpcAuthorizerTest { .applicationId(APPLICATION_ID) .build(); - HostRegistry hostRegistry = new HostRegistry(); + HostRegistry<TenantName> hostRegistry = new HostRegistry<>(); RpcAuthorizer authorizer = createAuthorizer(identity, hostRegistry); @@ -218,7 +219,7 @@ public class MultiTenantRpcAuthorizerTest { } - private static RpcAuthorizer createAuthorizer(NodeIdentity identity, HostRegistry hostRegistry) { + private static RpcAuthorizer createAuthorizer(NodeIdentity identity, HostRegistry<TenantName> hostRegistry) { return new MultiTenantRpcAuthorizer( new StaticNodeIdentifier(identity), hostRegistry, |