Skip to content
Permalink
Browse files
Implement load testing client, make config to disable authentication
  • Loading branch information
isururanawaka committed May 17, 2022
1 parent 0d8d9ad commit 783ed0deeb5ac49c091a506f27780af0d34c8114
Showing 9 changed files with 443 additions and 2 deletions.
@@ -26,4 +26,5 @@ custos.secret=mrMdl86Ia1H94cikW7CvHoh7L0ASNXQVt2aRzSIj
custos.host=custos.scigap.org
custos.port=31499
grpc.port=7070
server.port=8900
server.port=8900
custos.authentication.skip=true
@@ -18,6 +18,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.IOException;
@@ -32,8 +33,16 @@ public class Authenticator implements ServiceInterceptor {
private CustosClientProvider custosClientProvider;


@Value("${custos.authentication.skip}")
private boolean skipAuthentication;


@Override
public <ReqT> ReqT intercept(String method, Metadata headers, ReqT msg) throws IOException {

if (skipAuthentication) {
return msg;
}
Optional<AuthenticatedUser> authenticatorOptional = getAuthenticatedUser(msg, headers);
if (authenticatorOptional.isPresent()) {
return (ReqT) setAuthenticatedUser(msg, authenticatorOptional.get());
@@ -27,4 +27,5 @@ custos.host=services.usecustos.org
custos.port=31161
grpc.port=7070
local.grpc.port=7070
server.port=8081
server.port=8081
custos.authentication.skip=true
@@ -44,6 +44,7 @@
<logger name="org.apache.zookeeper" level="ERROR"/>
<logger name="org.apache.airavata" level="INFO"/>
<logger name="org.hibernate" level="ERROR"/>
<logger name="io.grpc.internal" level="OFF"/>
<Root level="INFO">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFileAppender"/>
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>airavata-data-lake</artifactId>
<groupId>org.apache.airavata.data.lake</groupId>
<version>0.01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>loadtesting-utilities</artifactId>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.7</version>
</dependency>
<dependency>
<groupId>org.apache.airavata.data.lake</groupId>
<artifactId>drms-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.airavata.data.lake</groupId>
<artifactId>drms-stubs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.3</version>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>
@@ -0,0 +1,14 @@
package org.apache.airavata.datalake.loadtesting;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = {"org.apache.airavata.datalake"})
@SpringBootApplication
public class LoadTestingServer {

public static void main(String[] args) {
SpringApplication.run(LoadTestingServer.class, args);
}
}

0 comments on commit 783ed0d

Please sign in to comment.