git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Deepak Patankar <patankardeepak04@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to Verify the Git Credentials supplied by the User
Date: Mon, 12 Oct 2020 22:32:13 -0700	[thread overview]
Message-ID: <xmqqsgailmhu.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CABmmNJMzs=BOYEv_pUaA3NbNkn_HhyOj_VoYeWSKzz138OCZkQ@mail.gmail.com> (Deepak Patankar's message of "Tue, 13 Oct 2020 10:54:15 +0530")

Deepak Patankar <patankardeepak04@gmail.com> writes:

> I can use the "ls-remote", "push --dry-run" command you suggested, but
> I have a use case which I don't know how to solve.
> The above commands require a repository. In our application, the user
> can give the following details
>
> Git Details:
>    Account URL:  https://github.com/OpenPrinting
>    UserName: deepakpatankar
>    password: ***********
>
> In this case, we don't know the repo name. At this step, I just know
> the account and the credentials of the user, later on
> the user will provide me with the repo name to which he wants to sync his file.
>
> Since I don't know the repository, I cannot do "git fetch" or "git
> push --dry-run". Can I check this credentials with some
> logic or git commands?

You'd have to go outside Git, as our transport layer is only about
talking with existing repositories.  You cannot even create a new 
repository using Git native methods.

You may need to find a method that works with GitHub account (note
that I am not even using the word repository here, instead saying
"account") and such a method would likely have to involve GitHub
specific API, but it probably would not work with other hosting
providers.

I also would imagine that even at GitHub, one may want to use
different authentication info depending on which repository one
accesses, so the "there is a single User with a password at this
hosting site" data model might turn out to be insufficient, but
that is outside the scope of Git proper.



      reply	other threads:[~2020-10-13  5:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 13:50 How to Verify the Git Credentials supplied by the User Deepak Patankar
2020-10-12 17:46 ` Junio C Hamano
     [not found]   ` <CABmmNJOCJEpGwz3hxYsKO=xwx_rrVv5_QcZuS_=gUZH9bM0G2A@mail.gmail.com>
2020-10-13  5:24     ` Deepak Patankar
2020-10-13  5:32       ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqsgailmhu.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=patankardeepak04@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).