HHH-14845 - Deprecate JACC support

This commit is contained in:
Steve Ebersole 2021-09-27 12:39:26 -05:00 committed by Sanne Grinovero
parent 694a0e4aed
commit 35b9513943
15 changed files with 69 additions and 4 deletions

View File

@ -2053,10 +2053,6 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings {
*/
String JTA_TRACK_BY_THREAD = "hibernate.jta.track_by_thread";
String JACC_CONTEXT_ID = "hibernate.jacc_context_id";
String JACC_PREFIX = "hibernate.jacc";
String JACC_ENABLED = "hibernate.jacc.enabled";
/**
* If enabled, allows schema update and validation to support synonyms. Due
* to the possibility that this would return duplicate tables (especially in
@ -2460,4 +2456,19 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings {
*/
String OMIT_JOIN_OF_SUPERCLASS_TABLES = "hibernate.query.omit_join_of_superclass_tables";
/**
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
String JACC_CONTEXT_ID = "hibernate.jacc_context_id";
/**
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
String JACC_PREFIX = "hibernate.jacc";
/**
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
String JACC_ENABLED = "hibernate.jacc.enabled";
}

View File

@ -258,4 +258,12 @@ public interface DeprecationLogger extends BasicLogger {
"This is deprecated and will be removed in a future version. Every property mapping combination should have its own java class"
)
void deprecatedComponentMapping(String name);
@LogMessage(level = WARN)
@Message(
id = 90000026,
value = "JACC integration was enabled. Support for JACC integration will be removed in version 6.0. Use of" +
"`%s`, `%s` or `%s` settings is discouraged"
)
void deprecatedJaccUsage(String jaccEnabled, String jaccContextId, String jaccPrefix);
}

View File

@ -16,7 +16,10 @@ import org.hibernate.secure.spi.PermissionCheckEntityInformation;
* Base class for JACC-securable event listeners
*
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public abstract class AbstractJaccSecurableEventListener implements JaccSecurityListener {
private JaccService jaccService;

View File

@ -15,7 +15,10 @@ import org.hibernate.secure.spi.PermissibleAction;
*
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class JaccPreDeleteEventListener extends AbstractJaccSecurableEventListener implements PreDeleteEventListener {
public JaccPreDeleteEventListener() {
}

View File

@ -15,7 +15,10 @@ import org.hibernate.secure.spi.PermissibleAction;
*
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class JaccPreInsertEventListener extends AbstractJaccSecurableEventListener implements PreInsertEventListener {
public JaccPreInsertEventListener() {
}

View File

@ -15,7 +15,10 @@ import org.hibernate.secure.spi.PermissibleAction;
*
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class JaccPreLoadEventListener extends AbstractJaccSecurableEventListener implements PreLoadEventListener {
public JaccPreLoadEventListener() {
}

View File

@ -15,7 +15,10 @@ import org.hibernate.secure.spi.PermissibleAction;
*
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class JaccPreUpdateEventListener extends AbstractJaccSecurableEventListener implements PreUpdateEventListener {
public JaccPreUpdateEventListener() {
}

View File

@ -11,6 +11,9 @@ package org.hibernate.secure.internal;
* {@link org.hibernate.secure.spi.JaccIntegrator} for details.
*
* @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public interface JaccSecurityListener {
}

View File

@ -34,7 +34,10 @@ import org.jboss.logging.Logger;
/**
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class StandardJaccServiceImpl implements JaccService, Configurable {
private static final Logger log = Logger.getLogger( StandardJaccServiceImpl.class );

View File

@ -10,7 +10,10 @@ package org.hibernate.secure.spi;
* Describes a Hibernate (persistence) permission.
*
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class GrantedPermission {
private final String role;
private final String entityName;

View File

@ -17,6 +17,7 @@ import org.hibernate.event.service.spi.DuplicationStrategy;
import org.hibernate.event.service.spi.EventListenerRegistry;
import org.hibernate.event.spi.EventType;
import org.hibernate.integrator.spi.ServiceContributingIntegrator;
import org.hibernate.internal.log.DeprecationLogger;
import org.hibernate.secure.internal.DisabledJaccServiceImpl;
import org.hibernate.secure.internal.JaccPreDeleteEventListener;
import org.hibernate.secure.internal.JaccPreInsertEventListener;
@ -32,7 +33,10 @@ import org.jboss.logging.Logger;
* Integrator for setting up JACC integration
*
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class JaccIntegrator implements ServiceContributingIntegrator {
private static final Logger log = Logger.getLogger( JaccIntegrator.class );
@ -81,6 +85,12 @@ public class JaccIntegrator implements ServiceContributingIntegrator {
return;
}
DeprecationLogger.DEPRECATION_LOGGER.deprecatedJaccUsage(
AvailableSettings.JACC_ENABLED,
AvailableSettings.JACC_CONTEXT_ID,
AvailableSettings.JACC_PREFIX
);
final String contextId = (String) properties.get( AvailableSettings.JACC_CONTEXT_ID );
if ( contextId == null ) {
throw new IntegrationException( "JACC context id must be specified" );

View File

@ -12,7 +12,10 @@ import java.util.List;
/**
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public class JaccPermissionDeclarations {
private final String contextId;
private List<GrantedPermission> permissionDeclarations;

View File

@ -12,7 +12,10 @@ import org.hibernate.service.Service;
* Service describing Hibernate integration with JACC for security service.
*
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public interface JaccService extends Service {
/**
* Obtain the JACC context-id in effect for this service. {@code null} indicates no

View File

@ -8,7 +8,10 @@ package org.hibernate.secure.spi;
/**
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public enum PermissibleAction {
INSERT( "insert" ),
UPDATE( "update" ),

View File

@ -10,7 +10,10 @@ import java.io.Serializable;
/**
* @author Steve Ebersole
*
* @deprecated Support for JACC will be removed in 6.0
*/
@Deprecated
public interface PermissionCheckEntityInformation {
public Object getEntity();
public String getEntityName();