Skip to content

Commit

Permalink
Merge pull request wildfly#13953 from RanabirChakraborty/WFLY-14324
Browse files Browse the repository at this point in the history
WFLY-14324 Replace 'Java Servlet, Java Authentication Service Provide…
  • Loading branch information
asoldano committed Feb 18, 2021
2 parents 25626a2 + 6e17a72 commit e70ad2c
Show file tree
Hide file tree
Showing 59 changed files with 134 additions and 126 deletions.
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/Developer_Guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ include::_developer-guide/EJB3_Reference_Guide.adoc[]

include::_developer-guide/JPA_Reference_Guide.adoc[]

include::_developer-guide/JTA_Reference.adoc[]
include::_developer-guide/Jakarta_Transactions_Reference.adoc[]

include::_developer-guide/JNDI_Reference.adoc[]

Expand Down
9 changes: 4 additions & 5 deletions docs/src/main/asciidoc/Getting_Started_Guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Profile |WildFly {wildflyVersion} Full Platform |WildFly {wildflyVersion} Web Pr

|JSR-367: Java API for JSON Binding 1.0 |X |X |X |X

|JSR-369: Java Servlet 4.0 |X |X |X |X
|Jakarta Servlet 4.0 |X |X |X |X

|Jakarta Server Faces 2.3 |X |X |X |X

Expand Down Expand Up @@ -74,7 +74,7 @@ Profile |WildFly {wildflyVersion} Full Platform |WildFly {wildflyVersion} Web Pr

|JSR-343: Java Message Service API 2.0 |X |-- |X |--

|JSR-907: Java Transaction API 1.2 |X |X |X |X
|Jakarta Transactions 1.3 |X |X |X |X

|Jakarta Mail 1.6 |X |-- |X |X

Expand All @@ -94,10 +94,9 @@ Profile |WildFly {wildflyVersion} Full Platform |WildFly {wildflyVersion} Web Pr

|JSR-222: Java Architecture for XML Binding (JAXB) 2.3 |X |X |X |X

|JSR-196: Java Authentication Service Provider Interface for Containers
1.1 |X |-- |X |--
|Jakarta Authentication 1.1 |X |-- |X |--

|JSR-115: Java Authorization Contract for Containers 1.5 |X |-- |X |--
|Jakarta Authorization 1.5 |X |-- |X |--

|Jakarta EE Application Deployment 1.2 |Optional |-- |-- |--

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/JavaEE_Tutorial.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ include::_javaee-guide/Jakarta_Server_Faces_Technology.adoc[]

include::_javaee-guide/Java_Persistence_API_(JPA).adoc[]

include::_javaee-guide/Java_Transaction_API_(JTA).adoc[]
include::_javaee-guide/Jakarta_Transactions.adoc[]

include::_javaee-guide/Managed_Beans.adoc[]

Expand All @@ -50,7 +50,7 @@ include::_javaee-guide/JavaEE_Connector_Architecture_(JCA).adoc[]

include::_javaee-guide/Jakarta_Mail.adoc[]

include::_javaee-guide/Java_Authorization_Contract_for_Containers_(JACC).adoc[]
include::_javaee-guide/Jakarta_Authorization.adoc[]

include::_javaee-guide/Java_Authentication_Service_Provider_Interface_for_Containers_(JASPIC).adoc[]

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/WildFly_Elytron_Security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ include::_elytron/Elytron_Subsystem.adoc[]
include::_elytron/Using_the_Elytron_Subsystem.adoc[]
include::_elytron/Using_WildFly_Elytron_with_WildFly.adoc[]
include::_elytron/Client_Authentication_with_Elytron_Client.adoc[]
include::_elytron/Elytron_and_Java_Authorization_Contract_for_Containers-JACC.adoc[]
include::_elytron/Elytron_and_Jakarta_Authorization.adoc[]
include::_elytron/Elytron_and_Java_Authentication_SPI_for_Containers-JASPI.adoc[]
include::_elytron/Elytron_and_Java_EE_Security.adoc[]
include::_elytron/Keycloak_Integration.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ more (in `domain.xml`) "profiles". A profile is a named set of subsystem
configurations. A subsystem is an added set of capabilities added to the
core server by an extension (see "Extensions" above). A subsystem
provides servlet handling capabilities; a subsystem provides an EJB
container; a subsystem provides JTA, etc. A profile is a named list of
container; a subsystem provides Jakarta Transactions, etc. A profile is a named list of
subsystems, along with the details of each subsystem's configuration. A
profile with a large number of subsystems results in a server with a
large set of capabilities. A profile with a small, focused set of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ The available statistics include the number of created / destroyed connections a
[[agroal-datasource-attributes]]
=== DataSource specific attributes

In addition to all the common attributes, a _datasource_ definition may disable the JTA integration.
In addition to all the common attributes, a _datasource_ definition may disable the Jakarta Transactions integration.

Deferred enlistment is not supported, meaning that if JTA is enabled a connection must always be obtained within the scope of a transaction. The connection will always be enlisted with that transaction (lazy enlistment is not supported).
Deferred enlistment is not supported, meaning that if Jakarta Transactions is enabled a connection must always be obtained within the scope of a transaction. The connection will always be enlisted with that transaction (lazy enlistment is not supported).

[TIP]
The _connectable_ attribute allows a non-XA datasource to take part in an XA transaction ('Last Resource Commit Optimization (LRCO)' / 'Commit Markable Resource')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ up in JNDI or injected.
`user` and `password` attributes. This is useful if the remote server to
which it is pointing is secured.
* Resources acquired from it will be automatically enlisted any on-going
JTA transaction. If you want to send a message from an EJB using CMT
Jakarta Transactions. If you want to send a message from an EJB using CMT
then this is likely the connection factory you want to use so the send
operation will be atomically committed along with the rest of the EJB's
transaction operations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ Authorization in the AS container is normally done with RBAC (role based
access control) but there are situations where a more fine grained
authorization policy is required. The authorization element allows
definition of different authorization modules to used, such that
authorization can be checked with JACC (Java Authorization Contract for
Containers) or XACML (eXtensible Access Control Markup Language). The
authorization can be checked with Jakarta Authorization
or XACML (eXtensible Access Control Markup Language). The
structure of the authorization element is:

[source,xml,options="nowrap"]
Expand Down Expand Up @@ -307,7 +307,7 @@ abbreviated names from the following list:

|Web |org.jboss.security.authorization.modules.WebAuthorizationModule

|JACC |org.jboss.security.authorization.modules.JACCAuthorizationModule
|Jakarta Authorization |org.jboss.security.authorization.modules.JACCAuthorizationModule

|XACML
|org.jboss.security.authorization.modules.XACMLAuthorizationModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Roles where PrincipalID=?, where Role is the role name and RoleGroup
column value should always be "Roles" with capital R.

|suspendResume |optional |A boolean flag that specifies that any
existing JTA transaction be suspended during DB operations. The default
existing Jakarta Transactions transaction be suspended during DB operations. The default
is true
|=======================================================================

Expand Down Expand Up @@ -135,7 +135,7 @@ column value should always be "Roles" with capital R. Default is select
Role, RoleGroup from Roles where PrincipalID=?

|suspendResume |optional |A boolean flag that specifies that any
existing JTA transaction be suspended during DB operations. The default
existing Jakarta Transactions transaction be suspended during DB operations. The default
is *true*
select Role, RoleGroup from Roles where PrincipalID=?
|=======================================================================
Original file line number Diff line number Diff line change
Expand Up @@ -990,3 +990,5 @@ public class ExampleSFSB {
== Tips for using the latest Hibernate ORM

http://docs.jboss.org/hibernate/stable/orm/topical/html_single/wildfly/Wildfly.html[Read about using Hibernate ORM feature packs on WildFly].

NOTE: References in this document to Java Transaction API(JTA) refer to Jakarta Transactions unless otherwise noted.
Original file line number Diff line number Diff line change
Expand Up @@ -494,4 +494,6 @@ or you can list all the configuration options of the subsystem in `jboss-cli`
```bash
/subsystem=transactions:read-resource-description(recursive=true)
```

NOTE: References in this document to CDI refer to Jakarta Contexts and Dependency Injection unless otherwise noted.
References in this document to Java Transaction API(JTA) refer to Jakarta Transactions unless otherwise noted.
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ to enable JACC you can execute a command as follows:
----
[standalone@localhost:9990 /] /subsystem=ejb3/application-security-domain=my-security-domain:write-attribute(name=enable-jacc,value=true)
----

NOTE: References in this document to Java Authorization Contract for Containers (JACC) refer to Jakarta Authorization unless otherwise noted.
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ The simplest approach is to add a mapping for `other`, then no further configura
----

The EE Security API is built on JASPI. Within JASPI we support two different modes of operation 'integrated', and 'non-integrated'. In integrated mode any identity being established during authentication is expected to exist in the associated security domain. With the EE Security APIs however it is quite likely an alternative store will be in use so configuration the mapping to use 'non-integrated' JASPI allows for identities to be dynamically created as required.


NOTE: References in this document to Java Authorization Contract for Containers (JACC) refer to the Jakarta Authorization unless otherwise noted
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ instance at runtime

The login quickstart builds on the knowledge of CDI and Jakarta Server Faces we have got
from numberguess. New stuff we will learn about is how to use JPA to
store data in a database, how to use JTA to control transactions, and
store data in a database, how to use Jakarta Transactions to control transactions, and
how to use EJB for declarative TX control.

[[run-the-app-1]]
Expand Down Expand Up @@ -403,7 +403,7 @@ auto-create tables - as you always have.
.. `import.sql` Again, the same old thing you are used to in Hibernate
- auto-import data when the app starts.
. `pom.xml` is the same again, but just adds in dependencies for JPA,
JTA and EJB
Jakarta Transactions and EJB

[[views-1]]
=== Views
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[Java_Authentication_Service_Provider_Interface_for_Containers_(JASPIC)]]
= Java Authentication Service Provider Interface for Containers (JASPIC)
[[Jakarta_Authentication]]
= Jakarta Authentication

JASPI is not available by default for deployments, and a specific
Security Domain must be created to use it. For a simplified developer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[[Java_Authorization_Contract_for_Containers_(JACC)]]
[[Java_Authorization_Contract_for_Containers_JACC]]
= Java Authorization Contract for Containers (JACC)

In order to register your own JACC Module, you'll need to create a
Expand Down Expand Up @@ -48,3 +48,5 @@ classes from:
----
[standalone@localhost:9990 /] /system-property=org.jboss.as.security.jacc-module:add(value=com.example.customjacc)
----

NOTE: References in this document to Java Authorization Contract for Containers (JACC) refer to the Jakarta Authorization unless otherwise noted
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[Java_Servlet_Technology]]
= Java Servlet Technology
[[Jakarta_Servlet_Technology]]
= Jakarta Servlet Technology

Coming Soon

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[Java_Transaction_API_(JTA)]]
= Java Transaction API (JTA)
[[Jakarta_Transactions]]
= Jakarta Transactions

Coming Soon

Expand Down
2 changes: 1 addition & 1 deletion ee/src/main/java/org/jboss/as/ee/logging/EeLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ public interface EeLogger extends BasicLogger {
OperationFailedException oneGlobalDirectory(String newGlobalDirectory, String existingGlobalDirectory);

@LogMessage(level = Level.WARN)
@Message(id = 124, value = "Error deleting JACC Policy")
@Message(id = 124, value = "Error deleting Jakarta Authorization Policy")
void errorDeletingJACCPolicy(@Cause Throwable t);

@Message(id = 125, value = "Unable to start the %s service")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public abstract class AbstractSecurityDeployer<T> {

public JaccService<T> deploy(DeploymentUnit deploymentUnit) {
// build the jacc context id.
// build the Jakarta Authorization context id.
String contextId = deploymentUnit.getName();
if (deploymentUnit.getParent() != null) {
contextId = deploymentUnit.getParent().getName() + "!" + contextId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.jboss.msc.service.ServiceTarget;

/**
* A {@code DeploymentUnitProcessor} for JACC policies.
* A {@code DeploymentUnitProcessor} for Jakarta Authorization policies.
*
* @author <a href="mailto:mmoyses@redhat.com">Marcus Moyses</a>
*/
Expand Down
2 changes: 1 addition & 1 deletion ee/src/main/java/org/jboss/as/ee/security/JaccService.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.wildfly.security.manager.WildFlySecurityManager;

/**
* A service for JACC policies
* A service for Jakarta Authorization policies
*
* @author <a href="mailto:mmoyses@redhat.com">Marcus Moyses</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<!-- event overriding -->
<property name="hibernate.ejb.event.pre-insert" value="org.hibernate.jpa.test.NoOpListener"/>
<!-- remove JACC and validator -->
<!-- remove Jakarta Authorization and validator -->

<!-- alternatively to <class> and <property> declarations, you can use a regular hibernate.cfg.xml file -->
<!-- property name="hibernate.ejb.cfgfile" value="/resource-path/to/hibernate.cfg.xml"/ -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<!-- event overriding -->
<property name="hibernate.ejb.event.pre-insert" value="org.hibernate.jpa.test.NoOpListener"/>
<!-- remove JACC and validator -->
<!-- remove Jakarta Authorization and validator -->

<!-- alternatively to <class> and <property> declarations, you can use a regular hibernate.cfg.xml file -->
<!-- property name="hibernate.ejb.cfgfile" value="/resource-path/to/hibernate.cfg.xml"/ -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void contribute(StandardServiceRegistryBuilder serviceRegistryBuilder) {

if (serviceRegistryBuilder.getSettings().get(TRANSACTION_PLATFORM) != null) {
// applications that already specify the transaction platform property which will override the WildFlyCustomJtaPlatform.
JPA_LOGGER.tracef("ServiceContributorImpl#contribute application configured the JTA Platform to be used instead of WildFlyCustomJtaPlatform (%s=%s)",
JPA_LOGGER.tracef("ServiceContributorImpl#contribute application configured the Jakarta Transactions Platform to be used instead of WildFlyCustomJtaPlatform (%s=%s)",
TRANSACTION_PLATFORM, serviceRegistryBuilder.getSettings().get(TRANSACTION_PLATFORM));
} else if (jtaPlatformInitiatorEnabled == null ||
(jtaPlatformInitiatorEnabled instanceof Boolean && ((Boolean) jtaPlatformInitiatorEnabled).booleanValue()) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.wildfly.common.Assert;

/**
* WildFlyCustomJtaPlatform can obtain the JTA TransactionSynchronizationRegistry to be used by
* WildFlyCustomJtaPlatform can obtain the Jakarta Transactions TransactionSynchronizationRegistry to be used by
* Hibernate ORM JPA + native applications.
* For JPA applications, we could of passed the TransactionSynchronizationRegistry into the
* constructor but Hibernate native apps wouldn't be able to do that, so this covers all app types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<!-- event overriding -->
<property name="hibernate.ejb.event.pre-insert" value="org.hibernate.jpa.test.NoOpListener"/>
<!-- remove JACC and validator -->
<!-- remove Jakarta Authorization and validator -->

<!-- alternatively to <class> and <property> declarations, you can use a regular hibernate.cfg.xml file -->
<!-- property name="hibernate.ejb.cfgfile" value="/resource-path/to/hibernate.cfg.xml"/ -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public abstract class AbstractEntityManager implements EntityManager {
protected abstract boolean isExtendedPersistenceContext();

/**
* @return true if a JTA transaction is active
* @return true if a Jakarta Transactions transaction active
* <p/>
* Precondition: getEntityManager() must be called previous to calling isInTx
*/
Expand Down Expand Up @@ -873,7 +873,7 @@ private StoredProcedureQuery detachStoredProcedureQueryNonTxInvocation(EntityMan
}


// JPA 7.9.1 if invoked without a JTA transaction and a transaction scoped persistence context is used,
// JPA 7.9.1 if invoked without a Jakarta Transactions transaction and a transaction scoped persistence context is used,
// will throw TransactionRequiredException for any calls to entity manager remove/merge/persist/refresh.
private void transactionIsRequired() {
if (!this.isExtendedPersistenceContext() && !this.isInTx()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
import javax.transaction.SystemException;

/**
* Listens for UserTransaction events and handles associating the extended persistence context with the JTA transaction.
* Listens for UserTransaction events and handles associating the extended persistence context with the Jakarta Transactions transaction.
*
* JPA 2.0 section 7.9.1 Container Responsibilities:
* "For stateful session beans with extended persistence contexts:
* When a business method of the stateful session bean is invoked, if the stateful session bean
* uses bean managed transaction demarcation and a UserTransaction is begun within the
* method, the container associates the persistence context with the JTA transaction and calls
* method, the container associates the persistence context with the Jakarta Transactions transaction and calls
* EntityManager.joinTransaction.
* "
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* StoredProcedureQueryNonTxInvocationDetacher
*
* for JPA 2.1 (Query Execution) section 3.10.7
* used by TransactionScopedEntityManager to clear persistence context after StoredProcedureQuery (non-JTA) calls.
* used by TransactionScopedEntityManager to clear persistence context after StoredProcedureQuery (non-Jakarta Transactions) calls.
*
* @author Scott Marlow
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ protected boolean skipQueryDetach() {


/**
* throw error if jta transaction already has an UNSYNCHRONIZED persistence context and a SYNCHRONIZED persistence context
* throw error if Jakarta Transactions transaction already has an UNSYNCHRONIZED persistence context and a SYNCHRONIZED persistence context
* is requested. We are only fussy in this test, if the target component persistence context is SYNCHRONIZED.
*
* WFLY-7075 introduces two extensions, allow a (transaction) joined UNSYNCHRONIZED persistence context to be treated as SYNCHRONIZED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

/**
* for JPA 2.0 section 3.8.6
* used by TransactionScopedEntityManager to detach entities loaded by a query in a non-jta invocation.
* used by TransactionScopedEntityManager to detach entities loaded by a query in a non-Jakarta Transactions invocation.
* This could be a proxy but wrapper classes give faster performance.
*
* @author Scott Marlow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* for error checking.
*
* If an SynchronizationType.SYNCHRONIZED transaction scoped persistence context is accessed
* while there is already an SynchronizationType.UNSYNCHRONIZED (with the same pu name + in active JTA TX),
* while there is already an SynchronizationType.UNSYNCHRONIZED (with the same pu name + in active Jakarta Transactions TX),
* an IllegalStateException needs to be thrown as per the JPA 2.1 spec (see 7.6.4.1 Requirements for Persistence Context Propagation).
*
* @author Scott Marlow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void setup(final Map<String, Object> properties) {

@Override
public void teardown(final Map<String, Object> properties) {
NonTxEmCloser.popCall(); // close any transactional entity managers that were created without a jta transaction.
NonTxEmCloser.popCall(); // close any transactional entity managers that were created without a Jakarta Transactions transaction.
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public interface JpaLogger extends BasicLogger {
* @return an {@link IllegalStateException} for the error.
*/
@Message(id = 64, value =
"JTA transaction already has a 'SynchronizationType.UNSYNCHRONIZED' persistence context (EntityManager) joined to it " +
"Jakarta Transactions transaction already has a 'SynchronizationType.UNSYNCHRONIZED' persistence context (EntityManager) joined to it " +
"but a component with a 'SynchronizationType.SYNCHRONIZED' is now being used. " +
"Change the calling component code to join the persistence context (EntityManager) to the transaction or "+
"change the called component code to also use 'SynchronizationType.UNSYNCHRONIZED'. "+
Expand Down
Loading

0 comments on commit e70ad2c

Please sign in to comment.