axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mili...@apache.org
Subject svn commit: r617757 - in /webservices/axis2/trunk/c/neethi: include/ src/ src/secpolicy/builder/ src/secpolicy/model/
Date Sat, 02 Feb 2008 06:27:22 GMT
Author: milinda
Date: Fri Feb  1 22:27:20 2008
New Revision: 617757

URL: http://svn.apache.org/viewvc?rev=617757&view=rev
Log:
Adding IssuedToken and SamlToken assertions support to neethi secpolicy implementation. Tested using example policy file extract from microsoft WS-Trust interop WSDL. Also all the Rampart/C security policy samples were succefull.

Added:
    webservices/axis2/trunk/c/neethi/include/rp_issued_token.h
    webservices/axis2/trunk/c/neethi/include/rp_issued_token_builder.h
    webservices/axis2/trunk/c/neethi/include/rp_saml_token.h
    webservices/axis2/trunk/c/neethi/include/rp_saml_token_builder.h
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/issued_token.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/saml_token.c
Modified:
    webservices/axis2/trunk/c/neethi/include/neethi_assertion.h
    webservices/axis2/trunk/c/neethi/include/rp_builders.h
    webservices/axis2/trunk/c/neethi/include/rp_defines.h
    webservices/axis2/trunk/c/neethi/include/rp_encryption_token_builder.h
    webservices/axis2/trunk/c/neethi/include/rp_property.h
    webservices/axis2/trunk/c/neethi/include/rp_protection_token_builder.h
    webservices/axis2/trunk/c/neethi/include/rp_signature_token_builder.h
    webservices/axis2/trunk/c/neethi/src/assertion.c
    webservices/axis2/trunk/c/neethi/src/assertion_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signature_token_builder.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c

Modified: webservices/axis2/trunk/c/neethi/include/neethi_assertion.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/neethi_assertion.h?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/neethi_assertion.h (original)
+++ webservices/axis2/trunk/c/neethi/include/neethi_assertion.h Fri Feb  1 22:27:20 2008
@@ -47,6 +47,8 @@
         ASSERTION_TYPE_WSS_USERNAME_TOKEN_11,
         ASSERTION_TYPE_USERNAME_TOKEN,
         ASSERTION_TYPE_X509_TOKEN,
+        ASSERTION_TYPE_SAML_TOKEN,
+	ASSERTION_TYPE_ISSUED_TOKEN,
         ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN,
         ASSERTION_TYPE_REQUIRE_EXTERNAL_URI,
         ASSERTION_TYPE_SC10_SECURITY_CONTEXT_TOKEN,
@@ -76,11 +78,18 @@
         ASSERTION_TYPE_REQUIRE_ISSUER_SERIAL_REFERENCE,
         ASSERTION_TYPE_REQUIRE_EMBEDDED_TOKEN_REFERENCE,
         ASSERTION_TYPE_REQUIRE_THUMBPRINT_REFERENCE,
+        ASSERTION_TYPE_REQUIRE_EXTERNAL_REFERENCE,
+	ASSERTION_TYPE_REQUIRE_INTERNAL_REFERENCE,
         ASSERTION_TYPE_MUST_SUPPORT_REF_THUMBPRINT,
         ASSERTION_TYPE_MUST_SUPPORT_REF_ENCRYPTED_KEY,
         ASSERTION_TYPE_REQUIRE_SIGNATURE_CONFIRMATION,
         ASSERTION_TYPE_WSS_X509_V1_TOKEN_10,
         ASSERTION_TYPE_WSS_X509_V3_TOKEN_10,
+        ASSERTION_TYPE_WSS_SAML_V10_TOKEN_V10,
+	ASSERTION_TYPE_WSS_SAML_V10_TOKEN_V11,
+	ASSERTION_TYPE_WSS_SAML_V11_TOKEN_V10,
+	ASSERTION_TYPE_WSS_SAML_V11_TOKEN_V11,
+	ASSERTION_TYPE_WSS_SAML_V20_TOKEN_V11,
         ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS,
         ASSERTION_TYPE_REQUIRE_DERIVED_KEYS,
         ASSERTION_TYPE_MUST_SUPPORT_CLIENT_CHALLENGE,

Modified: webservices/axis2/trunk/c/neethi/include/rp_builders.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_builders.h?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_builders.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_builders.h Fri Feb  1 22:27:20 2008
@@ -33,6 +33,8 @@
 #include <rp_qname_matcher.h>
 #include <rp_https_token_builder.h>
 #include <rp_x509_token_builder.h>
+#include <rp_issued_token_builder.h>
+#include <rp_saml_token_builder.h>
 #include <rp_security_context_token_builder.h>
 #include <rp_bootstrap_policy_builder.h>
 #include <rp_recipient_token_builder.h>

Modified: webservices/axis2/trunk/c/neethi/include/rp_defines.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_defines.h?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_defines.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_defines.h Fri Feb  1 22:27:20 2008
@@ -144,6 +144,8 @@
 
 #define RP_USERNAME_TOKEN "UsernameToken"
 #define RP_X509_TOKEN "X509Token"
+#define RP_SAML_TOKEN "SamlToken"
+#define RP_ISSUED_TOKEN "IssuedToken"
 #define RP_SECURITY_CONTEXT_TOKEN "SecurityContextToken"
 #define RP_SECURE_CONVERSATION_TOKEN "SecureConversationToken"
 #define RP_HTTPS_TOKEN "HttpsToken"
@@ -154,11 +156,15 @@
 #define RP_INCLUDE_ONCE "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Once"
 #define RP_INCLUDE_ALWAYS_TO_RECIPIENT "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"
 
+#define RP_REQUEST_SEC_TOKEN_TEMPLATE "RequestSecurityTokenTemplate"
+    
 #define RP_REQUIRE_KEY_IDENTIFIRE_REFERENCE "RequireKeyIdentifireReference"
 #define RP_REQUIRE_ISSUER_SERIAL_REFERENCE "RequireIssuerSerialReference"
 #define RP_REQUIRE_EMBEDDED_TOKEN_REFERENCE "RequireEmbeddedTokenReference"
 #define RP_REQUIRE_THUMBPRINT_REFERENCE "RequireThumbprintReference"
 #define RP_REQUIRE_DERIVED_KEYS "RequireDerivedKeys"
+#define RP_REQUIRE_EXTERNAL_REFERENCE "RequireExternalReference"
+#define RP_REQUIRE_INTERNAL_REFERENCE "RequireInternalReference"
 #define RP_WSS_X509_V1_TOKEN_10 "WssX509V1Token10"
 #define RP_WSS_X509_V3_TOKEN_10 "WssX509V3Token10"
 #define RP_WSS_X509_PKCS7_TOKEN_10 "WssX509Pkcs7Token10"
@@ -167,9 +173,15 @@
 #define RP_WSS_X509_V3_TOKEN_11 "WssX509V3Token11"
 #define RP_WSS_X509_PKCS7_TOKEN_11 "WssX509Pkcs7Token11"
 #define RP_WSS_X509_PKI_PATH_V1_TOKEN_11 "WssX509PkiPathV1Token11"
-
+    
 #define RP_WSS_USERNAME_TOKEN_10 "WssUsernameToken10"
 #define RP_WSS_USERNAME_TOKEN_11 "WssUsernameToken11"
+    
+#define RP_WSS_SAML_V10_TOKEN_V10 "WssSamlV10Token10"
+#define RP_WSS_SAML_V11_TOKEN_V10 "WssSamlV11Token10"
+#define RP_WSS_SAML_V10_TOKEN_V11 "WssSamlV10Token11"
+#define RP_WSS_SAML_V11_TOKEN_V11 "WssSamlV11Token11"
+#define RP_WSS_SAML_V20_TOKEN_V11 "WssSamlV20Token11"
 
 #define RP_REQUIRE_EXTERNAL_URI_REFERENCE "RequireExternalUriReference"
 #define RP_SC10_SECURITY_CONTEXT_TOKEN "SC10SecurityContextToken"

Modified: webservices/axis2/trunk/c/neethi/include/rp_encryption_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_encryption_token_builder.h?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_encryption_token_builder.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_encryption_token_builder.h Fri Feb  1 22:27:20 2008
@@ -28,6 +28,8 @@
 #include <rp_x509_token.h>
 #include <rp_security_context_token.h>
 #include <neethi_assertion.h>
+#include <rp_issued_token.h>
+#include <rp_saml_token.h>
 
 #ifdef __cplusplus
 extern "C"

Added: webservices/axis2/trunk/c/neethi/include/rp_issued_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_issued_token.h?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_issued_token.h (added)
+++ webservices/axis2/trunk/c/neethi/include/rp_issued_token.h Fri Feb  1 22:27:20 2008
@@ -0,0 +1,124 @@
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef RP_ISSUED_TOKEN_H
+#define RP_ISSUED_TOKEN_H
+
+/** @defgroup trust10
+ * @ingroup trust10
+ * @{
+ */
+
+#include <rp_includes.h>
+#include <axutil_utils.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+	
+	typedef struct rp_issued_token rp_issued_token_t;
+	
+	AXIS2_EXTERN rp_issued_token_t * AXIS2_CALL
+	rp_issued_token_create(
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN void AXIS2_CALL
+	rp_issued_token_free(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN axis2_char_t * AXIS2_CALL
+	rp_issued_token_get_inclusion(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL
+	rp_issued_token_set_inclusion(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env,
+			axis2_char_t *inclusion);
+	
+	AXIS2_EXTERN axiom_node_t * AXIS2_CALL
+	rp_issued_token_get_issuer_epr(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL
+	rp_issued_token_set_issuer_epr(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env,
+			axiom_node_t *issuer_epr);
+	
+	AXIS2_EXTERN axiom_node_t * AXIS2_CALL
+	rp_issued_token_get_requested_sec_token_template(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL
+	rp_issued_token_set_requested_sec_token_template(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env,
+			axiom_node_t *req_sec_token_template);
+	
+	AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+	rp_issued_token_get_derivedkeys(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL
+	rp_issued_token_set_derivedkeys(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env,
+			axis2_bool_t derivedkeys);
+	
+	AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+	rp_issued_token_get_require_external_reference(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL
+	rp_issued_token_set_require_exernal_reference(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env,
+			axis2_bool_t require_external_reference);
+	
+	AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+	rp_issued_token_get_require_internal_reference(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL
+	rp_issued_token_set_require_internal_reference(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env,
+			axis2_bool_t require_internal_reference);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL
+	rp_issued_token_increment_ref(
+			rp_issued_token_t *issued_token,
+			const axutil_env_t *env);
+	
+#ifdef __cplusplus
+}
+#endif
+#endif

Added: webservices/axis2/trunk/c/neethi/include/rp_issued_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_issued_token_builder.h?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_issued_token_builder.h (added)
+++ webservices/axis2/trunk/c/neethi/include/rp_issued_token_builder.h Fri Feb  1 22:27:20 2008
@@ -0,0 +1,50 @@
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef RP_ISSUED_TOKEN_BUILDER_H
+#define RP_ISSUED_TOKEN_BUILDER_H
+
+/** @defgroup trust10
+ * @ingroup trust10
+ * @{
+ */
+
+#include <rp_includes.h>
+#include <rp_issued_token.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+	
+	AXIS2_EXTERN neethi_assertion_t * AXIS2_CALL
+	rp_issued_token_builder_build(const axutil_env_t *env,
+			axiom_node_t *node, axiom_element_t *element);
+	
+	AXIS2_EXTERN axis2_status_t AXIS2_CALL rp_issued_token_builder_process_alternatives(
+			const axutil_env_t *env, neethi_all_t *all,
+			rp_issued_token_t *issued_token);
+	
+#ifdef __cplusplus
+}
+#endif
+#endif

Modified: webservices/axis2/trunk/c/neethi/include/rp_property.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_property.h?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_property.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_property.h Fri Feb  1 22:27:20 2008
@@ -25,6 +25,8 @@
 #include <rp_includes.h>
 #include <rp_username_token.h>
 #include <rp_x509_token.h>
+#include <rp_issued_token.h>
+#include <rp_saml_token.h>
 #include <rp_security_context_token.h>
 #include <rp_https_token.h>
 
@@ -37,6 +39,8 @@
     {
         RP_PROPERTY_USERNAME_TOKEN = 0,
         RP_PROPERTY_X509_TOKEN,
+        RP_PROPERTY_ISSUED_TOKEN,
+        RP_PROPERTY_SAML_TOKEN,
         RP_PROPERTY_SECURITY_CONTEXT_TOKEN,
         RP_PROPERTY_HTTPS_TOKEN,
         RP_PROPERTY_SYMMETRIC_BINDING,

Modified: webservices/axis2/trunk/c/neethi/include/rp_protection_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_protection_token_builder.h?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_protection_token_builder.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_protection_token_builder.h Fri Feb  1 22:27:20 2008
@@ -26,6 +26,8 @@
 #include <rp_includes.h>
 #include <rp_property.h>
 #include <rp_x509_token.h>
+#include <rp_issued_token.h>
+#include <rp_saml_token.h>
 #include <rp_security_context_token.h>
 #include <neethi_assertion.h>
 

Added: webservices/axis2/trunk/c/neethi/include/rp_saml_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_saml_token.h?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_saml_token.h (added)
+++ webservices/axis2/trunk/c/neethi/include/rp_saml_token.h Fri Feb  1 22:27:20 2008
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef RP_SAML_TOKEN_H
+#define RP_SAML_TOKEN_H
+
+#include <rp_includes.h>
+#include <axutil_utils.h>
+#include <neethi_operator.h>
+#include <neethi_policy.h>
+#include <neethi_exactlyone.h>
+#include <neethi_all.h>
+#include <neethi_engine.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+    
+    typedef struct rp_saml_token rp_saml_token_t;
+    
+    AXIS2_EXTERN rp_saml_token_t * AXIS2_CALL
+    rp_saml_token_create(
+        const axutil_env_t *env);
+
+    AXIS2_EXTERN void AXIS2_CALL
+    rp_saml_token_free(
+        rp_saml_token_t *saml_token,
+        const axutil_env_t *env);
+    
+    AXIS2_EXTERN axis2_char_t * AXIS2_CALL
+    rp_saml_token_get_inclusion(
+            rp_saml_token_t *saml_token,
+            const axutil_env_t *env);
+    
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_saml_token_set_inclusion(
+            rp_saml_token_t *saml_token,
+            const axutil_env_t *env,
+            axis2_char_t * inclusion);
+    
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    rp_saml_token_get_derivedkeys(
+                    rp_saml_token_t *saml_token,
+                    const axutil_env_t *env);
+    
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_saml_token_set_derivedkeys(
+                    rp_saml_token_t *saml_token,
+                    const axutil_env_t *env,
+                    axis2_bool_t derivedkeys);
+    
+    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+    rp_saml_token_get_require_key_identifier_reference(
+        rp_saml_token_t * saml_token,
+        const axutil_env_t * env);
+    
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_saml_token_set_require_key_identifier_reference(
+        rp_saml_token_t * saml_token,
+        const axutil_env_t * env,
+        axis2_bool_t require_key_identifier_reference);
+    
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    rp_saml_token_get_token_version_and_type(
+        rp_saml_token_t * saml_token,
+        const axutil_env_t * env);
+    
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_saml_token_set_token_version_and_type(
+        rp_saml_token_t * saml_token,
+        const axutil_env_t * env,
+        axis2_char_t * token_version_and_type);
+    
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    rp_saml_token_increment_ref(
+        rp_saml_token_t * saml_token,
+        const axutil_env_t * env);
+    
+    
+#ifdef __cplusplus
+}
+#endif
+#endif

Added: webservices/axis2/trunk/c/neethi/include/rp_saml_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_saml_token_builder.h?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_saml_token_builder.h (added)
+++ webservices/axis2/trunk/c/neethi/include/rp_saml_token_builder.h Fri Feb  1 22:27:20 2008
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef RP_SAML_TOKEN_BUILDER_H
+#define RP_SAML_TOKEN_BUILDER_H
+
+/** @defgroup rp_saml_token_builder
+ * @ingroup rp_saml_token_builder
+ * @{
+ */
+
+#include <rp_includes.h>
+#include <rp_property.h>
+#include <rp_saml_token.h>
+#include <neethi_assertion.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+    AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+    rp_saml_token_builder_build(
+        const axutil_env_t * env,
+        axiom_node_t * node,
+        axiom_element_t * element);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Modified: webservices/axis2/trunk/c/neethi/include/rp_signature_token_builder.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/rp_signature_token_builder.h?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/rp_signature_token_builder.h (original)
+++ webservices/axis2/trunk/c/neethi/include/rp_signature_token_builder.h Fri Feb  1 22:27:20 2008
@@ -26,6 +26,8 @@
 #include <rp_includes.h>
 #include <rp_property.h>
 #include <rp_x509_token.h>
+#include <rp_issued_token.h>
+#include <rp_saml_token.h>
 #include <rp_security_context_token.h>
 #include <neethi_assertion.h>
 

Modified: webservices/axis2/trunk/c/neethi/src/assertion.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/assertion.c?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/assertion.c (original)
+++ webservices/axis2/trunk/c/neethi/src/assertion.c Fri Feb  1 22:27:20 2008
@@ -31,6 +31,8 @@
 #include <rp_signed_encrypted_parts.h>
 #include <rp_symmetric_binding.h>
 #include <rp_transport_binding.h>
+#include <rp_saml_token.h>
+#include <rp_issued_token.h>
 
 struct neethi_assertion_t
 {
@@ -200,6 +202,15 @@
     {
         rp_rampart_config_increment_ref((rp_rampart_config_t *) value, env);
     }
+    if (type == ASSERTION_TYPE_ISSUED_TOKEN)
+    {
+        rp_issued_token_increment_ref((rp_issued_token_t *) value, env);
+    }
+    if (type == ASSERTION_TYPE_SAML_TOKEN)
+    {
+        rp_saml_token_increment_ref((rp_saml_token_t *) value, env);
+    }
+    
     neethi_assertion->value = value;
     neethi_assertion->type = type;
     neethi_assertion->element = NULL;

Modified: webservices/axis2/trunk/c/neethi/src/assertion_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/assertion_builder.c?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/assertion_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/assertion_builder.c Fri Feb  1 22:27:20 2008
@@ -697,6 +697,122 @@
         else
             return NULL;
     }
+    else if (axutil_strcmp(localname, RP_REQUIRE_EXTERNAL_REFERENCE) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_REQUIRE_EXTERNAL_REFERENCE, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_REQUIRE_EXTERNAL_REFERENCE);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_REQUIRE_INTERNAL_REFERENCE) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_REQUIRE_INTERNAL_REFERENCE, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_REQUIRE_INTERNAL_REFERENCE);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_ISSUED_TOKEN) == 0)
+    {
+        if (rp_match_secpolicy_qname(env, RP_ISSUED_TOKEN, node, element))
+        {
+            return rp_issued_token_builder_build(env, node, element);
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_SAML_TOKEN) == 0)
+    {
+        if (rp_match_secpolicy_qname(env, RP_SAML_TOKEN, node, element))
+        {
+            return rp_saml_token_builder_build(env, node, element);
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_WSS_SAML_V10_TOKEN_V10) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_WSS_SAML_V10_TOKEN_V10, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_WSS_SAML_V10_TOKEN_V10);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_WSS_SAML_V10_TOKEN_V11) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_WSS_SAML_V10_TOKEN_V11, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_WSS_SAML_V10_TOKEN_V11);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_WSS_SAML_V11_TOKEN_V10) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_WSS_SAML_V11_TOKEN_V10, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_WSS_SAML_V11_TOKEN_V10);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_WSS_SAML_V11_TOKEN_V11) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_WSS_SAML_V11_TOKEN_V11, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_WSS_SAML_V11_TOKEN_V11);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else if (axutil_strcmp(localname, RP_WSS_SAML_V20_TOKEN_V11) == 0)
+    {
+        if (rp_match_secpolicy_qname
+            (env, RP_WSS_SAML_V20_TOKEN_V11, node, element))
+        {
+            neethi_assertion_t *assertion = NULL;
+            assertion = neethi_assertion_create(env);
+            neethi_assertion_set_value(assertion, env, NULL,
+                                       ASSERTION_TYPE_WSS_SAML_V20_TOKEN_V11);
+            return assertion;
+        }
+        else
+            return NULL;
+    }
     else
     {
         AXIS2_ERROR_SET(env->error,

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/Makefile.am Fri Feb  1 22:27:20 2008
@@ -12,7 +12,8 @@
 						   recipient_token_builder.c signed_encrypted_parts_builder.c secpolicy_builder.c \
 						   symmetric_binding_builder.c protection_token_builder.c signature_token_builder.c \
 						   encryption_token_builder.c wss11_builder.c trust10_builder.c \
-						   bootstrap_policy_builder.c security_context_token_builder.c
+						   bootstrap_policy_builder.c security_context_token_builder.c \
+						   issued_token_builder.c saml_token_builder.c
 
 librp_builder_la_LIBADD  = ../../../../axiom/src/om/libaxis2_axiom.la \
 				../../../../util/src/libaxutil.la

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/encryption_token_builder.c Fri Feb  1 22:27:20 2008
@@ -140,6 +140,28 @@
                 else
                     return AXIS2_FAILURE;
             }
+            else if(type == ASSERTION_TYPE_ISSUED_TOKEN)
+            {
+                rp_issued_token_t *issued_token = NULL;
+                issued_token = (rp_issued_token_t *)neethi_assertion_get_value(assertion, env);
+                if(issued_token)
+                {
+                    rp_property_set_value(encryption_token, env, issued_token, RP_PROPERTY_ISSUED_TOKEN);
+                }
+                else
+                    return AXIS2_FAILURE;
+            }
+            else if(type == ASSERTION_TYPE_SAML_TOKEN)
+            {
+                rp_saml_token_t *saml_token = NULL;
+                saml_token = (rp_saml_token_t *)neethi_assertion_get_value(assertion, env);
+                if(saml_token)
+                {
+                    rp_property_set_value(encryption_token, env, saml_token, RP_PROPERTY_SAML_TOKEN);
+                }
+                else
+                    return AXIS2_FAILURE;
+            }
             else if (type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
             {
                 rp_security_context_token_t *security_context_token = NULL;

Added: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c (added)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/issued_token_builder.c Fri Feb  1 22:27:20 2008
@@ -0,0 +1,159 @@
+/*
+ * 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_issued_token_builder.h>
+
+AXIS2_EXTERN neethi_assertion_t * AXIS2_CALL
+rp_issued_token_builder_build(const axutil_env_t *env,
+		axiom_node_t *node, 
+		axiom_element_t *element) 
+{
+	rp_issued_token_t *issued_token= NULL;
+	neethi_policy_t *policy= NULL;
+	neethi_policy_t *normalized_policy= NULL;
+	neethi_all_t *all= NULL;
+	axutil_array_list_t *alternatives= NULL;
+	neethi_operator_t *component= NULL;
+	axis2_char_t *inclusoin_value= NULL;
+	axutil_qname_t *qname= NULL;
+	axiom_node_t *issuer_node= NULL;
+	axiom_element_t *issuer_ele= NULL;
+	axiom_element_t *issuer_first_child_ele= NULL;
+	axiom_node_t *issuer_first_child_node= NULL;
+	axiom_node_t *req_sec_tok_template_node= NULL;
+	axiom_element_t *req_sec_tok_template_ele= NULL;
+	axiom_node_t *policy_node= NULL;
+	axiom_element_t *policy_ele= NULL;
+	neethi_assertion_t *assertion= NULL;
+
+	issued_token = rp_issued_token_create(env);
+	qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS, RP_SP_PREFIX);
+
+	inclusoin_value = axiom_element_get_attribute_value(element, env, qname);
+
+	axutil_qname_free(qname, env);
+	qname = NULL;
+
+	if (inclusoin_value) 
+	{
+		rp_issued_token_set_inclusion(issued_token, env, inclusoin_value);
+	}
+
+	qname = axutil_qname_create(env, RP_ISSUER, RP_SP_NS, RP_SP_PREFIX);
+	issuer_ele = axiom_element_get_first_child_with_qname(element, env, qname,
+			node, &issuer_node);
+	if (issuer_ele) 
+	{
+		issuer_first_child_ele = axiom_element_get_first_element(issuer_ele,
+				env, issuer_node, &issuer_first_child_node);
+		if (issuer_first_child_ele) 
+		{
+			rp_issued_token_set_issuer_epr(issued_token, env,
+					issuer_first_child_node);
+		}
+	}
+	axutil_qname_free(qname, env);
+	qname = NULL;
+
+	qname = axutil_qname_create(env, RP_REQUEST_SEC_TOKEN_TEMPLATE, RP_SP_NS,
+			RP_SP_PREFIX);
+	req_sec_tok_template_ele = axiom_element_get_first_child_with_qname(
+			element, env, qname, node, &req_sec_tok_template_node);
+	if (req_sec_tok_template_ele) 
+	{
+		rp_issued_token_set_requested_sec_token_template(issued_token, env,
+				req_sec_tok_template_node);
+	} 
+	else 
+	{
+		return NULL;
+	}
+
+	axutil_qname_free(qname, env);
+	qname = NULL;
+
+	qname = axutil_qname_create(env, RP_POLICY, RP_POLICY_NS, RP_POLICY_PREFIX);
+	policy_ele = axiom_element_get_first_child_with_qname(element, env, qname,
+			node, &policy_node);
+	if (policy_ele) 
+	{
+		policy = neethi_engine_get_policy(env, policy_node, policy_ele);
+		if (!policy)
+		{
+			return NULL;
+		}
+		normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE,
+				policy);
+		neethi_policy_free(policy, env);
+		policy = NULL;
+		alternatives = neethi_policy_get_alternatives(normalized_policy, env);
+		component = (neethi_operator_t *) axutil_array_list_get(alternatives,
+				env, 0);
+		all = (neethi_all_t *) neethi_operator_get_value(component, env);
+		if(AXIS2_FAILURE == rp_issued_token_builder_process_alternatives(env, all, issued_token))
+			return NULL;
+		assertion = neethi_assertion_create_with_args(env,
+				(void *) rp_issued_token_free, issued_token,
+				ASSERTION_TYPE_ISSUED_TOKEN);
+
+		neethi_policy_free(normalized_policy, env);
+		normalized_policy = NULL;
+
+		return assertion;
+	} 
+	
+	return NULL;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL rp_issued_token_builder_process_alternatives(
+		const axutil_env_t *env, neethi_all_t *all,
+		rp_issued_token_t *issued_token) {
+	neethi_operator_t *operator= NULL;
+	axutil_array_list_t *arraylist= NULL;
+	neethi_assertion_t *assertion= NULL;
+	neethi_assertion_type_t type;
+
+	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);
+		type = neethi_assertion_get_type(assertion, env);
+
+		if (type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS) 
+		{
+			rp_issued_token_set_derivedkeys(issued_token, env, AXIS2_TRUE);
+		} 
+		else if (type == ASSERTION_TYPE_REQUIRE_EXTERNAL_REFERENCE)
+		{
+			rp_issued_token_set_require_exernal_reference(issued_token, env, AXIS2_TRUE);
+		}
+		else if (type == ASSERTION_TYPE_REQUIRE_INTERNAL_REFERENCE)
+		{
+			rp_issued_token_set_require_internal_reference(issued_token, env, AXIS2_TRUE);			
+		}
+		else
+			return AXIS2_FAILURE;
+	}
+	return AXIS2_SUCCESS;
+}
+

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/protection_token_builder.c Fri Feb  1 22:27:20 2008
@@ -140,6 +140,28 @@
                 else
                     return AXIS2_FAILURE;
             }
+            else if(type == ASSERTION_TYPE_ISSUED_TOKEN)
+            {
+                rp_issued_token_t *issued_token = NULL;
+                issued_token = (rp_issued_token_t *)neethi_assertion_get_value(assertion, env);
+                if(issued_token)
+                {
+                    rp_property_set_value(protection_token, env, issued_token, RP_PROPERTY_ISSUED_TOKEN);
+                }
+                else
+                    return AXIS2_FAILURE;
+            }
+            else if(type == ASSERTION_TYPE_SAML_TOKEN)
+            {
+                rp_saml_token_t *saml_token = NULL;
+                saml_token = (rp_saml_token_t *)neethi_assertion_get_value(assertion, env);
+                if(saml_token)
+                {
+                    rp_property_set_value(protection_token, env, saml_token, RP_PROPERTY_SAML_TOKEN);
+                }
+                else
+                    return AXIS2_FAILURE;
+            }
             else if (type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
             {
                 rp_security_context_token_t *security_context_token = NULL;

Added: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c (added)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/saml_token_builder.c Fri Feb  1 22:27:20 2008
@@ -0,0 +1,155 @@
+/*
+ * 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_saml_token_builder.h>
+
+axis2_status_t AXIS2_CALL saml_token_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_saml_token_t * saml_token);
+
+AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
+    rp_saml_token_builder_build(
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axiom_element_t * element)
+{
+    rp_saml_token_t *saml_token = NULL;
+    axis2_char_t *inclusion_value = 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;
+    axutil_qname_t *qname = NULL;
+    neethi_assertion_t *assertion = NULL;
+    neethi_policy_t *normalized_policy = NULL;
+    
+    saml_token = rp_saml_token_create(env);
+    qname = axutil_qname_create(env, RP_INCLUDE_TOKEN, RP_SP_NS, RP_SP_PREFIX);
+
+    inclusion_value = axiom_element_get_attribute_value(element, env, qname);
+
+    axutil_qname_free(qname, env);
+    qname = NULL;
+
+    rp_saml_token_set_inclusion(saml_token, env, inclusion_value);
+    
+    child_node = axiom_node_get_first_element(node, env);
+    if (!child_node)
+    {
+        return NULL;
+    }
+
+    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;
+            }
+            normalized_policy =
+                neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
+            neethi_policy_free(policy, env);
+            policy = NULL;
+            alternatives =
+                neethi_policy_get_alternatives(normalized_policy, env);
+            component =
+                (neethi_operator_t *) axutil_array_list_get(alternatives, env,
+                                                            0);
+            all = (neethi_all_t *) neethi_operator_get_value(component, env);
+            saml_token_process_alternatives(env, all, saml_token);
+
+            assertion =
+                neethi_assertion_create_with_args(env,
+                                                  (void *) rp_saml_token_free,
+                                                  saml_token,
+                                                  ASSERTION_TYPE_SAML_TOKEN);
+
+            neethi_policy_free(normalized_policy, env);
+            normalized_policy = NULL;
+
+            return assertion;
+        }
+        else
+            return NULL;
+    }
+    else
+        return NULL;
+}
+
+axis2_status_t AXIS2_CALL saml_token_process_alternatives(
+    const axutil_env_t * env,
+    neethi_all_t * all,
+    rp_saml_token_t * saml_token)
+{
+    neethi_operator_t *operator = NULL;
+    axutil_array_list_t *arraylist = NULL;
+    neethi_assertion_t *assertion = NULL;
+    neethi_assertion_type_t type;
+
+    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);
+        type = neethi_assertion_get_type(assertion, env);
+        
+        if(type == ASSERTION_TYPE_REQUIRE_DERIVED_KEYS)
+        {
+            rp_saml_token_set_derivedkeys(saml_token, env, AXIS2_TRUE);
+        }
+        else if (type == ASSERTION_TYPE_REQUIRE_KEY_IDENTIFIRE_REFERENCE)
+        {
+            rp_saml_token_set_require_key_identifier_reference(saml_token, env,
+                                                               AXIS2_TRUE);
+        }
+        else if(type == ASSERTION_TYPE_WSS_SAML_V10_TOKEN_V10)
+        {
+            rp_saml_token_set_token_version_and_type(saml_token, env, RP_WSS_SAML_V10_TOKEN_V10);
+        }
+        else if(type == ASSERTION_TYPE_WSS_SAML_V10_TOKEN_V11)
+        {
+            rp_saml_token_set_token_version_and_type(saml_token, env, RP_WSS_SAML_V10_TOKEN_V11);
+        }
+        else if(type == ASSERTION_TYPE_WSS_SAML_V11_TOKEN_V10)
+        {
+            rp_saml_token_set_token_version_and_type(saml_token, env,RP_WSS_SAML_V11_TOKEN_V10);
+        }
+        else if(type == ASSERTION_TYPE_WSS_SAML_V11_TOKEN_V11)
+        {
+            rp_saml_token_set_token_version_and_type(saml_token, env, RP_WSS_SAML_V11_TOKEN_V11);
+        }
+        else if(type == ASSERTION_TYPE_WSS_SAML_V20_TOKEN_V11)
+        {
+            rp_saml_token_set_token_version_and_type(saml_token, env, RP_WSS_SAML_V20_TOKEN_V11);
+        }
+        else
+            return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signature_token_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signature_token_builder.c?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signature_token_builder.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/builder/signature_token_builder.c Fri Feb  1 22:27:20 2008
@@ -140,6 +140,28 @@
                 else
                     return AXIS2_FAILURE;
             }
+            else if(type == ASSERTION_TYPE_ISSUED_TOKEN)
+            {
+                rp_issued_token_t *issued_token = NULL;
+                issued_token = (rp_issued_token_t *)neethi_assertion_get_value(assertion, env);
+                if(issued_token)
+                {
+                    rp_property_set_value(signature_token, env, issued_token, RP_PROPERTY_ISSUED_TOKEN);
+                }
+                else
+                    return AXIS2_FAILURE;
+            }
+            else if(type == ASSERTION_TYPE_SAML_TOKEN)
+            {
+                rp_saml_token_t *saml_token = NULL;
+                saml_token = (rp_saml_token_t *)neethi_assertion_get_value(assertion, env);
+                if(saml_token)
+                {
+                    rp_property_set_value(signature_token, env, saml_token, RP_PROPERTY_SAML_TOKEN);
+                }
+                else
+                    return AXIS2_FAILURE;
+            }
             else if (type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
             {
                 rp_security_context_token_t *security_context_token = NULL;

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/Makefile.am Fri Feb  1 22:27:20 2008
@@ -8,7 +8,7 @@
 							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 \
-							trust10.c
+							trust10.c issued_token.c saml_token.c
 
 
 librp_model_la_LIBADD  = ../../../../util/src/libaxutil.la

Added: webservices/axis2/trunk/c/neethi/src/secpolicy/model/issued_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/issued_token.c?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/issued_token.c (added)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/issued_token.c Fri Feb  1 22:27:20 2008
@@ -0,0 +1,211 @@
+
+/*
+ * 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_issued_token.h>
+
+struct rp_issued_token {
+	axis2_char_t *inclusion;
+	axiom_node_t *issuer_epr;
+	axiom_node_t *requested_sec_token_template;
+	axis2_bool_t derivedkeys;
+	axis2_bool_t require_external_reference;
+	axis2_bool_t require_internal_reference;
+	int ref;
+};
+
+AXIS2_EXTERN rp_issued_token_t * AXIS2_CALL
+rp_issued_token_create(
+		const axutil_env_t *env)
+{
+	rp_issued_token_t *issued_token = NULL;
+	
+	issued_token = (rp_issued_token_t*)AXIS2_MALLOC(env->allocator, sizeof(rp_issued_token_t));
+	
+	if (issued_token == NULL)
+	{
+		AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+	    return NULL;
+	}
+	
+	issued_token->inclusion = NULL;
+	issued_token->issuer_epr = NULL;
+	issued_token->requested_sec_token_template = NULL;
+	issued_token->derivedkeys = AXIS2_FALSE;
+	issued_token->require_external_reference = AXIS2_FALSE;
+	issued_token->require_internal_reference = AXIS2_FALSE;
+	issued_token->ref = 0;
+	
+	return issued_token;	
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+rp_issued_token_free(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	if(issued_token)
+	{
+		if(--(issued_token->ref) > 0)
+		{
+			return;
+		}
+		
+		AXIS2_FREE(env->allocator, issued_token);
+		issued_token = NULL;
+	}
+	return;
+}
+
+AXIS2_EXTERN axis2_char_t * AXIS2_CALL
+rp_issued_token_get_inclusion(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	return issued_token->inclusion;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_set_inclusion(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env,
+		axis2_char_t *inclusion)
+{
+	if(inclusion)
+	{
+		issued_token->inclusion = inclusion;
+		return AXIS2_SUCCESS;		
+	}
+	
+	return AXIS2_FAILURE;
+}
+
+AXIS2_EXTERN axiom_node_t * AXIS2_CALL
+rp_issued_token_get_issuer_epr(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	return issued_token->issuer_epr;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_set_issuer_epr(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env,
+		axiom_node_t *issuer_epr)
+{
+	if(issuer_epr)
+	{
+		issued_token->issuer_epr = issuer_epr;
+		return AXIS2_SUCCESS;
+	}
+	
+	return AXIS2_FAILURE;
+}
+
+AXIS2_EXTERN axiom_node_t * AXIS2_CALL
+rp_issued_token_get_requested_sec_token_template(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	return issued_token->requested_sec_token_template;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_set_requested_sec_token_template(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env,
+		axiom_node_t *req_sec_token_template)
+{
+	if(req_sec_token_template)
+	{
+		issued_token->requested_sec_token_template = req_sec_token_template;
+		return AXIS2_SUCCESS;
+	}
+	
+	return AXIS2_FAILURE;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_issued_token_get_derivedkeys(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	return issued_token->derivedkeys;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_set_derivedkeys(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env,
+		axis2_bool_t derivedkeys)
+{
+	AXIS2_PARAM_CHECK(env->error, derivedkeys, AXIS2_FAILURE);
+	issued_token->derivedkeys = derivedkeys;
+	
+	return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_issued_token_get_require_external_reference(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	return issued_token->require_external_reference;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_set_require_exernal_reference(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env,
+		axis2_bool_t require_external_reference)
+{
+	AXIS2_PARAM_CHECK(env->error, require_external_reference, AXIS2_FAILURE);
+	issued_token->require_external_reference = require_external_reference;
+	
+	return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_issued_token_get_require_internal_reference(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	return issued_token->require_internal_reference;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_set_require_internal_reference(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env,
+		axis2_bool_t require_internal_reference)
+{
+	AXIS2_PARAM_CHECK(env->error, require_internal_reference, AXIS2_FAILURE);
+	issued_token->require_internal_reference = require_internal_reference;
+	
+	return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_issued_token_increment_ref(
+		rp_issued_token_t *issued_token,
+		const axutil_env_t *env)
+{
+	issued_token->ref++;
+	return AXIS2_SUCCESS;
+}
+

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c?rev=617757&r1=617756&r2=617757&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c Fri Feb  1 22:27:20 2008
@@ -82,6 +82,16 @@
                 rp_x509_token_free((rp_x509_token_t *) property->value, env);
                 property->value = NULL;
                 break;
+                
+            case RP_PROPERTY_ISSUED_TOKEN:
+                rp_issued_token_free((rp_issued_token_t *)property->value, env);
+                property->value = NULL;
+                break;
+
+            case RP_PROPERTY_SAML_TOKEN:
+                rp_saml_token_free((rp_saml_token_t *)property->value, env);
+                property->value = NULL;
+            break;
 
             case RP_PROPERTY_SECURITY_CONTEXT_TOKEN:
                 rp_security_context_token_free((rp_security_context_token_t *)

Added: webservices/axis2/trunk/c/neethi/src/secpolicy/model/saml_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/saml_token.c?rev=617757&view=auto
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/saml_token.c (added)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/saml_token.c Fri Feb  1 22:27:20 2008
@@ -0,0 +1,163 @@
+/*
+ * 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_saml_token.h>
+
+struct rp_saml_token
+{
+    axis2_char_t *inclusion;
+    axis2_bool_t derivedkeys;
+    axis2_bool_t require_key_identifier_reference;
+    axis2_char_t *token_version_and_type;
+    int ref;
+};
+
+AXIS2_EXTERN rp_saml_token_t * AXIS2_CALL
+rp_saml_token_create(
+    const axutil_env_t *env)
+{
+    rp_saml_token_t * saml_token;
+    
+    saml_token = (rp_saml_token_t*)AXIS2_MALLOC(env->allocator, sizeof(rp_saml_token_t));
+    
+    if (saml_token == NULL)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    saml_token->inclusion = NULL;
+    saml_token->derivedkeys = AXIS2_FALSE;
+    saml_token->require_key_identifier_reference = AXIS2_FALSE;
+    saml_token->token_version_and_type = NULL;
+    saml_token->ref = 0;
+    
+    return saml_token;    
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+rp_saml_token_free(
+    rp_saml_token_t *saml_token,
+    const axutil_env_t *env)
+{
+    if(saml_token)
+    {
+        if(--(saml_token->ref) > 0)
+        {
+            return;
+        }
+        
+        AXIS2_FREE(env->allocator, saml_token);
+        saml_token = NULL;
+    }
+    
+    return;
+}
+
+AXIS2_EXTERN axis2_char_t * AXIS2_CALL
+rp_saml_token_get_inclusion(
+        rp_saml_token_t *saml_token,
+        const axutil_env_t *env)
+{
+    return saml_token->inclusion;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_saml_token_set_inclusion(
+        rp_saml_token_t *saml_token,
+        const axutil_env_t *env,
+        axis2_char_t * inclusion)
+{
+    AXIS2_PARAM_CHECK(env->error, inclusion, AXIS2_FAILURE);
+    saml_token->inclusion = inclusion;
+    
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_saml_token_get_derivedkeys(
+		rp_saml_token_t *saml_token,
+		const axutil_env_t *env)
+{
+	return saml_token->derivedkeys;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_saml_token_set_derivedkeys(
+		rp_saml_token_t *saml_token,
+		const axutil_env_t *env,
+		axis2_bool_t derivedkeys)
+{
+	AXIS2_PARAM_CHECK(env->error, derivedkeys, AXIS2_FAILURE);
+	saml_token->derivedkeys = derivedkeys;
+	
+	return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+rp_saml_token_get_require_key_identifier_reference(
+    rp_saml_token_t * saml_token,
+    const axutil_env_t * env)
+{
+    return saml_token->require_key_identifier_reference;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_saml_token_set_require_key_identifier_reference(
+    rp_saml_token_t * saml_token,
+    const axutil_env_t * env,
+    axis2_bool_t require_key_identifier_reference)
+{
+    AXIS2_PARAM_CHECK(env->error, require_key_identifier_reference,
+                      AXIS2_FAILURE);
+    saml_token->require_key_identifier_reference =
+        require_key_identifier_reference;
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+rp_saml_token_get_token_version_and_type(
+    rp_saml_token_t * saml_token,
+    const axutil_env_t * env)
+{
+    return saml_token->token_version_and_type;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_saml_token_set_token_version_and_type(
+    rp_saml_token_t * saml_token,
+    const axutil_env_t * env,
+    axis2_char_t * token_version_and_type)
+{
+    AXIS2_PARAM_CHECK(env->error, token_version_and_type, AXIS2_FAILURE);
+
+    saml_token->token_version_and_type = token_version_and_type;
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+rp_saml_token_increment_ref(
+    rp_saml_token_t * saml_token,
+    const axutil_env_t * env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    saml_token->ref++;
+    return AXIS2_SUCCESS;
+}
+
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message