Ticket Change Details
Not logged in
Overview

Artifact ID: 88cd83acf7cfe33e07da9eb53c3000cc32845392
Ticket: c46b0f7bb7241a02a7165f108206f866e0f3f7b3
Support HTTP Basic Auth for sync operations
User & Date: anonymous 2011-04-13 19:29:34
Changes

  1. comment changed to:
    HTTP Basic Auth needs to be supported for sync operations in order to be compatible with any kind of user validation done by the web server hosting fossil.
    
    A patch was provided (6 lines of code) by mightyhe on Sun, 27 Mar 2011 07:45:06 -0700 and may be accessed at:
    
      <a href="http://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg04219.html">http://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg04219.html</a>
    
    and for convenience is included here (NOTE: a fix for an incorrect line terminator on the Proxy-Authorization header is also mixed in with this patch):
    <verbatim>
    Index: src/http.c
    ===================================================================
    --- src/http.c
    +++ src/http.c
    @@ -105,11 +105,19 @@
       }else{
         zSep = "/";
       }
       blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep);
       if( g.urlProxyAuth ){
    -    blob_appendf(pHdr, "Proxy-Authorization: %s\n", g.urlProxyAuth);
    +    blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth);
    +  }
    +  // Basic HTTP Authorization
    +  if( g.urlUser && g.urlUser[0] && g.urlPasswd ){
    +      char *zpw = mprintf("%s:%s", g.urlUser, g.urlPasswd);
    +      char *zpw64 = encode64(zpw, strlen(zpw));
    +      free(zpw);
    +      blob_appendf(pHdr, "Authorization: Basic %s\r\n", zpw64);
    +      free(zpw64);
       }
       blob_appendf(pHdr, "Host: %s\r\n", g.urlHostname);
       blob_appendf(pHdr, "User-Agent: Fossil/" MANIFEST_VERSION "\r\n");
       if( g.fHttpTrace ){
         blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n");
    </verbatim>
    
  2. foundin changed to: "2011-04-13 12:05:18"
  3. severity changed to: "Severe"
  4. status changed to: "Open"
  5. title changed to: "Support HTTP Basic Auth for sync operations"
  6. type changed to: "Feature_Request"