You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ma...@apache.org on 2007/04/24 06:15:25 UTC
svn commit: r531715 - in /webservices/axis2/scratch/c/neethi/axis2c/neethi:
./ src/ src/secpolicy/ src/secpolicy/builder/ src/secpolicy/model/
Author: manjula
Date: Mon Apr 23 21:15:23 2007
New Revision: 531715
URL: http://svn.apache.org/viewvc?view=rev&rev=531715
Log:
Adding latest chnages to the svn.
Added:
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/assertion_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/Makefile.am
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/Makefile.am
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/qname_matcher.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/supporting_tokens_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/model/Makefile.am
Modified:
webservices/axis2/scratch/c/neethi/axis2c/neethi/Makefile.am
webservices/axis2/scratch/c/neethi/axis2c/neethi/configure.ac
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/Makefile.am
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/policy.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/algorithmsuite_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/layout_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/token_identifier.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_binding_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_token_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/username_token_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/wss10_builder.c
webservices/axis2/scratch/c/neethi/axis2c/neethi/src/test.c
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/Makefile.am?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/Makefile.am (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/Makefile.am Mon Apr 23 21:15:23 2007
@@ -1,4 +1,4 @@
-SUBDIRS = src
+SUBDIRS = src
includedir=$(prefix)/include/neethi-0.1
include_HEADERS=$(top_builddir)/include/*.h
#data_DATA= INSTALL README AUTHORS NEWS CREDITS LICENSE COPYING
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/configure.ac?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/configure.ac (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/configure.ac Mon Apr 23 21:15:23 2007
@@ -59,6 +59,9 @@
AC_CONFIG_FILES([Makefile \
src/Makefile \
+ src/secpolicy/Makefile \
+ src/secpolicy/model/Makefile \
+ src/secpolicy/builder/Makefile \
])
AC_OUTPUT
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/Makefile.am?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/Makefile.am (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/Makefile.am Mon Apr 23 21:15:23 2007
@@ -1,3 +1,4 @@
+SUBDIRS = secpolicy
lib_LTLIBRARIES=libneethi.la
libneethi_la_SOURCES= all.c \
@@ -8,7 +9,10 @@
policy.c \
reference.c \
registry.c \
+ assertion_builder.c \
test.c
+
+libneethi_la_LIBADD = ${AXIS2C_HOME}/lib
#libneethi_LIBADD=$(top_builddir)/src/core/description/libaxis2_description.la \
# $(top_builddir)/src/core/receivers/libaxis2_receivers.la \
Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/assertion_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/assertion_builder.c?view=auto&rev=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/assertion_builder.c (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/assertion_builder.c Mon Apr 23 21:15:23 2007
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include <neethi_assertion_builder.h>
+
+
+AXIS2_EXTERN neethi_assertion_t * AXIS2_CALL
+neethi_assertion_builder_build(
+ const axutil_env_t *env,
+ axiom_node_t *node,
+ axiom_element_t *element)
+{
+
+ axis2_char_t *localname = NULL;
+
+ localname = axiom_element_get_localname(element,env);
+ if(!localname)
+ {
+ return NULL;
+ }
+
+ if(axis2_strcmp(localname, RP_TRANSPORT_BINDING) ==0 )
+ {
+ if(rp_match_secpolicy_qname(env, RP_TRANSPORT_BINDING, node, element))
+ {
+ return rp_transport_binding_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else if(axis2_strcmp(localname, RP_TRANSPORT_TOKEN)==0)
+ {
+ if(rp_match_secpolicy_qname(env, RP_TRANSPORT_TOKEN, node, element))
+ {
+ return rp_transport_token_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else if(axis2_strcmp(localname, RP_ALGORITHM_SUITE)==0)
+ {
+ if(rp_match_secpolicy_qname(env, RP_ALGORITHM_SUITE, node, element))
+ {
+ return rp_algorithmsuite_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else if(axis2_strcmp(localname, RP_LAYOUT)==0)
+ {
+ if(rp_match_secpolicy_qname(env, RP_LAYOUT, node, element))
+ {
+ return rp_layout_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else if(axis2_strcmp(localname, RP_USERNAME_TOKEN)==0)
+ {
+ if(rp_match_secpolicy_qname(env, RP_USERNAME_TOKEN, node, element))
+ {
+ return rp_username_token_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else if(axis2_strcmp(localname, RP_SIGNED_SUPPORTING_TOKENS)==0)
+ {
+ if(rp_match_secpolicy_qname(env, RP_SIGNED_SUPPORTING_TOKENS, node, element))
+ {
+ return rp_supporting_tokens_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else if(axis2_strcmp(localname, RP_SIGNED_ENDORSING_SUPPORTING_TOKENS)==0)
+ {
+ if(rp_match_secpolicy_qname(env, RP_SIGNED_ENDORSING_SUPPORTING_TOKENS, node, element))
+ {
+ return rp_supporting_tokens_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else if(axis2_strcmp(localname, RP_WSS10)==0)
+ {
+ if(rp_match_secpolicy_qname(env, RP_WSS10, node, element))
+ {
+ return rp_wss10_builder_build(env, node, element);
+ }
+ else return NULL;
+ }
+ else return NULL;
+}
+
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c Mon Apr 23 21:15:23 2007
@@ -222,9 +222,40 @@
if(type == OPERATOR_TYPE_POLICY)
{
/*Adding attribute values to the hashmap logic
- *comes here. */
- }
-
+ *comes here.Following is a little hack until we implement attribute
+ hash map logic.*/
+
+ axis2_char_t *id = NULL;
+ axutil_qname_t *qname = NULL;
+ axis2_char_t *name = NULL;
+
+ qname = axutil_qname_create(env, NEETHI_ID, NEETHI_WSU_NS ,NEETHI_WSU_NS_PREFIX);
+ if(!qname)
+ {
+ return AXIS2_FAILURE;
+ }
+ id = axiom_element_get_attribute_value(element, env, qname);
+ axutil_qname_free(qname,env);
+ qname = NULL;
+
+ qname = axutil_qname_create(env, NEETHI_NAME, NULL, NULL);
+ if(!qname)
+ {
+ return AXIS2_FAILURE;
+ }
+ name = axiom_element_get_attribute_value(element, env, qname);
+ axutil_qname_free(qname,env);
+ qname = NULL;
+
+ if(id)
+ {
+ neethi_policy_set_id((neethi_policy_t *)value, env, id);
+ }
+ if(name)
+ {
+ neethi_policy_set_name((neethi_policy_t *)value, env, name);
+ }
+ }
children_iter = axiom_element_get_children(element, env, node);
if(children_iter)
@@ -394,8 +425,8 @@
AXIS2_EXTERN neethi_policy_t *AXIS2_CALL
neethi_engine_get_normalize(const axutil_env_t *env,
- neethi_policy_t *neethi_policy,
- axis2_bool_t deep)
+ axis2_bool_t deep,
+ neethi_policy_t *neethi_policy)
{
return neethi_engine_normalize(env, neethi_policy, NULL, deep);
}
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/policy.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/policy.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/policy.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/policy.c Mon Apr 23 21:15:23 2007
@@ -200,7 +200,7 @@
neethi_policy_t *normalized = NULL;
neethi_exactlyone_t *exactlyone = NULL;
- normalized = neethi_engine_get_normalize(neethi_policy,AXIS2_FALSE,env);
+ normalized = neethi_engine_get_normalize(env, AXIS2_FALSE, neethi_policy);
if(!normalized)
return NULL;
Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/Makefile.am?view=auto&rev=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/Makefile.am (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/Makefile.am Mon Apr 23 21:15:23 2007
@@ -0,0 +1 @@
+SUBDIRS = model builder
Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/Makefile.am?view=auto&rev=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/Makefile.am (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/Makefile.am Mon Apr 23 21:15:23 2007
@@ -0,0 +1,20 @@
+TESTS =
+
+noinst_LTLIBRARIES = librp_builder.la
+
+librp_builder_la_SOURCES = algorithmsuite_builder.c \
+ layout_builder.c qname_matcher.c \
+ supporting_tokens_builder.c \
+ transport_binding_builder.c username_token_builder.c \
+ wss10_builder.c transport_token_builder.c \
+ token_identifier.c
+
+
+librp_builder_la_LIBADD = ${AXIS2C_HOME}/lib
+
+
+INCLUDES = -I$(top_builddir)/include \
+ -I ../../../include \
+ -I ../../../../util/include \
+ -I ../../../../axiom/include \
+ -I ../../../../include
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/algorithmsuite_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/algorithmsuite_builder.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/algorithmsuite_builder.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/algorithmsuite_builder.c Mon Apr 23 21:15:23 2007
@@ -16,26 +16,25 @@
*/
#include <rp_algorithmsuite_builder.h>
-#include <policy_operator.h>
-#include <policy.h>
-#include <policy_exactlyone.h>
-#include <policy_all.h>
-#include <policy_engine.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
-AXIS2_EXTERN rp_assertion_t *AXIS2_CALL
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_algorithmsuite_builder_build(
const axutil_env_t *env,
axiom_node_t *node,
axiom_element_t *element)
-
{
rp_algorithmsuite_t *algorithmsuite = NULL;
axiom_node_t *child_node = NULL;
axiom_node_t *algo_node = NULL;
axiom_element_t *algo_element = NULL;
- rp_assertion_t *assertion = NULL;
+ neethi_assertion_t *assertion = NULL;
algorithmsuite = rp_algorithmsuite_create(env);
@@ -66,4 +65,3 @@
}
else return NULL;
}
-
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/layout_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/layout_builder.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/layout_builder.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/layout_builder.c Mon Apr 23 21:15:23 2007
@@ -16,11 +16,11 @@
*/
#include <rp_layout_builder.h>
-#include <policy_operator.h>
-#include <policy.h>
-#include <policy_exactlyone.h>
-#include <policy_all.h>
-#include <policy_engine.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
@@ -35,7 +35,7 @@
axiom_node_t *child_node = NULL;
axiom_node_t *layout_node = NULL;
axiom_element_t *layout_element = NULL;
- neeti_assertion_t *assertion = NULL;
+ neethi_assertion_t *assertion = NULL;
layout = rp_layout_create(env);
Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/qname_matcher.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/qname_matcher.c?view=auto&rev=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/qname_matcher.c (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/qname_matcher.c Mon Apr 23 21:15:23 2007
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <rp_qname_matcher.h>
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_match_secpolicy_qname(
+ const axutil_env_t *env,
+ const axis2_char_t *local_name,
+ axiom_node_t *node,
+ axiom_element_t *element)
+{
+
+ axutil_qname_t *qname = NULL;
+ axutil_qname_t *node_qname = NULL;
+
+ AXIS2_ENV_CHECK(env,AXIS2_FALSE);
+
+ node_qname = axiom_element_get_qname(element,env,node);
+
+ if(!node_qname)
+ {
+ axutil_qname_free(qname,env);
+ }
+ else
+ {
+ qname = axutil_qname_create(env,local_name,RP_SP_NS,RP_SP_PREFIX);
+ if(!qname)
+ return AXIS2_FALSE;
+ }
+ if(axutil_qname_equals(qname,env,node_qname))
+ {
+ axutil_qname_free(qname,env);
+ qname = NULL;
+ return AXIS2_TRUE;
+ }
+ else
+ {
+ axutil_qname_free(qname,env);
+ qname = NULL;
+ return AXIS2_FALSE;
+ }
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_match_policy_qname(
+ const axutil_env_t *env,
+ const axis2_char_t *local_name,
+ axiom_node_t *node,
+ axiom_element_t *element)
+{
+
+ axutil_qname_t *qname = NULL;
+ axutil_qname_t *node_qname = NULL;
+
+ AXIS2_ENV_CHECK(env,AXIS2_FALSE);
+
+ qname = axutil_qname_create(env,local_name,RP_POLICY_NS,RP_POLICY_PREFIX);
+ if(!qname)
+ return AXIS2_FALSE;
+
+ node_qname = axiom_element_get_qname(element,env,node);
+
+ if(!node_qname)
+ {
+ return AXIS2_FALSE;
+ }
+ else
+ {
+ qname = axutil_qname_create(env,local_name,RP_POLICY_NS,RP_POLICY_PREFIX);
+ if(!qname)
+ return AXIS2_FALSE;
+ }
+ if(axutil_qname_equals(qname,env,node_qname))
+ {
+ axutil_qname_free(qname,env);
+ qname = NULL;
+ return AXIS2_TRUE;
+ }
+ else
+ {
+ axutil_qname_free(qname,env);
+ qname = NULL;
+ return AXIS2_FALSE;
+ }
+}
+
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_match_rampart_config_qname(
+ const axutil_env_t *env,
+ const axis2_char_t *local_name,
+ axiom_node_t *node,
+ axiom_element_t *element)
+{
+
+ axutil_qname_t *qname = NULL;
+ axutil_qname_t *node_qname = NULL;
+
+ AXIS2_ENV_CHECK(env,AXIS2_FALSE);
+
+ node_qname = axiom_element_get_qname(element,env,node);
+
+ if(!node_qname)
+ {
+ return AXIS2_FALSE;
+ }
+ else
+ {
+ qname = axutil_qname_create(env,local_name,RP_RAMPART_NS,RP_RAMPART_PREFIX);
+ if(!qname)
+ return AXIS2_FALSE;
+ }
+ if(axutil_qname_equals(qname,env,node_qname))
+ {
+ axutil_qname_free(qname,env);
+ qname = NULL;
+ return AXIS2_TRUE;
+ }
+ else
+ {
+ axutil_qname_free(qname,env);
+ qname = NULL;
+ return AXIS2_FALSE;
+ }
+}
Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/supporting_tokens_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/supporting_tokens_builder.c?view=auto&rev=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/supporting_tokens_builder.c (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/supporting_tokens_builder.c Mon Apr 23 21:15:23 2007
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <rp_supporting_tokens_builder.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
+
+/*private functions*/
+
+axis2_status_t AXIS2_CALL
+supporting_tokens_process_alternatives(
+ const axutil_env_t *env,
+ neethi_all_t *all,
+ rp_supporting_tokens_t *supporting_tokens);
+
+
+axis2_bool_t AXIS2_CALL is_token_assertion(
+ const axutil_env_t *env,
+ neethi_assertion_type_t type);
+
+
+/***********************************/
+
+
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+rp_supporting_tokens_builder_build(
+ const axutil_env_t *env,
+ axiom_node_t *node,
+ axiom_element_t *element)
+
+{
+ rp_supporting_tokens_t *supporting_tokens = NULL;
+ neethi_policy_t *policy = NULL;
+ axiom_node_t *child_node = NULL;
+ axiom_element_t *child_element = NULL;
+ axutil_array_list_t *alternatives = NULL;
+ neethi_operator_t *component = NULL;
+ neethi_all_t *all = NULL;
+ neethi_assertion_t *assertion = NULL;
+ axis2_char_t *local_name = NULL;
+
+ supporting_tokens = rp_supporting_tokens_create(env);
+ local_name = axiom_element_get_localname(element, env);
+
+ if(local_name)
+ {
+ if(axutil_strcmp(local_name, RP_SIGNED_SUPPORTING_TOKENS) == 0)
+ {
+ rp_supporting_tokens_set_type(supporting_tokens, env, RP_SUPPORTING_SIGNED_SUPPORTING);
+ }
+ else if(axutil_strcmp(local_name, RP_SIGNED_ENDORSING_SUPPORTING_TOKENS)==0)
+ {
+ rp_supporting_tokens_set_type(supporting_tokens, env, RP_SUPPORTING_SIGNED_ENDORSING_SUPPORTING);
+ }
+ else return NULL;
+ }
+ else return NULL;
+
+ child_node = axiom_node_get_first_element(node,env);
+
+ if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
+ {
+ child_element = (axiom_element_t*)axiom_node_get_data_element(child_node, env);
+ if(child_element)
+ {
+ policy = neethi_engine_get_policy(env, child_node, child_element);
+ if(!policy)
+ {
+ return NULL;
+ }
+ policy = neethi_engine_get_normalize(env, AXIS2_FALSE,policy);
+ alternatives = neethi_policy_get_alternatives(policy, env);
+ component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
+ all = (neethi_all_t *)neethi_operator_get_value(component ,env);
+ supporting_tokens_process_alternatives(env, all, supporting_tokens);
+
+ assertion = neethi_assertion_create(env);
+ neethi_assertion_set_value(assertion, env, supporting_tokens, ASSERTION_TYPE_SUPPORTING_TOKENS);
+ return assertion;
+ }
+ else return NULL;
+ }
+ else return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+supporting_tokens_process_alternatives(
+ const axutil_env_t *env,
+ neethi_all_t *all,
+ rp_supporting_tokens_t *supporting_tokens)
+{
+ neethi_operator_t *operator = NULL;
+ axutil_array_list_t *arraylist = NULL;
+ neethi_assertion_t *assertion = NULL;
+ neethi_assertion_type_t type;
+ void *value = NULL;
+
+ int i = 0;
+
+ arraylist = neethi_all_get_policy_components(all, env);
+
+ for(i=0; i<axutil_array_list_size(arraylist, env); i++)
+ {
+ operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
+ assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
+ value = neethi_assertion_get_value(assertion, env);
+ type = neethi_assertion_get_type(assertion, env);
+
+ if(value)
+ {
+ if(type == ASSERTION_TYPE_ALGORITHM_SUITE)
+ {
+ rp_algorithmsuite_t *algorithmsuite = NULL;
+ algorithmsuite = (rp_algorithmsuite_t *)neethi_assertion_get_value(assertion, env);
+ if(algorithmsuite)
+ {
+ rp_supporting_tokens_set_algorithmsuite(supporting_tokens,env,algorithmsuite);
+ }
+ else return AXIS2_FAILURE;
+ }
+ else if(is_token_assertion(env, type))
+ {
+ rp_property_t *token = NULL;
+ token = rp_property_create(env);
+ rp_token_identifier_set_token(token, assertion, env);
+ rp_supporting_tokens_add_token(supporting_tokens, env, token);
+ }
+ else return AXIS2_FAILURE;
+ }
+ else return AXIS2_FAILURE;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_bool_t AXIS2_CALL is_token_assertion(
+ const axutil_env_t *env,
+ neethi_assertion_type_t type)
+{
+
+ if(type == ASSERTION_TYPE_USERNAME_TOKEN)
+ {
+ return AXIS2_TRUE;
+ }
+ else if(type == ASSERTION_TYPE_X509_TOKEN)
+ {
+ return AXIS2_TRUE;
+ }
+ else return AXIS2_FALSE;
+}
+
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/token_identifier.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/token_identifier.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/token_identifier.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/token_identifier.c Mon Apr 23 21:15:23 2007
@@ -34,7 +34,6 @@
rp_property_t *token,
neethi_assertion_t *assertion,
const axutil_env_t *env)
-
{
void *value = NULL;
neethi_assertion_type_t type;
@@ -49,12 +48,14 @@
rp_username_token_t *username_token = NULL;
username_token = (rp_username_token_t *)value;
rp_property_set_value(token, env, username_token, RP_TOKEN_USERNAME);
+ return AXIS2_SUCCESS;
}
- else if(type = ASSERTION_TYPE_X509_TOKEN)
+ else if(type == ASSERTION_TYPE_X509_TOKEN)
{
rp_x509_token_t *x509_token = NULL;
x509_token = (rp_x509_token_t *)value;
rp_property_set_value(token, env, x509_token, RP_TOKEN_X509);
+ return AXIS2_SUCCESS;
}
else
return AXIS2_FAILURE;
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_binding_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_binding_builder.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_binding_builder.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_binding_builder.c Mon Apr 23 21:15:23 2007
@@ -34,7 +34,7 @@
AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
-transport_binding_builder_build(
+rp_transport_binding_builder_build(
const axutil_env_t *env,
axiom_node_t *node,
axiom_element_t *element)
@@ -43,7 +43,7 @@
rp_transport_binding_t *transport_binding = NULL;
neethi_policy_t *policy = NULL;
axiom_node_t *child_node = NULL;
- axiom_element *child_element = NULL;
+ axiom_element_t *child_element = NULL;
axutil_array_list_t *alternatives = NULL;
neethi_operator_t *component = NULL;
neethi_all_t *all = NULL;
@@ -63,7 +63,7 @@
{
return NULL;
}
- policy = neethi_engine_get_normalize(policy, AXIS2_FALSE, env);
+ policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
alternatives = neethi_policy_get_alternatives(policy, env);
component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
all = (neethi_all_t *)neethi_operator_get_value(component ,env);
@@ -140,6 +140,7 @@
}
else return AXIS2_FAILURE;
}
+ /*
else if(type == ASSERTION_TYPE_SIGNED_SUPPORTING_TOKENS)
{
rp_supporting_tokens_t *signed_supporting_tokens = NULL;
@@ -159,7 +160,8 @@
rp_binding_commons_set_signed_endorsing_supporting_tokens(commons, env, signed_endorsing_supporting_tokens);
}
else return AXIS2_FAILURE;
- }
+ }
+ */
else return AXIS2_FAILURE;
}
else return AXIS2_FAILURE;
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_token_builder.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_token_builder.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/transport_token_builder.c Mon Apr 23 21:15:23 2007
@@ -35,7 +35,7 @@
AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
-transport_token_builder_build(
+rp_transport_token_builder_build(
const axutil_env_t *env,
axiom_node_t *node,
axiom_element_t *element)
@@ -44,7 +44,7 @@
rp_property_t *transport_token = NULL;
neethi_policy_t *policy = NULL;
axiom_node_t *child_node = NULL;
- axiom_element *child_element = NULL;
+ axiom_element_t *child_element = NULL;
axutil_array_list_t *alternatives = NULL;
neethi_operator_t *component = NULL;
neethi_all_t *all = NULL;
@@ -64,8 +64,8 @@
{
return NULL;
}
- policy = neethi_engine_get_normalize(policy, AXIS2_FALSE, env);
- alternatives = policy_get_alternatives(policy, env);
+ policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+ alternatives =neethi_policy_get_alternatives(policy, env);
component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
all = (neethi_all_t *)neethi_operator_get_value(component ,env);
transport_token_process_alternatives(env, all, transport_token);
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/username_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/username_token_builder.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/username_token_builder.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/username_token_builder.c Mon Apr 23 21:15:23 2007
@@ -34,7 +34,7 @@
AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
-username_token_builder_build(
+rp_username_token_builder_build(
const axutil_env_t *env,
axiom_node_t *node,
axiom_element_t *element)
@@ -43,7 +43,7 @@
rp_username_token_t *username_token = NULL;
neethi_policy_t *policy = NULL;
axiom_node_t *child_node = NULL;
- axiom_element *child_element = NULL;
+ axiom_element_t *child_element = NULL;
axutil_array_list_t *alternatives = NULL;
neethi_operator_t *component = NULL;
neethi_all_t *all = NULL;
@@ -73,7 +73,7 @@
{
return NULL;
}
- policy = neethi_engine_get_normalize(policy, AXIS2_FALSE, env);
+ policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
alternatives = neethi_policy_get_alternatives(policy, env);
component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
all = (neethi_all_t *)neethi_operator_get_value(component ,env);
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/wss10_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/wss10_builder.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/wss10_builder.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/builder/wss10_builder.c Mon Apr 23 21:15:23 2007
@@ -34,7 +34,7 @@
AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
-wss10_builder_build(
+rp_wss10_builder_build(
const axutil_env_t *env,
axiom_node_t *node,
axiom_element_t *element)
@@ -43,7 +43,7 @@
rp_wss10_t *wss10 = NULL;
neethi_policy_t *policy = NULL;
axiom_node_t *child_node = NULL;
- axiom_element *child_element = NULL;
+ axiom_element_t *child_element = NULL;
axutil_array_list_t *alternatives = NULL;
neethi_operator_t *component = NULL;
neethi_all_t *all = NULL;
@@ -63,7 +63,7 @@
{
return NULL;
}
- policy = neethi_engine_get_normalize(policy, AXIS2_FALSE, env);
+ policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
alternatives = neethi_policy_get_alternatives(policy, env);
component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
all = (neethi_all_t *)neethi_operator_get_value(component ,env);
Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/model/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/model/Makefile.am?view=auto&rev=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/model/Makefile.am (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/secpolicy/model/Makefile.am Mon Apr 23 21:15:23 2007
@@ -0,0 +1,20 @@
+TESTS =
+
+noinst_LTLIBRARIES = librp_model.la
+
+librp_model_la_SOURCES = algorithmsuite.c asymmetric_binding.c \
+ binding_commons.c header.c element.c https_token.c layout.c \
+ property.c rampart_config.c secpolicy.c security_context_token.c \
+ signed_encrypted_elements.c signed_encrypted_parts.c signed_encrypted_items.c \
+ supporting_tokens.c symmetric_asymmetric_binding_commons.c \
+ symmetric_binding.c transport_binding.c ut.c wss10.c wss11.c x509_token.c
+
+
+librp_model_la_LIBADD = ${AXIS2C_HOME}/lib
+
+
+INCLUDES = -I$(top_builddir)/include \
+ -I ../../../include \
+ -I ../../../../util/include \
+ -I ../../../../axiom/include \
+ -I ../../../../include
Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/test.c?view=diff&rev=531715&r1=531714&r2=531715
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/test.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/test.c Mon Apr 23 21:15:23 2007
@@ -69,7 +69,7 @@
{
neethi_policy_t *normalized = NULL;
printf("Policy object successfuly created\n");
- normalized = neethi_engine_normalize(neethi_policy,NULL,AXIS2_TRUE,env);
+ normalized = neethi_engine_normalize(env, neethi_policy,NULL,AXIS2_TRUE);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org