summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-02-09 17:11:18 +0100
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-02-09 17:11:18 +0100
commit3014e3e42ce93ec638eda67d0fd0c40f68431707 (patch)
treecbc4b587293c97e8d88dcc6bdf3bc0407693404b /configserver
parentcf2673c4494f233c086dc54d747a377474801fb9 (diff)
Define required capabilities for existing JRT RPC methods
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/rpc/RpcServer.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/RpcServer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/RpcServer.java
index 034ac97ebd8..be4738258d8 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/RpcServer.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/RpcServer.java
@@ -20,6 +20,7 @@ import com.yahoo.jrt.StringValue;
import com.yahoo.jrt.Supervisor;
import com.yahoo.jrt.Target;
import com.yahoo.jrt.Transport;
+import com.yahoo.security.tls.Capability;
import com.yahoo.vespa.config.ErrorCode;
import com.yahoo.vespa.config.JRTMethods;
import com.yahoo.vespa.config.protocol.ConfigResponse;
@@ -224,11 +225,13 @@ public class RpcServer implements Runnable, ConfigActivationListener, TenantList
getSupervisor().addMethod(new Method("printStatistics", "", "s", this::printStatistics)
.methodDesc("printStatistics")
.returnDesc(0, "statistics", "Statistics for server"));
- getSupervisor().addMethod(new Method("filedistribution.serveFile", "si*", "is", this::serveFile));
+ getSupervisor().addMethod(new Method("filedistribution.serveFile", "si*", "is", this::serveFile)
+ .requireCapabilities(Capability.CONFIGSERVER__FILEDISTRIBUTION_API));
getSupervisor().addMethod(new Method("filedistribution.setFileReferencesToDownload", "S", "i", this::setFileReferencesToDownload)
- .methodDesc("set which file references to download")
- .paramDesc(0, "file references", "file reference to download")
- .returnDesc(0, "ret", "0 if success, 1 otherwise"));
+ .requireCapabilities(Capability.CONFIGSERVER__FILEDISTRIBUTION_API)
+ .methodDesc("set which file references to download")
+ .paramDesc(0, "file references", "file reference to download")
+ .returnDesc(0, "ret", "0 if success, 1 otherwise"));
}
/**
@@ -236,7 +239,8 @@ public class RpcServer implements Runnable, ConfigActivationListener, TenantList
*/
public void setUpGetConfigHandlers() {
// The getConfig method in this class will handle RPC calls for getting config
- getSupervisor().addMethod(JRTMethods.createConfigV3GetConfigMethod(this::getConfigV3));
+ getSupervisor().addMethod(JRTMethods.createConfigV3GetConfigMethod(this::getConfigV3)
+ .requireCapabilities(Capability.CONFIGSERVER__CONFIG_API));
isServingConfigRequests = true;
}