Switching to new authz

This commit is contained in:
Luca Frosini 2022-01-31 15:40:30 +01:00
parent 3e1b48d645
commit bd05ffd7b3
2 changed files with 3 additions and 4 deletions

View File

@ -182,7 +182,7 @@ public class SocialPost extends Thread {
GXHTTPStringRequest gxhttpStringRequest = GXHTTPStringRequest.newRequest(basePath);
gxhttpStringRequest.from(Constants.CATALOGUE_NAME);
gxhttpStringRequest.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
gxhttpStringRequest.setSecurityToken(Constants.getCatalogueSecurityToken());
gxhttpStringRequest.setSecurityToken(Constants.getCatalogueSecret().getToken());
gxhttpStringRequest.path(SOCIAL_SERVICE_WRITE_APPLICATION_POST_PATH);
HttpURLConnection httpURLConnection = gxhttpStringRequest.post(objectMapper.writeValueAsString(objectNode));

View File

@ -8,8 +8,8 @@ import java.io.InputStream;
import java.util.Properties;
import org.gcube.common.authorization.utils.manager.SecretManager;
import org.gcube.common.authorization.utils.secret.GCubeSecret;
import org.gcube.common.authorization.utils.secret.Secret;
import org.gcube.common.authorization.utils.secret.SecretUtility;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@ -42,7 +42,6 @@ public class ContextTest {
ROOT = "/gcube";
VO = ROOT + "/devsec";
VRE = VO + "/devVRE";
}
public static void set(Secret secret) throws Exception {
@ -61,7 +60,7 @@ public class ContextTest {
}
private static Secret getSecret(String token) throws Exception {
GCubeSecret secret = new GCubeSecret(token);
Secret secret = SecretUtility.getSecretByTokenString(token);
return secret;
}