-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 16796 jwt pp auth 2 #19273
Issue 16796 jwt pp auth 2 #19273
Conversation
This reverts commit d06b4af.
|
||
private void checkColumnSize(final String tableName) throws SQLException { | ||
final Connection connection = DbConnectionFactory.getConnection(); | ||
final ResultSet resultSet = DotDatabaseMetaData.getColumnsMetaData(connection, tableName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Ensure that resources like this ResultSet object are closed after use
} | ||
|
||
private void dropConstraint(final String tableName, final String constraintName) throws DotDataException { | ||
DotConnect dc = new DotConnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid variables with short names like dc
import com.dotcms.publisher.pusher.AuthCredentialPushPublishUtil; | ||
|
||
import javax.servlet.http.HttpServletResponse; | ||
import javax.ws.rs.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'javax.ws.rs'
import java.sql.SQLException; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Set; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'java.util.Set'
import java.util.Set; | ||
|
||
import static com.dotcms.util.CollectionsUtils.list; | ||
import static com.dotcms.util.CollectionsUtils.map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'com.dotcms.util.CollectionsUtils.map'
* @throws DotDataException | ||
* @throws DotSecurityException | ||
*/ | ||
public void executeFix(final String endpointId) throws DotDataException, DotSecurityException; | ||
public void executeFix(final String key) throws DotDataException, DotSecurityException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return String.format("bundle_%d.tar.gz", System.currentTimeMillis()); | ||
} | ||
|
||
private boolean isAdmin(final User user) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused private methods such as 'isAdmin(User)'.
|
||
processing = false; | ||
|
||
InputStream zipFile = response.readEntity(InputStream.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Ensure that resources like this InputStream object are closed after use
* @throws JSONException | ||
* An error occurred when generating the JSON response. | ||
*/ | ||
private String getRemoteIP(@Context HttpServletRequest request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused private methods such as 'getRemoteIP(HttpServletRequest)'.
@@ -5,6 +5,7 @@ | |||
import com.dotcms.business.CloseDBIfOpened; | |||
import com.dotcms.business.WrapInTransaction; | |||
import com.dotcms.enterprise.cluster.ClusterFactory; | |||
import com.dotcms.publisher.pusher.PushPublisher; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'com.dotcms.publisher.pusher.PushPublisher'
//Setting the process status | ||
setStatus(session, endpoint.getId(), ProcessStatus.CANCELLED, null); | ||
Logger.debug(IntegrityResource.class, "Requested interruption of the integrity checking process by the user.", e); | ||
throw new RuntimeException("Requested interruption of the integrity checking process by the user.", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid throwing raw exception types.
} catch (Exception e) { | ||
|
||
//Special handling if the thread was interrupted | ||
if (e instanceof InterruptedException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dc.addParam("remote_identifier" + System.currentTimeMillis()); | ||
dc.addParam("html_page" + System.currentTimeMillis()); | ||
dc.addParam(remoteIP); | ||
dc.addParam(new Long("1")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid instantiating Long objects.Call Long.valueOf() instead
|
||
private String insertPublishingEndPoint() throws DotDataException { | ||
|
||
DotConnect dc = new DotConnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid variables with short names like dc
public enum AuthCredentialPushPublishUtil { | ||
INSTANCE; | ||
|
||
private final String BEARER = "Bearer "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: This final field could be made static
import com.liferay.portal.model.User; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'javax.servlet.http.HttpServletResponse'
/** | ||
* Provide util methods to get remote or local IP from {@link HttpServletRequest} | ||
*/ | ||
public class RestEndPointIPUtil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
task05390RemoveEndpointIdForeignKeyInIntegrityResolverTables.executeUpgrade(); | ||
|
||
insertFolderIntegrityResolver("anyIP"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: The String literal "anyIP" appears 5 times in this file; the first occurrence is on line 54
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.ws.rs.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'javax.ws.rs'
import com.dotcms.util.CollectionsUtils; | ||
import com.dotcms.util.HttpRequestDataUtil; | ||
import com.dotmarketing.util.Logger; | ||
import com.dotmarketing.util.UtilMethods; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'com.dotmarketing.util.UtilMethods'
@WrapInTransaction | ||
private Bundle publishBundle(final boolean forcePush, | ||
final HttpServletRequest request, | ||
final String remoteIP) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: A method/constructor should not explicitly throw java.lang.Exception
@QueryParam("FORCE_PUSH") final boolean forcePush, | ||
@Context final HttpServletRequest request, | ||
@Context final HttpServletResponse response | ||
) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: A method/constructor should not explicitly throw java.lang.Exception
import javax.ws.rs.Produces; | ||
import javax.ws.rs.WebApplicationException; | ||
import javax.ws.rs.client.Client; | ||
import javax.ws.rs.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'javax.ws.rs'
/** | ||
* Provide util method for {@link IntegrityResource} and {@link BundleResource} classes | ||
*/ | ||
public class PushPublishResourceUtil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.List; | ||
import java.util.Map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'java.util.Map'
… content (#20346) * #19723: Bringing hotfix (dotCMS/support@8331dd7) into core. * #19273: Implemented suggested code changes to make limit param immutable * Undo accidental merge of ext-properties.
Use JWT to authenticate in Push Publish and Integrity Checker