Skip to content

Commit

Permalink
Fix #484: Remove module powerauth-webflow-tests (#485)
Browse files Browse the repository at this point in the history
* Fix #484: Remove module powerauth-webflow-tests
  • Loading branch information
banterCZ authored Jul 26, 2024
1 parent b3ddcbd commit c079975
Show file tree
Hide file tree
Showing 23 changed files with 10 additions and 1,089 deletions.
1 change: 0 additions & 1 deletion .github/workflows/maven-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
POWERAUTH_REST_URL: ${{ secrets.POWERAUTH_REST_URL }}
POWERAUTH_INTEGRATION_SERVICE_URL: ${{ secrets.POWERAUTH_INTEGRATION_SERVICE_URL }}
POWERAUTH_NEXTSTEP_SERVICE_URL: ${{ secrets.POWERAUTH_NEXTSTEP_SERVICE_URL }}
POWERAUTH_ENROLLMENT_SERVICE_URL: ${{ secrets.POWERAUTH_ENROLLMENT_SERVICE_URL }}
POWERAUTH_ENROLLMENT_ONBOARDING_SERVICE_URL: ${{ secrets.POWERAUTH_ENROLLMENT_ONBOARDING_SERVICE_URL }}
POWERAUTH_SERVICE_SECURITY_CLIENTTOKEN: ${{ secrets.POWERAUTH_SERVICE_SECURITY_CLIENTTOKEN }}
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ This project contains various tests for PowerAuth backends:

- [PowerAuth End-To-End Tests](./powerauth-backend-tests/README.md)
- [PowerAuth Load Tests](./powerauth-load-tests/README.md)
- [PowerAuth Web Flow UI Tests](./powerauth-webflow-tests/README.md)
- [PowerAuth FIDO2 Tests](./powerauth-fido2-tests/README.md)

# License
Expand Down
9 changes: 0 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<powerauth-crypto.version>1.8.0-SNAPSHOT</powerauth-crypto.version>
<powerauth-restful-integration.version>1.8.0-SNAPSHOT</powerauth-restful-integration.version>
<powerauth-server.version>1.8.0-SNAPSHOT</powerauth-server.version>
<powerauth-webflow.version>1.8.0-SNAPSHOT</powerauth-webflow.version>
<wultra-core.version>1.10.0-SNAPSHOT</wultra-core.version>

<springdoc-openapi-starter-webmvc-ui.version>2.6.0</springdoc-openapi-starter-webmvc-ui.version>
Expand All @@ -65,18 +64,10 @@
<module>powerauth-fido2-tests</module>
<module>powerauth-load-tests</module>
<module>powerauth-test-server</module>
<module>powerauth-webflow-tests</module>
</modules>

<dependencyManagement>
<dependencies>
<!-- PowerAuth Webflow -->
<dependency>
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-nextstep-client</artifactId>
<version>${powerauth-webflow.version}</version>
</dependency>

<!-- PowerAuth Crypto -->
<dependency>
<groupId>io.getlime.security</groupId>
Expand Down
14 changes: 1 addition & 13 deletions powerauth-backend-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ PowerAuth backend end-to-end tests cover testing of the PowerAuth protocol using
- [powerauth-restful-integration](https://github.com/wultra/powerauth-restful-integration)
- [powerauth-cmd-tool](https://github.com/wultra/powerauth-cmd-tool)
- [enrollment-server](https://github.com/wultra/enrollment-server-wultra)
- [powerauth-webflow](https://github.com/wultra/powerauth-webflow) (optional, can replace `enrollment-server`)

_Note: most of the above listed components contain unit tests, however such low level tests do not cover possible defects found when testing the solution as a whole, which is why this project was introduced._

Expand Down Expand Up @@ -36,18 +35,16 @@ Clone the following repositories and use the default `develop` branch to build t
| https://github.com/wultra/powerauth-restful-integration | `mvn clean install` | the libraries are installed into local maven repository (.m2 folder) |
| https://github.com/wultra/enrollment-server-wultra | `mvn clean install` | the Enrollment Server artifact is available in `enrollment-server/target` |
| https://github.com/wultra/powerauth-cmd-tool | `mvn clean install` | the libraries are installed into local maven repository (.m2 folder) |
| https://github.com/wultra/powerauth-webflow | `mvn clean install` | the libraries are installed into local maven repository (.m2 folder) and the artifacts are available in `powerauth-nextstep/target` and `powerauth-webflow/target` folders |

## Deploying PowerAuth Components

We assume the tests will run on a local Tomcat instance. If you prefer to use Docker for running the server components, you can use the [PowerAuth Docker project](https://github.com/wultra/powerauth-docker). Do not run the applications directly from command line using `java -jar` command, this is not supported.

1. Copy the previously built war files `powerauth-java-server.war` and `enrollment-server.war` into the `webapps` folder of Tomcat. In case you want to test Web Flow and Next Step (optional), copy the `powerauth-webflow.war` and `powerauth-nextstep.war` files, too.
1. Copy the previously built war files `powerauth-java-server.war` and `enrollment-server.war` into the `webapps` folder of Tomcat.

2. Run the DDL scripts for these two components:
- [PowerAuth server DDL scripts](https://github.com/wultra/powerauth-server/tree/develop/docs/sql)
- [Enrollment server DDL scripts](https://github.com/wultra/enrollment-server/tree/develop/docs/sql)
- (Optional) [Web Flow DDL scripts](https://github.com/wultra/powerauth-webflow/tree/develop/docs/sql) - run the `initial_data.sql` script, too

_Note: if you want to avoid additional configuration, use database, schema and user `powerauth` when setting up the database._

Expand Down Expand Up @@ -82,8 +79,6 @@ Once you start the Tomcat server, you should see both applications up and runnin

- PowerAuth server URL: http://localhost:8080/powerauth-java-server
- Enrollment server URL: http://localhost:8080/enrollment-server
- PowerAuth Web Flow URL (optional): http://localhost:8080/powerauth-webflow/api/service/status
- PowerAuth Next Step URL (optional): http://localhost:8080/powerauth-nextstep/api/service/status

## Test Configuration

Expand All @@ -110,13 +105,6 @@ powerauth.service.security.clientToken=
powerauth.service.security.clientSecret=
```

In case you want to test Web Flow and Next Step instead of Enrollment server, use the following configuration:
```properties
# URLs used when testing Web Flow and Next Step
powerauth.integration.service.url=http://localhost:8080/powerauth-webflow
powerauth.nextstep.service.url=http://localhost:8080/powerauth-nextstep
```

## Running Tests from Console

You can simply run the tests using Maven in folder `powerauth-backend-tests`:
Expand Down
4 changes: 0 additions & 4 deletions powerauth-backend-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-restful-model</artifactId>
</dependency>
<dependency>
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-nextstep-client</artifactId>
</dependency>
<dependency>
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-java-crypto</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import com.wultra.security.powerauth.test.PowerAuthTestTearDown;
import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor;
import io.getlime.security.powerauth.lib.cmd.util.RestClientConfiguration;
import io.getlime.security.powerauth.lib.nextstep.client.NextStepClient;
import io.getlime.security.powerauth.lib.nextstep.client.NextStepClientException;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
Expand All @@ -44,7 +42,6 @@
import java.security.Security;
import java.time.Duration;
import java.util.Base64;
import java.util.Optional;
import java.util.UUID;

/**
Expand All @@ -63,9 +60,6 @@ public class PowerAuthTestConfiguration {
@Value("${powerauth.integration.service.url:http://localhost:8080/enrollment-server}")
private String powerAuthIntegrationUrl;

@Value("${powerauth.nextstep.service.url:http://localhost:8080/powerauth-nextstep}")
private Optional<String> nextStepServiceUrl;

@Value("${powerauth.enrollment.service.url:http://localhost:8080/enrollment-server}")
private String enrollmentServiceUrl;

Expand Down Expand Up @@ -174,18 +168,6 @@ public PowerAuthClient powerAuthClient() {
}
}

@Bean
public NextStepClient nextStepClient() {
if (nextStepServiceUrl.isEmpty()) {
return null;
}
try {
return new NextStepClient(nextStepServiceUrl.get());
} catch (NextStepClientException ex) {
return null;
}
}

@Bean
public PowerAuthTestSetUp testSetUp() {
return new PowerAuthTestSetUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.wultra.security.powerauth.client.PowerAuthClient;
import com.wultra.security.powerauth.configuration.PowerAuthTestConfiguration;
import io.getlime.core.rest.model.base.response.ErrorResponse;
import io.getlime.core.rest.model.base.response.ObjectResponse;
import io.getlime.security.powerauth.crypto.lib.generator.HashBasedCounter;
import io.getlime.security.powerauth.lib.cmd.logging.ObjectStepLogger;
import io.getlime.security.powerauth.lib.cmd.logging.model.StepItem;
Expand All @@ -30,9 +29,6 @@
import io.getlime.security.powerauth.lib.cmd.steps.model.VerifyTokenStepModel;
import io.getlime.security.powerauth.lib.cmd.steps.v3.CreateTokenStep;
import io.getlime.security.powerauth.lib.cmd.util.CounterUtil;
import io.getlime.security.powerauth.lib.nextstep.client.NextStepClient;
import io.getlime.security.powerauth.lib.nextstep.model.enumeration.AuthMethod;
import io.getlime.security.powerauth.lib.nextstep.model.response.GetAuthMethodsResponse;
import io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse;

import java.io.File;
Expand All @@ -50,7 +46,7 @@
*/
public class PowerAuthTokenShared {

public static void tokenCreateAndVerifyTest(final PowerAuthTestConfiguration config, final CreateTokenStepModel model, final NextStepClient nextStepClient, final File dataFile, final String version) throws Exception {
public static void tokenCreateAndVerifyTest(final PowerAuthTestConfiguration config, final CreateTokenStepModel model, final File dataFile, final String version) throws Exception {
ObjectStepLogger stepLogger1 = new ObjectStepLogger();
new CreateTokenStep().execute(stepLogger1, model.toMap());
assertTrue(stepLogger1.getResult().success());
Expand All @@ -70,13 +66,6 @@ public static void tokenCreateAndVerifyTest(final PowerAuthTestConfiguration con
assertNotNull(tokenId);
assertNotNull(tokenSecret);

if (isWebFlowRunning(config)) {
Map<String, String> configNS = new HashMap<>();
configNS.put("activationId", config.getActivationId(version));
ObjectResponse<GetAuthMethodsResponse> responseNS = nextStepClient.enableAuthMethodForUser(config.getUser(version), AuthMethod.POWERAUTH_TOKEN, configNS);
assertEquals("OK", responseNS.getStatus());
}

VerifyTokenStepModel modelVerify = new VerifyTokenStepModel();
modelVerify.setTokenId(tokenId);
modelVerify.setTokenSecret(tokenSecret);
Expand Down Expand Up @@ -131,7 +120,7 @@ public static void tokenVerifyInvalidTokenTest(final PowerAuthTestConfiguration
checkSignatureError(errorResponse);
}

public static void tokenVerifyRemovedTokenTest(final PowerAuthClient powerAuthClient, final PowerAuthTestConfiguration config, final CreateTokenStepModel model, final NextStepClient nextStepClient, final File dataFile, final String version) throws Exception {
public static void tokenVerifyRemovedTokenTest(final PowerAuthClient powerAuthClient, final PowerAuthTestConfiguration config, final CreateTokenStepModel model, final File dataFile, final String version) throws Exception {
ObjectStepLogger stepLogger1 = new ObjectStepLogger();
new CreateTokenStep().execute(stepLogger1, model.toMap());
assertTrue(stepLogger1.getResult().success());
Expand All @@ -151,13 +140,6 @@ public static void tokenVerifyRemovedTokenTest(final PowerAuthClient powerAuthCl
assertNotNull(tokenId);
assertNotNull(tokenSecret);

if (isWebFlowRunning(config)) {
Map<String, String> configNS = new HashMap<>();
configNS.put("activationId", config.getActivationId(version));
ObjectResponse<GetAuthMethodsResponse> responseNS = nextStepClient.enableAuthMethodForUser(config.getUser(version), AuthMethod.POWERAUTH_TOKEN, configNS);
assertEquals("OK", responseNS.getStatus());
}

powerAuthClient.removeToken(tokenId, config.getActivationId(version));

VerifyTokenStepModel modelVerify = new VerifyTokenStepModel();
Expand Down Expand Up @@ -247,7 +229,4 @@ private static String getTokenUri(final PowerAuthTestConfiguration config) {
return config.getPowerAuthIntegrationUrl() + "/api/auth/token/app/operation/list";
}

private static boolean isWebFlowRunning(final PowerAuthTestConfiguration config) {
return config.getPowerAuthIntegrationUrl().contains("powerauth-webflow");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.getlime.security.powerauth.crypto.lib.enums.PowerAuthSignatureTypes;
import io.getlime.security.powerauth.lib.cmd.logging.ObjectStepLogger;
import io.getlime.security.powerauth.lib.cmd.steps.model.CreateTokenStepModel;
import io.getlime.security.powerauth.lib.nextstep.client.NextStepClient;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -49,7 +48,6 @@ class PowerAuthTokenTest {
private static final String VERSION = "3.0";

private PowerAuthTestConfiguration config;
private NextStepClient nextStepClient;
private PowerAuthClient powerAuthClient;
private CreateTokenStepModel model;
private ObjectStepLogger stepLogger;
Expand All @@ -61,11 +59,6 @@ public void setPowerAuthTestConfiguration(PowerAuthTestConfiguration config) {
this.config = config;
}

@Autowired
public void setNextStepClient(NextStepClient nextStepClient) {
this.nextStepClient = nextStepClient;
}

@Autowired
public void setPowerAuthClient(PowerAuthClient powerAuthClient) {
this.powerAuthClient = powerAuthClient;
Expand Down Expand Up @@ -103,7 +96,7 @@ void setUp() {

@Test
void tokenCreateAndVerifyTest() throws Exception {
PowerAuthTokenShared.tokenCreateAndVerifyTest(config, model, nextStepClient, dataFile, VERSION);
PowerAuthTokenShared.tokenCreateAndVerifyTest(config, model, dataFile, VERSION);
}

@Test
Expand All @@ -118,7 +111,7 @@ void tokenVerifyInvalidTokenTest() throws Exception {

@Test
void tokenVerifyRemovedTokenTest() throws Exception {
PowerAuthTokenShared.tokenVerifyRemovedTokenTest(powerAuthClient, config, model, nextStepClient, dataFile, VERSION);
PowerAuthTokenShared.tokenVerifyRemovedTokenTest(powerAuthClient, config, model, dataFile, VERSION);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.getlime.security.powerauth.crypto.lib.enums.PowerAuthSignatureTypes;
import io.getlime.security.powerauth.lib.cmd.logging.ObjectStepLogger;
import io.getlime.security.powerauth.lib.cmd.steps.model.CreateTokenStepModel;
import io.getlime.security.powerauth.lib.nextstep.client.NextStepClient;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -49,7 +48,6 @@ class PowerAuthTokenTest {
private static final String VERSION = "3.1";

private PowerAuthTestConfiguration config;
private NextStepClient nextStepClient;
private PowerAuthClient powerAuthClient;
private CreateTokenStepModel model;
private ObjectStepLogger stepLogger;
Expand All @@ -61,11 +59,6 @@ public void setPowerAuthTestConfiguration(PowerAuthTestConfiguration config) {
this.config = config;
}

@Autowired
public void setNextStepClient(NextStepClient nextStepClient) {
this.nextStepClient = nextStepClient;
}

@Autowired
public void setPowerAuthClient(PowerAuthClient powerAuthClient) {
this.powerAuthClient = powerAuthClient;
Expand Down Expand Up @@ -103,7 +96,7 @@ void setUp() {

@Test
void tokenCreateAndVerifyTest() throws Exception {
PowerAuthTokenShared.tokenCreateAndVerifyTest(config, model, nextStepClient, dataFile, VERSION);
PowerAuthTokenShared.tokenCreateAndVerifyTest(config, model, dataFile, VERSION);
}

@Test
Expand All @@ -118,7 +111,7 @@ void tokenVerifyInvalidTokenTest() throws Exception {

@Test
void tokenVerifyRemovedTokenTest() throws Exception {
PowerAuthTokenShared.tokenVerifyRemovedTokenTest(powerAuthClient, config, model, nextStepClient, dataFile, VERSION);
PowerAuthTokenShared.tokenVerifyRemovedTokenTest(powerAuthClient, config, model, dataFile, VERSION);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.getlime.security.powerauth.crypto.lib.enums.PowerAuthSignatureTypes;
import io.getlime.security.powerauth.lib.cmd.logging.ObjectStepLogger;
import io.getlime.security.powerauth.lib.cmd.steps.model.CreateTokenStepModel;
import io.getlime.security.powerauth.lib.nextstep.client.NextStepClient;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -49,7 +48,6 @@ class PowerAuthTokenTest {
private static final String VERSION = "3.2";

private PowerAuthTestConfiguration config;
private NextStepClient nextStepClient;
private PowerAuthClient powerAuthClient;
private CreateTokenStepModel model;
private ObjectStepLogger stepLogger;
Expand All @@ -61,11 +59,6 @@ public void setPowerAuthTestConfiguration(PowerAuthTestConfiguration config) {
this.config = config;
}

@Autowired
public void setNextStepClient(NextStepClient nextStepClient) {
this.nextStepClient = nextStepClient;
}

@Autowired
public void setPowerAuthClient(PowerAuthClient powerAuthClient) {
this.powerAuthClient = powerAuthClient;
Expand Down Expand Up @@ -103,7 +96,7 @@ void setUp() {

@Test
void tokenCreateAndVerifyTest() throws Exception {
PowerAuthTokenShared.tokenCreateAndVerifyTest(config, model, nextStepClient, dataFile, VERSION);
PowerAuthTokenShared.tokenCreateAndVerifyTest(config, model, dataFile, VERSION);
}

@Test
Expand All @@ -118,7 +111,7 @@ void tokenVerifyInvalidTokenTest() throws Exception {

@Test
void tokenVerifyRemovedTokenTest() throws Exception {
PowerAuthTokenShared.tokenVerifyRemovedTokenTest(powerAuthClient, config, model, nextStepClient, dataFile, VERSION);
PowerAuthTokenShared.tokenVerifyRemovedTokenTest(powerAuthClient, config, model, dataFile, VERSION);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ powerauth.integration.service.url=http://localhost:8080/enrollment-server
# Customized enrollment service URL
powerauth.enrollment.service.url=http://localhost:8080/enrollment-server
powerauth.enrollment-onboarding.service.url=http://localhost:8080/enrollment-server-onboarding
# URLs used when testing Web Flow and Next Step
#powerauth.integration.service.url=http://localhost:8080/powerauth-webflow
#powerauth.nextstep.service.url=http://localhost:8080/powerauth-nextstep

# PowerAuth endpoint authentication
powerauth.service.security.clientToken=
Expand Down
2 changes: 1 addition & 1 deletion powerauth-load-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Command line parameters:
- `configFile` - file with application configuration, defaults to `./config.json`
- `powerAuthJavaServerUrl` - base url of the PowerAuth Java server
- `powerAuthRestServerUrl` - base url of the PowerAuth REST server
- `powerAuthTokenVerifyUrl` - full url to verify token with (optional), e.g. `http://localhost:8080/powerauth-webflow/api/auth/token/app/operation/list`
- `powerAuthTokenVerifyUrl` - full url to verify token with (optional)
- `countOfDevices` - count of simulated devices, defaults to 100
- `maxDevicesPerSecond` - maximum allowed number of active devices in one second, defaults to 80
- `testDuration` - duration of the load test, defaults to `15 minutes`
Expand Down
3 changes: 0 additions & 3 deletions powerauth-webflow-tests/README.md

This file was deleted.

Loading

0 comments on commit c079975

Please sign in to comment.