You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by sh...@apache.org on 2008/01/25 13:28:44 UTC

svn commit: r615202 - in /webservices/rampart/trunk/c: include/rampart_config.h include/rampart_constants.h src/util/rampart_config.c src/util/rampart_engine.c

Author: shankar
Date: Fri Jan 25 04:28:44 2008
New Revision: 615202

URL: http://svn.apache.org/viewvc?rev=615202&view=rev
Log:
rampart config support to get the configuration from client code. 

Modified:
    webservices/rampart/trunk/c/include/rampart_config.h
    webservices/rampart/trunk/c/include/rampart_constants.h
    webservices/rampart/trunk/c/src/util/rampart_config.c
    webservices/rampart/trunk/c/src/util/rampart_engine.c

Modified: webservices/rampart/trunk/c/include/rampart_config.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_config.h?rev=615202&r1=615201&r2=615202&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_config.h (original)
+++ webservices/rampart/trunk/c/include/rampart_config.h Fri Jan 25 04:28:44 2008
@@ -73,7 +73,7 @@
 
 
     AXIS2_EXTERN axis2_status_t AXIS2_CALL
-    rampart_config_set_user(rampart_config_t *rampart_config,
+    rampart_config_set_username(rampart_config_t *rampart_config,
                              const axutil_env_t *env,
                              axis2_char_t *user);
 
@@ -94,7 +94,7 @@
 
 
     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
-    rampart_config_get_user(
+    rampart_config_get_username(
         rampart_config_t *rampart_config,
         const axutil_env_t *env);
 

Modified: webservices/rampart/trunk/c/include/rampart_constants.h
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/include/rampart_constants.h?rev=615202&r1=615201&r2=615202&view=diff
==============================================================================
--- webservices/rampart/trunk/c/include/rampart_constants.h (original)
+++ webservices/rampart/trunk/c/include/rampart_constants.h Fri Jan 25 04:28:44 2008
@@ -95,6 +95,7 @@
 #define RAMPART_PASSWORD_TEXT                       "plainText"
 #define RAMPART_PASSWORD_DIGEST                     "Digest"
 #define RAMPART_CONFIGURATION                       "RampartConfiguration"
+#define RAMPART_CLIENT_CONFIGURATION                "RampartClientConfiguration"
 
     /************fault codes***************/
 #define RAMPART_FAULT_UNSUPPORTED_SECURITY_TOKEN    "wsse:UnsupportedSecurityToken"

Modified: webservices/rampart/trunk/c/src/util/rampart_config.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_config.c?rev=615202&r1=615201&r2=615202&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_config.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_config.c Fri Jan 25 04:28:44 2008
@@ -47,6 +47,7 @@
     rampart_config->username = NULL;
     rampart_config->password = NULL;
     rampart_config->password_type = NULL;
+    rampart_config->ttl = 0;
 
     return rampart_config;
 }

Modified: webservices/rampart/trunk/c/src/util/rampart_engine.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_engine.c?rev=615202&r1=615201&r2=615202&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_engine.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_engine.c Fri Jan 25 04:28:44 2008
@@ -33,6 +33,8 @@
 #include <axis2_msg.h>
 #include <axis2_conf_ctx.h>
 #include <rampart_handler_util.h>
+#include <rampart_config.h>
+#include <axis2_options.h>
 
 /*This method sets all the configurations
  loads required modules and start rampart.*/
@@ -155,6 +157,42 @@
     /*For the client side*/
     if(!is_server_side)
     {
+       /* axis2_options_t* options = NULL;
+        options = axis2_msg_ctx_get_options(msg_ctx, env);
+        value = axis2_options_get_property(options, env, RAMPART_CLIENT_CONFIGURATION);*/
+        value = axis2_msg_ctx_get_property_value(msg_ctx, env, RAMPART_CLIENT_CONFIGURATION);
+        if(value)
+        {
+            rampart_config_t *client_config = NULL;
+            axis2_char_t *config_value = NULL;
+            int ttl = 0;
+
+            client_config = (rampart_config_t*)value;
+            config_value = rampart_config_get_username(client_config, env);
+            if(config_value)
+            {
+                rampart_context_set_user(rampart_context, env, config_value);
+            }
+            
+            config_value = rampart_config_get_password(client_config, env);
+            if(config_value)
+            {
+                rampart_context_set_password(rampart_context, env, config_value);
+            }
+
+            config_value = rampart_config_get_password_type(client_config, env);
+            if(config_value)
+            {
+                rampart_context_set_password_type(rampart_context, env, config_value);
+            }
+
+            ttl = rampart_config_get_ttl(client_config, env);
+            if(ttl > 0)
+            {
+                rampart_context_set_ttl(rampart_context, env, ttl);
+            }
+        }
+
         conf_ctx =  axis2_msg_ctx_get_conf_ctx(msg_ctx,env);
         if(!conf_ctx)
         {