git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>, Git <git@vger.kernel.org>
Subject: Re: Gmail OAuth2 in git send-email
Date: Thu, 03 Jun 2021 12:46:55 -0500	[thread overview]
Message-ID: <60b9158f92812_258801208e0@natae.notmuch> (raw)
In-Reply-To: <878s3r73g3.fsf@evledraar.gmail.com>

Ævar Arnfjörð Bjarmason wrote:
> On Wed, Jun 02 2021, Jonathan Nieder wrote:
> > 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.

If Google requires a client secret, then it can't be used with open
source applications. Period.

Sure, you could create a developer account, create an app, get a client
id and secret, put into your authentication script, and the finally do
the authentication.

Open a browser with the link, type your password, verify on your phone
with a 2FA app or whatever.

And finally you'll get a token. Which will have to be refreshed
regularly.


Or you can just create an app password.

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2021-06-03 17:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  5:02 Gmail OAuth2 in git send-email Bagas Sanjaya
2021-06-03  5:48 ` ZheNing Hu
2021-06-03  6:08 ` Jonathan Nieder
2021-06-03  6:26   ` Eric Sunshine
2021-06-03  8:28   ` Ævar Arnfjörð Bjarmason
2021-06-03 17:46     ` Felipe Contreras [this message]
2021-06-03 18:21       ` Andreas Schwab
2021-06-03 19:01         ` Felipe Contreras
2021-06-04  1:49     ` Jonathan Nieder
2021-06-04  2:39       ` Jonathan Nieder
2021-06-04  3:44         ` Felipe Contreras
2021-06-03 18:08 ` Konstantin Ryabitsev
2021-06-03 18:25   ` Eric Sunshine
2021-06-03 18:32     ` Konstantin Ryabitsev
2021-06-03 19:02       ` Michal Suchánek
2021-06-03 19:07         ` Konstantin Ryabitsev
2021-06-03 19:23           ` Michal Suchánek
2021-06-03 23:42           ` Eric Sunshine
2021-06-03 19:06     ` Felipe Contreras
2021-06-03 23:35       ` Eric Sunshine
2021-06-04  1:11         ` Felipe Contreras
2021-06-04  1:49           ` Đoàn Trần Công Danh
2021-06-04  2:07             ` Felipe Contreras
2021-06-04  2:11               ` Đoàn Trần Công Danh
2021-06-04  3:45                 ` Felipe Contreras
2021-06-04  5:21                   ` Đoàn Trần Công Danh
2021-06-04  6:00                     ` Felipe Contreras
2021-06-04  6:23                       ` Đoàn Trần Công Danh
2021-06-04 13:32                         ` Felipe Contreras
2021-06-04  4:10           ` Eric Sunshine
2021-06-04  5:35             ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60b9158f92812_258801208e0@natae.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).