Changeset 19

Show
Ignore:
Timestamp:
06/22/04 00:21:55
Author:
DenisG
Message:

[SubversionSharp] Add authentication provider callback and most Get function

- Provide a wrapper for all SvnAuthCred?... structures
- Provide a wrapper for SslServerCertInfo? structure
- Provide exception secure wrapper delegates for all AuthProvide? callback
- Provide Get function for non-interactive provider
- Other Get function throw NotImplemented? for now

Issue: When using callback function, avoid garbage collection of callback
functions and their related class...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SubversionSharp/dev/src/SubversionSharp.prjx

    r7 r19  
    88    <File name="./SvnConfig.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
    99    <File name="./SvnClientContext.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
     10    <File name="./SvnAuthProvider.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
     11    <File name="./SvnAuthCred.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
     12    <File name="./SvnAuthSslServerCertInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 
    1013  </Contents> 
    1114  <References> 
  • trunk/SubversionSharp/dev/src/Svn.cs

    r7 r19  
    5757        } 
    5858        #endregion 
     59         
     60        #region SvnError 
     61        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     62        internal IntPtr svn_error_create(int apr_err, IntPtr child, string message); 
     63         
     64        [DllImport("svn_client-1", CharSet=CharSet.Ansi)] static extern 
     65        internal void svn_error_clear(IntPtr error);    
     66        #endregion 
    5967 
    6068        #region ClientContext 
     
    7482        internal IntPtr svn_config_get_config(out IntPtr cfg_hash, string config_dir, IntPtr pool); 
    7583        #endregion 
     84         
     85        #region AuthProvider 
     86        public delegate IntPtr svn_auth_simple_prompt_func_t(out IntPtr cred, IntPtr baton,  
     87                                                             IntPtr realm, IntPtr username,  
     88                                                             int may_save, IntPtr pool); 
     89 
     90        public delegate IntPtr svn_auth_username_prompt_func_t(out IntPtr cred, IntPtr baton,  
     91                                                               IntPtr realm, int may_save,  
     92                                                               IntPtr pool); 
     93                                                                
     94        [CLSCompliant(false)] 
     95        public delegate IntPtr svn_auth_ssl_server_trust_prompt_func_t(out IntPtr cred, IntPtr baton,  
     96                                                                       IntPtr realm, uint failures,  
     97                                                                       IntPtr cert_info,  
     98                                                                       int may_save, IntPtr pool); 
     99 
     100        public delegate IntPtr svn_auth_ssl_client_cert_prompt_func_t(out IntPtr cred, IntPtr baton, 
     101                                                                      IntPtr realm, int may_save, 
     102                                                                      IntPtr pool); 
     103 
     104        public delegate IntPtr svn_auth_ssl_client_cert_pw_prompt_func_t(out IntPtr cred,  
     105                                                                         IntPtr baton, 
     106                                                                         IntPtr realm, int may_save, 
     107                                                                         IntPtr pool); 
     108                                                                          
     109        [DllImport("svn_client-1")] static extern 
     110        internal void svn_client_get_simple_prompt_provider(out IntPtr provider,  
     111                                                    svn_auth_simple_prompt_func_t prompt_func,  
     112                                                    IntPtr prompt_baton, int retry_limit, IntPtr pool); 
     113        [DllImport("svn_client-1")] static extern 
     114        internal void svn_client_get_username_prompt_provider(out IntPtr provider, 
     115                                                svn_auth_username_prompt_func_t prompt_func, 
     116                                                IntPtr prompt_baton, int retry_limit, IntPtr pool); 
     117        [DllImport("svn_client-1")] static extern 
     118        internal void svn_client_get_simple_provider(out IntPtr provider, 
     119                                                     IntPtr pool); 
     120        [DllImport("svn_client-1")] static extern 
     121        internal void svn_client_get_username_provider(out IntPtr provider, 
     122                                                       IntPtr pool); 
     123        [DllImport("svn_client-1")] static extern 
     124        internal void svn_client_get_ssl_server_trust_file_provider(out IntPtr provider,  
     125                                                                    IntPtr pool); 
     126        [DllImport("svn_client-1")] static extern 
     127        internal void svn_client_get_ssl_client_cert_file_provider(out IntPtr provider, 
     128                                                                   IntPtr pool); 
     129        [DllImport("svn_client-1")] static extern 
     130        internal void svn_client_get_ssl_client_cert_pw_file_provider(out IntPtr provider,  
     131                                                                      IntPtr pool); 
     132        [DllImport("svn_client-1")] static extern 
     133        internal void svn_client_get_ssl_server_trust_prompt_provider(out IntPtr provider,  
     134                                                svn_auth_ssl_server_trust_prompt_func_t prompt_func, 
     135                                                IntPtr prompt_baton, IntPtr pool); 
     136        [DllImport("svn_client-1")] static extern 
     137        internal void svn_client_get_ssl_client_cert_prompt_provider(out IntPtr provider, 
     138                                                svn_auth_ssl_client_cert_prompt_func_t prompt_func, 
     139                                                IntPtr prompt_baton, int retry_limit, IntPtr pool); 
     140        [DllImport("svn_client-1")] static extern 
     141        internal void svn_client_get_ssl_client_cert_pw_prompt_provider(out IntPtr provider, 
     142                                                svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func, 
     143                                                IntPtr prompt_baton, int retry_limit, IntPtr pool); 
     144        #endregion 
    76145    } 
    77146}