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

Re: Gmail OAuth2 in git send-email

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 3, 2021, 08:28 UTC
Message-ID
<878s3r73g3.fsf@evledraar.gmail.com>
In-Reply-To
<YLhx7nIptHUwXfBD@google.com>
On Wed, Jun 02 2021, Jonathan Nieder wrote:
Show 30 quoted lines
> Hi,
>
> Bagas Sanjaya wrote:
>
>> We wonder whether git send-email can support Gmail OAuth2 so that we can
>> seamlessly send patches without having to choose either action. But however,
>> we have to create a GCP project [1] first in order to enable Gmail API. This
>> can be overkill for some folks, but unfortunately that's the only way.
>
> Yes, that's how I have mutt and other tools working with my Gmail
> account set up.  See [1] for details.
>
>> If we want to enable support for Gmail OAuth2, should we hands-off API
>> configuration to git send-email users, or should we configure it on behalf
>> of them? Note that when we go the former approach, some Gmail users simply
>> can't afford GCP pricing for whatever reason
>
> I didn't have to pay for GCP in order to set this up; I only had to
> follow the instructions at
> https://developers.google.com/identity/protocols/oauth2 to create a
> client ID and client secret for oauth access.
>
> Alas, I don't think Git can provide its own client secret to do this
> out of the box.  I could imagine Git providing a way to supply an API
> key at build time, but distros would need to go through a procedure
> similar to [2] to make use of it for their own builds.  If someone
> wants to set that up, I think that would make sense as its _own_
> separate package --- e.g. a "sendgmail" command that "git send-email"
> could use via the --sendmail-cmd option.  That way, it would be useful
> for a variety of calling programs and not just Git.

It's been a while but I set this up at some point, why would git or distros need to make/register a private key? Last I checked you can take software like git-send-email or whatever, and just register a new "jonathan's e-mail sending script" with Google's OAuth thingy.

That "jonathan's e-mail sending script" happens to be git-send-email with a bit of configuration isn't something they know or care about.

That seems like a much better approach than some centralized solution, since as you note doing that will require some authority to manage keys etc, and presumably if "jonathan's e-mail sending script" inadvertently starts using git-send-email.perl to send spam, that would currently not result in ban on "ævar's e-mail sending script", but if the two were registered as the same application Google might overzelously ban those as two tenticles of the same misbehaving "app".

Previous: Eric SunshineNext: Felipe Contreras
Message 5 of 31 in “Gmail OAuth2 in git send-email”
  1. Bagas SanjayaJun 3, 2021
  2. ZheNing HuJun 3, 2021
  3. Jonathan NiederJun 3, 2021
  4. Eric SunshineJun 3, 2021
  5. Ævar Arnfjörð BjarmasonJun 3, 2021
  6. Felipe ContrerasJun 3, 2021
  7. Andreas SchwabJun 3, 2021
  8. Felipe ContrerasJun 3, 2021
  9. Jonathan NiederJun 4, 2021
  10. Jonathan NiederJun 4, 2021
  11. Felipe ContrerasJun 4, 2021
  12. Konstantin RyabitsevJun 3, 2021
  13. Eric SunshineJun 3, 2021
  14. Konstantin RyabitsevJun 3, 2021
  15. Michal SuchánekJun 3, 2021
  16. Konstantin RyabitsevJun 3, 2021
  17. Michal SuchánekJun 3, 2021
  18. Eric SunshineJun 3, 2021
  19. Felipe ContrerasJun 3, 2021
  20. Eric SunshineJun 3, 2021
  21. Felipe ContrerasJun 4, 2021
  22. Đoàn Trần Công DanhJun 4, 2021
  23. Felipe ContrerasJun 4, 2021
  24. Đoàn Trần Công DanhJun 4, 2021
  25. Felipe ContrerasJun 4, 2021
  26. Đoàn Trần Công DanhJun 4, 2021
  27. Felipe ContrerasJun 4, 2021
  28. Đoàn Trần Công DanhJun 4, 2021
  29. Felipe ContrerasJun 4, 2021
  30. Eric SunshineJun 4, 2021
  31. Felipe ContrerasJun 4, 2021

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.