From ef83099cdd06440c6c8e1eb5b853973653a72d95 Mon Sep 17 00:00:00 2001 From: Anton Baliasnikov Date: Fri, 24 Nov 2023 10:34:23 +0000 Subject: [PATCH] test: improve configuration for integration tests (#796) Signed-off-by: Anton Baliasnikov Signed-off-by: Shota Jolbordi --- infrastructure/shared/docker-compose-demo.yml | 2 +- tests/integration-tests/README.md | 13 + .../src/test/kotlin/common/TestConstants.kt | 17 +- .../src/test/kotlin/config/AgentConf.kt | 11 - .../src/test/kotlin/config/AgentInitConf.kt | 12 - .../src/test/kotlin/config/Config.kt | 13 +- .../src/test/kotlin/config/GlobalConf.kt | 8 - .../src/test/kotlin/config/Role.kt | 11 + .../src/test/kotlin/config/ServicesConf.kt | 31 -- .../src/test/kotlin/config/Webhook.kt | 9 + .../src/test/kotlin/config/services/Agent.kt | 37 ++ .../test/kotlin/config/services/Keycloak.kt | 118 ++++++ .../test/kotlin/config/services/PrismNode.kt | 23 ++ .../test/kotlin/config/services/Service.kt | 9 + .../kotlin/config/services/ServiceBase.kt | 20 + .../src/test/kotlin/config/services/Vault.kt | 22 ++ .../src/test/kotlin/features/CommonSteps.kt | 359 ------------------ .../src/test/kotlin/features/Init.kt | 120 ++++++ .../kotlin/features/common/CommonSteps.kt | 93 +++++ .../credentials/IssueCredentialsSteps.kt | 6 +- .../interactions/AuthRestInteraction.kt | 10 +- .../src/test/resources/configs/basic.conf | 65 ++-- .../src/test/resources/configs/double.conf | 75 ---- .../src/test/resources/configs/keycloak.conf | 70 ---- .../test/resources/configs/mt_keycloak.conf | 58 +++ .../resources/configs/mt_keycloak_vault.conf | 62 +++ .../src/test/resources/configs/mt_vault.conf | 58 +++ .../configs/two_agents_sharing_keycloak.conf | 66 ++++ .../src/test/resources/containers/agent.yml | 4 +- .../src/test/resources/containers/vault.yml | 2 +- .../features/connection/connection.feature | 10 +- .../credentials/issue_credentials.feature | 52 +-- .../resources/features/did/create_did.feature | 4 +- .../features/did/deactivate_did.feature | 4 +- .../features/did/listing_did.feature | 2 +- .../resources/features/did/update_did.feature | 12 +- .../features/proofs/present_proof.feature | 36 +- .../schemas/credential_schemas.feature | 8 +- .../features/system/health_endpoint.feature | 4 +- .../verification_policies.feature | 2 +- 40 files changed, 839 insertions(+), 699 deletions(-) create mode 100644 tests/integration-tests/README.md delete mode 100644 tests/integration-tests/src/test/kotlin/config/AgentConf.kt delete mode 100644 tests/integration-tests/src/test/kotlin/config/AgentInitConf.kt delete mode 100644 tests/integration-tests/src/test/kotlin/config/GlobalConf.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/Role.kt delete mode 100644 tests/integration-tests/src/test/kotlin/config/ServicesConf.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/Webhook.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/services/Agent.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/services/Keycloak.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/services/PrismNode.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/services/Service.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/services/ServiceBase.kt create mode 100644 tests/integration-tests/src/test/kotlin/config/services/Vault.kt delete mode 100644 tests/integration-tests/src/test/kotlin/features/CommonSteps.kt create mode 100644 tests/integration-tests/src/test/kotlin/features/Init.kt create mode 100644 tests/integration-tests/src/test/kotlin/features/common/CommonSteps.kt delete mode 100644 tests/integration-tests/src/test/resources/configs/double.conf delete mode 100644 tests/integration-tests/src/test/resources/configs/keycloak.conf create mode 100644 tests/integration-tests/src/test/resources/configs/mt_keycloak.conf create mode 100644 tests/integration-tests/src/test/resources/configs/mt_keycloak_vault.conf create mode 100644 tests/integration-tests/src/test/resources/configs/mt_vault.conf create mode 100644 tests/integration-tests/src/test/resources/configs/two_agents_sharing_keycloak.conf diff --git a/infrastructure/shared/docker-compose-demo.yml b/infrastructure/shared/docker-compose-demo.yml index 3ea5f8c296..aae1127117 100644 --- a/infrastructure/shared/docker-compose-demo.yml +++ b/infrastructure/shared/docker-compose-demo.yml @@ -40,10 +40,10 @@ services: POLLUX_DB_HOST: db CONNECT_DB_HOST: db AGENT_DB_HOST: db - WALLET_SEED: GLOBAL_WEBHOOK_URL: GLOBAL_WEBHOOK_API_KEY: DEFAULT_WALLET_ENABLED: + DEFAULT_WALLET_SEED: DEFAULT_WALLET_WEBHOOK_URL: DEFAULT_WALLET_AUTH_API_KEY: API_KEY_ENABLED: diff --git a/tests/integration-tests/README.md b/tests/integration-tests/README.md new file mode 100644 index 0000000000..c670caedff --- /dev/null +++ b/tests/integration-tests/README.md @@ -0,0 +1,13 @@ +# Integration Tests + +This directory contains the integration tests for the Open Enterprise Agent. + +## Main concepts + +## System under test + +## Configuring the tests + +## Running the tests + +## Analysing reports diff --git a/tests/integration-tests/src/test/kotlin/common/TestConstants.kt b/tests/integration-tests/src/test/kotlin/common/TestConstants.kt index 36258df158..694049f6e1 100644 --- a/tests/integration-tests/src/test/kotlin/common/TestConstants.kt +++ b/tests/integration-tests/src/test/kotlin/common/TestConstants.kt @@ -7,6 +7,7 @@ import java.time.Duration import java.util.* object TestConstants { + val TESTS_CONFIG = System.getenv("TESTS_CONFIG") ?: "/configs/basic.conf" val TEST_VERIFICATION_POLICY = VerificationPolicyInput( name = "Trusted Issuer and SchemaID", description = "Verification Policy with trusted issuer and schemaId", @@ -21,9 +22,7 @@ object TestConstants { ) ) val CREDENTIAL_SCHEMA_TYPE = "https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json" - val SCHEMA_TYPE_JSON = "https://json-schema.org/draft/2020-12/schema" - val jsonSchema = JsonSchema( id = "https://example.com/student-schema-1.0", schema = SCHEMA_TYPE_JSON, @@ -34,7 +33,6 @@ object TestConstants { "age" to JsonSchemaProperty(type = "integer") ) ) - fun generate_with_name_suffix_and_author(suffix: String, author: String): CredentialSchemaInput { return CredentialSchemaInput( author = author, @@ -46,7 +44,6 @@ object TestConstants { version = "1.0.0" ) } - val STUDENT_SCHEMA = CredentialSchemaInput( author = "did:prism:agent", name = UUID.randomUUID().toString(), @@ -56,26 +53,14 @@ object TestConstants { tags = listOf("school", "students"), version = "1.0.0" ) - val RANDOM_CONSTAND_UUID = UUID.randomUUID().toString() val DID_UPDATE_PUBLISH_MAX_WAIT_5_MIN = Duration.ofSeconds(60L) val PRISM_DID_AUTH_KEY = ManagedDIDKeyTemplate("auth-1", Purpose.AUTHENTICATION) - val PRISM_DID_ASSERTION_KEY = ManagedDIDKeyTemplate("assertion-1", Purpose.ASSERTION_METHOD) val PRISM_DID_UPDATE_NEW_AUTH_KEY = ManagedDIDKeyTemplate("auth-2", Purpose.AUTHENTICATION) - val PRISM_DID_SERVICE = Service( - "https://foo.bar.com", - listOf("LinkedDomains"), - Json("https://foo.bar.com/") - ) val PRISM_DID_SERVICE_FOR_UPDATE = Service( "https://update.com", listOf("LinkedDomains"), Json("https://update.com/") ) - val PRISM_DID_SERVICE_TO_REMOVE = Service( - "https://remove.com", - listOf("LinkedDomains"), - Json("https://remove.com/") - ) val PRISM_DID_UPDATE_NEW_SERVICE_URL = "https://bar.foo.com/" val PRISM_DID_UPDATE_NEW_SERVICE = Service( "https://new.service.com", diff --git a/tests/integration-tests/src/test/kotlin/config/AgentConf.kt b/tests/integration-tests/src/test/kotlin/config/AgentConf.kt deleted file mode 100644 index 38d5e87649..0000000000 --- a/tests/integration-tests/src/test/kotlin/config/AgentConf.kt +++ /dev/null @@ -1,11 +0,0 @@ -package config - -import com.sksamuel.hoplite.ConfigAlias -import java.net.URL - -data class AgentConf( - val url: URL, - val apikey: String?, - @ConfigAlias("webhook_url") val webhookUrl: URL?, - val init: AgentInitConf?, -) diff --git a/tests/integration-tests/src/test/kotlin/config/AgentInitConf.kt b/tests/integration-tests/src/test/kotlin/config/AgentInitConf.kt deleted file mode 100644 index 3ba21e3cbe..0000000000 --- a/tests/integration-tests/src/test/kotlin/config/AgentInitConf.kt +++ /dev/null @@ -1,12 +0,0 @@ -package config - -import com.sksamuel.hoplite.ConfigAlias - -data class AgentInitConf( - val version: String, - @ConfigAlias("http_port") val httpPort: Int, - @ConfigAlias("didcomm_port") val didcommPort: Int, - @ConfigAlias("secret_storage_backend") val secretStorageBackend: String, - @ConfigAlias("auth_enabled") val authEnabled: Boolean, - @ConfigAlias("keycloak_enabled") val keycloakEnabled: Boolean, -) diff --git a/tests/integration-tests/src/test/kotlin/config/Config.kt b/tests/integration-tests/src/test/kotlin/config/Config.kt index b5f7cd8130..506ee7290f 100644 --- a/tests/integration-tests/src/test/kotlin/config/Config.kt +++ b/tests/integration-tests/src/test/kotlin/config/Config.kt @@ -1,11 +1,10 @@ package config +import config.services.Agent +import config.services.Service + data class Config( - val global: GlobalConf, - val admin: AgentConf, - val issuer: AgentConf, - val holder: AgentConf, - val verifier: AgentConf, - val agents: List, - val services: ServicesConf + val roles: List, + val agents: List?, + val services: Service? ) diff --git a/tests/integration-tests/src/test/kotlin/config/GlobalConf.kt b/tests/integration-tests/src/test/kotlin/config/GlobalConf.kt deleted file mode 100644 index ade1a77c88..0000000000 --- a/tests/integration-tests/src/test/kotlin/config/GlobalConf.kt +++ /dev/null @@ -1,8 +0,0 @@ -package config - -import com.sksamuel.hoplite.ConfigAlias - -data class GlobalConf( - @ConfigAlias("auth_header") val authHeader: String = "apikey", - @ConfigAlias("admin_auth_header") val adminAuthHeader: String = "x-admin-api-key", -) diff --git a/tests/integration-tests/src/test/kotlin/config/Role.kt b/tests/integration-tests/src/test/kotlin/config/Role.kt new file mode 100644 index 0000000000..304bb51d81 --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/Role.kt @@ -0,0 +1,11 @@ +package config + +import java.net.URL + +data class Role( + val name: String, + val url: URL, + val apikey: String?, + val authHeader: String = "apikey", + val webhook: Webhook? +) diff --git a/tests/integration-tests/src/test/kotlin/config/ServicesConf.kt b/tests/integration-tests/src/test/kotlin/config/ServicesConf.kt deleted file mode 100644 index 691afbc4e1..0000000000 --- a/tests/integration-tests/src/test/kotlin/config/ServicesConf.kt +++ /dev/null @@ -1,31 +0,0 @@ -package config - -import com.sksamuel.hoplite.ConfigAlias - -data class ServicesConf( - @ConfigAlias("prism_node") val prismNode: PrismNodeConf?, - val keycloak: KeycloakConf?, - val vault: VaultConf?, -) - -data class PrismNodeConf( - @ConfigAlias("http_port") val httpPort: Int, - val version: String, -) - -data class KeycloakConf( - @ConfigAlias("http_port") val httpPort: Int, - val realm: String, - @ConfigAlias("client_id") val clientId: String, - @ConfigAlias("client_secret") val clientSecret: String, - val users: List -) - -data class KeycloakUser( - val username: String, - val password: String -) - -data class VaultConf( - @ConfigAlias("http_port") val httpPort: Int, -) diff --git a/tests/integration-tests/src/test/kotlin/config/Webhook.kt b/tests/integration-tests/src/test/kotlin/config/Webhook.kt new file mode 100644 index 0000000000..80aba3778f --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/Webhook.kt @@ -0,0 +1,9 @@ +package config + +import com.sksamuel.hoplite.ConfigAlias +import java.net.URL + +data class Webhook( + val url: URL, + @ConfigAlias("init_required") val initRequired: Boolean = true +) diff --git a/tests/integration-tests/src/test/kotlin/config/services/Agent.kt b/tests/integration-tests/src/test/kotlin/config/services/Agent.kt new file mode 100644 index 0000000000..f0c639aa5e --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/services/Agent.kt @@ -0,0 +1,37 @@ +package config.services + +import com.sksamuel.hoplite.ConfigAlias +import org.testcontainers.containers.ComposeContainer +import org.testcontainers.containers.wait.strategy.Wait +import java.io.File + +data class Agent( + val version: String, + @ConfigAlias("http_port") val httpPort: Int, + @ConfigAlias("didcomm_port") val didcommPort: Int, + @ConfigAlias("auth_enabled") val authEnabled: Boolean, + @ConfigAlias("prism_node") val prismNode: PrismNode?, + val keycloak: Keycloak?, + val vault: Vault?, + @ConfigAlias("keep_running") override val keepRunning: Boolean = false +) : ServiceBase { + + override val env: ComposeContainer = ComposeContainer( + File("src/test/resources/containers/agent.yml") + ).withEnv( + mapOf( + "OPEN_ENTERPRISE_AGENT_VERSION" to version, + "API_KEY_ENABLED" to authEnabled.toString(), + "AGENT_DIDCOMM_PORT" to didcommPort.toString(), + "AGENT_HTTP_PORT" to httpPort.toString(), + "PRISM_NODE_PORT" to (prismNode?.httpPort?.toString() ?: ""), + "SECRET_STORAGE_BACKEND" to if (vault != null) "vault" else "postgres", + "VAULT_HTTP_PORT" to (vault?.httpPort?.toString() ?: ""), + "KEYCLOAK_ENABLED" to (keycloak != null).toString(), + "KEYCLOAK_HTTP_PORT" to (keycloak?.httpPort?.toString() ?: ""), + "KEYCLOAK_REALM" to (keycloak?.realm ?: ""), + "KEYCLOAK_CLIENT_ID" to (keycloak?.clientId ?: ""), + "KEYCLOAK_CLIENT_SECRET" to (keycloak?.clientSecret ?: "") + ) + ).waitingFor("open-enterprise-agent", Wait.forHealthcheck()) +} diff --git a/tests/integration-tests/src/test/kotlin/config/services/Keycloak.kt b/tests/integration-tests/src/test/kotlin/config/services/Keycloak.kt new file mode 100644 index 0000000000..db3c63ec78 --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/services/Keycloak.kt @@ -0,0 +1,118 @@ +package config.services + +import com.sksamuel.hoplite.ConfigAlias +import io.restassured.RestAssured +import io.restassured.builder.RequestSpecBuilder +import io.restassured.specification.RequestSpecification +import org.apache.http.HttpStatus +import org.testcontainers.containers.ComposeContainer +import org.testcontainers.containers.wait.strategy.Wait +import java.io.File + +data class Keycloak( + @ConfigAlias("http_port") val httpPort: Int, + val realm: String = "atala-demo", + @ConfigAlias("client_id") val clientId: String = "prism-agent", + @ConfigAlias("client_secret") val clientSecret: String = "prism-agent-demo-secret", + @ConfigAlias("keep_running") override val keepRunning: Boolean = false +) : ServiceBase { + + private val keycloakComposeFile = "src/test/resources/containers/keycloak.yml" + private val keycloakEnvConfig: Map = mapOf( + "KEYCLOAK_HTTP_PORT" to httpPort.toString() + ) + override val env: ComposeContainer = + ComposeContainer(File(keycloakComposeFile)).withEnv(keycloakEnvConfig) + .waitingFor("keycloak", Wait.forLogMessage(".*Running the server.*", 1)) + private val keycloakBaseUrl = "http://localhost:$httpPort/" + private var requestBuilder: RequestSpecification? = null + + fun start(users: List) { + super.start() + initRequestBuilder() + createRealm() + createClient() + createUsers(users) + } + + fun getKeycloakAuthToken(username: String, password: String): String { + val tokenResponse = + RestAssured + .given().body("grant_type=password&client_id=$clientId&client_secret=$clientSecret&username=$username&password=$password") + .contentType("application/x-www-form-urlencoded") + .header("Host", "localhost") + .post("http://localhost:$httpPort/realms/$realm/protocol/openid-connect/token") + .thenReturn() + tokenResponse.then().statusCode(HttpStatus.SC_OK) + return tokenResponse.body.jsonPath().getString("access_token") + } + + private fun getAdminToken(): String { + val getAdminTokenResponse = + RestAssured.given().body("grant_type=password&client_id=admin-cli&username=admin&password=admin") + .contentType("application/x-www-form-urlencoded") + .baseUri(keycloakBaseUrl) + .post("/realms/master/protocol/openid-connect/token") + .thenReturn() + getAdminTokenResponse.then().statusCode(HttpStatus.SC_OK) + return getAdminTokenResponse.body.jsonPath().getString("access_token") + } + + private fun initRequestBuilder() { + requestBuilder = RequestSpecBuilder() + .setBaseUri(keycloakBaseUrl) + .setContentType("application/json") + .addHeader("Authorization", "Bearer ${getAdminToken()}") + .build() + } + + private fun createRealm() { + RestAssured.given().spec(requestBuilder) + .body( + mapOf( + "realm" to realm, + "enabled" to true, + "accessTokenLifespan" to 3600000 + ) + ) + .post("/admin/realms") + .then().statusCode(HttpStatus.SC_CREATED) + } + + private fun createClient() { + RestAssured.given().spec(requestBuilder) + .body( + mapOf( + "id" to clientId, + "directAccessGrantsEnabled" to true, + "authorizationServicesEnabled" to true, + "serviceAccountsEnabled" to true, + "secret" to clientSecret + ) + ) + .post("/admin/realms/$realm/clients") + .then().statusCode(HttpStatus.SC_CREATED) + } + + private fun createUsers(users: List) { + users.forEach { keycloakUser -> + RestAssured.given().spec(requestBuilder) + .body( + mapOf( + "id" to keycloakUser, + "username" to keycloakUser, + "firstName" to keycloakUser, + "enabled" to true, + "credentials" to listOf( + mapOf( + "value" to keycloakUser, + "temporary" to false + ) + ) + ) + ) + .post("/admin/realms/$realm/users") + .then().statusCode(HttpStatus.SC_CREATED) + } + } +} diff --git a/tests/integration-tests/src/test/kotlin/config/services/PrismNode.kt b/tests/integration-tests/src/test/kotlin/config/services/PrismNode.kt new file mode 100644 index 0000000000..177ce72033 --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/services/PrismNode.kt @@ -0,0 +1,23 @@ +package config.services + +import com.sksamuel.hoplite.ConfigAlias +import org.testcontainers.containers.ComposeContainer +import org.testcontainers.containers.wait.strategy.Wait +import java.io.File + +data class PrismNode( + @ConfigAlias("http_port") val httpPort: Int, + val version: String, + @ConfigAlias("keep_running") override val keepRunning: Boolean = false +) : ServiceBase { + private val vdrComposeFile = "src/test/resources/containers/vdr.yml" + override val env: ComposeContainer = ComposeContainer(File(vdrComposeFile)).withEnv( + mapOf( + "PRISM_NODE_VERSION" to version, + "PRISM_NODE_PORT" to httpPort.toString() + ) + ).waitingFor( + "prism-node", + Wait.forLogMessage(".*Server started, listening on.*", 1) + ) +} diff --git a/tests/integration-tests/src/test/kotlin/config/services/Service.kt b/tests/integration-tests/src/test/kotlin/config/services/Service.kt new file mode 100644 index 0000000000..c9a16443bb --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/services/Service.kt @@ -0,0 +1,9 @@ +package config.services + +import com.sksamuel.hoplite.ConfigAlias + +data class Service( + @ConfigAlias("prism_node") val prismNode: PrismNode?, + val keycloak: Keycloak?, + val vault: Vault? +) diff --git a/tests/integration-tests/src/test/kotlin/config/services/ServiceBase.kt b/tests/integration-tests/src/test/kotlin/config/services/ServiceBase.kt new file mode 100644 index 0000000000..580244fa79 --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/services/ServiceBase.kt @@ -0,0 +1,20 @@ +package config.services + +import com.sksamuel.hoplite.ConfigAlias +import org.testcontainers.containers.ComposeContainer + +interface ServiceBase { + + val env: ComposeContainer + + @ConfigAlias("keep_running") + val keepRunning: Boolean + fun start() { + env.start() + } + fun stop() { + if (!keepRunning) { + env.stop() + } + } +} diff --git a/tests/integration-tests/src/test/kotlin/config/services/Vault.kt b/tests/integration-tests/src/test/kotlin/config/services/Vault.kt new file mode 100644 index 0000000000..9ded310ed0 --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/config/services/Vault.kt @@ -0,0 +1,22 @@ +package config.services + +import com.sksamuel.hoplite.ConfigAlias +import org.testcontainers.containers.ComposeContainer +import org.testcontainers.containers.wait.strategy.Wait +import java.io.File + +data class Vault( + @ConfigAlias("http_port") val httpPort: Int, + @ConfigAlias("keep_running") override val keepRunning: Boolean = false +) : ServiceBase { + + private val vaultComposeFile: String = "src/test/resources/containers/vault.yml" + override val env: ComposeContainer = ComposeContainer(File(vaultComposeFile)).withEnv( + mapOf( + "VAULT_PORT" to httpPort.toString() + ) + ).waitingFor( + "vault", + Wait.forHealthcheck() + ) +} diff --git a/tests/integration-tests/src/test/kotlin/features/CommonSteps.kt b/tests/integration-tests/src/test/kotlin/features/CommonSteps.kt deleted file mode 100644 index 440bea7212..0000000000 --- a/tests/integration-tests/src/test/kotlin/features/CommonSteps.kt +++ /dev/null @@ -1,359 +0,0 @@ -package features - -import com.sksamuel.hoplite.ConfigLoader -import common.ListenToEvents -import config.* -import features.connection.ConnectionSteps -import features.credentials.IssueCredentialsSteps -import features.did.PublishDidSteps -import interactions.Get -import io.cucumber.java.AfterAll -import io.cucumber.java.BeforeAll -import io.cucumber.java.ParameterType -import io.cucumber.java.en.Given -import io.iohk.atala.automation.extensions.get -import io.iohk.atala.automation.serenity.ensure.Ensure -import io.iohk.atala.prism.models.* -import io.restassured.RestAssured -import net.serenitybdd.rest.SerenityRest -import net.serenitybdd.screenplay.Actor -import net.serenitybdd.screenplay.actors.Cast -import net.serenitybdd.screenplay.actors.OnStage -import net.serenitybdd.screenplay.rest.abilities.CallAnApi -import org.apache.http.HttpStatus -import org.apache.http.HttpStatus.SC_CREATED -import org.apache.http.HttpStatus.SC_OK -import org.testcontainers.containers.ComposeContainer -import org.testcontainers.containers.wait.strategy.Wait -import java.io.File -import java.util.* - -val environments: MutableList = mutableListOf() - -fun initializeVdr(prismNode: PrismNodeConf) { - val vdrEnvironment: ComposeContainer = ComposeContainer( - File("src/test/resources/containers/vdr.yml") - ).withEnv( - mapOf( - "PRISM_NODE_VERSION" to prismNode.version, - "PRISM_NODE_PORT" to prismNode.httpPort.toString() - ) - ).waitingFor( - "prism-node", Wait.forLogMessage(".*Server started, listening on.*", 1) - ) - environments.add(vdrEnvironment) - vdrEnvironment.start() -} - -fun initializeKeycloak(keycloakConf: KeycloakConf) { - val keycloakEnvironment: ComposeContainer = ComposeContainer( - File("src/test/resources/containers/keycloak.yml") - ).withEnv( - mapOf( - "KEYCLOAK_HTTP_PORT" to keycloakConf.httpPort.toString(), - ) - ).waitingFor( - "keycloak", Wait.forLogMessage(".*Running the server.*", 1) - ) - environments.add(keycloakEnvironment) - keycloakEnvironment.start() - - // Get admin token - val getAdminTokenResponse = - RestAssured - .given().body("grant_type=password&client_id=admin-cli&username=admin&password=admin") - .contentType("application/x-www-form-urlencoded") - .post("http://localhost:${keycloakConf.httpPort}/realms/master/protocol/openid-connect/token") - .thenReturn() - getAdminTokenResponse.then().statusCode(SC_OK) - val adminToken = getAdminTokenResponse.body.jsonPath().getString("access_token") - - // Create realm - val createRealmResponse = - RestAssured - .given().body( - mapOf( - "realm" to keycloakConf.realm, - "enabled" to true, - "accessTokenLifespan" to 3600000 - ) - ) - .header("Authorization", "Bearer $adminToken") - .contentType("application/json") - .post("http://localhost:${keycloakConf.httpPort}/admin/realms") - .then().statusCode(SC_CREATED) - - // Create client - val createClientResponse = - RestAssured - .given().body( - mapOf( - "id" to keycloakConf.clientId, - "directAccessGrantsEnabled" to true, - "authorizationServicesEnabled" to true, - "serviceAccountsEnabled" to true, - "secret" to keycloakConf.clientSecret, - )) - .header("Authorization", "Bearer $adminToken") - .contentType("application/json") - .post("http://localhost:${keycloakConf.httpPort}/admin/realms/${keycloakConf.realm}/clients") - .then().statusCode(SC_CREATED) - - // Create users - keycloakConf.users.forEach { keycloakUser -> - RestAssured - .given().body( - mapOf( - "id" to keycloakUser.username, - "username" to keycloakUser.username, - "firstName" to keycloakUser.username, - "enabled" to true, - "credentials" to listOf( - mapOf( - "value" to keycloakUser.password, - "temporary" to false - ) - ) - ) - ) - .header("Authorization", "Bearer $adminToken") - .contentType("application/json") - .post("http://localhost:${keycloakConf.httpPort}/admin/realms/${keycloakConf.realm}/users") - .then().statusCode(SC_CREATED) - } -} - -fun initializeAgent(agentInitConf: AgentInitConf) { - val config = ConfigLoader().loadConfigOrThrow(System.getenv("INTEGRATION_TESTS_CONFIG") ?: "/configs/basic.conf") - val agentConfMap: Map = mapOf( - "OPEN_ENTERPRISE_AGENT_VERSION" to agentInitConf.version, - "API_KEY_ENABLED" to agentInitConf.authEnabled.toString(), - "AUTH_HEADER" to config.global.authHeader, - "ADMIN_AUTH_HEADER" to config.global.adminAuthHeader, - "AGENT_DIDCOMM_PORT" to agentInitConf.didcommPort.toString(), - "AGENT_HTTP_PORT" to agentInitConf.httpPort.toString(), - "PRISM_NODE_PORT" to if (config.services.prismNode != null) - config.services.prismNode.httpPort.toString() else "", - "SECRET_STORAGE_BACKEND" to agentInitConf.secretStorageBackend, - "VAULT_HTTP_PORT" to if (config.services.vault != null && agentInitConf.secretStorageBackend == "vault") - config.services.vault.httpPort.toString() else "", - "KEYCLOAK_ENABLED" to agentInitConf.keycloakEnabled.toString(), - "KEYCLOAK_HTTP_PORT" to if (config.services.keycloak != null && agentInitConf.keycloakEnabled) - config.services.keycloak.httpPort.toString() else "", - "KEYCLOAK_REALM" to if (config.services.keycloak != null && agentInitConf.keycloakEnabled) - config.services.keycloak.realm else "", - "KEYCLOAK_CLIENT_ID" to if (config.services.keycloak != null && agentInitConf.keycloakEnabled) - config.services.keycloak.clientId else "", - "KEYCLOAK_CLIENT_SECRET" to if (config.services.keycloak != null && agentInitConf.keycloakEnabled) - config.services.keycloak.clientSecret else "", - ) - val environment: ComposeContainer = ComposeContainer( - File("src/test/resources/containers/agent.yml") - ).withEnv(agentConfMap).waitingFor("open-enterprise-agent", Wait.forHealthcheck()) - environments.add(environment) - environment.start() -} - -fun initializeWallet(agentConf: AgentConf, bearerToken: String? = "") { - val config = ConfigLoader().loadConfigOrThrow(System.getenv("INTEGRATION_TESTS_CONFIG") ?: "/configs/basic.conf") - val createWalletResponse = - RestAssured - .given().body( - CreateWalletRequest( - name = UUID.randomUUID().toString() - ) - ) - .header("Authorization", "Bearer $bearerToken") - .post("${agentConf.url}/wallets") - .then().statusCode(HttpStatus.SC_CREATED) -} - -fun initializeWebhook(agentConf: AgentConf, bearerToken: String? = "") { - val config = ConfigLoader().loadConfigOrThrow(System.getenv("INTEGRATION_TESTS_CONFIG") ?: "/configs/basic.conf") - val registerWebhookResponse = - RestAssured - .given().body( - CreateWebhookNotification( - url = agentConf.webhookUrl!!.toExternalForm() - ) - ) - .header("Authorization", "Bearer $bearerToken") - .header(config.global.authHeader, agentConf.apikey) - .post("${agentConf.url}/events/webhooks") - .then().statusCode(HttpStatus.SC_OK) -} - -fun getKeycloakAuthToken(keycloakConf: KeycloakConf, username: String, password: String): String { - val tokenResponse = - RestAssured - .given().body("grant_type=password&client_id=${keycloakConf.clientId}&client_secret=${keycloakConf.clientSecret}&username=${username}&password=${password}") - .contentType("application/x-www-form-urlencoded") - .header("Host", "localhost") - .post("http://localhost:${keycloakConf.httpPort}/realms/${keycloakConf.realm}/protocol/openid-connect/token") - .thenReturn() - tokenResponse.then().statusCode(HttpStatus.SC_OK) - return tokenResponse.body.jsonPath().getString("access_token") -} - -@BeforeAll -fun initAgents() { - val cast = Cast() - val config = ConfigLoader().loadConfigOrThrow(System.getenv("INTEGRATION_TESTS_CONFIG") ?: "/configs/basic.conf") - cast.actorNamed( - "Acme", - CallAnApi.at(config.issuer.url.toExternalForm()), - ListenToEvents.at(config.issuer.webhookUrl!!) - ) - cast.actorNamed( - "Bob", - CallAnApi.at(config.holder.url.toExternalForm()), - ListenToEvents.at(config.holder.webhookUrl!!) - ) - cast.actorNamed( - "Faber", - CallAnApi.at(config.verifier.url.toExternalForm()), - ListenToEvents.at(config.verifier.webhookUrl!!) - ) - cast.actorNamed( - "Admin", - CallAnApi.at(config.admin.url.toExternalForm()) - ) - OnStage.setTheStage(cast) - - if (config.services.keycloak != null) { - initializeKeycloak(config.services.keycloak) - } - - if (config.services.prismNode != null) { - initializeVdr(config.services.prismNode) - } - // Initialize the agents - config.agents.forEach { agent -> - initializeAgent(agent) - } - - if (config.services.keycloak != null) { - cast.actors.forEach { actor -> - actor.remember("KEYCLOAK_BEARER_TOKEN", getKeycloakAuthToken(config.services.keycloak, actor.name, actor.name)) - when (actor.name) { - "Acme" -> { - initializeWallet(config.issuer, cast.actorNamed(actor.name).recall("KEYCLOAK_BEARER_TOKEN")) - } - "Bob" -> { - initializeWallet(config.holder, cast.actorNamed(actor.name).recall("KEYCLOAK_BEARER_TOKEN")) - } - "Faber" -> { - initializeWallet(config.verifier, cast.actorNamed(actor.name).recall("KEYCLOAK_BEARER_TOKEN")) - } - } - } - } - - initializeWebhook(config.issuer, cast.actorNamed("Acme").recall("KEYCLOAK_BEARER_TOKEN")) - initializeWebhook(config.holder, cast.actorNamed("Bob").recall("KEYCLOAK_BEARER_TOKEN")) - initializeWebhook(config.verifier, cast.actorNamed("Faber").recall("KEYCLOAK_BEARER_TOKEN")) - - cast.actors.forEach { actor -> - when (actor.name) { - "Acme" -> { - actor.remember("AUTH_KEY", config.issuer.apikey) - actor.remember("AUTH_HEADER", config.global.authHeader) - } - "Bob" -> { - actor.remember("AUTH_KEY", config.holder.apikey) - actor.remember("AUTH_HEADER", config.global.authHeader) - } - "Faber" -> { - actor.remember("AUTH_KEY", config.verifier.apikey) - actor.remember("AUTH_HEADER", config.global.authHeader) - } - "Admin" -> { - actor.remember("AUTH_KEY", config.admin.apikey) - actor.remember("AUTH_HEADER", config.global.adminAuthHeader) - } - } - } -} - -@AfterAll -fun clearStage() { - OnStage.drawTheCurtain() - environments.forEach { environment -> - environment.stop() - } -} - -class CommonSteps { - @ParameterType(".*") - fun actor(actorName: String): Actor { - return OnStage.theActorCalled(actorName) - } - - @Given("{actor} has an issued credential from {actor}") - fun holderHasIssuedCredentialFromIssuer(holder: Actor, issuer: Actor) { - holder.attemptsTo( - Get.resource("/issue-credentials/records") - ) - holder.attemptsTo( - Ensure.thatTheLastResponse().statusCode().isEqualTo(SC_OK) - ) - val receivedCredential = SerenityRest.lastResponse().get().contents!!.findLast { credential -> - credential.protocolState == IssueCredentialRecord.ProtocolState.CREDENTIAL_RECEIVED - && credential.credentialFormat == IssueCredentialRecord.CredentialFormat.JWT - } - - if (receivedCredential != null) { - holder.remember("issuedCredential", receivedCredential) - } else { - val publishDidSteps = PublishDidSteps() - val issueSteps = IssueCredentialsSteps() - actorsHaveExistingConnection(issuer, holder) - publishDidSteps.createsUnpublishedDid(holder) - publishDidSteps.createsUnpublishedDid(issuer) - publishDidSteps.hePublishesDidToLedger(issuer) - issueSteps.acmeOffersACredential(issuer, holder, "short") - issueSteps.holderReceivesCredentialOffer(holder) - issueSteps.holderAcceptsCredentialOfferForJwt(holder) - issueSteps.acmeIssuesTheCredential(issuer) - issueSteps.bobHasTheCredentialIssued(holder) - } - } - - @Given("{actor} and {actor} have an existing connection") - fun actorsHaveExistingConnection(inviter: Actor, invitee: Actor) { - inviter.attemptsTo( - Get.resource("/connections") - ) - inviter.attemptsTo( - Ensure.thatTheLastResponse().statusCode().isEqualTo(SC_OK) - ) - val inviterConnection = SerenityRest.lastResponse().get().contents!!.firstOrNull { - it.label == "Connection with ${invitee.name}" && it.state == Connection.State.CONNECTION_RESPONSE_SENT - } - - var inviteeConnection: Connection? = null - if (inviterConnection != null) { - invitee.attemptsTo( - Get.resource("/connections") - ) - invitee.attemptsTo( - Ensure.thatTheLastResponse().statusCode().isEqualTo(SC_OK) - ) - inviteeConnection = SerenityRest.lastResponse().get().contents!!.firstOrNull { - it.theirDid == inviterConnection.myDid && it.state == Connection.State.CONNECTION_RESPONSE_RECEIVED - } - } - - if (inviterConnection != null && inviteeConnection != null) { - inviter.remember("connection-with-${invitee.name}", inviterConnection) - invitee.remember("connection-with-${inviter.name}", inviteeConnection) - } else { - val connectionSteps = ConnectionSteps() - connectionSteps.inviterGeneratesAConnectionInvitation(inviter, invitee) - connectionSteps.inviteeSendsAConnectionRequestToInviter(invitee, inviter) - connectionSteps.inviterReceivesTheConnectionRequest(inviter) - connectionSteps.inviteeReceivesTheConnectionResponse(invitee) - connectionSteps.inviterAndInviteeHaveAConnection(inviter, invitee) - } - } -} diff --git a/tests/integration-tests/src/test/kotlin/features/Init.kt b/tests/integration-tests/src/test/kotlin/features/Init.kt new file mode 100644 index 0000000000..bc525f245b --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/features/Init.kt @@ -0,0 +1,120 @@ +package features + +import com.sksamuel.hoplite.ConfigException +import com.sksamuel.hoplite.ConfigLoader +import common.ListenToEvents +import common.TestConstants +import config.Config +import interactions.Post +import io.cucumber.java.AfterAll +import io.cucumber.java.BeforeAll +import io.iohk.atala.prism.models.CreateWalletRequest +import io.iohk.atala.prism.models.CreateWebhookNotification +import net.serenitybdd.screenplay.Actor +import net.serenitybdd.screenplay.actors.Cast +import net.serenitybdd.screenplay.actors.OnStage +import net.serenitybdd.screenplay.rest.abilities.CallAnApi +import org.apache.http.HttpStatus +import java.util.* + +val config = ConfigLoader().loadConfigOrThrow(TestConstants.TESTS_CONFIG) + +/** + * This function starts all services and actors before all tests. + */ +fun initServices() { + config.services?.keycloak?.start( + config.roles.filter { it.name != "Admin" }.map { it.name } + ) + config.services?.prismNode?.start() + config.services?.vault?.start() + config.agents?.forEach { agent -> + agent.start() + } +} + +/** + * This function initializes all actors and sets the stage. + */ +fun initActors() { + /** + * This function initializes a wallet for an actor when Keycloak is used. + * + * @param actor The actor for which the wallet should be initialized. + */ + fun initializeWallet(actor: Actor) { + Post("") + .specWithAuthHeaders(actor) + .body( + CreateWalletRequest( + name = UUID.randomUUID().toString() + ) + ) + .post("/wallets") + .then().statusCode(HttpStatus.SC_CREATED) + } + + /** + * This function registers a webhook for an actor. + * + * @param actor The actor for which the webhook should be registered. + * @param webhookUrl The url of the webhook. + */ + fun registerWebhook(actor: Actor, webhookUrl: String) { + Post("") + .specWithAuthHeaders(actor) + .body(CreateWebhookNotification(url = webhookUrl)) + .post("/events/webhooks") + .then().statusCode(HttpStatus.SC_OK) + } + + val cast = Cast() + config.roles.forEach { role -> + cast.actorNamed( + role.name, + CallAnApi.at(role.url.toExternalForm()) + ) + } + if (config.services?.keycloak != null) { + cast.actors.filter { it.name != "Admin" }.forEach { actor -> + try { + actor.remember("BEARER_TOKEN", config.services.keycloak.getKeycloakAuthToken(actor.name, actor.name)) + } catch (e: NullPointerException) { + throw ConfigException("Keycloak is configured, but no token found for user ${actor.name}!") + } + initializeWallet(actor) + } + } + config.roles.forEach { role -> + println(role.name) + val actor = cast.actorNamed(role.name) + if (role.apikey != null) { + actor.remember("AUTH_KEY", role.apikey) + actor.remember("AUTH_HEADER", role.authHeader) + } + if (role.webhook != null) { + actor.whoCan(ListenToEvents.at(role.webhook.url)) + if (role.webhook.initRequired) { + registerWebhook(actor, role.webhook.url.toExternalForm()) + } + } + } + OnStage.setTheStage(cast) +} + +@BeforeAll +fun init() { + initServices() + initActors() +} + +@AfterAll +fun clearStage() { + OnStage.drawTheCurtain() + config.agents?.forEach { agent -> + agent.stop() + } + config.services?.keycloak?.stop() + config.services?.prismNode?.stop() + config.services?.vault?.stop() +} diff --git a/tests/integration-tests/src/test/kotlin/features/common/CommonSteps.kt b/tests/integration-tests/src/test/kotlin/features/common/CommonSteps.kt new file mode 100644 index 0000000000..147fe2f179 --- /dev/null +++ b/tests/integration-tests/src/test/kotlin/features/common/CommonSteps.kt @@ -0,0 +1,93 @@ +package features.common + +import features.connection.ConnectionSteps +import features.credentials.IssueCredentialsSteps +import features.did.PublishDidSteps +import interactions.Get +import io.cucumber.java.ParameterType +import io.cucumber.java.en.Given +import io.iohk.atala.automation.extensions.get +import io.iohk.atala.automation.serenity.ensure.Ensure +import io.iohk.atala.prism.models.Connection +import io.iohk.atala.prism.models.ConnectionsPage +import io.iohk.atala.prism.models.IssueCredentialRecord +import io.iohk.atala.prism.models.IssueCredentialRecordPage +import net.serenitybdd.rest.SerenityRest +import net.serenitybdd.screenplay.Actor +import net.serenitybdd.screenplay.actors.OnStage +import org.apache.http.HttpStatus + +class CommonSteps { + @ParameterType(".*") + fun actor(actorName: String): Actor { + return OnStage.theActorCalled(actorName) + } + + @Given("{actor} has an issued credential from {actor}") + fun holderHasIssuedCredentialFromIssuer(holder: Actor, issuer: Actor) { + holder.attemptsTo( + Get.resource("/issue-credentials/records") + ) + holder.attemptsTo( + Ensure.thatTheLastResponse().statusCode().isEqualTo(HttpStatus.SC_OK) + ) + val receivedCredential = SerenityRest.lastResponse().get().contents!!.findLast { credential -> + credential.protocolState == IssueCredentialRecord.ProtocolState.CREDENTIAL_RECEIVED && + credential.credentialFormat == IssueCredentialRecord.CredentialFormat.JWT + } + + if (receivedCredential != null) { + holder.remember("issuedCredential", receivedCredential) + } else { + val publishDidSteps = PublishDidSteps() + val issueSteps = IssueCredentialsSteps() + actorsHaveExistingConnection(issuer, holder) + publishDidSteps.createsUnpublishedDid(holder) + publishDidSteps.createsUnpublishedDid(issuer) + publishDidSteps.hePublishesDidToLedger(issuer) + issueSteps.acmeOffersACredential(issuer, holder, "short") + issueSteps.holderReceivesCredentialOffer(holder) + issueSteps.holderAcceptsCredentialOfferForJwt(holder) + issueSteps.acmeIssuesTheCredential(issuer) + issueSteps.bobHasTheCredentialIssued(holder) + } + } + + @Given("{actor} and {actor} have an existing connection") + fun actorsHaveExistingConnection(inviter: Actor, invitee: Actor) { + inviter.attemptsTo( + Get.resource("/connections") + ) + inviter.attemptsTo( + Ensure.thatTheLastResponse().statusCode().isEqualTo(HttpStatus.SC_OK) + ) + val inviterConnection = SerenityRest.lastResponse().get().contents!!.firstOrNull { + it.label == "Connection with ${invitee.name}" && it.state == Connection.State.CONNECTION_RESPONSE_SENT + } + + var inviteeConnection: Connection? = null + if (inviterConnection != null) { + invitee.attemptsTo( + Get.resource("/connections") + ) + invitee.attemptsTo( + Ensure.thatTheLastResponse().statusCode().isEqualTo(HttpStatus.SC_OK) + ) + inviteeConnection = SerenityRest.lastResponse().get().contents!!.firstOrNull { + it.theirDid == inviterConnection.myDid && it.state == Connection.State.CONNECTION_RESPONSE_RECEIVED + } + } + + if (inviterConnection != null && inviteeConnection != null) { + inviter.remember("connection-with-${invitee.name}", inviterConnection) + invitee.remember("connection-with-${inviter.name}", inviteeConnection) + } else { + val connectionSteps = ConnectionSteps() + connectionSteps.inviterGeneratesAConnectionInvitation(inviter, invitee) + connectionSteps.inviteeSendsAConnectionRequestToInviter(invitee, inviter) + connectionSteps.inviterReceivesTheConnectionRequest(inviter) + connectionSteps.inviteeReceivesTheConnectionResponse(invitee) + connectionSteps.inviterAndInviteeHaveAConnection(inviter, invitee) + } + } +} diff --git a/tests/integration-tests/src/test/kotlin/features/credentials/IssueCredentialsSteps.kt b/tests/integration-tests/src/test/kotlin/features/credentials/IssueCredentialsSteps.kt index 8238474631..3eed12796f 100644 --- a/tests/integration-tests/src/test/kotlin/features/credentials/IssueCredentialsSteps.kt +++ b/tests/integration-tests/src/test/kotlin/features/credentials/IssueCredentialsSteps.kt @@ -105,7 +105,7 @@ class IssueCredentialsSteps { author = issuer.recall("shortFormDid"), signatureType = "CL", tag = "student", - supportRevocation = false, + supportRevocation = false ) ) } @@ -157,10 +157,10 @@ class IssueCredentialsSteps { it.data.thid == holder.recall("thid") } credentialEvent != null && - credentialEvent!!.data.protocolState == IssueCredentialRecord.ProtocolState.OFFER_RECEIVED + credentialEvent!!.data.protocolState == IssueCredentialRecord.ProtocolState.OFFER_RECEIVED }, "Holder was unable to receive the credential offer from Issuer! " + - "Protocol state did not achieve ${IssueCredentialRecord.ProtocolState.OFFER_RECEIVED} state." + "Protocol state did not achieve ${IssueCredentialRecord.ProtocolState.OFFER_RECEIVED} state." ) val recordId = ListenToEvents.`as`(holder).credentialEvents.last().data.recordId diff --git a/tests/integration-tests/src/test/kotlin/interactions/AuthRestInteraction.kt b/tests/integration-tests/src/test/kotlin/interactions/AuthRestInteraction.kt index d1350973bd..cc51d50394 100644 --- a/tests/integration-tests/src/test/kotlin/interactions/AuthRestInteraction.kt +++ b/tests/integration-tests/src/test/kotlin/interactions/AuthRestInteraction.kt @@ -1,21 +1,17 @@ package interactions -import com.sksamuel.hoplite.ConfigLoader -import config.Config import io.restassured.specification.RequestSpecification import net.serenitybdd.screenplay.Actor import net.serenitybdd.screenplay.rest.interactions.RestInteraction abstract class AuthRestInteraction : RestInteraction() { - private val config = ConfigLoader().loadConfigOrThrow(System.getenv("INTEGRATION_TESTS_CONFIG") ?: "/configs/basic.conf") - fun specWithAuthHeaders(actor: T): RequestSpecification { val spec = rest() - if (config.services.keycloak != null && actor!!.recall("KEYCLOAK_BEARER_TOKEN") != null) { - spec.header("Authorization", "Bearer ${actor!!.recall("KEYCLOAK_BEARER_TOKEN")}") + if (actor!!.recall("BEARER_TOKEN") != null) { + spec.header("Authorization", "Bearer ${actor.recall("BEARER_TOKEN")}") } - if (actor!!.recall("AUTH_KEY") != null) { + if (actor.recall("AUTH_KEY") != null) { spec.header(actor.recall("AUTH_HEADER"), actor.recall("AUTH_KEY")) } return spec diff --git a/tests/integration-tests/src/test/resources/configs/basic.conf b/tests/integration-tests/src/test/resources/configs/basic.conf index 3b30de9fb5..031d376e9e 100644 --- a/tests/integration-tests/src/test/resources/configs/basic.conf +++ b/tests/integration-tests/src/test/resources/configs/basic.conf @@ -12,36 +12,43 @@ agents = [ version = "${OPEN_ENTERPRISE_AGENT_VERSION}" http_port = 8080 didcomm_port = 7080 - secret_storage_backend = "postgres" auth_enabled = true - keycloak_enabled = false + prism_node = ${services.prism_node} } ] -global { - auth_header = "${AUTH_HEADER:-apikey}" - admin_auth_header = "${ADMIN_AUTH_HEADER:-x-admin-api-key}" -} - -admin { - url = "${ADMIN_AGENT_URL:-http://localhost:8080}" - apikey = "${ADMIN_API_KEY:-admin}" -} - -issuer { - url = "${ISSUER_AGENT_URL:-http://localhost:8080}" - apikey = "${ISSUER_API_KEY:-${random.string(16)}}" - webhook_url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" -} - -holder { - url = "${HOLDER_AGENT_URL:-http://localhost:8080}" - apikey = "${HOLDER_API_KEY:-${random.string(16)}}" - webhook_url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" -} - -verifier { - url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" - apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" - webhook_url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" -} +roles = [ + { + name = "Admin" + url = "${ADMIN_AGENT_URL:-http://localhost:8080}" + apikey = "${ADMIN_API_KEY:-admin}" + auth_header = "x-admin-api-key" + } + { + name = "Issuer" + url = "${ISSUER_AGENT_URL:-http://localhost:8080}" + apikey = "${ISSUER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" + init_required = true + } + }, + { + name = "Holder" + url = "${HOLDER_AGENT_URL:-http://localhost:8080}" + apikey = "${HOLDER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" + init_required = true + } + }, + { + name = "Verifier" + url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" + apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" + init_required = true + } + } +] diff --git a/tests/integration-tests/src/test/resources/configs/double.conf b/tests/integration-tests/src/test/resources/configs/double.conf deleted file mode 100644 index 871daf4dc7..0000000000 --- a/tests/integration-tests/src/test/resources/configs/double.conf +++ /dev/null @@ -1,75 +0,0 @@ -# Specify shared services that are used by all agents (if any) -services = { - prism_node = { - http_port = 50053 - version = "${PRISM_NODE_VERSION}" - }, - keycloak = { - http_port = 9980 - realm = "atala-demo" - client_id = "prism-agent" - client_secret = "prism-agent-demo-secret" - users = [ - { - username = "Acme" - password = "Acme" - }, - { - username = "Bob" - password = "Bob" - }, - { - username = "Faber" - password = "Faber" - } - ] - } -} - -# Specify agents that are required to be created before running tests -agents = [ - { - version = "${OPEN_ENTERPRISE_AGENT_VERSION}" - http_port = 8080 - didcomm_port = 7080 - secret_storage_backend = "postgres" - auth_enabled = true - keycloak_enabled = false - }, - { - version = "${OPEN_ENTERPRISE_AGENT_VERSION}" - http_port = 8090 - didcomm_port = 7090 - secret_storage_backend = "postgres" - auth_enabled = false - keycloak_enabled = true - } -] - -global { - auth_header = "${AUTH_HEADER:-apikey}" - admin_auth_header = "${ADMIN_AUTH_HEADER:-x-admin-api-key}" -} - -admin { - url = "${ADMIN_AGENT_URL:-http://localhost:8080}" - apikey = "${ADMIN_API_KEY:-admin}" -} - -issuer { - url = "${ISSUER_AGENT_URL:-http://localhost:8080}" - apikey = "${ISSUER_API_KEY:-${random.string(16)}}" - webhook_url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" -} - -holder { - url = "${HOLDER_AGENT_URL:-http://localhost:8090}" - apikey = "${HOLDER_API_KEY:-${random.string(16)}}" - webhook_url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" -} - -verifier { - url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" - apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" - webhook_url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" -} diff --git a/tests/integration-tests/src/test/resources/configs/keycloak.conf b/tests/integration-tests/src/test/resources/configs/keycloak.conf deleted file mode 100644 index 5f42199e48..0000000000 --- a/tests/integration-tests/src/test/resources/configs/keycloak.conf +++ /dev/null @@ -1,70 +0,0 @@ -# Specify shared services that are used by all agents (if any) -services = { - prism_node = { - http_port = 50053 - version = "${PRISM_NODE_VERSION}" - } - keycloak = { - http_port = 9980 - realm = "atala-demo" - client_id = "prism-agent" - client_secret = "prism-agent-demo-secret" - users = [ - { - username = "Acme" - password = "Acme" - }, - { - username = "Bob" - password = "Bob" - }, - { - username = "Faber" - password = "Faber" - } - ] - } - vault = { - http_port = 8200 - } -} - -# Specify agents that are required to be created before running tests -agents = [ - { - version = "${OPEN_ENTERPRISE_AGENT_VERSION}" - http_port = 8080 - didcomm_port = 7080 - secret_storage_backend = "postgres" # can be vault - auth_enabled = false - keycloak_enabled = true - } -] - -global { - auth_header = "${AUTH_HEADER:-apikey}" - admin_auth_header = "${ADMIN_AUTH_HEADER:-x-admin-api-key}" -} - -admin { - url = "${ADMIN_AGENT_URL:-http://localhost:8080}" - apikey = "${ADMIN_API_KEY:-admin}" -} - -issuer { - url = "${ISSUER_AGENT_URL:-http://localhost:8080}" - apikey = "${ISSUER_API_KEY:-${random.string(16)}}" - webhook_url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" -} - -holder { - url = "${HOLDER_AGENT_URL:-http://localhost:8080}" - apikey = "${HOLDER_API_KEY:-${random.string(16)}}" - webhook_url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" -} - -verifier { - url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" - apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" - webhook_url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" -} diff --git a/tests/integration-tests/src/test/resources/configs/mt_keycloak.conf b/tests/integration-tests/src/test/resources/configs/mt_keycloak.conf new file mode 100644 index 0000000000..baca698106 --- /dev/null +++ b/tests/integration-tests/src/test/resources/configs/mt_keycloak.conf @@ -0,0 +1,58 @@ +# Specify shared services that are used by all agents (if any) +services = { + prism_node = { + http_port = 50053 + version = "${PRISM_NODE_VERSION}" + } + keycloak = { + http_port = 9980 + } +} + +# Specify agents that are required to be created before running tests +agents = [ + { + version = "${OPEN_ENTERPRISE_AGENT_VERSION}" + http_port = 8080 + didcomm_port = 7080 + auth_enabled = false + prism_node = ${services.prism_node} + keycloak = ${services.keycloak} + } +] + +roles = [ + { + name = "Admin" + url = "${ADMIN_AGENT_URL:-http://localhost:8080}" + apikey = "${ADMIN_API_KEY:-admin}" + auth_header = "x-admin-api-key" + } + { + name = "Issuer" + url = "${ISSUER_AGENT_URL:-http://localhost:8080}" + apikey = "${ISSUER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" + init_required = true + } + }, + { + name = "Holder" + url = "${HOLDER_AGENT_URL:-http://localhost:8080}" + apikey = "${HOLDER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" + init_required = true + } + }, + { + name = "Verifier" + url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" + apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" + init_required = true + } + } +] diff --git a/tests/integration-tests/src/test/resources/configs/mt_keycloak_vault.conf b/tests/integration-tests/src/test/resources/configs/mt_keycloak_vault.conf new file mode 100644 index 0000000000..f5dff9f9ab --- /dev/null +++ b/tests/integration-tests/src/test/resources/configs/mt_keycloak_vault.conf @@ -0,0 +1,62 @@ +# Specify shared services that are used by all agents (if any) +services = { + prism_node = { + http_port = 50053 + version = "${PRISM_NODE_VERSION}" + } + keycloak = { + http_port = 9980 + } + vault = { + http_port = 8200 + } +} + +# Specify agents that are required to be created before running tests +agents = [ + { + version = "${OPEN_ENTERPRISE_AGENT_VERSION}" + http_port = 8080 + didcomm_port = 7080 + auth_enabled = false + prism_node = ${services.prism_node} + keycloak = ${services.keycloak} + vault = ${services.vault} + } +] + +roles = [ + { + name = "Admin" + url = "${ADMIN_AGENT_URL:-http://localhost:8080}" + apikey = "${ADMIN_API_KEY:-admin}" + auth_header = "x-admin-api-key" + } + { + name = "Issuer" + url = "${ISSUER_AGENT_URL:-http://localhost:8080}" + apikey = "${ISSUER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" + init_required = true + } + }, + { + name = "Holder" + url = "${HOLDER_AGENT_URL:-http://localhost:8080}" + apikey = "${HOLDER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" + init_required = true + } + }, + { + name = "Verifier" + url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" + apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" + init_required = true + } + } +] diff --git a/tests/integration-tests/src/test/resources/configs/mt_vault.conf b/tests/integration-tests/src/test/resources/configs/mt_vault.conf new file mode 100644 index 0000000000..4b40259412 --- /dev/null +++ b/tests/integration-tests/src/test/resources/configs/mt_vault.conf @@ -0,0 +1,58 @@ +# Specify shared services that are used by all agents (if any) +services = { + prism_node = { + http_port = 50053 + version = "${PRISM_NODE_VERSION}" + } + vault = { + http_port = 8200 + } +} + +# Specify agents that are required to be created before running tests +agents = [ + { + version = "${OPEN_ENTERPRISE_AGENT_VERSION}" + http_port = 8080 + didcomm_port = 7080 + auth_enabled = true + prism_node = ${services.prism_node} + vault = ${services.vault} + } +] + +roles = [ + { + name = "Admin" + url = "${ADMIN_AGENT_URL:-http://localhost:8080}" + apikey = "${ADMIN_API_KEY:-admin}" + auth_header = "x-admin-api-key" + } + { + name = "Issuer" + url = "${ISSUER_AGENT_URL:-http://localhost:8080}" + apikey = "${ISSUER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" + init_required = true + } + }, + { + name = "Holder" + url = "${HOLDER_AGENT_URL:-http://localhost:8080}" + apikey = "${HOLDER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" + init_required = true + } + }, + { + name = "Verifier" + url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" + apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" + init_required = true + } + } +] diff --git a/tests/integration-tests/src/test/resources/configs/two_agents_sharing_keycloak.conf b/tests/integration-tests/src/test/resources/configs/two_agents_sharing_keycloak.conf new file mode 100644 index 0000000000..5740b2789b --- /dev/null +++ b/tests/integration-tests/src/test/resources/configs/two_agents_sharing_keycloak.conf @@ -0,0 +1,66 @@ +# Specify shared services that are used by all agents (if any) +services = { + prism_node = { + http_port = 50053 + version = "${PRISM_NODE_VERSION}" + } + keycloak = { + http_port = 9980 + } +} + +# Specify agents that are required to be created before running tests +agents = [ + { + version = "${OPEN_ENTERPRISE_AGENT_VERSION}" + http_port = 8080 + didcomm_port = 7080 + auth_enabled = true + prism_node = ${services.prism_node} + keycloak = ${services.keycloak} + }, + { + version = "${OPEN_ENTERPRISE_AGENT_VERSION}" + http_port = 8090 + didcomm_port = 7090 + auth_enabled = true + prism_node = ${services.prism_node} + keycloak = ${services.keycloak} + } +] + +roles = [ + { + name = "Admin" + url = "${ADMIN_AGENT_URL:-http://localhost:8080}" + apikey = "${ADMIN_API_KEY:-admin}" + auth_header = "x-admin-api-key" + } + { + name = "Issuer" + url = "${ISSUER_AGENT_URL:-http://localhost:8080}" + apikey = "${ISSUER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${ISSUER_WEBHOOK_URL:-http://host.docker.internal:9955}" + init_required = true + } + }, + { + name = "Holder" + url = "${HOLDER_AGENT_URL:-http://localhost:8090}" + apikey = "${HOLDER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${HOLDER_WEBHOOK_URL:-http://host.docker.internal:9956}" + init_required = true + } + }, + { + name = "Verifier" + url = "${VERIFIER_AGENT_URL:-http://localhost:8080}" + apikey = "${VERIFIER_API_KEY:-${random.string(16)}}" + webhook = { + url = "${VERIFIER_WEBHOOK_URL:-http://host.docker.internal:9957}" + init_required = true + } + } +] diff --git a/tests/integration-tests/src/test/resources/containers/agent.yml b/tests/integration-tests/src/test/resources/containers/agent.yml index c82e740a54..72a208ff55 100644 --- a/tests/integration-tests/src/test/resources/containers/agent.yml +++ b/tests/integration-tests/src/test/resources/containers/agent.yml @@ -32,13 +32,13 @@ services: CONNECT_DB_HOST: postgres AGENT_DB_HOST: postgres VAULT_TOKEN: root + AUTH_HEADER: apikey + ADMIN_AUTH_HEADER: "x-admin-api-key" # Configuration parameters AGENT_DIDCOMM_PORT: AGENT_HTTP_PORT: DIDCOMM_SERVICE_URL: "http://host.docker.internal:${AGENT_DIDCOMM_PORT}" REST_SERVICE_URL: "http://host.docker.internal:${AGENT_HTTP_PORT}" - AUTH_HEADER: - ADMIN_AUTH_HEADER: API_KEY_ENABLED: # Secret storage configuration SECRET_STORAGE_BACKEND: diff --git a/tests/integration-tests/src/test/resources/containers/vault.yml b/tests/integration-tests/src/test/resources/containers/vault.yml index a762c5dc0b..ff728110a3 100644 --- a/tests/integration-tests/src/test/resources/containers/vault.yml +++ b/tests/integration-tests/src/test/resources/containers/vault.yml @@ -3,7 +3,7 @@ version: "3.8" services: - vault-server: + vault: image: hashicorp/vault:1.13.3 ports: - "${VAULT_PORT}:8200" diff --git a/tests/integration-tests/src/test/resources/features/connection/connection.feature b/tests/integration-tests/src/test/resources/features/connection/connection.feature index 360a135220..2b24c704b1 100644 --- a/tests/integration-tests/src/test/resources/features/connection/connection.feature +++ b/tests/integration-tests/src/test/resources/features/connection/connection.feature @@ -1,8 +1,8 @@ Feature: Agents connection Scenario: Establish a connection between two agents - When Acme generates a connection invitation to Bob - And Bob sends a connection request to Acme - And Acme receives the connection request and sends back the response - And Bob receives the connection response - Then Acme and Bob have a connection + When Issuer generates a connection invitation to Holder + And Holder sends a connection request to Issuer + And Issuer receives the connection request and sends back the response + And Holder receives the connection response + Then Issuer and Holder have a connection diff --git a/tests/integration-tests/src/test/resources/features/credentials/issue_credentials.feature b/tests/integration-tests/src/test/resources/features/credentials/issue_credentials.feature index 8f85e9d332..72bcefc7cb 100644 --- a/tests/integration-tests/src/test/resources/features/credentials/issue_credentials.feature +++ b/tests/integration-tests/src/test/resources/features/credentials/issue_credentials.feature @@ -2,35 +2,35 @@ Feature: Issue Credentials Protocol Scenario: Issuing credential with published PRISM DID - Given Acme and Bob have an existing connection - When Acme creates unpublished DID + Given Issuer and Holder have an existing connection + When Issuer creates unpublished DID And He publishes DID to ledger - And Bob creates unpublished DID - And Acme offers a credential to Bob with "short" form DID - And Bob receives the credential offer - And Bob accepts credential offer for JWT - And Acme issues the credential - Then Bob receives the issued credential + And Holder creates unpublished DID + And Issuer offers a credential to Holder with "short" form DID + And Holder receives the credential offer + And Holder accepts credential offer for JWT + And Issuer issues the credential + Then Holder receives the issued credential Scenario: Issuing credential with unpublished PRISM DID - Given Acme and Bob have an existing connection - When Acme creates unpublished DID - And Bob creates unpublished DID - And Acme offers a credential to Bob with "long" form DID - And Bob receives the credential offer - And Bob accepts credential offer for JWT - And Acme issues the credential - Then Bob receives the issued credential + Given Issuer and Holder have an existing connection + When Issuer creates unpublished DID + And Holder creates unpublished DID + And Issuer offers a credential to Holder with "long" form DID + And Holder receives the credential offer + And Holder accepts credential offer for JWT + And Issuer issues the credential + Then Holder receives the issued credential Scenario: Issuing anoncred with published PRISM DID - Given Acme and Bob have an existing connection - When Acme creates unpublished DID + Given Issuer and Holder have an existing connection + When Issuer creates unpublished DID And He publishes DID to ledger - And Bob creates unpublished DID - And Acme creates anoncred schema - And Acme creates anoncred credential definition - And Acme offers anoncred to Bob - And Bob receives the credential offer - And Bob accepts credential offer for anoncred - And Acme issues the credential - Then Bob receives the issued credential + And Holder creates unpublished DID + And Issuer creates anoncred schema + And Issuer creates anoncred credential definition + And Issuer offers anoncred to Holder + And Holder receives the credential offer + And Holder accepts credential offer for anoncred + And Issuer issues the credential + Then Holder receives the issued credential diff --git a/tests/integration-tests/src/test/resources/features/did/create_did.feature b/tests/integration-tests/src/test/resources/features/did/create_did.feature index f987c46390..e5177d5669 100644 --- a/tests/integration-tests/src/test/resources/features/did/create_did.feature +++ b/tests/integration-tests/src/test/resources/features/did/create_did.feature @@ -1,10 +1,10 @@ Feature: Create and publish DID Scenario: Create PRISM DID - When Acme creates PRISM DID + When Issuer creates PRISM DID Then He sees PRISM DID was created successfully Scenario: Successfully publish DID to ledger - When Acme creates unpublished DID + When Issuer creates unpublished DID And He publishes DID to ledger Then He resolves DID document corresponds to W3C standard diff --git a/tests/integration-tests/src/test/resources/features/did/deactivate_did.feature b/tests/integration-tests/src/test/resources/features/did/deactivate_did.feature index 9f98dfa7a3..bed84078a0 100644 --- a/tests/integration-tests/src/test/resources/features/did/deactivate_did.feature +++ b/tests/integration-tests/src/test/resources/features/did/deactivate_did.feature @@ -2,6 +2,6 @@ Feature: Deactivate DID Scenario: Deactivate DID - Given Acme have published PRISM DID - When Acme deactivates PRISM DID + Given Issuer have published PRISM DID + When Issuer deactivates PRISM DID Then He sees that PRISM DID is successfully deactivated diff --git a/tests/integration-tests/src/test/resources/features/did/listing_did.feature b/tests/integration-tests/src/test/resources/features/did/listing_did.feature index cddac4ecd2..70239864c8 100644 --- a/tests/integration-tests/src/test/resources/features/did/listing_did.feature +++ b/tests/integration-tests/src/test/resources/features/did/listing_did.feature @@ -1,6 +1,6 @@ Feature: DID listing Scenario: Listing multiple PRISM DIDs - Given Acme creates 5 PRISM DIDs + Given Issuer creates 5 PRISM DIDs When He lists all PRISM DIDs Then He sees the list contains all created DIDs diff --git a/tests/integration-tests/src/test/resources/features/did/update_did.feature b/tests/integration-tests/src/test/resources/features/did/update_did.feature index 349ae0628a..ae474c65fa 100644 --- a/tests/integration-tests/src/test/resources/features/did/update_did.feature +++ b/tests/integration-tests/src/test/resources/features/did/update_did.feature @@ -2,29 +2,29 @@ Feature: Update DID Background: Published DID is created - Given Acme have published PRISM DID + Given Issuer have published PRISM DID Scenario: Update PRISM DID by adding new services - When Acme updates PRISM DID with new services + When Issuer updates PRISM DID with new services And He submits PRISM DID update operation Then He sees PRISM DID was successfully updated with new services Scenario: Update PRISM DID by removing services - When Acme updates PRISM DID by removing services + When Issuer updates PRISM DID by removing services And He submits PRISM DID update operation Then He sees PRISM DID was successfully updated by removing services Scenario: Update PRISM DID by updating services - When Acme updates PRISM DID by updating services + When Issuer updates PRISM DID by updating services And He submits PRISM DID update operation Then He sees PRISM DID was successfully updated by updating services Scenario: Update PRISM DID by adding new keys - When Acme updates PRISM DID by adding new keys + When Issuer updates PRISM DID by adding new keys And He submits PRISM DID update operation Then He sees PRISM DID was successfully updated with new keys Scenario: Update PRISM DID by removing keys - When Acme updates PRISM DID by removing keys + When Issuer updates PRISM DID by removing keys And He submits PRISM DID update operation Then He sees PRISM DID was successfully updated and keys removed diff --git a/tests/integration-tests/src/test/resources/features/proofs/present_proof.feature b/tests/integration-tests/src/test/resources/features/proofs/present_proof.feature index 406908d490..cbf44843f6 100644 --- a/tests/integration-tests/src/test/resources/features/proofs/present_proof.feature +++ b/tests/integration-tests/src/test/resources/features/proofs/present_proof.feature @@ -1,25 +1,25 @@ Feature: Present Proof Protocol Scenario: Holder presents credential proof to verifier - Given Faber and Bob have an existing connection - And Bob has an issued credential from Acme - When Faber sends a request for proof presentation to Bob - And Bob receives the request - And Bob makes the presentation of the proof to Faber - Then Faber has the proof verified + Given Verifier and Holder have an existing connection + And Holder has an issued credential from Issuer + When Verifier sends a request for proof presentation to Holder + And Holder receives the request + And Holder makes the presentation of the proof to Verifier + Then Verifier has the proof verified Scenario: Verifier rejects holder proof - Given Faber and Bob have an existing connection - And Bob has an issued credential from Acme - When Faber sends a request for proof presentation to Bob - And Bob receives the request - And Bob rejects the proof - Then Bob sees the proof is rejected + Given Verifier and Holder have an existing connection + And Holder has an issued credential from Issuer + When Verifier sends a request for proof presentation to Holder + And Holder receives the request + And Holder rejects the proof + Then Holder sees the proof is rejected Scenario: Holder presents proof to verifier which is the issuer itself - Given Acme and Bob have an existing connection - And Bob has an issued credential from Acme - When Acme sends a request for proof presentation to Bob - And Bob receives the request - And Bob makes the presentation of the proof to Acme - Then Acme has the proof verified + Given Issuer and Holder have an existing connection + And Holder has an issued credential from Issuer + When Issuer sends a request for proof presentation to Holder + And Holder receives the request + And Holder makes the presentation of the proof to Issuer + Then Issuer has the proof verified diff --git a/tests/integration-tests/src/test/resources/features/schemas/credential_schemas.feature b/tests/integration-tests/src/test/resources/features/schemas/credential_schemas.feature index 1cd58174fc..3903b5892e 100644 --- a/tests/integration-tests/src/test/resources/features/schemas/credential_schemas.feature +++ b/tests/integration-tests/src/test/resources/features/schemas/credential_schemas.feature @@ -1,13 +1,13 @@ Feature: Credential schemas Scenario: Successful schema creation - When Acme creates unpublished DID - And Acme creates a new credential schema + When Issuer creates unpublished DID + And Issuer creates a new credential schema Then He sees new credential schema is available Scenario Outline: Multiple schema creation - When Acme creates unpublished DID - And Acme creates new schemas + When Issuer creates unpublished DID + And Issuer creates new schemas Then He can access all of them one by one Examples: | schemas | diff --git a/tests/integration-tests/src/test/resources/features/system/health_endpoint.feature b/tests/integration-tests/src/test/resources/features/system/health_endpoint.feature index ea5229aee6..1158de85b1 100644 --- a/tests/integration-tests/src/test/resources/features/system/health_endpoint.feature +++ b/tests/integration-tests/src/test/resources/features/system/health_endpoint.feature @@ -2,5 +2,5 @@ Feature: Agent Health Endpoint Scenario: The runtime version can be retrieved from the Health Endpoint - When Acme makes a request to the health endpoint - Then Acme knows what version of the service is running + When Issuer makes a request to the health endpoint + Then Issuer knows what version of the service is running diff --git a/tests/integration-tests/src/test/resources/features/verificationpolicies/verification_policies.feature b/tests/integration-tests/src/test/resources/features/verificationpolicies/verification_policies.feature index e72204109f..c8455fc4a1 100644 --- a/tests/integration-tests/src/test/resources/features/verificationpolicies/verification_policies.feature +++ b/tests/integration-tests/src/test/resources/features/verificationpolicies/verification_policies.feature @@ -1,7 +1,7 @@ Feature: Verification Policies Scenario: Successful verification policy creation - When Acme creates a new verification policy + When Issuer creates a new verification policy Then He sees new verification policy is available When He updates a new verification policy Then He sees the updated verification policy is available