git/list[1] front-page[2] threads[3] people[4] search[5] about
 

bearer token authorization with HTTPS transport

From
DRDavid Renshaw <david@sandstorm.io>
Date
Dec 30, 2014, 19:24 UTC
Message-ID
<CACejzECGUnH6B2Leq+H6u0Joo1SQmMCZ5UoHja_fK99+6a_iEA@mail.gmail.com>

Hi, I would like to be able to serve a git repository over HTTPS from a web server that requires OAuth2-style bearer tokens for authorization. For more context, see this thread: https://groups.google.com/forum/#!topic/sandstorm-dev/4oigfb4-9E4

Does anyone here have any advice about how to convince a git client to add an "Authorization: Bearer <token>" header?

I can think of a few approaches:

(1) I could modify the curl remote helper to insert the header if it sees a "bearertoken" config option. I have in fact written a proof-of-concept patch that does this (see https://github.com/dwrensha/git/commit/4da7b64b85b3b6652abe7), but I don't know how much of chance something like this has of getting merged into the mainline git client.

(2) I could write a new remote helper for, say, a "https+bearertoken" transport. This seems like it would be more work than (1), but it would also allow easier installation without interfering with the rest of git.

(3) I could write a proxy server that inserts the header, designed to run on the same machine as the client. This feels rather heavyweight.

Am I missing anything?

Thanks, David

Next: brian m. carlson
Message 1 of 6 in “bearer token authorization with HTTPS transport”
  1. David RenshawDec 30, 2014
  2. brian m. carlsonDec 30, 2014
  3. Jeff KingDec 31, 2014
  4. Jeff KingDec 31, 2014
  5. brian m. carlsonJan 6, 2015
  6. David RenshawJan 6, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.