[prev in list] [next in list] [prev in thread] [next in thread]
List: wsf-c-commits
Subject: [Wsf-c-commits] svn commit r16253 - trunk/wsf/php/src
From: svn () wso2 ! org
Date: 2008-04-28 9:56:10
Message-ID: E1JqQ5i-0002yw-88 () wso2 ! org
[Download RAW message or body]
Author: dimuthu
Date: Mon Apr 28 02:56:04 2008
New Revision: 16253
Log:
Adding custom token support
Modified:
trunk/wsf/php/src/wsf.c
trunk/wsf/php/src/wsf_policy.c
trunk/wsf/php/src/wsf_policy.h
Modified: trunk/wsf/php/src/wsf.c
==============================================================================
--- trunk/wsf/php/src/wsf.c (original)
+++ trunk/wsf/php/src/wsf.c Mon Apr 28 02:56:04 2008
@@ -1618,6 +1618,10 @@
WSF_GET_THIS (object);
if (options) {
HashTable * ht = Z_ARRVAL_P (options);
+ if (zend_hash_find (ht, WS_CUSTOM_TOKENS, sizeof (WS_CUSTOM_TOKENS),
+ (void **) &tmp) == SUCCESS && Z_TYPE_PP (tmp) == IS_ARRAY) {
+ add_property_zval (object, WS_CUSTOM_TOKENS, *tmp);
+ }
if (zend_hash_find (ht, WS_USER, sizeof (WS_USER),
(void **) &tmp) == SUCCESS && Z_TYPE_PP (tmp) == IS_STRING) {
add_property_stringl (object, WS_USER, Z_STRVAL_PP (tmp),
Modified: trunk/wsf/php/src/wsf_policy.c
==============================================================================
--- trunk/wsf/php/src/wsf_policy.c (original)
+++ trunk/wsf/php/src/wsf_policy.c Mon Apr 28 02:56:04 2008
@@ -475,6 +475,42 @@
&& Z_TYPE_PP (token_val) == IS_STRING) {
tmp_rampart_ctx.callback_function = Z_STRVAL_PP (token_val);
}
+ if (zend_hash_find (ht_token, WS_CUSTOM_TOKENS,
+ sizeof (WS_CUSTOM_TOKENS), (void **) &token_val) == SUCCESS
+ && Z_TYPE_PP (token_val) == IS_ARRAY) {
+
+ zval **tmp;
+ HashPosition pos;
+ axutil_array_list_t *custom_tokens = NULL;
+ HashTable *ht_custom_tokens = NULL;
+
+ /* custom token hash */
+ ht_custom_tokens = Z_ARRVAL_PP(token_val);
+ /* initialize the tokens array */
+ custom_tokens = axutil_array_list_create(env, 10);
+ /* reset the hash pointer to start */
+ zend_hash_internal_pointer_reset_ex (ht_custom_tokens, &pos);
+ /* loop through each element */
+ while(zend_hash_get_current_data_ex(ht_custom_tokens, (void**)&tmp, &pos) != FAILURE){
+ if(Z_TYPE_PP (tmp) == IS_STRING) {
+ axis2_char_t *custom_token = NULL;
+ axiom_node_t *custom_token_node = NULL;
+
+ custom_token = Z_STRVAL_PP(tmp);
+
+ AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI,
+ "[wsf_sec_policy] custom token: %s ", custom_token);
+
+ custom_token_node = wsf_util_deserialize_buffer(env, custom_token);
+ if(custom_token_node) {
+ axutil_array_list_add(custom_tokens, env, (void*)custom_token_node);
+ }
+ }
+ zend_hash_move_forward_ex (ht_custom_tokens, &pos);
+ }
+
+ tmp_rampart_ctx.custom_tokens = custom_tokens;
+ }
return tmp_rampart_ctx;
}
@@ -542,6 +578,11 @@
AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI,
"[wsf_sec_policy]setting callback function");
+ if (rampart_context_set_custom_tokens(x_rampart_ctx, env,
+ token_ctx.custom_tokens) == AXIS2_SUCCESS)
+ AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI,
+ "[wsf_sec_policy]setting custom tokens");
+
return AXIS2_SUCCESS;
}
Modified: trunk/wsf/php/src/wsf_policy.h
==============================================================================
--- trunk/wsf/php/src/wsf_policy.h (original)
+++ trunk/wsf/php/src/wsf_policy.h Mon Apr 28 02:56:04 2008
@@ -43,6 +43,7 @@
#define WS_UT "useUsernameToken"
#define WS_TOKEN_REFERENCE "securityTokenReference"
#define WS_ENCRYPT_SIGNATURE "encryptSignature"
+#define WS_CUSTOM_TOKENS "customTokens"
#define WS_DEFAULT_TOKEN_VAL "X509"
#define WS_X509_TOKEN_VAL "X509Token"
@@ -109,7 +110,7 @@
char *receiverCertificateFormat;
int ttl;
char *callback_function;
-
+ axutil_array_list_t *custom_tokens;
}
tokenProperties_t;
_______________________________________________
Wsf-c-commits mailing list
Wsf-c-commits@wso2.org
http://www.wso2.org/cgi-bin/mailman/listinfo/wsf-c-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic