diff --git a/legal-acceptance-test/docs/README.md b/legal-acceptance-test/docs/README.md index 88cb4a9ff5363f73a76bc6530dceb1ede4f55ca3..32a02ae3cd391106fa8872005af2ad3af4b56509 100644 --- a/legal-acceptance-test/docs/README.md +++ b/legal-acceptance-test/docs/README.md @@ -7,10 +7,6 @@ You will need to have the following environment variables defined. | `HOST_URL` | ex `https://osdu.core-dev.gcp.gnrg-osdu.projects.epam.com/api/legal/v1/` | - | yes | - | | `MY_TENANT` | ex `osdu` | OSDU tenant used for testing | yes | - | | `SKIP_HTTP_TESTS` | ex `true` | jetty server returns 403 when running locally when deployed jettyserver is not used and the app returns a 302 so just run against deployed version only when checking http -> https redirects. Use 'true' for Google Cloud Run | yes | - | -| `BAREMETAL_PROJECT_ID` | ex `osdu-cim-dev` | project id used to specify bucket name if `ENABLE_FULL_BUCKET_NAME`=true | no | - | -| `TEST_MINIO_ACCESS_KEY` | ex `admin` | Minio access key | no | - | -| `TEST_MINIO_SECRET_KEY` | `********` | Minio secret | yes | -- | -| `TEST_MINIO_URL` | ex `https://s3.core-dev.gcp.gnrg-osdu.projects.epam.com` | Minio url | -- | | `PARTITION_API` | ex `https://osdu.core-dev.gcp.gnrg-osdu.projects.epam.com/api/partition/v1` | Partition service host | no | -- | @@ -19,20 +15,20 @@ Authentication can be provided as OIDC config: | name | value | description | sensitive? | source | |-------------------------------------------------|-----------------------------------------|-------------------------------|------------|--------| -| `TEST_OPENID_PROVIDER_CLIENT_ID` | `********` | Client Id for `$INTEGRATION_TESTER` | yes | - | -| `TEST_OPENID_PROVIDER_CLIENT_SECRET` | `********` | Client secret for `$INTEGRATION_TESTER` | yes | - | +| `PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_ID` | `********` | PRIVILEGED_USER Client Id | yes | - | +| `PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_SECRET` | `********` | PRIVILEGED_USER Client secret | yes | - | | `TEST_OPENID_PROVIDER_URL` | `https://keycloak.com/auth/realms/osdu` | OpenID provider url | yes | - | Or tokens can be used directly from env variables: | name | value | description | sensitive? | source | |-------------------------|------------|-----------------------|------------|--------| -| `TEST_USER_TOKEN` | `********` | `$INTEGRATION_TESTER` Token | yes | - | +| `PRIVILEGED_USER_TOKEN` | `********` | PRIVILEGED_USER_TOKEN Token | yes | - | **Entitlements configuration for integration accounts** -| INTEGRATION_TESTER | +| PRIVILEGED_USER | |------------------------------------------------------------------------------------------------------------------------------------------------------| | users<br/>service.entitlements.user<br/>service.legal.admin<br/>service.legal.editor<br/>service.legal.user<br/>data.test1<br/>data.integration.test | diff --git a/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/LegalTagUtils.java b/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/LegalTagUtils.java index 68b5e41dd74539b973d2d47380c24205dc029e24..c8152b1266e74f80bb21458f46fb6f4bd98871c6 100644 --- a/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/LegalTagUtils.java +++ b/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/LegalTagUtils.java @@ -16,7 +16,7 @@ import com.sun.jersey.api.client.ClientResponse; public class LegalTagUtils extends TestUtils { - public static final String INTEGRATION_TESTER_TOKEN = "TEST_USER_TOKEN"; + public static final String INTEGRATION_TESTER_TOKEN = "PRIVILEGED_USER_TOKEN"; protected static String token = null; private OpenIDTokenProvider tokenProvider; diff --git a/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/TestUtils.java b/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/TestUtils.java index 09ee3fe2222ca26d2a4131aeba27ffc1b59c2002..1448f6f6e86e6f5ef9a76be9cf404f17786b736e 100644 --- a/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/TestUtils.java +++ b/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/TestUtils.java @@ -38,18 +38,10 @@ public class TestUtils { baseUrl = baseUrl.replaceFirst("https", "http"); } - public TestUtils(String url){ - baseUrl = url; - } - public boolean isLocalHost(){ return baseUrl.contains("//localhost"); } - public static String getMyProjectAccountId(){ - return System.getProperty("MY_TENANT_PROJECT", System.getenv("MY_TENANT_PROJECT")); - } - public String getBaseHost() {return baseUrl.substring(8,baseUrl.length()-1);} public String getApiPath(String api) throws Exception { diff --git a/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/conf/OpenIDProviderConfig.java b/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/conf/OpenIDProviderConfig.java index 79d528e753bbeb8f14d18d41978894fe810270a9..bd0e44f14da6a9a0cac32f3774b318e81d05d8f8 100644 --- a/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/conf/OpenIDProviderConfig.java +++ b/legal-acceptance-test/src/test/java/org/opengroup/osdu/legal/util/conf/OpenIDProviderConfig.java @@ -25,6 +25,10 @@ import com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata; public class OpenIDProviderConfig { + public static final String TEST_OPENID_PROVIDER_CLIENT_ID = "PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_ID"; + public static final String TEST_OPENID_PROVIDER_CLIENT_SECRET = "PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_SECRET"; + public static final String TEST_OPENID_PROVIDER_URL = "TEST_OPENID_PROVIDER_URL"; + private String clientId; private String clientSecret; private String url; @@ -34,9 +38,13 @@ public class OpenIDProviderConfig { public static OpenIDProviderConfig Instance() { try { - openIDProviderConfig.clientId = System.getProperty("TEST_OPENID_PROVIDER_CLIENT_ID", System.getenv("TEST_OPENID_PROVIDER_CLIENT_ID")); - openIDProviderConfig.clientSecret = System.getProperty("TEST_OPENID_PROVIDER_CLIENT_SECRET", System.getenv("TEST_OPENID_PROVIDER_CLIENT_SECRET")); - openIDProviderConfig.url = System.getProperty("TEST_OPENID_PROVIDER_URL", System.getenv("TEST_OPENID_PROVIDER_URL")); + openIDProviderConfig.clientId = System.getProperty(TEST_OPENID_PROVIDER_CLIENT_ID, + System.getenv(TEST_OPENID_PROVIDER_CLIENT_ID)); + openIDProviderConfig.clientSecret = System.getProperty(TEST_OPENID_PROVIDER_CLIENT_SECRET, + System.getenv(TEST_OPENID_PROVIDER_CLIENT_SECRET)); + openIDProviderConfig.url = System.getProperty(TEST_OPENID_PROVIDER_URL, + System.getenv(TEST_OPENID_PROVIDER_URL)); + Issuer issuer = new Issuer(openIDProviderConfig.url); OIDCProviderConfigurationRequest request = new OIDCProviderConfigurationRequest(issuer); HTTPRequest httpRequest = request.toHTTPRequest();