perfsonar-dev - perfsonar: r2477 - in trunk/perfsonar: ant ant/as conf conf/wsdd schema/example-instances/perfSONAR schema/example-instances/perfSONAR/AS schema/example-instances/perfSONAR/AS/test src/org/perfsonar/commons/auxiliary/components/authn src/org/perfsonar/commons/auxiliary/components/authn/wssec src/org/perfsonar/commons/messages src/org/perfsonar/service src/org/perfsonar/service/authService src/org/perfsonar/service/testHarness src/org/perfsonar/service/testHarness/authService src/org/perfsonar/service/web
Subject: perfsonar development work
List archive
perfsonar: r2477 - in trunk/perfsonar: ant ant/as conf conf/wsdd schema/example-instances/perfSONAR schema/example-instances/perfSONAR/AS schema/example-instances/perfSONAR/AS/test src/org/perfsonar/commons/auxiliary/components/authn src/org/perfsonar/commons/auxiliary/components/authn/wssec src/org/perfsonar/commons/messages src/org/perfsonar/service src/org/perfsonar/service/authService src/org/perfsonar/service/testHarness src/org/perfsonar/service/testHarness/authService src/org/perfsonar/service/web
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2477 - in trunk/perfsonar: ant ant/as conf conf/wsdd schema/example-instances/perfSONAR schema/example-instances/perfSONAR/AS schema/example-instances/perfSONAR/AS/test src/org/perfsonar/commons/auxiliary/components/authn src/org/perfsonar/commons/auxiliary/components/authn/wssec src/org/perfsonar/commons/messages src/org/perfsonar/service src/org/perfsonar/service/authService src/org/perfsonar/service/testHarness src/org/perfsonar/service/testHarness/authService src/org/perfsonar/service/web
- Date: Wed, 20 Jun 2007 07:38:44 -0400
Author: rodriguez
Date: 2007-06-20 07:38:44 -0400 (Wed, 20 Jun 2007)
New Revision: 2477
Added:
trunk/perfsonar/ant/as/
trunk/perfsonar/ant/as/build-targets.xml
trunk/perfsonar/ant/as/client-run-targets.xml
trunk/perfsonar/ant/as/configure-targets.xml
trunk/perfsonar/ant/as/deploy-targets.xml
trunk/perfsonar/ant/as/libs-download-targets.xml
trunk/perfsonar/ant/as/pre-install-targets.xml
trunk/perfsonar/ant/as/release-targets.xml
trunk/perfsonar/ant/as/test-run-targets.xml
trunk/perfsonar/ant/as/undeploy-targets.xml
trunk/perfsonar/ant/build-as.xml
trunk/perfsonar/ant/const.properties.as
trunk/perfsonar/conf/ASValidComponentsFile
trunk/perfsonar/conf/components.properties.as
trunk/perfsonar/conf/perfSONARtruststore.jks
trunk/perfsonar/conf/service.properties.as
trunk/perfsonar/conf/test-eduGAIN.key
trunk/perfsonar/conf/test-eduGAIN.pem
trunk/perfsonar/conf/wsdd/as-service-deploy.wsdd
trunk/perfsonar/conf/wsdd/as-service-undeploy.wsdd
trunk/perfsonar/schema/example-instances/perfSONAR/AS/
trunk/perfsonar/schema/example-instances/perfSONAR/AS/test/
trunk/perfsonar/schema/example-instances/perfSONAR/AS/test/AuthNRequest.xml
trunk/perfsonar/src/org/perfsonar/commons/messages/AuthNClient.java
trunk/perfsonar/src/org/perfsonar/service/authService/
trunk/perfsonar/src/org/perfsonar/service/authService/ASAction.java
trunk/perfsonar/src/org/perfsonar/service/authService/ASEngine.java
trunk/perfsonar/src/org/perfsonar/service/authService/AuthNAction.java
trunk/perfsonar/src/org/perfsonar/service/testHarness/authService/
trunk/perfsonar/src/org/perfsonar/service/testHarness/authService/AuthNRequestTest.java
Modified:
trunk/perfsonar/ant/axis-deploy-targets.xml
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/AuthNComponent.java
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/wssec/WSSecAuthNComponent.java
trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
Log:
Updating the code... First version of the AS and the Authentication Component
Added: trunk/perfsonar/ant/as/build-targets.xml
Added: trunk/perfsonar/ant/as/client-run-targets.xml
Added: trunk/perfsonar/ant/as/configure-targets.xml
Added: trunk/perfsonar/ant/as/deploy-targets.xml
Added: trunk/perfsonar/ant/as/libs-download-targets.xml
Added: trunk/perfsonar/ant/as/pre-install-targets.xml
Added: trunk/perfsonar/ant/as/release-targets.xml
Added: trunk/perfsonar/ant/as/test-run-targets.xml
Added: trunk/perfsonar/ant/as/undeploy-targets.xml
Modified: trunk/perfsonar/ant/axis-deploy-targets.xml
===================================================================
--- trunk/perfsonar/ant/axis-deploy-targets.xml 2007-06-19 15:15:07 UTC (rev
2476)
+++ trunk/perfsonar/ant/axis-deploy-targets.xml 2007-06-20 11:38:44 UTC (rev
2477)
@@ -91,6 +91,9 @@
<copy file="./lib/repository/log4j/log4j/1.2.9/log4j-1.2.9.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
+ <copy file="./lib/repository/wss4j/wss4j/1.5.1/wss4j-1.5.1.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
+ <copy
file="./lib/repository/xml-security/xmlsec/1.3.0/xmlsec-1.3.0.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
+
</target>
@@ -155,7 +158,7 @@
</target>
- <target name="copy-generic-jar"
+ <target name="copy-generic-jar"
depends="does-jar-generic-exist"
if="jar.perfsonar.generic.present"
description="Copy generic jar to Tomcat">
@@ -165,7 +168,7 @@
</target>
- <!-- adding/removing a new listener to/from the Axis file web.xml -->
+ <!-- adding/removing a new listener to/from the Axis file web.xml -->
<!-- Add service (un)initialization context listener class to AXIS
web.xml -->
<target name="add-context-listener">
Added: trunk/perfsonar/ant/build-as.xml
Added: trunk/perfsonar/ant/const.properties.as
Added: trunk/perfsonar/conf/ASValidComponentsFile
Added: trunk/perfsonar/conf/components.properties.as
Added: trunk/perfsonar/conf/perfSONARtruststore.jks
Property changes on: trunk/perfsonar/conf/perfSONARtruststore.jks
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/perfsonar/conf/service.properties.as
Added: trunk/perfsonar/conf/test-eduGAIN.key
Added: trunk/perfsonar/conf/test-eduGAIN.pem
Added: trunk/perfsonar/conf/wsdd/as-service-deploy.wsdd
Added: trunk/perfsonar/conf/wsdd/as-service-undeploy.wsdd
Added:
trunk/perfsonar/schema/example-instances/perfSONAR/AS/test/AuthNRequest.xml
Modified:
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/AuthNComponent.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/AuthNComponent.java
2007-06-19 15:15:07 UTC (rev 2476)
+++
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/AuthNComponent.java
2007-06-20 11:38:44 UTC (rev 2477)
@@ -3,5 +3,9 @@
import org.perfsonar.service.commons.exceptions.PerfSONARException;
public interface AuthNComponent {
+ public static final String CHECK_AUTHN_PARAM =
"service.as.authn_active";
+ public static final String YES_CHECK_AUTHN = "on";
+ public static final String LIST_MSG_AUTHN =
"service.as.authn_for_msg_types";
+
public void requestAuthN(String messageType) throws
PerfSONARException;
}
Modified:
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/wssec/WSSecAuthNComponent.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/wssec/WSSecAuthNComponent.java
2007-06-19 15:15:07 UTC (rev 2476)
+++
trunk/perfsonar/src/org/perfsonar/commons/auxiliary/components/authn/wssec/WSSecAuthNComponent.java
2007-06-20 11:38:44 UTC (rev 2477)
@@ -18,10 +18,6 @@
import org.perfsonar.service.commons.exceptions.PerfSONARException;
public class WSSecAuthNComponent implements AuthNComponent,
AuxiliaryComponent {
- private final String CHECK_AUTHN_PARAM = "service.as.authn_active";
- private final String YES_CHECK_AUTHN = "on";
- private final String LIST_MSG_AUTHN =
"service.as.authn_for_msg_types";
-
private String componentName = null;
private ConfigurationComponent configuration;
private boolean checkAuthN;
@@ -40,10 +36,10 @@
configuration = (ConfigurationComponent)AuxiliaryComponentManager.
getInstance().getComponent(ComponentNames.CONFIG);
try {
- String
checkAuthNParam=configuration.getProperty(CHECK_AUTHN_PARAM);
- if (checkAuthNParam.equals(YES_CHECK_AUTHN)) {
+ String
checkAuthNParam=configuration.getProperty(AuthNComponent.CHECK_AUTHN_PARAM);
+ if (checkAuthNParam.equals(AuthNComponent.YES_CHECK_AUTHN)) {
checkAuthN = true;
- String
listMsgsParam=configuration.getProperty(LIST_MSG_AUTHN);
+ String
listMsgsParam=configuration.getProperty(AuthNComponent.LIST_MSG_AUTHN);
StringTokenizer st=new
StringTokenizer(listMsgsParam,",");
while (st.hasMoreTokens()) {
String msg=st.nextToken();
Added: trunk/perfsonar/src/org/perfsonar/commons/messages/AuthNClient.java
Added: trunk/perfsonar/src/org/perfsonar/service/authService/ASAction.java
Added: trunk/perfsonar/src/org/perfsonar/service/authService/ASEngine.java
Added: trunk/perfsonar/src/org/perfsonar/service/authService/AuthNAction.java
Added:
trunk/perfsonar/src/org/perfsonar/service/testHarness/authService/AuthNRequestTest.java
Modified: trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
===================================================================
--- trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
2007-06-19 15:15:07 UTC (rev 2476)
+++ trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
2007-06-20 11:38:44 UTC (rev 2477)
@@ -10,6 +10,7 @@
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.perfsonar.commons.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.commons.auxiliary.ComponentNames;
+import org.perfsonar.commons.auxiliary.components.authn.AuthNComponent;
import
org.perfsonar.commons.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.commons.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.commons.messages.MessageHandler;
@@ -50,6 +51,7 @@
private LoggerComponent logger = null;
+ private AuthNComponent authnComponent = null;
// ---------------------------------- public methods
@@ -64,15 +66,15 @@
* @return org.w3c.dom.Document response provided by the service
*
* @throws Exception If any fatal error occurred (but almost all errors
- * are being catched and converted to PerfSONAR result codes
+ * are being catched and converted to PerfSONAR result codes
*/
public Document acceptCall(Document request) {
/*
- *
+ *
* The first invocation of AuxiliaryComponentManager.getInstance()
* creates the static instance of AuxiliaryComponentManager.
- *
+ *
*/
try {
@@ -89,12 +91,17 @@
//get logger component
logger = (LoggerComponent)AuxiliaryComponentManager.
- getInstance().getComponent(ComponentNames.LOGGER);
+ getInstance().getComponent(ComponentNames.LOGGER);
if (logger == null) throw new PerfSONARException(
"error.common.no_logger",
"Cannot find logger component");
+ //get authn component
+
+ authnComponent = (AuthNComponent)AuxiliaryComponentManager.
+ getInstance().getComponent(ComponentNames.AUTHN);
+
logger.info("RequestHandler: Service received a request");
logger.debug("RequestHandler: " +
"Calling on parser to parse the request");
@@ -105,12 +112,12 @@
try {
requestMessage = XMLUtils.convertToMessage(
- request,
+ request,
configuration.getProperty(SAX_PARSER_CONFIG));
} catch (Exception e) {
-
- throw new PerfSONARException("error.common.parse_error",
+
+ throw new PerfSONARException("error.common.parse_error",
"Parse/validation error, " +
"Cannot convert request to Message. " +
"Nested error messsage was "+e.getMessage());
@@ -123,7 +130,7 @@
logger.debug("RequestHandler: " +
"Message object constructed from request. " +
- "Request is of type: " +
+ "Request is of type: " +
requestMessage.getType());
/*
@@ -135,14 +142,37 @@
//if so, response that service was set up correctly
throw new PerfSONARException("service.common.success",
"Service initialized correctly");
-
+
}
-
-
+
+ // Check if it's needed authentication for this type of
message
+ try {
+ String
checkAuthNParam=configuration.getProperty(AuthNComponent.CHECK_AUTHN_PARAM);
+ if
(checkAuthNParam!=null&&checkAuthNParam.equals(AuthNComponent.YES_CHECK_AUTHN))
{
+ logger.debug(
+ "RequestHandler: " +
+ "Authenticating the message");
+ if (authnComponent == null) throw new
PerfSONARException(
+ "error.common.no_authn",
+ "Cannot find authn component");
+
authnComponent.requestAuthN(requestMessage.getType());
+ }
+ else {
+ logger.debug(
+ "RequestHandler: " +
+ "Automated authentication not required");
+ }
+ } catch (PerfSONARException e) {
+ logger.debug(
+ "RequestHandler: " +
+ "Authentication component not configured");
+ }
+
+
// Call on the MessageHandlerFactory to get the appropriate
// message handler for this type of message.
- MessageHandler messageHandler =
+ MessageHandler messageHandler =
MessageHandlerFactory.getMessageHandler(
requestMessage.getType());
@@ -154,7 +184,7 @@
messageHandler.getClass()+"] to satisfy request");
- //run proper message handler,
+ //run proper message handler,
//which will run ServiceEngine
//*****************************************************
@@ -176,20 +206,20 @@
} else {
- //if anything went wrong with parsing, throw exception
+ //if anything went wrong with parsing, throw exception
logger.error("RequestHandler: " +
"Message object constructed as null from request");
-
- throw new PerfSONARException("error.common.parse_error",
+
+ throw new PerfSONARException("error.common.parse_error",
"RequestHandler: " +
"Server could not construct a message object " +
"from the request due to unknown error. " +
"Please check request and try again");
}
-
-
- } catch (PerfSONARException pex) {
+
+ } catch (PerfSONARException pex) {
+
/*
* If any error occured
* response with result/error code
@@ -197,7 +227,7 @@
//create common result code
- Message responseMessage =
+ Message responseMessage =
ResultCodesUtil.createResultCodeMetadata(
null,
pex);
@@ -228,5 +258,5 @@
}
-
+
} //RequestHandler
- perfsonar: r2477 - in trunk/perfsonar: ant ant/as conf conf/wsdd schema/example-instances/perfSONAR schema/example-instances/perfSONAR/AS schema/example-instances/perfSONAR/AS/test src/org/perfsonar/commons/auxiliary/components/authn src/org/perfsonar/commons/auxiliary/components/authn/wssec src/org/perfsonar/commons/messages src/org/perfsonar/service src/org/perfsonar/service/authService src/org/perfsonar/service/testHarness src/org/perfsonar/service/testHarness/authService src/org/perfsonar/service/web, svnlog, 06/20/2007
Archive powered by MHonArc 2.6.16.