The credential_fill function looks up credentials for a given host, and
if none exists it will attempt to prompt the user for new credentials. Upon
success it returns a list with the same protocol
and host
fields as the
cred
input, and additional username
and password
fields.
After you have tried to authenticate the provided credentials, you can report
back if the credentials were valid or not. Call credential_approve and
credential_reject with the cred
that was returned by credential_fill
in order to validate or invalidate a credential from the store.
Because git credential interacts with the system password manager, the appearance
of the prompts vary by OS and R frontend. Note that credential_fill should
only be used interactively, because it may require the user to enter credentials
or unlock the system keychain. On the other hand credential_approve and
credential_reject are non-interactive and could be used to save or delete
credentials in a scripted program. However note that some credential helpers
(e.g. on Windows) have additional security restrictions that limit use of
credential_approve and credential_reject to credentials that were actually
entered by the user via credential_fill. Here it is not possible at all to
update the credential store without user interaction.