Skip to content

Commit

Permalink
removed unused code, fix restriction warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmasek committed Sep 27, 2023
1 parent 56046f9 commit 3baa634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package com.axonivy.connector.adobe.esign.connector.auth.oauth;

import java.io.IOException;
Expand All @@ -19,9 +20,7 @@
import ch.ivyteam.ivy.request.IRequest;
import ch.ivyteam.ivy.rest.client.FeatureConfig;
import ch.ivyteam.ivy.rest.client.RestClientFactoryConstants;
import ch.ivyteam.ivy.rest.client.internal.oauth2.RedirectToIdentityProvider;

@SuppressWarnings("restriction")
public class OAuth2BearerFilter implements javax.ws.rs.client.ClientRequestFilter {
private static final String AUTHORIZATION = "Authorization";
private static final String BEARER = "Bearer ";
Expand All @@ -35,6 +34,8 @@ public class OAuth2BearerFilter implements javax.ws.rs.client.ClientRequestFilte

public static final AdobeVariable REFRESH_TOKEN_VAR = AdobeVariable.OAUTH_TOKEN;
public static final AdobeVariable ACCESS_TOKEN_VAR = AdobeVariable.ACCESS_TOKEN;

private static final String OAUTH2_ERROR_CODE = "ivy:error:rest:client:oauth2";

private String property;
private Supplier<String> name = null;
Expand Down Expand Up @@ -154,6 +155,6 @@ protected String getAuthCode() {
}

private static BpmPublicErrorBuilder authError() {
return BpmError.create(RedirectToIdentityProvider.OAUTH2_ERROR_CODE);
return BpmError.create(OAUTH2_ERROR_CODE);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.axonivy.connector.adobe.esign.connector.rest;

import java.util.Optional;

import javax.annotation.security.PermitAll;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
Expand Down Expand Up @@ -33,7 +31,6 @@
public class WebHookService {

private static final String CLIENT_ID_HEADER = "X-ADOBESIGN-CLIENTID";
private static final String CLIENT_ID_VAR = "ivy.var.adobe-sign-connector.clientId";

@GET
@Produces("application/json")
Expand All @@ -55,11 +52,6 @@ public void notification(JsonNode node) {
Ivy.log().info(node);
}

@SuppressWarnings("unused")
private boolean verifyClientId(String clientId) {
return Optional.ofNullable(Ivy.var().get(CLIENT_ID_VAR)).map(s -> s.compareTo(clientId) == 0).orElse(false);
}

private record ClientIdResponse(String xAdobeSignClientId) {};

}

0 comments on commit 3baa634

Please sign in to comment.