Author: darran.lofthouse(a)jboss.com
Date: 2009-01-12 12:15:52 -0500 (Mon, 12 Jan 2009)
New Revision: 9013
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
Removed:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
Modified:
stack/native/trunk/modules/core/pom.xml
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java
Log:
[JBWS-1999] WS-Security, authentication and authorization for POJO endpoints.
Modified: stack/native/trunk/modules/core/pom.xml
===================================================================
--- stack/native/trunk/modules/core/pom.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/pom.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -82,6 +82,12 @@
<version>${jboss.jbosssx.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ <scope>provided</scope>
+ <version>${jboss.jbosssx.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
<scope>provided</scope>
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -171,7 +171,7 @@
protected boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type), false);
executorMap.put(type, executor);
MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -595,7 +595,7 @@
private boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)bindingProvider.getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData,
binding.getHandlerChain(type), false);
executorMap.put(type, executor);
MessageContext msgContext =
(MessageContext)MessageContextAssociation.peekMessageContext();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -61,10 +61,14 @@
protected int falseIndex = -1;
// True if the current direction is outbound
protected Boolean isOutbound;
+ // True if this is for the server/endpoint side, used to determine client side
specific
+ // conformance requirements.
+ private boolean serverSide;
- public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler>
unsortedChain)
+ public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler>
unsortedChain, boolean serverSide)
{
this.epMetaData = epMetaData;
+ this.serverSide = serverSide;
// Sort handler logical handlers first
List<Handler> sortedChain = new ArrayList<Handler>();
@@ -264,9 +268,17 @@
// the client MUST be passed on to the application. If the exception in question is a
subclass of WebService-
// Exception then an implementation MUST rethrow it as-is, without any additional
wrapping, otherwise it
// MUST throw a WebServiceException whose cause is set to the exception that was
thrown during handler processing.
- private void processHandlerFailure(Exception ex)
+ private void processHandlerFailure(RuntimeException ex)
{
log.error("Exception during handler processing", ex);
+
+ // If this call is server side then the conformance requirement specific to
+ // clients can be avoided.
+ if (serverSide == true)
+ {
+ throw ex;
+ }
+
if (ex instanceof WebServiceException)
{
throw (WebServiceException)ex;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -161,8 +161,8 @@
{
if (type == HandlerType.ALL)
throw new IllegalArgumentException("Invalid handler type: " + type);
-
- HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData,
getHandlerChain(sepMetaData, type));
+
+ HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData,
getHandlerChain(sepMetaData, type), true);
if (type == HandlerType.PRE)
preExecutor.set(executor);
else if (type == HandlerType.ENDPOINT)
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -35,6 +35,7 @@
import org.jboss.ws.extensions.security.element.UsernameToken;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.ws.extensions.security.nonce.NonceFactory;
+import org.jboss.ws.extensions.security.operation.AuthorizeOperation;
import org.jboss.ws.extensions.security.operation.DecryptionOperation;
import org.jboss.ws.extensions.security.operation.ReceiveUsernameOperation;
import org.jboss.ws.extensions.security.operation.ReceiveX509Certificate;
@@ -44,6 +45,7 @@
import org.jboss.ws.extensions.security.operation.SignatureVerificationOperation;
import org.jboss.ws.extensions.security.operation.TimestampVerificationOperation;
import org.jboss.ws.metadata.wsse.Authenticate;
+import org.jboss.ws.metadata.wsse.Authorize;
import org.jboss.ws.metadata.wsse.TimestampVerification;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -67,7 +69,7 @@
private TimestampVerification timestampVerification;
- private Authenticate authenticate;
+ private Authenticate authenticate;
private HashSet<String> signedIds = new HashSet<String>();
@@ -155,9 +157,8 @@
if (ids != null)
encryptedIds.addAll(ids);
}
- }
+ }
-
}
public void verify(List<RequireOperation> requireOperations) throws
WSSecurityException
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -39,6 +39,7 @@
import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.ws.extensions.security.nonce.DefaultNonceFactory;
import org.jboss.ws.extensions.security.nonce.NonceFactory;
+import org.jboss.ws.extensions.security.operation.AuthorizeOperation;
import org.jboss.ws.extensions.security.operation.EncodingOperation;
import org.jboss.ws.extensions.security.operation.EncryptionOperation;
import org.jboss.ws.extensions.security.operation.RequireEncryptionOperation;
@@ -50,6 +51,8 @@
import org.jboss.ws.extensions.security.operation.TimestampOperation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.wsse.Authenticate;
+import org.jboss.ws.metadata.wsse.Authorize;
import org.jboss.ws.metadata.wsse.Config;
import org.jboss.ws.metadata.wsse.Encrypt;
import org.jboss.ws.metadata.wsse.Operation;
@@ -79,7 +82,7 @@
Config config = getActualConfig(configuration, operationConfig);
SOAPHeader soapHeader = message.getSOAPHeader();
QName secQName = new QName(Constants.WSSE_NS, "Security");
- Element secHeaderElement = (soapHeader != null) ? Util.findElement(soapHeader,
secQName) : null;
+ Element secHeaderElement = (soapHeader != null) ? Util.findElement(soapHeader,
secQName) : null;
if (secHeaderElement == null)
{
@@ -89,45 +92,76 @@
if (hasRequirements(config))
throw convertToFault(new InvalidSecurityHeaderException("This service
requires <wsse:Security>, which is missing."));
-
- return;
}
try
{
- SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(),
configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
- configuration.getKeyPasswords(), configuration.getTrustStoreURL(),
configuration.getTrustStoreType(), configuration.getTrustStorePassword());
- NonceFactory factory = Util.loadFactory(NonceFactory.class,
configuration.getNonceFactory(), DefaultNonceFactory.class);
- SecurityDecoder decoder = new SecurityDecoder(securityStore, factory,
configuration.getTimestampVerification(), config == null ? null :
config.getAuthenticate());
+ if (secHeaderElement != null)
+ {
+ decodeHeader(configuration, config, message, secHeaderElement);
+ }
- decoder.decode(message.getSOAPPart(), secHeaderElement);
-
- if (log.isTraceEnabled())
- log.trace("Decoded Message:\n" +
DOMWriter.printNode(message.getSOAPPart(), true));
-
- List<RequireOperation> operations = buildRequireOperations(config);
-
- decoder.verify(operations);
- if(log.isDebugEnabled()) log.debug("Verification is successful");
-
- decoder.complete();
+ authorize(config);
}
catch (WSSecurityException e)
{
if (e.isInternalError())
log.error("Internal error occured handling inbound message:", e);
- else if(log.isDebugEnabled()) log.debug("Returning error to sender: "
+ e.getMessage());
+ else if (log.isDebugEnabled())
+ log.debug("Returning error to sender: " + e.getMessage());
throw convertToFault(e);
}
-
+
}
+ private void decodeHeader(WSSecurityConfiguration configuration, Config config,
SOAPMessage message, Element secHeaderElement) throws WSSecurityException
+ {
+ SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(),
configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
+ configuration.getKeyPasswords(), configuration.getTrustStoreURL(),
configuration.getTrustStoreType(), configuration.getTrustStorePassword());
+ NonceFactory factory = Util.loadFactory(NonceFactory.class,
configuration.getNonceFactory(), DefaultNonceFactory.class);
+
+ Authenticate authenticate = null;
+
+ if (config != null)
+ {
+ authenticate = config.getAuthenticate();
+ }
+
+ SecurityDecoder decoder = new SecurityDecoder(securityStore, factory,
configuration.getTimestampVerification(), authenticate);
+
+ decoder.decode(message.getSOAPPart(), secHeaderElement);
+
+ if (log.isTraceEnabled())
+ log.trace("Decoded Message:\n" +
DOMWriter.printNode(message.getSOAPPart(), true));
+
+ List<RequireOperation> operations = buildRequireOperations(config);
+
+ decoder.verify(operations);
+ if (log.isDebugEnabled())
+ log.debug("Verification is successful");
+
+ decoder.complete();
+ }
+
+ private void authorize(Config config) throws WSSecurityException
+ {
+ if (config != null)
+ {
+ Authorize authorize = config.getAuthorize();
+ if (authorize != null)
+ {
+ AuthorizeOperation authorizeOp = new AuthorizeOperation(authorize);
+ authorizeOp.process();
+ }
+ }
+ }
+
public void encodeMessage(WSSecurityConfiguration configuration, SOAPMessage message,
Config operationConfig, String user, String password) throws SOAPException
{
Config config = getActualConfig(configuration, operationConfig);
log.debug("WS-Security config: " + config);
-
+
// Nothing to process
if (config == null)
return;
@@ -172,12 +206,13 @@
if (operations.size() == 0)
return;
- if(log.isDebugEnabled()) log.debug("Encoding Message:\n" +
DOMWriter.printNode(message.getSOAPPart(), true));
+ if (log.isDebugEnabled())
+ log.debug("Encoding Message:\n" +
DOMWriter.printNode(message.getSOAPPart(), true));
try
{
SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(),
configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
- configuration.getKeyPasswords() , configuration.getTrustStoreURL(),
configuration.getTrustStoreType(), configuration.getTrustStorePassword());
+ configuration.getKeyPasswords(), configuration.getTrustStoreURL(),
configuration.getTrustStoreType(), configuration.getTrustStorePassword());
SecurityEncoder encoder = new SecurityEncoder(operations, securityStore);
encoder.encode(message.getSOAPPart());
}
@@ -185,7 +220,8 @@
{
if (e.isInternalError())
log.error("Internal error occured handling outbound message:", e);
- else if(log.isDebugEnabled()) log.debug("Returning error to sender: "
+ e.getMessage());
+ else if (log.isDebugEnabled())
+ log.debug("Returning error to sender: " + e.getMessage());
throw convertToFault(e);
}
@@ -199,7 +235,7 @@
securityAdaptor.setPrincipal(null);
securityAdaptor.setCredential(null);
}
-
+
private List<Target>
convertTargets(List<org.jboss.ws.metadata.wsse.Target> targets)
{
if (targets == null)
@@ -232,7 +268,7 @@
{
if (operationConfig == null)
return null;
-
+
Requires requires = operationConfig.getRequires();
if (requires == null)
return null;
@@ -270,7 +306,7 @@
{
EndpointMetaData epMetaData = ctx.getEndpointMetaData();
QName port = epMetaData.getPortName();
-
+
OperationMetaData opMetaData = ctx.getOperationMetaData();
if (opMetaData == null)
{
@@ -293,7 +329,7 @@
//null operationConfig means default behavior
return operationConfig != null ? operationConfig :
configuration.getDefaultConfig();
}
-
+
private Config selectOperationConfig(WSSecurityConfiguration configuration, QName
portName, QName opName)
{
Port port = configuration.getPorts().get(portName != null ? portName.getLocalPart()
: null);
@@ -311,8 +347,7 @@
}
return operation.getConfig();
}
-
-
+
private boolean hasRequirements(Config config)
{
return config != null && config.getRequires() != null;
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,186 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.security.AccessController;
+import java.security.Principal;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.security.auth.Subject;
+
+import org.jboss.logging.Logger;
+import org.jboss.security.AuthenticationManager;
+import org.jboss.security.RealmMapping;
+import org.jboss.security.SecurityContext;
+import org.jboss.security.SecurityContextAssociation;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.metadata.wsse.Authorize;
+import org.jboss.ws.metadata.wsse.Role;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+
+/**
+ * Operation to authenticate and check the authorisation of the
+ * current user.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran
Lofthouse</a>
+ * @since December 23rd 2008
+ */
+public class AuthorizeOperation
+{
+
+ private static final Logger log = Logger.getLogger(AuthorizeOperation.class);
+
+ private Authorize authorize;
+
+ private AuthenticationManager am;
+
+ private RealmMapping rm;
+
+ private SecurityAdaptorFactory secAdapterfactory;
+
+ public AuthorizeOperation(Authorize authorize)
+ {
+ this.authorize = authorize;
+
+ try
+ {
+ Context ctx = new InitialContext();
+ Object obj = ctx.lookup("java:comp/env/security/securityMgr");
+ am = (AuthenticationManager)obj;
+ rm = (RealmMapping)am;
+ }
+ catch (NamingException ne)
+ {
+ throw new WSException("Unable to lookup AuthenticationManager", ne);
+ }
+
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
+ }
+
+ public void process() throws WSSecurityException
+ {
+ boolean TRACE = log.isTraceEnabled();
+
+ if (TRACE)
+ log.trace("About to check authorization, using security domain '"
+ am.getSecurityDomain() + "'");
+
+ // Step 1 - Authenticate using currently associated principals.
+ SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
+ Principal principal = securityAdaptor.getPrincipal();
+ Object credential = securityAdaptor.getCredential();
+
+ Subject subject = new Subject();
+
+ if (am.isValid(principal, credential, subject) == false)
+ {
+ String msg = "Authentication failed, principal=" + principal;
+ log.error(msg);
+ SecurityException e = new SecurityException(msg);
+ throw new FailedAuthenticationException(e);
+ }
+ pushSubjectContext(principal, credential, subject);
+ if (TRACE)
+ log.trace("Authenticated, principal=" + principal);
+
+ // Step 2 - If unchecked all ok so return.
+ if (authorize.isUnchecked())
+ {
+ if (TRACE)
+ log.trace("authorize.isUnchecked()==true skipping roles check.");
+
+ return;
+ }
+
+ // Step 3 - If roles specified check user in role.
+ Set<Principal> expectedRoles = expectedRoles();
+ if (TRACE)
+ log.trace("expectedRoles=" + expectedRoles);
+
+ if (rm.doesUserHaveRole(principal, expectedRoles) == false)
+ {
+ Set<Principal> userRoles = rm.getUserRoles(principal);
+ String msg = "Insufficient method permissions, principal=" + principal
+ ", requiredRoles=" + expectedRoles + ", principalRoles=" +
userRoles;
+ log.error(msg);
+ SecurityException e = new SecurityException(msg);
+ throw new FailedAuthenticationException(e);
+ }
+
+ if (TRACE)
+ log.trace("Roles check complete, principal=" + principal + ",
requiredRoles=" + expectedRoles);
+ }
+
+ private Set<Principal> expectedRoles()
+ {
+ List<Role> roles = authorize.getRoles();
+ int rolesCount = (roles != null) ? roles.size() : 0;
+ Set<Principal> expectedRoles = new HashSet<Principal>(rolesCount);
+
+ if (roles != null)
+ {
+ for (Role current : roles)
+ {
+ expectedRoles.add(new SimplePrincipal(current.getName()));
+ }
+ }
+
+ return expectedRoles;
+ }
+
+ private static SecurityContext getSecurityContext()
+ {
+ return (SecurityContext)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run()
+ {
+ return SecurityContextAssociation.getSecurityContext();
+ }
+ });
+ }
+
+ private static void pushSubjectContext(final Principal p, final Object cred, final
Subject s)
+ {
+ AccessController.doPrivileged(new PrivilegedAction() {
+
+ public Object run()
+ {
+ SecurityContext sc = getSecurityContext();
+ if (sc == null)
+ throw new IllegalStateException("Security Context is null");
+ sc.getUtil().createSubjectInfo(p, cred, s);
+ return null;
+ }
+ });
+ }
+
+}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -65,8 +65,6 @@
{
UsernameToken user = (UsernameToken)token;
SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
- Logger.getLogger(this.getClass()).info("Username: " +
user.getUsername());
- Logger.getLogger(this.getClass()).info("Password: " +
user.getPassword());
if (user.isDigest())
{
verifyUsernameToken(user);
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsse;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * <code>Authorize</code> specifies that the users credentials should be
+ * checked to ensure the user is authorized to call the endpoint.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran
Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class Authorize implements Serializable
+{
+
+ private Unchecked unchecked;
+
+ private List<Role> roles = new ArrayList<Role>();
+
+ public List<Role> getRoles()
+ {
+ return Collections.unmodifiableList(roles);
+ }
+
+ public void addRole(final Role role)
+ {
+ if (isUnchecked())
+ {
+ throw new IllegalStateException("Can not add role after setting
'Unchecked'");
+ }
+ roles.add(role);
+ }
+
+ public boolean isUnchecked()
+ {
+ return unchecked != null;
+ }
+
+ void setUnchecked(Unchecked unchecked)
+ {
+ if (roles.isEmpty() == false)
+ {
+ throw new IllegalStateException("Can not set 'Unchecked' with
role(s) defined.");
+ }
+ this.unchecked = unchecked;
+ }
+
+}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -38,6 +38,7 @@
private Encrypt encrypt;
private Requires requires;
private Authenticate authenticate;
+ private Authorize authorize;
public Encrypt getEncrypt()
{
@@ -98,4 +99,14 @@
{
this.authenticate = authenticate;
}
+
+ public Authorize getAuthorize()
+ {
+ return this.authorize;
+ }
+
+ public void setAuthorize(Authorize authorize)
+ {
+ this.authorize = authorize;
+ }
}
Copied: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java)
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Role</code> representation of a role authorized to call an
endpoint.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran
Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class Role implements Serializable
+{
+
+ private String name;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.name;
+ }
+
+}
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Unchecked</code> used when all authenticated users are authorized.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran
Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class Unchecked implements Serializable
+{
+
+}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -307,6 +307,10 @@
{
return new Authenticate();
}
+ else if ("authorize".equals(localName))
+ {
+ return new Authorize();
+ }
return null;
}
@@ -363,7 +367,7 @@
{
log.trace("addChild: [obj=" + config + ",child=" + authenticate
+ "]");
config.setAuthenticate(authenticate);
- }
+ }
/**
* Called when parsing character is complete.
@@ -372,7 +376,7 @@
{
log.trace("addChild: [obj=" + authenticate + ",child=" +
usernameAuth + "]");
authenticate.setUsernameAuth(usernameAuth);
- }
+ }
/**
* Called when parsing character is complete.
@@ -382,7 +386,34 @@
log.trace("addChild: [obj=" + authenticate + ",child=" +
signatureCertAuth + "]");
authenticate.setSignatureCertAuth(signatureCertAuth);
}
-
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Authorize authorize, UnmarshallingContext
navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + authorize +
"]");
+ config.setAuthorize(authorize);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Authorize authorize, Unchecked unchecked, UnmarshallingContext
navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + authorize + ",child=" + unchecked
+ "]");
+ authorize.setUnchecked(unchecked);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Authorize authorize, Role role, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + authorize + ",child=" + role +
"]");
+ authorize.addRole(role);
+ }
+
private Object handleTargets(Object object, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
{
log.trace("newChild: " + localName);
@@ -452,7 +483,25 @@
return null;
}
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Authorize authorize, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("unchecked".equals(localName))
+ {
+ return new Unchecked();
+ }
+ else if ("role".equals(localName))
+ {
+ return new Role();
+ }
+ return null;
+ }
+
/**
* Called when parsing of a new element started.
*/
@@ -475,7 +524,14 @@
target.setValue(value);
}
+
+ public void setValue(Role role, UnmarshallingContext navigator, String namespaceURI,
String localName, String value)
+ {
+ log.trace("setValue: [obj=" + role + ",value=" + value +
"]");
+ role.setName(value);
+ }
+
/**
* Called when parsing character is complete.
*/
Modified:
stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd
===================================================================
---
stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd 2009-01-12
17:15:52 UTC (rev 9013)
@@ -136,6 +136,16 @@
<xs:documentation>Specifies the token to be used for JAAS authentication.
If this is not specified, the username token will be used if
available.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="authorize" type="authorizeType"
minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ Specifies that authentication is required and either provides a list of roles
authorized to access the endpoint or unchecked if any
+ authenticated user can access the endpoint.
+
+ This should only be used for POJO endpoints, EJB3 endpoints should configure
security as for any other EJB3 session bean.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="requireTimestampType">
@@ -351,4 +361,19 @@
</xs:annotation>
</xs:attribute>
</xs:complexType>
+ <xs:complexType name="authorizeType">
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="role" type="xs:string"
minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Specifies a role that is allowed to call the
endpoint.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="unchecked" type="uncheckedType"
minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Specifies that any authenticated user can call the
endpoint.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ <xs:complexType name="uncheckedType"/>
</xs:schema>
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -255,6 +255,17 @@
<include name="jboss.xml"/>
</metainf>
</jar>
+
+ <!-- jaxws-jbws1999 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws1999.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws1999/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1999/*.class"/>
+ <exclude
name="org/jboss/test/ws/jaxws/jbws1999/*TestCase.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws1999/WEB-INF">
+ <include name="*"/>
+ </webinf>
+ </war>
<!-- jaxws-jbws2011-->
<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2011.jar">
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -28,7 +28,7 @@
* Simple TestEndpoint to test the handling to WSSE timestamps.
*
* @author <a href="mailto:darran.lofthouse@jboss.com">Darran
Lofthouse</a>
- * @since Aril 14 2008
+ * @since April 14 2008
*/
public interface TestEndpoint extends Remote
{
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999)
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import javax.jws.WebService;
-
-/**
- * Test Endpoint to test UsernameToken authorization / authentication
- * for POJO endpoints.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 12th January 2008
- * @see
https://jira.jboss.org/jira/browse/JBWS-1999
- */
-@WebService(name = "Endpoint", targetNamespace =
"http://ws.jboss.org/jbws1999")
-public interface Endpoint
-{
-
- public String echoUnchecked(final String message);
-
- public String echoFriendRequired(final String message);
-
- public String echoEnemyRequired(final String message);
-
- public String echoNoSecurity(final String message);
-
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see
https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+@WebService(name = "Endpoint", targetNamespace =
"http://ws.jboss.org/jbws1999")
+public interface Endpoint
+{
+
+ public String echoUnchecked(final String message);
+
+ public String echoFriendRequired(final String message);
+
+ public String echoEnemyRequired(final String message);
+
+ public String echoNoSecurity(final String message);
+
+}
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import javax.jws.WebService;
-
-import org.jboss.ws.annotation.EndpointConfig;
-
-/**
- * Test Endpoint to test UsernameToken authorization / authentication
- * for POJO endpoints.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 12th January 2008
- * @see
https://jira.jboss.org/jira/browse/JBWS-1999
- */
-@WebService(name = "Endpoint", serviceName = "EndpointService",
targetNamespace = "http://ws.jboss.org/jbws1999", endpointInterface =
"org.jboss.test.ws.jaxws.jbws1999.Endpoint")
-@EndpointConfig(configName = "Standard WSSecurity Endpoint")
-public class EndpointImpl implements Endpoint
-{
-
- public String echoEnemyRequired(final String message)
- {
- return message;
- }
-
- public String echoFriendRequired(final String message)
- {
- return message;
- }
-
- public String echoNoSecurity(final String message)
- {
- return message;
- }
-
- public String echoUnchecked(final String message)
- {
- return message;
- }
-
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.annotation.EndpointConfig;
+
+/**
+ * Test Endpoint to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see
https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+@WebService(name = "Endpoint", serviceName = "EndpointService",
targetNamespace = "http://ws.jboss.org/jbws1999", endpointInterface =
"org.jboss.test.ws.jaxws.jbws1999.Endpoint")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+public class EndpointImpl implements Endpoint
+{
+
+ public String echoEnemyRequired(final String message)
+ {
+ return message;
+ }
+
+ public String echoFriendRequired(final String message)
+ {
+ return message;
+ }
+
+ public String echoNoSecurity(final String message)
+ {
+ return message;
+ }
+
+ public String echoUnchecked(final String message)
+ {
+ return message;
+ }
+
+}
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,211 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.wsse.Authorize;
-import org.jboss.ws.metadata.wsse.Config;
-import org.jboss.ws.metadata.wsse.Port;
-import org.jboss.ws.metadata.wsse.Role;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * Test case to test reading the 'authorize' configuration.
- *
- * @author <a href="mailto:darran.lofthouse@jboss.com">Darran
Lofthouse</a>
- * @since December 18th 2008
- */
-public class JBWS1999ConfigurationTestCase extends JBossWSTest
-{
-
- private WSSecurityConfiguration load(final String fileName) throws IOException
- {
- File configFile = getResourceFile("jaxws/jbws1999/config/" + fileName);
- WSSecurityOMFactory factory = WSSecurityOMFactory.newInstance();
-
- return factory.parse(configFile.toURL());
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * which contains two roles.
- */
- public void testDefaultRoles() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-default-roles.xml");
-
- Config config = wsConfig.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 2 roles", 2, roles.size());
-
- List<String> roleNames = new ArrayList<String>(roles.size());
- for (Role current : roles)
- {
- roleNames.add(current.getName());
- }
- assertTrue("Expected 'Trader' role.",
roleNames.contains("Trader"));
- assertTrue("Expected 'Banker' role.",
roleNames.contains("Banker"));
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * which contains two roles.
- */
- public void testPortRoles() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-port-roles.xml");
-
- Port port = wsConfig.getPorts().get("TestPort");
- Config config = port.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 2 roles", 2, roles.size());
-
- List<String> roleNames = new ArrayList<String>(roles.size());
- for (Role current : roles)
- {
- roleNames.add(current.getName());
- }
- assertTrue("Expected 'Trader' role.",
roleNames.contains("Trader"));
- assertTrue("Expected 'Banker' role.",
roleNames.contains("Banker"));
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * which contains one role.
- */
- public void testDefaultRole() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-default-role.xml");
-
- Config config = wsConfig.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 1 roles", 1, roles.size());
-
- Role role = roles.get(0);
- assertEquals("Expected 'Trader' role.", "Trader",
role.getName());
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * which contains one role.
- */
- public void testPortRole() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-port-role.xml");
-
- Port port = wsConfig.getPorts().get("TestPort");
- Config config = port.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 1 roles", 1, roles.size());
-
- Role role = roles.get(0);
- assertEquals("Expected 'Trader' role.", "Trader",
role.getName());
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * with unchecked.
- */
- public void testDefaultUnchecked() throws Exception
- {
- WSSecurityConfiguration wsConfig =
load("jboss-wsse-default-unchecked.xml");
-
- Config config = wsConfig.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertTrue("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 0 roles", 0, roles.size());
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * with unchecked.
- */
- public void testPortUnchecked() throws Exception
- {
- WSSecurityConfiguration wsConfig =
load("jboss-wsse-port-unchecked.xml");
-
- Port port = wsConfig.getPorts().get("TestPort");
- Config config = port.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertTrue("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 0 roles", 0, roles.size());
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * with unchecked and a role defined, parsing should fail.
- */
- public void testDefaultRoleUnchecked() throws Exception
- {
- try
- {
- WSSecurityConfiguration wsConfig =
load("jboss-wsse-default-role-unchecked.xml");
- fail("Expected exception not thrown.");
- }
- catch (IOException expected)
- {
- Throwable cause = expected.getCause();
- assertEquals(IllegalStateException.class, cause.getClass());
- }
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * with unchecked and a role defined, parsing should fail.
- */
- public void testPortRoleUnchecked() throws Exception
- {
- try
- {
- WSSecurityConfiguration wsConfig =
load("jboss-wsse-port-role-unchecked.xml");
- fail("Expected exception not thrown.");
- }
- catch (IOException expected)
- {
- Throwable cause = expected.getCause();
- assertEquals(IllegalStateException.class, cause.getClass());
- }
- }
-
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,211 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.metadata.wsse.Authorize;
+import org.jboss.ws.metadata.wsse.Config;
+import org.jboss.ws.metadata.wsse.Port;
+import org.jboss.ws.metadata.wsse.Role;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * Test case to test reading the 'authorize' configuration.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran
Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class JBWS1999ConfigurationTestCase extends JBossWSTest
+{
+
+ private WSSecurityConfiguration load(final String fileName) throws IOException
+ {
+ File configFile = getResourceFile("jaxws/jbws1999/config/" + fileName);
+ WSSecurityOMFactory factory = WSSecurityOMFactory.newInstance();
+
+ return factory.parse(configFile.toURL());
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * which contains two roles.
+ */
+ public void testDefaultRoles() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-default-roles.xml");
+
+ Config config = wsConfig.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 2 roles", 2, roles.size());
+
+ List<String> roleNames = new ArrayList<String>(roles.size());
+ for (Role current : roles)
+ {
+ roleNames.add(current.getName());
+ }
+ assertTrue("Expected 'Trader' role.",
roleNames.contains("Trader"));
+ assertTrue("Expected 'Banker' role.",
roleNames.contains("Banker"));
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * which contains two roles.
+ */
+ public void testPortRoles() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-port-roles.xml");
+
+ Port port = wsConfig.getPorts().get("TestPort");
+ Config config = port.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 2 roles", 2, roles.size());
+
+ List<String> roleNames = new ArrayList<String>(roles.size());
+ for (Role current : roles)
+ {
+ roleNames.add(current.getName());
+ }
+ assertTrue("Expected 'Trader' role.",
roleNames.contains("Trader"));
+ assertTrue("Expected 'Banker' role.",
roleNames.contains("Banker"));
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * which contains one role.
+ */
+ public void testDefaultRole() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-default-role.xml");
+
+ Config config = wsConfig.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 1 roles", 1, roles.size());
+
+ Role role = roles.get(0);
+ assertEquals("Expected 'Trader' role.", "Trader",
role.getName());
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * which contains one role.
+ */
+ public void testPortRole() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-port-role.xml");
+
+ Port port = wsConfig.getPorts().get("TestPort");
+ Config config = port.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 1 roles", 1, roles.size());
+
+ Role role = roles.get(0);
+ assertEquals("Expected 'Trader' role.", "Trader",
role.getName());
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * with unchecked.
+ */
+ public void testDefaultUnchecked() throws Exception
+ {
+ WSSecurityConfiguration wsConfig =
load("jboss-wsse-default-unchecked.xml");
+
+ Config config = wsConfig.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertTrue("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 0 roles", 0, roles.size());
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * with unchecked.
+ */
+ public void testPortUnchecked() throws Exception
+ {
+ WSSecurityConfiguration wsConfig =
load("jboss-wsse-port-unchecked.xml");
+
+ Port port = wsConfig.getPorts().get("TestPort");
+ Config config = port.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertTrue("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 0 roles", 0, roles.size());
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * with unchecked and a role defined, parsing should fail.
+ */
+ public void testDefaultRoleUnchecked() throws Exception
+ {
+ try
+ {
+ WSSecurityConfiguration wsConfig =
load("jboss-wsse-default-role-unchecked.xml");
+ fail("Expected exception not thrown.");
+ }
+ catch (IOException expected)
+ {
+ Throwable cause = expected.getCause();
+ assertEquals(IllegalStateException.class, cause.getClass());
+ }
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * with unchecked and a role defined, parsing should fail.
+ */
+ public void testPortRoleUnchecked() throws Exception
+ {
+ try
+ {
+ WSSecurityConfiguration wsConfig =
load("jboss-wsse-port-role-unchecked.xml");
+ fail("Expected exception not thrown.");
+ }
+ catch (IOException expected)
+ {
+ Throwable cause = expected.getCause();
+ assertEquals(IllegalStateException.class, cause.getClass());
+ }
+ }
+
+}
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,196 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2009, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import java.net.URL;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPFault;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import junit.framework.Test;
-
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * Test case to test UsernameToken authorization / authentication
- * for POJO endpoints.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 12th January 2008
- * @see
https://jira.jboss.org/jira/browse/JBWS-1999
- */
-public class JBWS1999TestCase extends JBossWSTest
-{
-
- private final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws1999";
-
- private static final String FAULT_CODE = "wsse:FailedAuthentication";
-
- private static final String FAULT_STRING = FailedAuthenticationException.faultString;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS1999TestCase.class,
"jaxws-jbws1999.war");
- }
-
- public void testNoSecurity() throws Exception
- {
- Endpoint endpoint = getPort(false);
-
- String message = "NoSecurity Message";
-
- String response = endpoint.echoNoSecurity(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testUnchecked_Default() throws Exception
- {
- Endpoint endpoint = getPort(false);
-
- String message = "UncheckedDefault Message";
-
- String response = endpoint.echoUnchecked(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testUnchecked() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
-
- String message = "Unchecked Message";
-
- String response = endpoint.echoUnchecked(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testUnchecked_WrongPassword() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
-
- String message = "Unchecked_WrongPassword Message";
-
- try
- {
- endpoint.echoUnchecked(message);
- fail("Expected SOAPFaultException not thrown!!");
- }
- catch (SOAPFaultException sfe)
- {
- SOAPFault fault = sfe.getFault();
- String faultCode = fault.getFaultCode();
- assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault String", FAULT_STRING, faultString);
- }
-
- }
-
- public void testFriendRequired() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
-
- String message = "FriendRequired Message";
-
- String response = endpoint.echoFriendRequired(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testFriendRequired_WrongPassword() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
-
- String message = "FriendRequired Message";
-
- try
- {
- endpoint.echoFriendRequired(message);
- fail("Expected SOAPFaultException not thrown!!");
- }
- catch (SOAPFaultException sfe)
- {
- SOAPFault fault = sfe.getFault();
- String faultCode = fault.getFaultCode();
- assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault Message", FAULT_STRING, faultString);
- }
- }
-
- public void testEnemyRequired() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
-
- String message = "EnemyRequired Message";
-
- try
- {
- endpoint.echoEnemyRequired(message);
- fail("Expected SOAPFaultException not thrown!!");
- }
- catch (SOAPFaultException sfe)
- {
- SOAPFault fault = sfe.getFault();
- String faultCode = fault.getFaultCode();
- System.out.println(faultCode);
- assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault Message", FAULT_STRING, faultString);
- }
- }
-
- private Endpoint getPort(boolean enableSecurity) throws Exception
- {
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new
QName("http://ws.jboss.org/jbws1999",
"EndpointService");
- Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
- if (enableSecurity == true)
- {
- URL securityURL =
getResourceURL("jaxws/jbws1999/jboss-wsse-client.xml");
- ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
- ((StubExt)port).setConfigName("Standard WSSecurity Client");
- }
-
- return port;
- }
-}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,196 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test case to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see
https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+public class JBWS1999TestCase extends JBossWSTest
+{
+
+ private final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws1999";
+
+ private static final String FAULT_CODE = "wsse:FailedAuthentication";
+
+ private static final String FAULT_STRING = FailedAuthenticationException.faultString;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS1999TestCase.class,
"jaxws-jbws1999.war");
+ }
+
+ public void testNoSecurity() throws Exception
+ {
+ Endpoint endpoint = getPort(false);
+
+ String message = "NoSecurity Message";
+
+ String response = endpoint.echoNoSecurity(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked_Default() throws Exception
+ {
+ Endpoint endpoint = getPort(false);
+
+ String message = "UncheckedDefault Message";
+
+ String response = endpoint.echoUnchecked(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "Unchecked Message";
+
+ String response = endpoint.echoUnchecked(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked_WrongPassword() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
+
+ String message = "Unchecked_WrongPassword Message";
+
+ try
+ {
+ endpoint.echoUnchecked(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault String", FAULT_STRING, faultString);
+ }
+
+ }
+
+ public void testFriendRequired() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "FriendRequired Message";
+
+ String response = endpoint.echoFriendRequired(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testFriendRequired_WrongPassword() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
+
+ String message = "FriendRequired Message";
+
+ try
+ {
+ endpoint.echoFriendRequired(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault Message", FAULT_STRING, faultString);
+ }
+ }
+
+ public void testEnemyRequired() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext =
((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "EnemyRequired Message";
+
+ try
+ {
+ endpoint.echoEnemyRequired(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ System.out.println(faultCode);
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault Message", FAULT_STRING, faultString);
+ }
+ }
+
+ private Endpoint getPort(boolean enableSecurity) throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new
QName("http://ws.jboss.org/jbws1999",
"EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+ if (enableSecurity == true)
+ {
+ URL securityURL =
getResourceURL("jaxws/jbws1999/jboss-wsse-client.xml");
+ ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+ }
+
+ return port;
+ }
+}
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999 (from
rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999)
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF)
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
- <security-domain>java:/jaas/JBossWS</security-domain>
-
- <context-root>/jaxws-jbws1999</context-root>
-</jboss-web>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWS</security-domain>
+
+ <context-root>/jaxws-jbws1999</context-root>
+</jboss-web>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,34 +0,0 @@
-<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.jboss.com/ws-security/config
-
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
-
- <port name="EndpointPort">
- <operation
name="{http://ws.jboss.org/jbws1999}echoUnchecked">
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
- </operation>
-
- <operation
name="{http://ws.jboss.org/jbws1999}echoFriendRequired">
- <config>
- <authorize>
- <role>friend</role>
- </authorize>
- </config>
- </operation>
-
- <operation
name="{http://ws.jboss.org/jbws1999}echoEnemyRequired">
- <config>
- <authorize>
- <role>enemy</role>
- </authorize>
- </config>
- </operation>
- </port>
-
-
-
-</jboss-ws-security>
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,34 @@
+<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.com/ws-security/config
+
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <port name="EndpointPort">
+ <operation
name="{http://ws.jboss.org/jbws1999}echoUnchecked">
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation
name="{http://ws.jboss.org/jbws1999}echoFriendRequired">
+ <config>
+ <authorize>
+ <role>friend</role>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation
name="{http://ws.jboss.org/jbws1999}echoEnemyRequired">
+ <config>
+ <authorize>
+ <role>enemy</role>
+ </authorize>
+ </config>
+ </operation>
+ </port>
+
+
+
+</jboss-ws-security>
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <servlet>
- <servlet-name>Endpoint</servlet-name>
-
<servlet-class>org.jboss.test.ws.jaxws.jbws1999.EndpointImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>Endpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws1999.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config)
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,12 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- <unchecked/>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,12 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ <unchecked/>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,11 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,11 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,12 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Banker</role>
- <role>Trader</role>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,12 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Banker</role>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,11 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,11 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,20 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <role>Trader</role>
- <unchecked/>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,20 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <role>Trader</role>
+ <unchecked/>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,19 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,19 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,20 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <role>Banker</role>
- <role>Trader</role>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,20 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <role>Banker</role>
+ <role>Trader</role>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,19 +0,0 @@
-<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
-
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,19 @@
+<jboss-ws-security
xmlns='http://www.jboss.com/ws-security/config'
+
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+
xsi:schemaLocation='http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml 2009-01-12
16:46:40 UTC (rev 9012)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
-
- <config>
- <username/>
-
- </config>
-</jboss-ws-security>
\ No newline at end of file
Copied:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
(from rev 9012,
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml)
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml 2009-01-12
17:15:52 UTC (rev 9013)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <config>
+ <username/>
+
+ </config>
+</jboss-ws-security>
\ No newline at end of file