]> git.ipfire.org Git - thirdparty/git.git/commit
credential/wincred: store oauth_refresh_token
authorM Hickford <mirth.hickford@gmail.com>
Sun, 28 Jan 2024 21:25:02 +0000 (21:25 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jan 2024 20:11:24 +0000 (12:11 -0800)
commitf061959efd6ff16bb26d8b442707a25dd49085ee
treef6d649f762e75ecfe60ef404d09d1bcecf53a172
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3
credential/wincred: store oauth_refresh_token

a5c7656 (credential: new attribute oauth_refresh_token) introduced
a new confidential credential attribute and added support to
credential-cache. Later 0ce02e2f (credential/libsecret: store new
attributes, 2023-06-16) added support in credential-libsecret.

To add support in credential-wincred, we encode the new attribute in the
CredentialBlob, separated by newline:

    hunter2
    oauth_refresh_token=xyzzy

This is extensible and backwards compatible. The credential protocol
already assumes that attribute values do not contain newlines.

This fixes test "helper (wincred) gets oauth_refresh_token" when
t0303-credential-external.sh is run with
GIT_TEST_CREDENTIAL_HELPER=wincred. This test was added in a5c76569e7
(credential: new attribute oauth_refresh_token, 2023-04-21).

Alternatives considered: store oauth_refresh_token in a wincred
attribute. This would be insecure because wincred assumes attribute
values to be non-confidential.

Signed-off-by: M Hickford <mirth.hickford@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/credential/wincred/git-credential-wincred.c