|
|
@ -50,7 +50,8 @@ public class PublisherRESTAPIServices {
|
|
|
|
public JSONObject getScopes(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo)
|
|
|
|
public JSONObject getScopes(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo)
|
|
|
|
throws APIServicesException, BadRequestException {
|
|
|
|
throws APIServicesException, BadRequestException {
|
|
|
|
|
|
|
|
|
|
|
|
String getAllScopesUrl = "https://" + host + ":" + port + Constants.GET_ALL_SCOPES;
|
|
|
|
String getAllScopesUrl = Constants.HTTPS_PROTOCOL + Constants.SCHEME_SEPARATOR + host + Constants.COLON
|
|
|
|
|
|
|
|
+ port + Constants.GET_ALL_SCOPES;
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
.url(getAllScopesUrl)
|
|
|
|
.url(getAllScopesUrl)
|
|
|
|
.addHeader(Constants.AUTHORIZATION_HEADER_NAME, Constants.AUTHORIZATION_HEADER_PREFIX_BEARER
|
|
|
|
.addHeader(Constants.AUTHORIZATION_HEADER_NAME, Constants.AUTHORIZATION_HEADER_PREFIX_BEARER
|
|
|
@ -87,8 +88,10 @@ public class PublisherRESTAPIServices {
|
|
|
|
public boolean isSharedScopeNameExists(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String key)
|
|
|
|
public boolean isSharedScopeNameExists(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String key)
|
|
|
|
throws APIServicesException, BadRequestException {
|
|
|
|
throws APIServicesException, BadRequestException {
|
|
|
|
|
|
|
|
|
|
|
|
String keyValue = new String(Base64.encodeBase64((key).getBytes())).replace("=", "");
|
|
|
|
String keyValue = new String(Base64.encodeBase64((key).getBytes())).replace(Constants.QUERY_KEY_VALUE_SEPARATOR,
|
|
|
|
String getScopeUrl = "https://" + host + ":" + port + Constants.GET_SCOPE + keyValue;
|
|
|
|
Constants.EMPTY_STRING);
|
|
|
|
|
|
|
|
String getScopeUrl = Constants.HTTPS_PROTOCOL + Constants.SCHEME_SEPARATOR + host + Constants.COLON
|
|
|
|
|
|
|
|
+ port + Constants.GET_SCOPE + keyValue;
|
|
|
|
|
|
|
|
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
.url(getScopeUrl)
|
|
|
|
.url(getScopeUrl)
|
|
|
@ -124,7 +127,8 @@ public class PublisherRESTAPIServices {
|
|
|
|
public boolean updateSharedScope(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, Scope scope)
|
|
|
|
public boolean updateSharedScope(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, Scope scope)
|
|
|
|
throws APIServicesException, BadRequestException {
|
|
|
|
throws APIServicesException, BadRequestException {
|
|
|
|
|
|
|
|
|
|
|
|
String updateScopeUrl = "https://" + host + ":" + port + Constants.GET_SCOPE + scope.getId();
|
|
|
|
String updateScopeUrl = Constants.HTTPS_PROTOCOL + Constants.SCHEME_SEPARATOR + host
|
|
|
|
|
|
|
|
+ Constants.COLON + port + Constants.GET_SCOPE + scope.getId();
|
|
|
|
|
|
|
|
|
|
|
|
ScopeUtils scopeUtil = new ScopeUtils();
|
|
|
|
ScopeUtils scopeUtil = new ScopeUtils();
|
|
|
|
scopeUtil.setKey(scope.getKey());
|
|
|
|
scopeUtil.setKey(scope.getKey());
|
|
|
|