rampart_authn_provider.h

Go to the documentation of this file.
00001 /*
00002 * Licensed to the Apache Software Foundation (ASF) under one or more
00003 * contributor license agreements.  See the NOTICE file distributed with
00004 * this work for additional information regarding copyright ownership.
00005 * The ASF licenses this file to You under the Apache License, Version 2.0
00006 * (the "License"); you may not use this file except in compliance with
00007 * the License.  You may obtain a copy of the License at
00008 *
00009 *      http://www.apache.org/licenses/LICENSE-2.0
00010 *
00011 * Unless required by applicable law or agreed to in writing, software
00012 * distributed under the License is distributed on an "AS IS" BASIS,
00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 * See the License for the specific language governing permissions and
00015 * limitations under the License.
00016 */
00017 #include <axutil_param.h>
00018 
00019 #ifndef RAMPART_AUTHN_PROVIDER_H
00020 #define RAMPART_AUTHN_PROVIDER_H
00021 
00032 #include <axis2_defines.h>
00033 #include <axutil_error.h>
00034 #include <axutil_env.h>
00035 #include <axutil_utils.h>
00036 #include <axis2_msg_ctx.h>
00037 
00038 #ifdef __cplusplus
00039 extern "C"
00040 {
00041 #endif
00042     enum rampart_authn_provider_status{
00043         RAMPART_AUTHN_PROVIDER_DENIED = 0,
00044         RAMPART_AUTHN_PROVIDER_GRANTED,
00045         RAMPART_AUTHN_PROVIDER_FOUND,
00046         RAMPART_AUTHN_PROVIDER_USER_FOUND,
00047         RAMPART_AUTHN_PROVIDER_USER_NOT_FOUND,
00048         RAMPART_AUTHN_PROVIDER_GENERAL_ERROR
00049     };
00050 
00051     typedef enum rampart_authn_provider_status rampart_authn_provider_status_t;
00052 
00061     typedef struct rampart_authn_provider_ops rampart_authn_provider_ops_t;
00062 
00067     typedef struct rampart_authn_provider rampart_authn_provider_t;
00068 
00071     struct rampart_authn_provider_ops
00072     {
00073 
00074 
00084         rampart_authn_provider_status_t (AXIS2_CALL*
00085                                          rampart_authn_provider_check_password)(
00086                                              rampart_authn_provider_t *authn_provider,
00087                                              const axutil_env_t* env,
00088                                              axis2_msg_ctx_t *msg_ctx,
00089                                              const axis2_char_t *username,
00090                                              const axis2_char_t *password
00091                                          );
00092 
00104         rampart_authn_provider_status_t (AXIS2_CALL*
00105                                          rampart_authn_provider_check_password_digest)(
00106                                              rampart_authn_provider_t *authn_provider,
00107                                              const axutil_env_t* env,
00108                                              axis2_msg_ctx_t *msg_ctx,
00109                                              const axis2_char_t *username,
00110                                              const axis2_char_t *nonce,
00111                                              const axis2_char_t *created,
00112                                              const char *digest
00113                                          );
00114 
00121         axis2_status_t (AXIS2_CALL*
00122                         free)(rampart_authn_provider_t *authn_provider,
00123                               const axutil_env_t* env);
00124 
00125     };
00126 
00127     struct rampart_authn_provider
00128     {
00129         rampart_authn_provider_ops_t *ops;
00130         axutil_param_t *param;
00131     };
00132 
00133     /*************************** Function macros **********************************/
00134     /*TODO write the implementation*/
00135 #define RAMPART_AUTHN_PROVIDER_FREE(authn_provider, env) \
00136       ((authn_provider)->ops->free (authn_provider, env))
00137 
00138 #define RAMPART_AUTHN_PROVIDER_CHECK_PASSWORD(authn_provider, env, msg_ctx, username, password) \
00139       ((authn_provider)->ops->rampart_authn_provider_check_password(authn_provider, env, msg_ctx, username, password))
00140 
00141 #define RAMPART_AUTHN_PROVIDER_CHECK_PASSWORD_DIGEST(authn_provider, env, msg_ctx, username, nonce, nonce_length, digest) \
00142       ((authn_provider)->ops->rampart_authn_provider_check_password_digest(authn_provider, env, msg_ctx, username, nonce, nonce_length, digest))
00143 
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148 
00149 #endif                          /* RAMPART_AUTHN_PROVIDER_H */
00150 

Generated on Thu Oct 4 17:37:07 2007 for Rampart/C by  doxygen 1.4.7