[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: authentication storage question

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2001-09-17 00:46:22 CEST

Greg Stein <gstein@lyra.org> writes:

> So... the client-provided vtable looks something like:
>
> * open_tempfile(client_baton, pool, &file)
> * close_tempfile(file)
> * get_authenticator(which_method, client_baton, pool, &auth_vtable, &auth_baton)
>
> [ we may not need close_tempfile; APR files already have a "delete on close"
> and there is also a patch floating for APR to create temp files as
> appropriate for the platform at hand (e.g. TMP/TEMP/TMPDIR on Windows, or
> mkstemp() on unixen, etc) ]

That would be swell. :-)

>
> And the authenticator vtable looks like:
>
> * authenticate(auth_baton)
> * save_authinfo(auth_baton)
> * ... functions appropriate to this auth method

Authenticator? We have no more authenticator objects.

Here's my latest draft of svn_ra.h. I'm almost done rewriting
svn_client_* routines and the two RA implementations to use it.

/*** Authentication ***/

/* This is the 2nd draft of client-side authentication; in the first
   draft, the client presumed to be in control of selecting auth
   methods and then "pushing" data at the RA layer. In this draft,
   the RA layer is presumed to be in control; as server challenges
   are made, it "pulls" data from the client via callbacks. */

/* Every known type of info that an RA layer may want to fetch from
   the client. */
#define SVN_RA_AUTH_USERNAME 0x0001
#define SVN_RA_AUTH_PASSWORD 0x0002

/* ### someday add PRIVATE_KEY, CERT, etc. */

/* A structure that represents an RA layer's desire to pull
   authentication information from the client; this information can be
   retrieved either by prompting the user, or by retrieving it from a
   file, etc. It's up to the client to decide how to retrieve the
   info. */
typedef struct svn_ra_get_info_t
{
  /* A flag which identifies the exact info being asked for. Should
     be one of the #defines above. */
  apr_uint64_t info_kind;

  /* A prompt to display to the user (if necessary). */
  const char *prompt;

  /* If prompting user, whether to echo typing or not. */
  svn_boolean_t no_echo;

  /* The desired information, filled in by the client. */
  char *info;

} svn_ra_get_info_t;

/* A collection of callbacks that allows an RA layer to "pull"
   information from the client application, or possibly store
   information. */
typedef struct svn_ra_callbacks_t
{
  /* -- Miscellaneous Callbacks -- */

  /* Open a temporary file FILENAME in the working copy.
     Arguments are identical to apr_file_open(), except that FILENAME
     is presumed to be a basename (instead of a whole path.) */
  svn_error_t *(*open_tmp_file) (apr_file_t **fp,
                                 const char *filename,
                                 apr_int32_t flag,
                                 apr_fileperms_t perm,
                                 apr_pool_t *pool);
  
  /* Delete a temporary file FILENAME, which previously created in
     working copy. Again, FILENAME is assumed to be a basename. */
  svn_error_t *(*delete_tmp_file) (const char *filename);

  /* -- Authentication Callbacks -- */

  /* A context the client may need for getting/setting auth info. */
  void *info_baton;

  /* Pull a list of information from the client.

     INFOS is a list of svn_ra_get_info_t structures; the client's
     responses will be returned in each structure's `info' field,
     allocated in POOL. */
  svn_error_t *(*get_informations) (apr_array_header_t *infos,
                                    void *info_baton,
                                    apr_pool_t *pool);

  /* Store auth info in the client.

     Assuming authentication was successful, ask the client to store
     each svn_ra_get_info_t in INFOS -- so that the info will be
     cached for next time. */
  svn_error_t *(*set_informations) (apr_array_header_t *infos,
                                    void *info_baton,
                                    apr_pool_t *pool);

} svn_ra_callbacks_t

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:41 2006

This is an archived mail posted to the Subversion Dev mailing list.