Commit 8b5625c5 authored by Komal Makkar's avatar Komal Makkar
Browse files

cleaning stray changes

parent 82aae306
Pipeline #7372 failed with stages
in 2 minutes and 15 seconds
/*
* Copyright 2017-2020, Schlumberger
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright © Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.notification.api;
......
// Copyright © Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.notification.api;
import org.junit.After;
......
// Copyright © Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.notification.util;
import com.google.common.base.Strings;
......@@ -13,51 +27,42 @@ public class AzureTestUtils extends TestUtils {
@Override
public synchronized String getOpsToken() throws Exception {
if (Strings.isNullOrEmpty(opsToken)) {
noAccessToken = getToken("c4167fb6-c724-40e8-be11-2e20d1b7a92c",//System.getProperty("NO_DATA_ACCESS_TESTER", System.getenv("NO_DATA_ACCESS_TESTER")),
"muwCHobjuKlVzQwdUgMcta4w7mfQzAiW");//System.getProperty("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET")));
/*opsToken = getToken(System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER")),
opsToken = getToken(System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER")),
System.getProperty("TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("TESTER_SERVICEPRINCIPAL_SECRET")));
*/}
}
return "Bearer " + opsToken;
}
@Override
public synchronized String getAdminToken() throws Exception {
if (Strings.isNullOrEmpty(adminToken)) {
noAccessToken = getToken("c4167fb6-c724-40e8-be11-2e20d1b7a92c",//System.getProperty("NO_DATA_ACCESS_TESTER", System.getenv("NO_DATA_ACCESS_TESTER")),
"muwCHobjuKlVzQwdUgMcta4w7mfQzAiW");//System.getProperty("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET")));
/*adminToken = getToken(System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER")),
adminToken = getToken(System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER")),
System.getProperty("TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("TESTER_SERVICEPRINCIPAL_SECRET")));
*/}
}
return "Bearer " + adminToken;
}
@Override
public synchronized String getEditorToken() throws Exception {
if (Strings.isNullOrEmpty(editorToken)) {
noAccessToken = getToken("c4167fb6-c724-40e8-be11-2e20d1b7a92c",//System.getProperty("NO_DATA_ACCESS_TESTER", System.getenv("NO_DATA_ACCESS_TESTER")),
"muwCHobjuKlVzQwdUgMcta4w7mfQzAiW");//System.getProperty("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET")));
/*editorToken = getToken(System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER")),
editorToken = getToken(System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER")),
System.getProperty("TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("TESTER_SERVICEPRINCIPAL_SECRET")));
*/}
}
return "Bearer " + editorToken;
}
@Override
public synchronized String getNoAccessToken() throws Exception {
if (Strings.isNullOrEmpty(noAccessToken)) {
noAccessToken = getToken("c4167fb6-c724-40e8-be11-2e20d1b7a92c",//System.getProperty("NO_DATA_ACCESS_TESTER", System.getenv("NO_DATA_ACCESS_TESTER")),
"muwCHobjuKlVzQwdUgMcta4w7mfQzAiW");//System.getProperty("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET")));
noAccessToken = getToken(System.getProperty("NO_DATA_ACCESS_TESTER", System.getenv("NO_DATA_ACCESS_TESTER")),
System.getProperty("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("NO_DATA_ACCESS_TESTER_SERVICEPRINCIPAL_SECRET")));
}
return "Bearer " + noAccessToken;
}
private String getToken(String sp_id, String sp_secret) throws Exception {
String tenant_id = "58975fd3-4977-44d0-bea8-37af0baac100";//System.getProperty("AZURE_AD_TENANT_ID", System.getenv("AZURE_AD_TENANT_ID"));
String app_resource_id = "dbf53e4d-f088-4379-87c3-d9b1496e77f8";//System.getProperty("AZURE_AD_APP_RESOURCE_ID", System.getenv("AZURE_AD_APP_RESOURCE_ID"));
String tenant_id = System.getProperty("AZURE_AD_TENANT_ID", System.getenv("AZURE_AD_TENANT_ID"));
String app_resource_id = System.getProperty("AZURE_AD_APP_RESOURCE_ID", System.getenv("AZURE_AD_APP_RESOURCE_ID"));
return new AzureServicePrincipal().getIdToken(sp_id, sp_secret, tenant_id, app_resource_id);
}
......
......@@ -37,13 +37,14 @@ public class Config {
config.IntegrationAudience = "245464679631-ktfdfpl147m1mjpbutl00b3cmffissgq.apps.googleusercontent.com";
config.OsduTenant = "opendes";
config.Topic = "records-changed";
config.hmacSecretValue = System.getProperty("HMAC_SECRET", System.getenv("HMAC_SECRET"));
if (env.equalsIgnoreCase("LOCAL")) {
//make sure to run register service on a different port. You can also choose to point to Register service that is running in cloud
String registerUrl = "http://localhost:8081/api/register/v1";
//must have notification and register services running on different ports
config.HostUrl = "http://localhost:8082/";
config.HostUrl = "http://localhost:8080/";
config.GSAPushUrl = registerUrl+"/test/gsa-challenge/";
config.HMACPushUrl = registerUrl+"/test/challenge/";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment