<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/lib-httpd, branch v2.2.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.2.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.2.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-09-17T21:58:04Z</updated>
<entry>
<title>signed push: teach smart-HTTP to pass "git push --signed" around</title>
<updated>2014-09-17T21:58:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-15T21:59:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ea47f9d3307bdb1cd9364acd3e4a463b244bba2'/>
<id>urn:sha1:0ea47f9d3307bdb1cd9364acd3e4a463b244bba2</id>
<content type='text'>
The "--signed" option received by "git push" is first passed to the
transport layer, which the native transport directly uses to notice
that a push certificate needs to be sent.  When the transport-helper
is involved, however, the option needs to be told to the helper with
set_helper_option(), and the helper needs to take necessary action.
For the smart-HTTP helper, the "necessary action" involves spawning
the "git send-pack" subprocess with the "--signed" option.

Once the above all gets wired in, the smart-HTTP transport now can
use the push certificate mechanism to authenticate its pushes.

Add a test that is modeled after tests for the native transport in
t5534-push-signed.sh to t5541-http-push-smart.sh.  Update the test
Apache configuration to pass GNUPGHOME environment variable through.
As PassEnv would trigger warnings for an environment variable that
is not set, export it from test-lib.sh set to a harmless value when
GnuPG is not being used in the tests.

Note that the added test is deliberately loose and does not check
the nonce in this step.  This is because the stateless RPC mode is
inevitably flaky and a nonce that comes back in the actual push
processing is one issued by a different process; if the two
interactions with the server crossed a second boundary, the nonces
will not match and such a check will fail.  A later patch in the
series will work around this shortcoming.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: fix charset detection of extract_content_type()</title>
<updated>2014-06-17T22:25:00Z</updated>
<author>
<name>Yi EungJun</name>
<email>eungjun.yi@navercorp.com</email>
</author>
<published>2014-06-17T22:11:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f34a655d4d1e25f314cd5760e2a39bec28950aa1'/>
<id>urn:sha1:f34a655d4d1e25f314cd5760e2a39bec28950aa1</id>
<content type='text'>
extract_content_type() could not extract a charset parameter if the
parameter is not the first one and there is a whitespace and a following
semicolon just before the parameter. For example:

    text/plain; format=fixed ;charset=utf-8

And it also could not handle correctly some other cases, such as:

    text/plain; charset=utf-8; format=fixed
    text/plain; some-param="a long value with ;semicolons;"; charset=utf-8

Thanks-to: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Yi EungJun &lt;eungjun.yi@navercorp.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>remote-curl: reencode http error messages</title>
<updated>2014-05-27T16:59:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-22T09:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc1b774c72990f0ff92370316412b19fd72baa77'/>
<id>urn:sha1:fc1b774c72990f0ff92370316412b19fd72baa77</id>
<content type='text'>
We currently recognize an error message with a content-type
"text/plain; charset=utf-16" as text, but we ignore the
charset parameter entirely. Let's encode it to
log_output_encoding, which is presumably something the
user's terminal can handle.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: extract type/subtype portion of content-type</title>
<updated>2014-05-27T16:57:00Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-22T09:29:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf197fd7eebcb3579dd659af35822ce88adc66c8'/>
<id>urn:sha1:bf197fd7eebcb3579dd659af35822ce88adc66c8</id>
<content type='text'>
When we get a content-type from curl, we get the whole
header line, including any parameters, and without any
normalization (like downcasing or whitespace) applied.
If we later try to match it with strcmp() or even
strcasecmp(), we may get false negatives.

This could cause two visible behaviors:

  1. We might fail to recognize a smart-http server by its
     content-type.

  2. We might fail to relay text/plain error messages to
     users (especially if they contain a charset parameter).

This patch teaches the http code to extract and normalize
just the type/subtype portion of the string. This is
technically passing out less information to the callers, who
can no longer see the parameters. But none of the current
callers cares, and a future patch will add back an
easier-to-use method for accessing those parameters.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t5550: test display of remote http error messages</title>
<updated>2014-05-23T19:43:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-22T09:29:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbcf2bd3dec1244fdbafb3ec7312ed14d83c0025'/>
<id>urn:sha1:dbcf2bd3dec1244fdbafb3ec7312ed14d83c0025</id>
<content type='text'>
Since commit 426e70d (remote-curl: show server content on
http errors, 2013-04-05), we relay any text/plain error
messages from the remote server to the user. However, we
never tested it.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/lib-httpd: use write_script to copy CGI scripts</title>
<updated>2014-05-23T19:41:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-22T09:28:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c7db2d16474874b21aad9141e6856f836f719643'/>
<id>urn:sha1:c7db2d16474874b21aad9141e6856f836f719643</id>
<content type='text'>
Using write_script will set our shebang line appropriately
with $SHELL_PATH. The script that is there now is quite
simple and likely to succeed even with a non-POSIX /bin/sh,
but it does not hurt to be defensive.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use distinct username/password for http auth tests</title>
<updated>2014-01-02T18:25:03Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-01-02T07:38:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afbf5ca507470aab6716671f2ad207c74cd585fb'/>
<id>urn:sha1:afbf5ca507470aab6716671f2ad207c74cd585fb</id>
<content type='text'>
The httpd server we set up to test git's http client code
knows about a single account, in which both the username and
password are "user@host" (the unusual use of the "@" here is
to verify that we handle the character correctly when URL
escaped).

This means that we may miss a certain class of errors in
which the username and password are mixed up internally by
git. We can make our tests more robust by having distinct
values for the username and password.

In addition to tweaking the server passwd file and the
client URL, we must teach the "askpass" harness to accept
multiple values. As a bonus, this makes the setup of some
tests more obvious; when we are expecting git to ask
only about the password, we can seed the username askpass
response with a bogus value.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/http-auth-redirects'</title>
<updated>2013-10-30T19:09:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-30T19:09:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=177f0a400955f2345c73a5c8b0459d617429ffd9'/>
<id>urn:sha1:177f0a400955f2345c73a5c8b0459d617429ffd9</id>
<content type='text'>
Handle the case where http transport gets redirected during the
authorization request better.

* jk/http-auth-redirects:
  http.c: Spell the null pointer as NULL
  remote-curl: rewrite base url from info/refs redirects
  remote-curl: store url as a strbuf
  remote-curl: make refs_url a strbuf
  http: update base URLs when we see redirects
  http: provide effective url to callers
  http: hoist credential request out of handle_curl_result
  http: refactor options to http_get_*
  http_request: factor out curlinfo_strbuf
  http_get_file: style fixes
</content>
</entry>
<entry>
<title>remote-curl: rewrite base url from info/refs redirects</title>
<updated>2013-10-15T00:01:34Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-09-28T08:35:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=050ef3655c8ea1dc7a2b3b843ca7c45dd94d9c88'/>
<id>urn:sha1:050ef3655c8ea1dc7a2b3b843ca7c45dd94d9c88</id>
<content type='text'>
For efficiency and security reasons, an earlier commit in
this series taught http_get_* to re-write the base url based
on redirections we saw while making a specific request.

This commit wires that option into the info/refs request,
meaning that a redirect from

    http://example.com/foo.git/info/refs

to

    https://example.com/bar.git/info/refs

will behave as if "https://example.com/bar.git" had been
provided to git in the first place.

The tests bear some explanation. We introduce two new
hierearchies into the httpd test config:

  1. Requests to /smart-redir-limited will work only for the
     initial info/refs request, but not any subsequent
     requests. As a result, we can confirm whether the
     client is re-rooting its requests after the initial
     contact, since otherwise it will fail (it will ask for
     "repo.git/git-upload-pack", which is not redirected).

  2. Requests to smart-redir-auth will redirect, and require
     auth after the redirection. Since we are using the
     redirected base for further requests, we also update
     the credential struct, in order not to mislead the user
     (or credential helpers) about which credential is
     needed. We can therefore check the GIT_ASKPASS prompts
     to make sure we are prompting for the new location.
     Because we have neither multiple servers nor https
     support in our test setup, we can only redirect between
     paths, meaning we need to turn on
     credential.useHttpPath to see the difference.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
</content>
</entry>
<entry>
<title>http: add http.savecookies option to write out HTTP cookies</title>
<updated>2013-07-30T16:19:04Z</updated>
<author>
<name>Dave Borowitz</name>
<email>dborowitz@google.com</email>
</author>
<published>2013-07-23T22:40:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=912b2acf2f376e51bee32a486ca42ba4ad764363'/>
<id>urn:sha1:912b2acf2f376e51bee32a486ca42ba4ad764363</id>
<content type='text'>
HTTP servers may send Set-Cookie headers in a response and expect them
to be set on subsequent requests. By default, libcurl behavior is to
store such cookies in memory and reuse them across requests within a
single session. However, it may also make sense, depending on the
server and the cookies, to store them across sessions. Provide users
an option to enable this behavior, writing cookies out to the same
file specified in http.cookiefile.

Signed-off-by: Dave Borowitz &lt;dborowitz@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
