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

Re: Fwd: [Bug] `credential fill` prints incomplete bearer credential

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2024, 05:56 UTC
Message-ID
<xmqqldwcnrlz.fsf@gitster.g>
In-Reply-To
<Z2N-rV4fhF3ZkGlp@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 32 quoted lines
> On 2024-12-18 at 20:42:31, M Hickford wrote:
>> Hi. Is this a bug in git version 2.47.1? Or am I using it incorrectly?
>> 
>> # erase existing example.com credentials
>> printf "host=example.com\nprotocol=https\n" | git -c credential.helper= -c credential.helper=cache credential reject
>> # store bearer token with expiry in far future in credential-cache
>> printf "host=example.com\nprotocol=https\nauthtype=bearer\ncredential=letmein\npassword_expiry_utc=2147483640\n"
>> | git credential-cache store
>> # try to retrieve credential
>> printf "host=example.com\nprotocol=https\n" | git -c credential.helper= -c credential.helper=cache credential fill
>> 
>> Expected output (complete credential):
>> 
>> protocol=https
>> host=example.com
>> authtype=bearer
>> credential=letmein
>> password_expiry_utc=2147483640
>> 
>> Actual output (incomplete credential, no prompt for username or password):
>> 
>> protocol=https
>> host=example.com
>> password_expiry_utc=2147483640
>
> This is expected.  Every request to a credential helper should include
> all of the capabilities that the caller supports on input, and the
> credential helper will always emit those on output.  `git credential`,
> however, will only emit the capabilities that were actually supported,
> so that general callers (including Git LFS) can determine the actual
> set of supported capabilities.
> ...
The original report did
 - run "git credential reject" to clear
 - run "git credential-cache store"!!
 - run "git credential fill" to check
which looked curious.

Am I correct to understand that if the second step is replaced with "git credential approve" (which calls "credential-cache store" internally), the right thing happens and necessary capabilities are passed?

Thanks.
Previous: brian m. carlsonNext: M Hickford
Message 3 of 6 in “Fwd: [Bug] `credential fill` prints incomplete bearer credential”
  1. M HickfordDec 18, 2024
  2. brian m. carlsonDec 19, 2024
  3. Junio C HamanoDec 19, 2024
  4. M HickfordDec 19, 2024
  5. M HickfordDec 19, 2024
  6. M HickfordDec 21, 2024

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.