Skip to content
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

Container auth #30619

Open
wants to merge 4 commits into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions dev/cnf/dependabot/check_this_in_if_it_changes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2601,26 +2601,6 @@
<artifactId>checker-compat-qual</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2021 IBM Corporation and others.
* Copyright (c) 2012, 2025 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -21,6 +21,7 @@
import com.ibm.ws.recoverylog.spi.CustomLogProperties;
import com.ibm.ws.recoverylog.spi.InternalLogException;
import com.ibm.ws.recoverylog.spi.TraceConstants;
import com.ibm.wsspi.resource.ResourceConfig;
import com.ibm.wsspi.resource.ResourceFactory;

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -98,7 +99,13 @@ public DataSource getDataSource() throws InternalLogException {
}

try {
nonTranDataSource = (DataSource) dataSourceFactory.createResource(null);
// Retrieve the resourceConfig from the custom log properties. This may be null, in which case the "old"
// behaviour will pertain with application authentication. A non-null resourceConfig will have been
// configured if container authentication has been specified.
ResourceConfig resourceConfig = _customLogProperties.resourceConfig();
if (tc.isDebugEnabled())
Tr.debug(tc, "create resource with ResourceConfig ", resourceConfig);
nonTranDataSource = (DataSource) dataSourceFactory.createResource(resourceConfig);
} catch (Exception e) {
//e.printStackTrace();
if (tc.isEntryEnabled())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2024 IBM Corporation and others.
* Copyright (c) 2007, 2025 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -21,6 +21,7 @@
import com.ibm.tx.config.RuntimeMetaDataProvider;
import com.ibm.tx.jta.util.alarm.AlarmManagerImpl;
import com.ibm.tx.util.alarm.AlarmManager;
import com.ibm.wsspi.resource.ResourceConfig;
import com.ibm.wsspi.resource.ResourceFactory;

public class DefaultConfigurationProvider implements ConfigurationProvider {
Expand Down Expand Up @@ -235,6 +236,11 @@ public ResourceFactory getResourceFactory() {
return null;
}

@Override
public ResourceConfig getResourceConfig() {
return null;
}

protected boolean _propagateXAResourceTransactionTimeout = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
@Override
public Boolean run() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2024 IBM Corporation and others.
* Copyright (c) 2002, 2025 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -62,6 +62,7 @@
import com.ibm.ws.recoverylog.spi.SharedServerLeaseLog;
import com.ibm.ws.recoverylog.spi.TerminationFailedException;
import com.ibm.wsspi.classloading.ClassLoadingService;
import com.ibm.wsspi.resource.ResourceConfig;
import com.ibm.wsspi.resource.ResourceFactory;

public class TxRecoveryAgentImpl implements RecoveryAgent {
Expand Down Expand Up @@ -299,11 +300,12 @@ public void initiateRecovery(FailureScope fs) throws RecoveryFailedException {
Tr.exit(tc, "initiateRecovery", "ConfigurationProvider is null");
throw new RecoveryFailedException("ConfigurationProvider is null");
}
ResourceFactory nontranDSResourceFactory = cp.getResourceFactory();
if (tc.isDebugEnabled())
Tr.debug(tc, "Retrieved non tran DS Resource Factory, ", nontranDSResourceFactory);
final ResourceFactory nontranDSResourceFactory = cp.getResourceFactory();
((CustomLogProperties) transactionLogProps).setResourceFactory(nontranDSResourceFactory);
((CustomLogProperties) partnerLogProps).setResourceFactory(nontranDSResourceFactory);
final ResourceConfig resConfig = cp.getResourceConfig();
((CustomLogProperties) transactionLogProps).setResourceConfig(resConfig);
((CustomLogProperties) partnerLogProps).setResourceConfig(resConfig);
} else {
// Set up FileLogProperties
String recLogDirStem = tlc.expandedLogDirectory().trim();
Expand Down Expand Up @@ -1033,6 +1035,7 @@ public HeartbeatLog getHeartbeatLog(FailureScope fs) {
Tr.debug(tc, "Retrieved non tran DS Resource Factory {0}", nontranDSResourceFactory);

((CustomLogProperties) partnerLogProps).setResourceFactory(nontranDSResourceFactory);
((CustomLogProperties) partnerLogProps).setResourceConfig(cp.getResourceConfig());

//
// Get the Partner (XAResources) log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2024 IBM Corporation and others.
* Copyright (c) 2013, 2025 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -16,6 +16,7 @@
import java.util.logging.Level;

import com.ibm.tx.util.alarm.AlarmManager;
import com.ibm.wsspi.resource.ResourceConfig;
import com.ibm.wsspi.resource.ResourceFactory;

public interface ConfigurationProvider {
Expand Down Expand Up @@ -208,6 +209,13 @@ public interface ConfigurationProvider {
*/
public ResourceFactory getResourceFactory();

/**
* Allows the retrieval of the ResourceConfig specified for a Resource
*
* @return
*/
public ResourceConfig getResourceConfig();

/**
* Returns whether we will propagate the transaction timeout to XAResources
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ IBM-API-Service: com.ibm.wsspi.uow.UOWManager, \
com.ibm.tx.util, \
com.ibm.rls.jdbc, \
com.ibm.ws.tx.embeddable, \
com.ibm.ws.recoverylog
com.ibm.ws.recoverylog, \
com.ibm.ws.security.auth.data.common
-jars=com.ibm.websphere.appserver.spi.transaction; location:=dev/spi/ibm/
-files=dev/spi/ibm/javadoc/com.ibm.websphere.appserver.spi.transaction_1.1-javadoc.zip
kind=ga
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ IBM-API-Service: com.ibm.wsspi.uow.UOWManager, \
com.ibm.rls.jdbc, \
com.ibm.ws.tx.embeddable, \
com.ibm.ws.recoverylog, \
com.ibm.ws.security.auth.data.common, \
com.ibm.ws.cdi.interfaces
-jars=com.ibm.websphere.appserver.spi.transaction; location:=dev/spi/ibm/
-files=dev/spi/ibm/javadoc/com.ibm.websphere.appserver.spi.transaction_1.1-javadoc.zip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Subsystem-Name: Jakarta Transactions 2.0
com.ibm.rls.jdbc.jakarta, \
com.ibm.ws.tx.embeddable.jakarta, \
com.ibm.ws.recoverylog, \
com.ibm.ws.security.auth.data.common, \
com.ibm.ws.cdi.interfaces.jakarta
-jars=com.ibm.websphere.appserver.spi.transaction; location:=dev/spi/ibm/
-files=dev/spi/ibm/javadoc/com.ibm.websphere.appserver.spi.transaction_1.1-javadoc.zip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2010, 2021 IBM Corporation and others.
* Copyright (c) 2010, 2025 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-2.0/
*
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
Expand All @@ -16,6 +16,8 @@

import com.ibm.websphere.ras.Tr;
import com.ibm.websphere.ras.TraceComponent;
import com.ibm.websphere.ras.annotation.Trivial;
import com.ibm.wsspi.resource.ResourceConfig;
import com.ibm.wsspi.resource.ResourceFactory;

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -89,6 +91,11 @@ public class CustomLogProperties implements LogProperties {
*/
private ResourceFactory _resourceFactory;

/**
* The Resource Config associated with this log implementation
*/
private ResourceConfig _resourceConfig;

//------------------------------------------------------------------------------
// Method: CustomLogProperties.CustomLogProperties
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -242,11 +249,10 @@ public static void setDefaultLogType(int t) {
defaultLogType = t;
}

@Trivial
public void setResourceFactory(ResourceFactory fac) {
if (tc.isEntryEnabled())
Tr.entry(tc, "setResourceFactory", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "setResourceFactory", fac);
if (tc.isDebugEnabled())
Tr.debug(tc, "setResourceFactory", fac);
_resourceFactory = fac;
}

Expand All @@ -260,11 +266,31 @@ public void setResourceFactory(ResourceFactory fac) {
* @return ResourceFactory associated with this log
* implementation
*/
@Trivial
public ResourceFactory resourceFactory() {
if (tc.isEntryEnabled())
Tr.entry(tc, "resourceFactory", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "resourceFactory", _resourceFactory);
if (tc.isDebugEnabled())
Tr.debug(tc, "resourceFactory", _resourceFactory);
return _resourceFactory;
}

@Trivial
public void setResourceConfig(ResourceConfig conf) {
if (tc.isDebugEnabled())
Tr.debug(tc, "setResourceConfig", conf);
_resourceConfig = conf;
}

/**
* Returns the Resource Config associated with this log
* implementation
*
* @return ResourceConfig associated with this log
* implementation
*/
@Trivial
public ResourceConfig resourceConfig() {
if (tc.isDebugEnabled())
Tr.debug(tc, "resourceConfig", _resourceConfig);
return _resourceConfig;
}
}
11 changes: 11 additions & 0 deletions dev/com.ibm.ws.transaction.containerAuth_fat.db2/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="fat/src"/>
<classpathentry exported="true" kind="con" path="aQute.bnd.classpath.container"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
23 changes: 23 additions & 0 deletions dev/com.ibm.ws.transaction.containerAuth_fat.db2/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.ws.transaction.containerAuth_fat.db2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>bndtools.core.bndbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>bndtools.core.bndnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
compileErrorAction=build
eclipse.preferences.version=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Ant properties
#Automatically generated by the ant prepare.settings.files task
eclipse.preferences.version=1
encoding/<project>=UTF-8
Loading