Search in sources :

Example 1 with MessageSecurityBindingDescriptor

use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.

the class AuthMessagePolicy method getMessageSecurityBinding.

public static MessageSecurityBindingDescriptor getMessageSecurityBinding(String layer, Map<String, ?> properties) {
    if (properties == null) {
        return null;
    }
    MessageSecurityBindingDescriptor binding = null;
    WebServiceEndpoint e = (WebServiceEndpoint) properties.get("SERVICE_ENDPOINT");
    if (e != null) {
        binding = e.getMessageSecurityBinding();
    } else {
        ServiceReferenceDescriptor s = (ServiceReferenceDescriptor) properties.get("SERVICE_REF");
        if (s != null) {
            WebServicesDelegate delegate = Globals.get(WebServicesDelegate.class);
            if (delegate != null) {
                binding = delegate.getBinding(s, properties);
            }
        }
    }
    if (binding != null) {
        String bindingLayer = binding.getAttributeValue(MessageSecurityBindingDescriptor.AUTH_LAYER);
        if (bindingLayer == null || layer.equals(bindingLayer)) {
            return binding;
        }
    }
    return null;
}
Also used : MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) WebServiceEndpoint(com.sun.enterprise.deployment.WebServiceEndpoint) ServiceReferenceDescriptor(com.sun.enterprise.deployment.ServiceReferenceDescriptor)

Example 2 with MessageSecurityBindingDescriptor

use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.

the class PipeHelper method processSunDeploymentDescriptor.

private boolean processSunDeploymentDescriptor() {
    if (factory == null) {
        return false;
    }
    MessageSecurityBindingDescriptor binding = getMessageSecurityBinding(SOAP_LAYER, map);
    if (binding != null) {
        if (!hasExactMatchAuthProvider()) {
            String jaspicProviderRegisID = factory.registerConfigProvider(new GFServerConfigProvider(null, null), layer, appCtxt, "GF AuthConfigProvider bound by Sun Specific Descriptor");
            setRegistrationId(jaspicProviderRegisID);
        }
    }
    WebServiceEndpoint webServiceEndpoint = (WebServiceEndpoint) map.get(SERVICE_ENDPOINT);
    return webServiceEndpoint == null ? false : webServiceEndpoint.implementedByEjbComponent();
}
Also used : MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) GFServerConfigProvider(com.sun.enterprise.security.jaspic.config.GFServerConfigProvider) WebServiceEndpoint(com.sun.enterprise.deployment.WebServiceEndpoint)

Example 3 with MessageSecurityBindingDescriptor

use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.

the class WebServiceEndpointRuntimeNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param node name for the descriptor
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, WebServiceEndpoint endpoint) {
    Node endpointNode = super.writeDescriptor(parent, nodeName, endpoint);
    appendTextChild(endpointNode, WebServicesTagNames.PORT_COMPONENT_NAME, endpoint.getEndpointName());
    appendTextChild(endpointNode, WebServicesTagNames.ENDPOINT_ADDRESS_URI, endpoint.getEndpointAddressUri());
    // this info is described in web application itself.
    if (endpoint.implementedByEjbComponent() && endpoint.hasAuthMethod()) {
        Node loginConfigNode = appendChild(endpointNode, RuntimeTagNames.LOGIN_CONFIG);
        appendTextChild(loginConfigNode, RuntimeTagNames.AUTH_METHOD, endpoint.getAuthMethod());
        appendTextChild(loginConfigNode, RuntimeTagNames.REALM, endpoint.getRealm());
    }
    // message-security-binding
    MessageSecurityBindingDescriptor messageSecBindingDesc = endpoint.getMessageSecurityBinding();
    if (messageSecBindingDesc != null) {
        MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
        messageSecBindingNode.writeDescriptor(endpointNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
    }
    appendTextChild(endpointNode, WebServicesTagNames.TRANSPORT_GUARANTEE, endpoint.getTransportGuarantee());
    QName serviceName = endpoint.getServiceName();
    if (serviceName != null) {
        Node serviceQnameNode = appendChild(endpointNode, WebServicesTagNames.SERVICE_QNAME);
        appendTextChild(serviceQnameNode, WebServicesTagNames.NAMESPACE_URI, serviceName.getNamespaceURI());
        appendTextChild(serviceQnameNode, WebServicesTagNames.LOCAL_PART, serviceName.getLocalPart());
    }
    appendTextChild(endpointNode, WebServicesTagNames.TIE_CLASS, endpoint.getTieClassName());
    if (endpoint.implementedByWebComponent() && (endpoint.getServletImplClass() != null)) {
        appendTextChild(endpointNode, WebServicesTagNames.SERVLET_IMPL_CLASS, endpoint.getServletImplClass());
    }
    // debugging-enabled?
    appendTextChild(endpointNode, WebServicesTagNames.DEBUGGING_ENABLED, endpoint.getDebugging());
    // property*
    Iterator properties = endpoint.getProperties();
    if (properties != null) {
        RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
        while (properties.hasNext()) {
            NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
            propNode.writeDescriptor(endpointNode, RuntimeTagNames.PROPERTY, aProp);
        }
    }
    return endpointNode;
}
Also used : MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) QName(javax.xml.namespace.QName) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Node(org.w3c.dom.Node) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) Iterator(java.util.Iterator) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode)

Example 4 with MessageSecurityBindingDescriptor

use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.

the class ServiceRefPortInfoRuntimeNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param node name for the descriptor
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, ServiceRefPortInfo desc) {
    Node serviceRefPortInfoRuntimeNode = super.writeDescriptor(parent, nodeName, desc);
    appendTextChild(serviceRefPortInfoRuntimeNode, WebServicesTagNames.SERVICE_ENDPOINT_INTERFACE, desc.getServiceEndpointInterface());
    QName port = desc.getWsdlPort();
    if (port != null) {
        Node wsdlPortNode = appendChild(serviceRefPortInfoRuntimeNode, WebServicesTagNames.WSDL_PORT);
        appendTextChild(wsdlPortNode, WebServicesTagNames.NAMESPACE_URI, port.getNamespaceURI());
        appendTextChild(wsdlPortNode, WebServicesTagNames.LOCAL_PART, port.getLocalPart());
    }
    // stub-property*
    NameValuePairNode nameValueNode = new NameValuePairNode();
    Set stubProperties = desc.getStubProperties();
    for (Iterator iter = stubProperties.iterator(); iter.hasNext(); ) {
        NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
        nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.STUB_PROPERTY, next);
    }
    // call-property*
    for (Iterator iter = desc.getCallProperties().iterator(); iter.hasNext(); ) {
        NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
        nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.CALL_PROPERTY, next);
    }
    // message-security-binding
    MessageSecurityBindingDescriptor messageSecBindingDesc = desc.getMessageSecurityBinding();
    if (messageSecBindingDesc != null) {
        MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
        messageSecBindingNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
    }
    return serviceRefPortInfoRuntimeNode;
}
Also used : Set(java.util.Set) MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) QName(javax.xml.namespace.QName) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Node(org.w3c.dom.Node) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) Iterator(java.util.Iterator) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode)

Example 5 with MessageSecurityBindingDescriptor

use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.

the class PipeHelper method processSunDeploymentDescriptor.

private boolean processSunDeploymentDescriptor() {
    if (factory == null) {
        return false;
    }
    MessageSecurityBindingDescriptor binding = AuthMessagePolicy.getMessageSecurityBinding(PipeConstants.SOAP_LAYER, map);
    if (binding != null) {
        if (!hasExactMatchAuthProvider()) {
            String jmacProviderRegisID = factory.registerConfigProvider(new GFServerConfigProvider(null, null), layer, appCtxt, "GF AuthConfigProvider bound by Sun Specific Descriptor");
            this.setJmacProviderRegisID(jmacProviderRegisID);
        }
    }
    WebServiceEndpoint e = (WebServiceEndpoint) map.get(PipeConstants.SERVICE_ENDPOINT);
    return (e == null ? false : e.implementedByEjbComponent());
}
Also used : MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) GFServerConfigProvider(com.sun.enterprise.security.jmac.config.GFServerConfigProvider) WebServiceEndpoint(com.sun.enterprise.deployment.WebServiceEndpoint)

Aggregations

MessageSecurityBindingDescriptor (com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor)9 WebServiceEndpoint (com.sun.enterprise.deployment.WebServiceEndpoint)4 QName (javax.xml.namespace.QName)4 ServiceRefPortInfo (com.sun.enterprise.deployment.ServiceRefPortInfo)3 NameValuePairDescriptor (com.sun.enterprise.deployment.NameValuePairDescriptor)2 ServiceReferenceDescriptor (com.sun.enterprise.deployment.ServiceReferenceDescriptor)2 DeploymentDescriptorNode (com.sun.enterprise.deployment.node.DeploymentDescriptorNode)2 MessageSecurityBindingNode (com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode)2 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)2 Iterator (java.util.Iterator)2 Node (org.w3c.dom.Node)2 NameValuePairNode (com.sun.enterprise.deployment.node.NameValuePairNode)1 RuntimeNameValuePairNode (com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode)1 GFServerConfigProvider (com.sun.enterprise.security.jaspic.config.GFServerConfigProvider)1 GFServerConfigProvider (com.sun.enterprise.security.jmac.config.GFServerConfigProvider)1 Set (java.util.Set)1 HandlerInfo (javax.xml.rpc.handler.HandlerInfo)1