<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/gitcredentials.txt, branch v2.41.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.41.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.41.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-02-22T23:18:58Z</updated>
<entry>
<title>credential: new attribute password_expiry_utc</title>
<updated>2023-02-22T23:18:58Z</updated>
<author>
<name>M Hickford</name>
<email>mirth.hickford@gmail.com</email>
</author>
<published>2023-02-18T06:32:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d208bfdfef97a1e8fb746763b5057e0ad91e283b'/>
<id>urn:sha1:d208bfdfef97a1e8fb746763b5057e0ad91e283b</id>
<content type='text'>
Some passwords have an expiry date known at generation. This may be
years away for a personal access token or hours for an OAuth access
token.

When multiple credential helpers are configured, `credential fill` tries
each helper in turn until it has a username and password, returning
early. If Git authentication succeeds, `credential approve`
stores the successful credential in all helpers. If authentication
fails, `credential reject` erases matching credentials in all helpers.
Helpers implement corresponding operations: get, store, erase.

The credential protocol has no expiry attribute, so helpers cannot
store expiry information. Even if a helper returned an improvised
expiry attribute, git credential discards unrecognised attributes
between operations and between helpers.

This is a particular issue when a storage helper and a
credential-generating helper are configured together:

	[credential]
		helper = storage  # eg. cache or osxkeychain
		helper = generate  # eg. oauth

`credential approve` stores the generated credential in both helpers
without expiry information. Later `credential fill` may return an
expired credential from storage. There is no workaround, no matter how
clever the second helper. The user sees authentication fail (a retry
will succeed).

Introduce a password expiry attribute. In `credential fill`, ignore
expired passwords and continue to query subsequent helpers.

In the example above, `credential fill` ignores the expired password
and a fresh credential is generated. If authentication succeeds,
`credential approve` replaces the expired password in storage.
If authentication fails, the expired credential is erased by
`credential reject`. It is unnecessary but harmless for storage
helpers to self prune expired credentials.

Add support for the new attribute to credential-cache.
Eventually, I hope to see support in other popular storage helpers.

Example usage in a credential-generating helper
https://github.com/hickford/git-credential-oauth/pull/16

Signed-off-by: M Hickford &lt;mirth.hickford@gmail.com&gt;
Reviewed-by: Calvin Wan &lt;calvinwan@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mh/gitcredentials-generate'</title>
<updated>2022-11-23T02:22:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-11-23T02:22:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c197977cb6b250906dbe1a05f899c65bb1ac2a9f'/>
<id>urn:sha1:c197977cb6b250906dbe1a05f899c65bb1ac2a9f</id>
<content type='text'>
Doc update.

* mh/gitcredentials-generate:
  Docs: describe how a credential-generating helper works
</content>
</entry>
<entry>
<title>Merge branch 'mh/credential-unrecognized-attrs'</title>
<updated>2022-11-18T23:43:59Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-11-18T23:43:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35a62bb5798092d491e6c7e688db6cb1418c9098'/>
<id>urn:sha1:35a62bb5798092d491e6c7e688db6cb1418c9098</id>
<content type='text'>
Docfix.

* mh/credential-unrecognized-attrs:
  docs: clarify that credential discards unrecognised attributes
</content>
</entry>
<entry>
<title>Docs: describe how a credential-generating helper works</title>
<updated>2022-11-14T23:18:59Z</updated>
<author>
<name>M Hickford</name>
<email>mirth.hickford@gmail.com</email>
</author>
<published>2022-11-12T01:44:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dabb9d875f665ec5da9ae8c84fed765cf9187463'/>
<id>urn:sha1:dabb9d875f665ec5da9ae8c84fed765cf9187463</id>
<content type='text'>
Previously the docs only described storage helpers.

A concrete example: Git Credential Manager can generate credentials
for GitHub and GitLab via OAuth.
https://github.com/GitCredentialManager/git-credential-manager

Signed-off-by: M Hickford &lt;mirth.hickford@gmail.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>docs: clarify that credential discards unrecognised attributes</title>
<updated>2022-11-13T04:57:34Z</updated>
<author>
<name>M Hickford</name>
<email>mirth.hickford@gmail.com</email>
</author>
<published>2022-10-24T07:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fd54b6238e5802147a5ca259c3b5e6b8e06471d'/>
<id>urn:sha1:7fd54b6238e5802147a5ca259c3b5e6b8e06471d</id>
<content type='text'>
It was previously unclear how unrecognised attributes are handled.

Signed-off-by: M Hickford &lt;mirth.hickford@gmail.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>Documentation/gitcredentials.txt: mention password alternatives</title>
<updated>2022-11-08T21:46:54Z</updated>
<author>
<name>M Hickford</name>
<email>mirth.hickford@gmail.com</email>
</author>
<published>2022-11-08T13:01:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=54e95b466334e8f6ba4421991cfc189e1291ea87'/>
<id>urn:sha1:54e95b466334e8f6ba4421991cfc189e1291ea87</id>
<content type='text'>
Git asks for a "password", but the user might use a
personal access token or OAuth access token instead.

Example:

    Password for 'https://AzureDiamond@github.com':

Signed-off-by: M Hickford &lt;mirth.hickford@gmail.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>doc: uniformize &lt;URL&gt; placeholders' case</title>
<updated>2021-11-09T17:39:11Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2021-11-06T18:48:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7706294ec94ab9f9b864a8451ac089f15d18a254'/>
<id>urn:sha1:7706294ec94ab9f9b864a8451ac089f15d18a254</id>
<content type='text'>
URL being an acronym, it deserves to be kept uppercase.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>command-list.txt: add missing 'gitcredentials' and 'gitremote-helpers'</title>
<updated>2020-08-05T01:34:01Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2020-08-05T01:19:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2135e1ad7037f72c1a96d4ae11eef8e0ed1cbc65'/>
<id>urn:sha1:2135e1ad7037f72c1a96d4ae11eef8e0ed1cbc65</id>
<content type='text'>
The guides 'gitcredentials' and 'gitremote-helpers' do not currently
appear in command-list.txt.

'gitcredentials' was forgotten back when guides were added to
command-list.txt in 1b81d8cb19 (help: use command-list.txt for the
source of guides, 2018-05-20).

'gitremote-helpers' was moved to section 7 in 439cc74632 (docs: move
gitremote-helpers into section 7, 2019-03-25), but command-list.txt was
not updated at the time.

Add these two guides to the list of guides in 'command-list.txt', so
that they appear in the output of 'git help --guides', and capitalize
the first word of the description of 'gitcredentials', as was done in
1b81d8c (help: use command-list.txt for the source of guides,
2018-05-20) for the other guides.

While at it, add a comment in Documentation/Makefile to remind developers
to update command-list.txt if they add a new guide.

Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cb/credential-doc-fixes'</title>
<updated>2020-05-13T19:19:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-13T19:19:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa28171c2752c0aa04c2e25f2f79bc01a7f045d5'/>
<id>urn:sha1:aa28171c2752c0aa04c2e25f2f79bc01a7f045d5</id>
<content type='text'>
Minor in-code comments and documentation updates around credential
API.

* cb/credential-doc-fixes:
  credential: document protocol updates
  credential: update gitcredentials documentation
  credential: correct order of parameters for credential_match
  credential: update description for credential_from_url_gently
</content>
</entry>
<entry>
<title>credential: update gitcredentials documentation</title>
<updated>2020-05-07T21:01:54Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2020-05-06T21:47:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b8938be4c4ef2d87642988f3486bc15c366b617'/>
<id>urn:sha1:4b8938be4c4ef2d87642988f3486bc15c366b617</id>
<content type='text'>
Clarify the expected effect of all attributes and how the helpers
are expected to handle them and the context where they operate.

While at it, space the descriptions for clarity, and add a paragraph
mentioning the early termination in the list processing of helpers,
to complement the one about the special "quit" attribute.

Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
